]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: vt6655: rxtx replace typedef struct tagSRrvTime_ab with struct vnt_rrv_time_ab
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 30 Aug 2014 21:25:29 +0000 (22:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 22:19:15 +0000 (15:19 -0700)
Replacing members
wRTSTxRrvTime and wTxRrvTime
with
rts_rrv_time and rrv_time

using __le16 type

Moving structure to rxtx.h

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 237a99c338ad1494cd440c0d313a2a9915d16333..84de4efd2ae4ef6b839229765fb63c9ac34ddb01 100644 (file)
@@ -331,13 +331,6 @@ typedef const STxSyncDesc *PCSTxSyncDesc;
 //
 // RsvTime buffer header
 //
-typedef struct tagSRrvTime_ab {
-       unsigned short wRTSTxRrvTime;
-       unsigned short wTxRrvTime;
-} __attribute__ ((__packed__))
-SRrvTime_ab, *PSRrvTime_ab;
-typedef const SRrvTime_ab *PCSRrvTime_ab;
-
 typedef struct tagSRrvTime_atim {
        unsigned short wCTSTxRrvTime_ba;
        unsigned short wTxRrvTime_a;
index b2fd513a2b36a51672416aa89255946257f08722..a0b83846ac0cec727d71ff9833167ae445e9e751 100644 (file)
@@ -1109,38 +1109,38 @@ s_vGenerateTxParameter(
                if (pvRTS != NULL) {//RTS_need, non PCF mode
                        //Fill RsvTime
                        if (pvRrvTime) {
-                               PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+                               struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-                               pBuf->wRTSTxRrvTime = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 0:5GHz
-                               pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//0:OFDM
+                               buf->rts_rrv_time = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));
+                               buf->rrv_time = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));
                        }
                        //Fill RTS
                        s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
                } else if (pvRTS == NULL) {//RTS_needless, non PCF mode
                        //Fill RsvTime
                        if (pvRrvTime) {
-                               PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+                               struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-                               pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK)); //0:OFDM
+                               buf->rrv_time = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK));
                        }
                }
        } else if (byPktType == PK_TYPE_11B) {
                if ((pvRTS != NULL)) {//RTS_need, non PCF mode
                        //Fill RsvTime
                        if (pvRrvTime) {
-                               PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+                               struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-                               pBuf->wRTSTxRrvTime = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz
-                               pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK));//1:CCK
+                               buf->rts_rrv_time = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));
+                               buf->rrv_time = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK));
                        }
                        //Fill RTS
                        s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
                } else { //RTS_needless, non PCF mode
                        //Fill RsvTime
                        if (pvRrvTime) {
-                               PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+                               struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-                               pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK)); //1:CCK
+                               buf->rrv_time = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK));
                        }
                }
        }
@@ -1348,36 +1348,36 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
 
                if (byFBOption == AUTO_FB_NONE) {
                        if (bRTS == true) {
-                               pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
-                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
-                               pvRTS = (PSRTS_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
+                               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
+                               pvRTS = (PSRTS_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
                                pvCTS = NULL;
-                               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_ab));
-                               cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_ab) + sizeof(STxDataHead_ab);
+                               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(SRTS_ab));
+                               cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(SRTS_ab) + sizeof(STxDataHead_ab);
                        } else { //RTS_needless, need MICHDR
-                               pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
-                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+                               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
                                pvRTS = NULL;
                                pvCTS = NULL;
-                               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
-                               cbHeaderLength = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab);
+                               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
+                               cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(STxDataHead_ab);
                        }
                } else {
                        // Auto Fall Back
                        if (bRTS == true) {//RTS_need
-                               pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
-                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
-                               pvRTS = (PSRTS_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
+                               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
+                               pvRTS = (PSRTS_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
                                pvCTS = NULL;
-                               pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_a_FB));
-                               cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR + sizeof(SRTS_a_FB) + sizeof(STxDataHead_a_FB);
+                               pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(SRTS_a_FB));
+                               cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(SRTS_a_FB) + sizeof(STxDataHead_a_FB);
                        } else { //RTS_needless
-                               pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
-                               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+                               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+                               pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
                                pvRTS = NULL;
                                pvCTS = NULL;
-                               pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
-                               cbHeaderLength = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_a_FB);
+                               pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
+                               cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(STxDataHead_a_FB);
                        }
                } // Auto Fall Back
        }
@@ -2193,12 +2193,12 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
                cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
                                        sizeof(SCTS) + sizeof(STxDataHead_g);
        } else { // 802.11a/b packet
-               pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
+               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
                pMICHDR = NULL;
                pvRTS = NULL;
                pCTS = NULL;
-               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
-               cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + sizeof(STxDataHead_ab);
+               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
+               cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + sizeof(STxDataHead_ab);
        }
 
        memset((void *)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderSize - wTxBufSize));
@@ -2683,12 +2683,15 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb,
 
        } else {//802.11a/b packet
 
-               pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
-               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+               pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
+               pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr +
+                               wTxBufSize + sizeof(struct vnt_rrv_time_ab));
                pvRTS = NULL;
                pvCTS = NULL;
-               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
-               cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab);
+               pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr +
+                       wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
+               cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
+                                       cbMICHDR + sizeof(STxDataHead_ab);
 
        }
 
index 4dca615438a6020421815e25d2b107eaeddf1f65..a14b5f1d26c79def46a82f97e88d296f3de2055d 100644 (file)
@@ -73,6 +73,11 @@ struct vnt_rrv_time_cts {
        __le16 rrv_time_a;
 } __packed;
 
+struct vnt_rrv_time_ab {
+       __le16 rts_rrv_time;
+       __le16 rrv_time;
+} __packed;
+
 struct vnt_tx_short_buf_head {
        __le16 fifo_ctl;
        u16 time_stamp;