staging: vt6655: rxtx replace typedef struct tagSRrvTime_gCTS with struct vnt_rrv_tim...
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 30 Aug 2014 21:25:28 +0000 (22:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 22:19:15 +0000 (15:19 -0700)
replacing members
wCTSTxRrvTime_ba, wReserved, wTxRrvTime_b and wTxRrvTime_a
with
cts_rrv_time_ba, reserved, rrv_time_b and rrv_time_a;

Creating the new structure in rxtx.h and Using __le16 where necessary

pvRrvTime is a void pointer

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/desc.h
drivers/staging/vt6655/rxtx.c
drivers/staging/vt6655/rxtx.h

index 49a2e04f3b67691495c3b2ecc3d5bd88b36420b0..237a99c338ad1494cd440c0d313a2a9915d16333 100644 (file)
@@ -331,15 +331,6 @@ typedef const STxSyncDesc *PCSTxSyncDesc;
 //
 // RsvTime buffer header
 //
-typedef struct tagSRrvTime_gCTS {
-       unsigned short wCTSTxRrvTime_ba;
-       unsigned short wReserved;
-       unsigned short wTxRrvTime_b;
-       unsigned short wTxRrvTime_a;
-} __attribute__ ((__packed__))
-SRrvTime_gCTS, *PSRrvTime_gCTS;
-typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
-
 typedef struct tagSRrvTime_ab {
        unsigned short wRTSTxRrvTime;
        unsigned short wTxRrvTime;
index 609aec8f412a0ebeddcc364dd4097dea34e17032..b2fd513a2b36a51672416aa89255946257f08722 100644 (file)
@@ -1095,11 +1095,11 @@ s_vGenerateTxParameter(
 
                        //Fill RsvTime
                        if (pvRrvTime) {
-                               PSRrvTime_gCTS pBuf = (PSRrvTime_gCTS)pvRrvTime;
+                               struct vnt_rrv_time_cts *buf = pvRrvTime;
 
-                               pBuf->wTxRrvTime_a = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//2.4G OFDM
-                               pBuf->wTxRrvTime_b = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));//1:CCK
-                               pBuf->wCTSTxRrvTime_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));//3:CTSTxRrvTime_Ba, 1:2.4GHz
+                               buf->rrv_time_a = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));
+                               buf->rrv_time_b = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));
+                               buf->cts_rrv_time_ba = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));
                        }
 
                        //Fill CTS
@@ -1319,12 +1319,12 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
                                pvTxDataHd = (PSTxDataHead_g)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR + sizeof(SRTS_g));
                                cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR + sizeof(SRTS_g) + sizeof(STxDataHead_g);
                        } else { //RTS_needless
-                               pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
-                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
+                               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
                                pvRTS = NULL;
-                               pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR);
-                               pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS));
-                               cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
+                               pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
+                               pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS));
+                               cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
                        }
                } else {
                        // Auto Fall Back
@@ -1336,12 +1336,12 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
                                pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR + sizeof(SRTS_g_FB));
                                cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR + sizeof(SRTS_g_FB) + sizeof(STxDataHead_g_FB);
                        } else { //RTS_needless
-                               pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
-                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
+                               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
                                pvRTS = NULL;
-                               pvCTS = (PSCTS_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR);
-                               pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS_FB));
-                               cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS_FB) + sizeof(STxDataHead_g_FB);
+                               pvCTS = (PSCTS_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
+                               pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS_FB));
+                               cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS_FB) + sizeof(STxDataHead_g_FB);
                        }
                } // Auto Fall Back
        } else {//802.11a/b packet
@@ -2183,13 +2183,15 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
 
        //Set RrvTime/RTS/CTS Buffer
        if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
-
-               pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
+               pvRrvTime = (void *) (pbyTxBufferAddr + wTxBufSize);
                pMICHDR = NULL;
                pvRTS = NULL;
-               pCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
-               pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + sizeof(SCTS));
-               cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + sizeof(SCTS) + sizeof(STxDataHead_g);
+               pCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize +
+                                       sizeof(struct vnt_rrv_time_cts));
+               pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
+                               sizeof(struct vnt_rrv_time_cts) + sizeof(SCTS));
+               cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
+                                       sizeof(SCTS) + sizeof(STxDataHead_g);
        } else { // 802.11a/b packet
                pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
                pMICHDR = NULL;
@@ -2668,12 +2670,16 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb,
 
        if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
 
-               pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
-               pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
+               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+               pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize +
+                                       sizeof(struct vnt_rrv_time_cts));
                pvRTS = NULL;
-               pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR);
-               pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS));
-               cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
+               pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize +
+                               sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
+               pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
+                       sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS));
+               cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
+                               cbMICHDR + sizeof(SCTS) + sizeof(STxDataHead_g);
 
        } else {//802.11a/b packet
 
index f5f64787cc6d4250ea9229891a14c933fac69a58..4dca615438a6020421815e25d2b107eaeddf1f65 100644 (file)
@@ -66,6 +66,13 @@ struct vnt_rrv_time_rts {
        __le16 rrv_time_a;
 } __packed;
 
+struct vnt_rrv_time_cts {
+       __le16 cts_rrv_time_ba;
+       u16 reserved;
+       __le16 rrv_time_b;
+       __le16 rrv_time_a;
+} __packed;
+
 struct vnt_tx_short_buf_head {
        __le16 fifo_ctl;
        u16 time_stamp;