Commit e21eb1c8d1002c519f84020da1b9883231c78369
Committed by
Greg Kroah-Hartman
1 parent
9587b09206
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
staging: vt6655: replace typedef struct tagSRTS_ab with struct vnt_rts_ab
Replacing members ab, wDuration, wReserved and data with ab, duration, reserved and data replacing unsigned short with u16 and __le16 where necessary. pvRTS is void pointer. 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 36 additions and 32 deletions Side-by-side Diff
drivers/staging/vt6655/desc.h
... | ... | @@ -352,15 +352,6 @@ |
352 | 352 | u32 field_write; |
353 | 353 | }; |
354 | 354 | |
355 | -typedef struct tagSRTS_ab { | |
356 | - struct vnt_phy_field ab; | |
357 | - unsigned short wDuration; | |
358 | - unsigned short wReserved; | |
359 | - struct ieee80211_rts data; | |
360 | -} __attribute__ ((__packed__)) | |
361 | -SRTS_ab, *PSRTS_ab; | |
362 | -typedef const SRTS_ab *PCSRTS_ab; | |
363 | - | |
364 | 355 | typedef struct tagSRTS_a_FB { |
365 | 356 | struct vnt_phy_field a; |
366 | 357 | unsigned short wDuration; |
drivers/staging/vt6655/rxtx.c
... | ... | @@ -920,31 +920,34 @@ |
920 | 920 | } // if (byFBOption == AUTO_FB_NONE) |
921 | 921 | } else if (byPktType == PK_TYPE_11A) { |
922 | 922 | if (byFBOption == AUTO_FB_NONE) { |
923 | - PSRTS_ab pBuf = (PSRTS_ab)pvRTS; | |
923 | + struct vnt_rts_ab *buf = pvRTS; | |
924 | 924 | /* Get SignalField, ServiceField & Length */ |
925 | 925 | vnt_get_phy_field(pDevice, uRTSFrameLen, |
926 | 926 | pDevice->byTopOFDMBasicRate, |
927 | - byPktType, &pBuf->ab); | |
928 | - //Get Duration | |
929 | - pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_aa, 0:5G, 0: 5G OFDMData | |
930 | - pBuf->data.duration = pBuf->wDuration; | |
927 | + byPktType, &buf->ab); | |
928 | + /* Get Duration */ | |
929 | + buf->duration = | |
930 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, | |
931 | + byPktType, wCurrentRate, bNeedAck, | |
932 | + byFBOption)); | |
933 | + buf->data.duration = buf->duration; | |
931 | 934 | /* Get RTS Frame body */ |
932 | - pBuf->data.frame_control = | |
935 | + buf->data.frame_control = | |
933 | 936 | cpu_to_le16(IEEE80211_FTYPE_CTL | |
934 | 937 | IEEE80211_STYPE_RTS); |
935 | 938 | |
936 | 939 | |
937 | 940 | if ((pDevice->eOPMode == OP_MODE_ADHOC) || |
938 | 941 | (pDevice->eOPMode == OP_MODE_AP)) { |
939 | - memcpy(&pBuf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); | |
942 | + memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); | |
940 | 943 | } else { |
941 | - memcpy(&pBuf->data.ra, pDevice->abyBSSID, ETH_ALEN); | |
944 | + memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN); | |
942 | 945 | } |
943 | 946 | |
944 | 947 | if (pDevice->eOPMode == OP_MODE_AP) |
945 | - memcpy(&pBuf->data.ta, pDevice->abyBSSID, ETH_ALEN); | |
948 | + memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN); | |
946 | 949 | else |
947 | - memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); | |
950 | + memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); | |
948 | 951 | |
949 | 952 | } else { |
950 | 953 | PSRTS_a_FB pBuf = (PSRTS_a_FB)pvRTS; |
951 | 954 | |
952 | 955 | |
953 | 956 | |
954 | 957 | |
955 | 958 | |
956 | 959 | |
... | ... | @@ -975,29 +978,32 @@ |
975 | 978 | memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); |
976 | 979 | } |
977 | 980 | } else if (byPktType == PK_TYPE_11B) { |
978 | - PSRTS_ab pBuf = (PSRTS_ab)pvRTS; | |
981 | + struct vnt_rts_ab *buf = pvRTS; | |
979 | 982 | /* Get SignalField, ServiceField & Length */ |
980 | 983 | vnt_get_phy_field(pDevice, uRTSFrameLen, |
981 | 984 | pDevice->byTopCCKBasicRate, |
982 | - PK_TYPE_11B, &pBuf->ab); | |
983 | - //Get Duration | |
984 | - pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData | |
985 | - pBuf->data.duration = pBuf->wDuration; | |
985 | + PK_TYPE_11B, &buf->ab); | |
986 | + /* Get Duration */ | |
987 | + buf->duration = | |
988 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, | |
989 | + byPktType, wCurrentRate, bNeedAck, | |
990 | + byFBOption)); | |
991 | + buf->data.duration = buf->duration; | |
986 | 992 | /* Get RTS Frame body */ |
987 | - pBuf->data.frame_control = | |
993 | + buf->data.frame_control = | |
988 | 994 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); |
989 | 995 | |
990 | 996 | if ((pDevice->eOPMode == OP_MODE_ADHOC) || |
991 | 997 | (pDevice->eOPMode == OP_MODE_AP)) { |
992 | - memcpy(&pBuf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); | |
998 | + memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); | |
993 | 999 | } else { |
994 | - memcpy(&pBuf->data.ra, pDevice->abyBSSID, ETH_ALEN); | |
1000 | + memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN); | |
995 | 1001 | } |
996 | 1002 | |
997 | 1003 | if (pDevice->eOPMode == OP_MODE_AP) |
998 | - memcpy(&pBuf->data.ta, pDevice->abyBSSID, ETH_ALEN); | |
1004 | + memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN); | |
999 | 1005 | else |
1000 | - memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); | |
1006 | + memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); | |
1001 | 1007 | } |
1002 | 1008 | } |
1003 | 1009 | |
1004 | 1010 | |
1005 | 1011 | |
... | ... | @@ -1408,12 +1414,12 @@ |
1408 | 1414 | if (bRTS == true) { |
1409 | 1415 | pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); |
1410 | 1416 | pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab)); |
1411 | - pvRTS = (PSRTS_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR); | |
1417 | + pvRTS = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR); | |
1412 | 1418 | pvCTS = NULL; |
1413 | 1419 | pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + |
1414 | - sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(SRTS_ab)); | |
1420 | + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(struct vnt_rts_ab)); | |
1415 | 1421 | cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + |
1416 | - cbMICHDR + sizeof(SRTS_ab) + sizeof(struct vnt_tx_datahead_ab); | |
1422 | + cbMICHDR + sizeof(struct vnt_rts_ab) + sizeof(struct vnt_tx_datahead_ab); | |
1417 | 1423 | } else { //RTS_needless, need MICHDR |
1418 | 1424 | pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); |
1419 | 1425 | pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab)); |
drivers/staging/vt6655/rxtx.h
... | ... | @@ -138,6 +138,13 @@ |
138 | 138 | struct ieee80211_rts data; |
139 | 139 | } __packed; |
140 | 140 | |
141 | +struct vnt_rts_ab { | |
142 | + struct vnt_phy_field ab; | |
143 | + __le16 duration; | |
144 | + u16 reserved; | |
145 | + struct ieee80211_rts data; | |
146 | +} __packed; | |
147 | + | |
141 | 148 | struct vnt_tx_short_buf_head { |
142 | 149 | __le16 fifo_ctl; |
143 | 150 | u16 time_stamp; |