summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6656/rxtx.c
AgeCommit message (Collapse)Author
2014-04-07Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12Scott Wood
2013-10-16staging: vt6656: rxtx.c s_vFillTxKey replace u8 *pbyBuf.Malcolm Priestley
Replace with struct vnt_tx_fifo_head and attach pbyBuf to adwTxKey[0] Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16staging: vt6656: rxtx.c clean up s_uGetRTSCTSDurationMalcolm Priestley
White space clean up. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16staging: vt6656: rxtx.c s_uGetRTSCTSDuration allow fall-through duplicatesMalcolm Priestley
Allow switch fall-through of duplicate case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16staging: vt6656: rxtx.c s_bPacketToWirelessUsb set fallback tx ratesMalcolm Priestley
Set the two TX fall back rates in s_bPacketToWirelessUsb and pass to private area of driver in variables tx_rate_fb0 and tx_rate_fb1 from the wFB_Opt0/wFB_Opt1 array. Apply these rates were needed in the TX structure and remove byFBOption settings in s_uGetRTSCTSDuration. This greatly simplifies s_uGetRTSCTSDuration and more future flexibility of setting rates from upper levels of driver. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-08staging: vt6656: rxtx.c cleanup s_vGenerateTxParameterMalcolm Priestley
Remove white space and commented out code. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c remove dead code s_uFillDataHead/pvTxDataHd.Malcolm Priestley
uFillDataHead in is now dead so remove and pvTxDataHd. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c add no rts struct vnt_tx_datahead_abMalcolm Priestley
Add no rts/cts vnt_tx_datahead_ab to union vnt_tx_data_head. The need_mic now applies to all modes of packet type PK_TYPE_11B. and return vnt_rxtx_datahead_ab in s_vGenerateTxParameter This removes pvTxDataHd pointer assignment and calls to s_uFillDataHead. Since pvTxDataHd is now null a small vendor hack to vDMA0_tx_80211/csMgmt_xmit to do with Disassociation-packet is also changed correct head position. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c parse out vnt_rxtx_datahead_abMalcolm Priestley
Parse struct vnt_tx_datahead_ab from s_uFillDataHead and move to struct vnt_rts_ab structure returning duration down functions. Both are returned in s_uFillDataHead at this stage as pvTxDataHd is only null in s_bPacketToWirelessUsb. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c add no rts struct vnt_tx_datahead_a_fbMalcolm Priestley
Add no rts/cts vnt_tx_datahead_a_fb to union vnt_tx_data_head. The need_mic now applies to all modes of packet type PK_TYPE_11A. and return vnt_rxtx_datahead_a_fb in s_vGenerateTxParameter This removes pvTxDataHd pointer assignment. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c parse out struct vnt_tx_datahead_a_fbMalcolm Priestley
Parse struct vnt_tx_datahead_a_fb from s_uFillDataHead and move to struct vnt_rts_a_fb structure returning duration down functions. This removes pvTxDataHd pointer assignment. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c Parse struct vnt_tx_datahead_g_fbMalcolm Priestley
Parse struct vnt_tx_datahead_g_fb from s_uFillDataHead and move to struct vnt_rts_g_fb/struct vnt_cts_fb structure returning duration down functions. This removes pvTxDataHd pointer assignment. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c Parse struct vnt_tx_datahead_gMalcolm Priestley
Parse struct vnt_tx_datahead_g from s_uFillDataHead and move to struct vnt_rts_g/struct vnt_cts structure. This removes pvTxDataHd pointer assignment. The duration_id(uDuration) field is now returned in s_vGenerateTxParameter. The return of s_uFillDataHead temporary or'ed to retain functionality of other functions and is removed at the end of this patch series. Since pvTxDataHd is now null a small vendor hack to vDMA0_tx_80211/csMgmt_xmit to do with Disassociation-packet is also changed correct head position. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03staging: vt6656: rxtx.c change tx functions to return u16Malcolm Priestley
s_vGenerateTxParameter, s_vFillCTSHead, s_vFillRTSHead, vnt_rxtx_rts* functions to return u16 Initially this is the duration_id field for ieee80211_hdr Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-30Merge 3.12-rc3 into staging-nextGreg Kroah-Hartman
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26staging: vt6656: rxtx.c remove dead code rts_cts voidMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26staging: vt6656: rxtx.c Move rts_cts pointer assignment to ↵Malcolm Priestley
s_vGenerateTxParameter Move rts/cts pointers to relevant vnt_tx_data_head position. Remove old rts_cts pointers in calling functions. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26staging: vt6656: rxtx.c s_vGenerateTxParameter Create vnt_mic_hdr structureMalcolm Priestley
Create double pointer to pass back vnt_mic_hdr address position of relevant structure if need_mic is more than 0. Otherwise it is NULL. This replaces the pMICHDR void pointer with struct vnt_mic_hdr and assignments in the calling functions. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26staging: vt6656: rxtx.c create structure to join vnt_tx_data_head with ↵Malcolm Priestley
vnt_tx_head. Create struct vnt_tx_mic_hdr for with union vnt_tx_data_head for mic mode. Create union vnt_tx for mic and non mic mode. Attach vnt_rrv_time_* to relevant tx_head. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26staging: vt6656: rxtx.c Create union of struct vnt_rrv_time* stucturesMalcolm Priestley
Attach union vnt_tx_head to structure vnt_tx_buffer replacing pointer pvRrvTime. In s_vGenerateTxParameter the relevant struct vnt_rrv_time_* structure is attached to the vnt_tx_head. The NULL check is now pFifoHead. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: vt6656: rxtx.c [BUG] s_vGetFreeContext dead lock on null apTD.Malcolm Priestley
There seems to be race condition that the device is ndo_start_xmit at a point where the device is closing and apTD is NULL resulting in dead lock. Add a NULL check to apTD and return NULL to calling functions. This is more likely on 64 bit systems. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: vt6656: rxtx.c s_vGenerateTxParameter replace pTxBufHead void pointer.Malcolm Priestley
with struct vnt_tx_buffer and attach vnt_tx_fifo_head to pTX_Buffer structure. The the calling pbyTxBufferAddr points to the same address as vnt_tx_buffer->fifo_head and is still in use. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: vt6656: desc.h remove typedef struct tagSTxBufHead to rxtx.hMalcolm Priestley
In code it is referred to as fifo to renamed to typedef struct tagSTxBufHead -> struct vnt_tx_fifo_head This is only needed by rxtc.c so moved to rxtx.h Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: device.h replace typedef struct _USB_SEND_CONTEXT.Malcolm Priestley
Replace with struct vnt_usb_send_context. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c s_vFillTxKey use switch for pTransmitKey->byCipherSuiteMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c s_vFillTxKey clean up format and white space.Malcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c s_vFillRTSHead/s_vFillCTSHead move union ↵Malcolm Priestley
vnt_tx_data_head up one level. Move s_vFillRTSHead union vnt_tx_data_head to void *pvRTS argument. s_vFillCTSHead union vnt_tx_data_head to void *pvCTS argument. In s_vGenerateTxParameter create union vnt_tx_data_head pointing to rts_cts; Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c merge pvRTS and pvCTS/pCTS void pointersMalcolm Priestley
As result of patch rxtx.c s_vGenerateTxParameter create argument bool need rts RTS and CTS void pointers can be merged. Create new pointer rts_cts so that unions in s_vFillCTSHead/s_vFillRTSHead can be joined. If rts_cts is NULL neither exist. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c s_vGenerateTxParameter create argument bool need rtsMalcolm Priestley
Allow conditional statements to be based on true/false instead of NULL or not pointer pvRTS. Harmonise all call functions will bool type. If need_rts is true then rts is needed. If need_rts is false then cts is needed only when byPktType == PK_TYPE_11GB || PK_TYPE_11GA. none no rts/cts other byPktTypes. This allow the joining of pointers pvRTS/pvCTS in to single pointer. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: s_vFillCTSHead join structures of vnt_cts* to union ↵Malcolm Priestley
vnt_tx_data_head Only one of vnt_rts*/vnt_cts* structures are accessed at any one time. structures vnt_cts and vnt_cts_fb are members of union vnt_tx_data_head. Create pointer union head and point structures to the correct member. Point the union to pvCTS. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c s_vFillCTSHead Remove byPktType ifMalcolm Priestley
s_vFillCTSHead is only called when byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA so remove unnecessary if on byPktType. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c s_vFillRTSHead PK_TYPE_11A allow fall through ↵Malcolm Priestley
AUTO_FB_NONE byFBOption == AUTO_FB_NONE (0) is the same as PK_TYPE_11B Reverse if condition to break and allow fall through. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27staging: vt6656: rxtx.c: s_vFillRTSHead change if/else to switch on byPktypeMalcolm Priestley
Allowing fall through where necessary. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: rxtx.c s_vFillRTSHead white space and formating clean upMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx s_vFillRTSHead create union of vnt_rts*/vnt_cts* ↵Malcolm Priestley
structures. Only one of vnt_rts*/vnt_cts* structures are accessed at any one time. Join these structures in to a single union. These will eventually form the tail structure of vnt_tx_buffer and include structures vnt_tx_datahead* Structures in s_vFillCTSHead will join in next patch series. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx.c s_vFillRTSHead Parse out struct vnt_rts_a_fb to new ↵Malcolm Priestley
function. Parse out vnt_rts_a_fb code to new function vnt_rxtx_rts_a_fb_head. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx.c s_vFillRTSHead Parse out struct vnt_rts_ab to new ↵Malcolm Priestley
function. Parse out vnt_rts_ab code to new function vnt_rxtx_rts_ab_head. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx.c s_vFillRTSHead Parse out struct vnt_rts_g_fb to new ↵Malcolm Priestley
function. Parse out vnt_rts_g_fb code to new function vnt_rxtx_rts_g_fb_head. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx.c s_vFillRTSHead Parse out struct vnt_rts_g to new ↵Malcolm Priestley
functions. Parse out vnt_rts_g code to new function vnt_rxtx_rts_g_head. Also create a new common calling function vnt_fill_ieee80211_rts to fill the ieee80211_rts structure. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: s_vGenerateTxParameter pvRrvTime should never be NULLMalcolm Priestley
If pvRrvTime is NULL the whole structure is NULL, so remove if statements and consolidate to single return. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: s_vGenerateTxParameter dead code bDisCRCMalcolm Priestley
As result of patch vt6656: rxtx.c s_vFillCTSHead remove dead code bDisCRC bDisCRC is unused. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx.c s_vFillCTSHead remove dead code bDisCRCMalcolm Priestley
As result of patch vt6656: device.h Remove dead code bSoftwareGenCrcErr. dDiscCRC is unused. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: rxtx.c s_vFillRTSHead remove dead bDiscCRCMalcolm Priestley
As result of patch vt6656: device.h Remove dead code bSoftwareGenCrcErr. dDiscCRC is unused. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: vt6656: device.h Remove dead code bSoftwareGenCrcErr.Malcolm Priestley
Probably an error in earlier firmware is never enabled so remove. bPacketToWirelessUsb remove dead if/else and variables. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: vt6656: rxtx.c s_vFillTxKey fill structure vnt_mic_hdrMalcolm Priestley
Replace the pointer offsets with structure of mic_hdr with endian conversion where needed. Replace vFillTxKey argument u8 *pMICHDR with struct vnt_mic_hdr *mic_hdr and fix type of calling functions. An extra check that mic_hdr is not NULL Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: vt6656: desc.h Remove typedef struct tagSMICHDRHead to new ↵Malcolm Priestley
structure in rxtx.h To new structure. typedef struct tagSMICHDRHead -> struct vnt_mic_hdr This is only needed by rxtc.c so moved to rxtx.h The new structure is the same size as the old but contains the members as pointer referenced in rxtx.c s_vFillTxKey u8 id *pMICHDR = 0x59; u8 tx_priority; *((u8 *)(pMICHDR+1)) = 0; // TxPriority u8 mic_addr2[6]; memcpy(pMICHDR+2, &(pMACHeader->addr2[0]), 6); __be32 tsc_47_16; pMICHDR+8 = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16)); pMICHDR+9 = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16)); pMICHDR+10 = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16)); pMICHDR+11 = LOBYTE(LOWORD(pTransmitKey->dwTSC47_16)); __be16 tsc_15_0; pMICHDR+12 = HIBYTE(pTransmitKey->wTSC15_0); pMICHDR+13 = LOBYTE(pTransmitKey->wTSC15_0); __be16 payload_len; pMICHDR+14 = HIBYTE(wPayloadLen); pMICHDR+15 = LOBYTE(wPayloadLen); __be16 hlen; pMICHDR+16 = 0; // HLEN[15:8] pMICHDR+17 = 28; // HLEN[7:0] __le16 frame_control; memcpy(pMICHDR+18, (u8 *)&wValue, 2); // MSKFRACTL u8 addr1[6]; memcpy(pMICHDR+20, &(pMACHeader->addr1[0]), 6); u8 addr2[6]; memcpy(pMICHDR+26, &(pMACHeader->addr2[0]), 6); u8 addr3[6]; memcpy(pMICHDR+32, &(pMACHeader->addr3[0]), 6); __le16 seq_ctrl; memcpy(pMICHDR+38, (u8 *)&wValue, 2); // MSKSEQCTL u8 addr4[6]; memcpy(pMICHDR+40, &(pMACHeader->addr4[0]), 6); u16 packing; /* packing to 48 bytes */ Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: vt6656: rxtx.c endian correct wTimeStampOffMalcolm Priestley
wTimeStampOff needs to be endian corrected Create new function vnt_time_stamp_off to return little endian u16 value. Private variable byPreambleType is common to all calling functions is included. variable rate to set the desired rate. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: vt6656: rxtx.c s_create new function to endian correct uGetTxRsvTime.Malcolm Priestley
We can't endian correct uGetTxRsvTime because it is called by other functions. Create new function to vnt_rxtx_rsvtime_le16 to return little endian u16 value. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: vt6656: s_uGetRTSCTSRsvTime return u16 endian corrected value.Malcolm Priestley
s_uGetRTSCTSRsvTime always needs to be corrected to u16 endian value. Change function to return u16 endian corrected value. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-22staging: vt6656: rxtx.c: s_uGetDataDuration Drop argument byDurType.Malcolm Priestley
When byDurType == DATADUR_B then byPktType == PK_TYPE_11B Drop argument byDurType and filter on byPktType == PK_TYPE_11B. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>