Commit 9587b09206d702d3ca50ef582072cd658185e7d4
Committed by
Greg Kroah-Hartman
1 parent
17434f094a
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
staging: vt6655: replace typedef struct tagSRTS_g_FB with struct vnt_rts_g_fb
Replacing members b, a, wDuration_ba, wDuration_aa, wDuration_bb, wReserved, wRTSDuration_ba_f0, wRTSDuration_aa_f0, wRTSDuration_ba_f1, wRTSDuration_aa_f1 and data with b, a, duration_ba, duration_aa, duration_bb, wReserved, rts_duration_ba_f0, rts_duration_aa_f0, rts_duration_ba_f1, rts_duration_aa_f1 and data replacing unsigned short with u16 or __le16 where endian correction is necessary. Creating the new structure in rxtx.h Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 3 changed files with 56 additions and 36 deletions Side-by-side Diff
drivers/staging/vt6655/desc.h
... | ... | @@ -352,22 +352,6 @@ |
352 | 352 | u32 field_write; |
353 | 353 | }; |
354 | 354 | |
355 | -typedef struct tagSRTS_g_FB { | |
356 | - struct vnt_phy_field b; | |
357 | - struct vnt_phy_field a; | |
358 | - unsigned short wDuration_ba; | |
359 | - unsigned short wDuration_aa; | |
360 | - unsigned short wDuration_bb; | |
361 | - unsigned short wReserved; | |
362 | - unsigned short wRTSDuration_ba_f0; | |
363 | - unsigned short wRTSDuration_aa_f0; | |
364 | - unsigned short wRTSDuration_ba_f1; | |
365 | - unsigned short wRTSDuration_aa_f1; | |
366 | - struct ieee80211_rts data; | |
367 | -} __attribute__ ((__packed__)) | |
368 | -SRTS_g_FB, *PSRTS_g_FB; | |
369 | -typedef const SRTS_g_FB *PCSRTS_g_FB; | |
370 | - | |
371 | 355 | typedef struct tagSRTS_ab { |
372 | 356 | struct vnt_phy_field ab; |
373 | 357 | unsigned short wDuration; |
drivers/staging/vt6655/rxtx.c
... | ... | @@ -860,41 +860,62 @@ |
860 | 860 | memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); |
861 | 861 | |
862 | 862 | } else { |
863 | - PSRTS_g_FB pBuf = (PSRTS_g_FB)pvRTS; | |
863 | + struct vnt_rts_g_fb *buf = pvRTS; | |
864 | 864 | /* Get SignalField, ServiceField & Length */ |
865 | 865 | vnt_get_phy_field(pDevice, uRTSFrameLen, |
866 | 866 | pDevice->byTopCCKBasicRate, |
867 | - PK_TYPE_11B, &pBuf->b); | |
867 | + PK_TYPE_11B, &buf->b); | |
868 | 868 | |
869 | 869 | vnt_get_phy_field(pDevice, uRTSFrameLen, |
870 | 870 | pDevice->byTopOFDMBasicRate, |
871 | - byPktType, &pBuf->a); | |
872 | - //Get Duration | |
873 | - pBuf->wDuration_bb = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData | |
874 | - pBuf->wDuration_aa = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //2:RTSDuration_aa, 1:2.4G, 2,3:2.4G OFDMData | |
875 | - pBuf->wDuration_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //1:RTSDuration_ba, 1:2.4G, 2,3:2.4G OFDMData | |
876 | - pBuf->wRTSDuration_ba_f0 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //4:wRTSDuration_ba_f0, 1:2.4G, 1:CCKData | |
877 | - pBuf->wRTSDuration_aa_f0 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //5:wRTSDuration_aa_f0, 1:2.4G, 1:CCKData | |
878 | - pBuf->wRTSDuration_ba_f1 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //6:wRTSDuration_ba_f1, 1:2.4G, 1:CCKData | |
879 | - pBuf->wRTSDuration_aa_f1 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //7:wRTSDuration_aa_f1, 1:2.4G, 1:CCKData | |
880 | - pBuf->data.duration = pBuf->wDuration_aa; | |
871 | + byPktType, &buf->a); | |
872 | + /* Get Duration */ | |
873 | + buf->duration_bb = | |
874 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, | |
875 | + PK_TYPE_11B, pDevice->byTopCCKBasicRate, | |
876 | + bNeedAck, byFBOption)); | |
877 | + buf->duration_aa = | |
878 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, | |
879 | + byPktType, wCurrentRate, bNeedAck, | |
880 | + byFBOption)); | |
881 | + buf->duration_ba = | |
882 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, | |
883 | + byPktType, wCurrentRate, bNeedAck, | |
884 | + byFBOption)); | |
885 | + buf->rts_duration_ba_f0 = | |
886 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0, cbFrameLength, | |
887 | + byPktType, wCurrentRate, bNeedAck, | |
888 | + byFBOption)); | |
889 | + buf->rts_duration_aa_f0 = | |
890 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, | |
891 | + byPktType, wCurrentRate, bNeedAck, | |
892 | + byFBOption)); | |
893 | + buf->rts_duration_ba_f1 = | |
894 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1, cbFrameLength, | |
895 | + byPktType, wCurrentRate, bNeedAck, | |
896 | + byFBOption)); | |
897 | + buf->rts_duration_aa_f1 = | |
898 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, | |
899 | + byPktType, wCurrentRate, bNeedAck, | |
900 | + byFBOption)); | |
901 | + buf->data.duration = buf->duration_aa; | |
881 | 902 | /* Get RTS Frame body */ |
882 | - pBuf->data.frame_control = | |
903 | + buf->data.frame_control = | |
883 | 904 | cpu_to_le16(IEEE80211_FTYPE_CTL | |
884 | 905 | IEEE80211_STYPE_RTS); |
885 | 906 | |
886 | 907 | |
887 | 908 | if ((pDevice->eOPMode == OP_MODE_ADHOC) || |
888 | 909 | (pDevice->eOPMode == OP_MODE_AP)) { |
889 | - memcpy(&pBuf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); | |
910 | + memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); | |
890 | 911 | } else { |
891 | - memcpy(&pBuf->data.ra, pDevice->abyBSSID, ETH_ALEN); | |
912 | + memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN); | |
892 | 913 | } |
893 | 914 | |
894 | 915 | if (pDevice->eOPMode == OP_MODE_AP) |
895 | - memcpy(&pBuf->data.ta, pDevice->abyBSSID, ETH_ALEN); | |
916 | + memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN); | |
896 | 917 | else |
897 | - memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); | |
918 | + memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); | |
898 | 919 | |
899 | 920 | } // if (byFBOption == AUTO_FB_NONE) |
900 | 921 | } else if (byPktType == PK_TYPE_11A) { |
901 | 922 | |
902 | 923 | |
... | ... | @@ -1365,11 +1386,12 @@ |
1365 | 1386 | if (bRTS == true) {//RTS_need |
1366 | 1387 | pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); |
1367 | 1388 | pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts)); |
1368 | - pvRTS = (PSRTS_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR); | |
1389 | + pvRTS = (void *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR); | |
1369 | 1390 | pvCTS = NULL; |
1370 | - pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR + sizeof(SRTS_g_FB)); | |
1391 | + pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + | |
1392 | + cbMICHDR + sizeof(struct vnt_rts_g_fb)); | |
1371 | 1393 | cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) + |
1372 | - cbMICHDR + sizeof(SRTS_g_FB) + sizeof(struct vnt_tx_datahead_g_fb); | |
1394 | + cbMICHDR + sizeof(struct vnt_rts_g_fb) + sizeof(struct vnt_tx_datahead_g_fb); | |
1373 | 1395 | } else { //RTS_needless |
1374 | 1396 | pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); |
1375 | 1397 | pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts)); |
drivers/staging/vt6655/rxtx.h
... | ... | @@ -124,6 +124,20 @@ |
124 | 124 | struct ieee80211_rts data; |
125 | 125 | } __packed; |
126 | 126 | |
127 | +struct vnt_rts_g_fb { | |
128 | + struct vnt_phy_field b; | |
129 | + struct vnt_phy_field a; | |
130 | + __le16 duration_ba; | |
131 | + __le16 duration_aa; | |
132 | + __le16 duration_bb; | |
133 | + u16 wReserved; | |
134 | + __le16 rts_duration_ba_f0; | |
135 | + __le16 rts_duration_aa_f0; | |
136 | + __le16 rts_duration_ba_f1; | |
137 | + __le16 rts_duration_aa_f1; | |
138 | + struct ieee80211_rts data; | |
139 | +} __packed; | |
140 | + | |
127 | 141 | struct vnt_tx_short_buf_head { |
128 | 142 | __le16 fifo_ctl; |
129 | 143 | u16 time_stamp; |