Commit f5172b0edf2fcc37dfe9b64899c2a318fa462a6b
Committed by
Greg Kroah-Hartman
1 parent
8e44804e73
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
staging: vt6655: replace typedef struct tagSCTS with struct vnt_cts
Replacing members b, wDuration_ba, wReserved, data and reserved2 with b, duration_ba, reserved, data and reserved2 unsigned short is replaced with u16 or __le16 where necessary. cast void pointer to pvCTS 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 34 additions and 31 deletions Side-by-side Diff
drivers/staging/vt6655/desc.h
... | ... | @@ -355,16 +355,6 @@ |
355 | 355 | // |
356 | 356 | // CTS buffer header |
357 | 357 | // |
358 | -typedef struct tagSCTS { | |
359 | - struct vnt_phy_field b; | |
360 | - unsigned short wDuration_ba; | |
361 | - unsigned short wReserved; | |
362 | - struct ieee80211_cts data; | |
363 | - u16 reserved2; | |
364 | -} __attribute__ ((__packed__)) | |
365 | -SCTS, *PSCTS; | |
366 | -typedef const SCTS *PCSCTS; | |
367 | - | |
368 | 358 | typedef struct tagSCTS_FB { |
369 | 359 | struct vnt_phy_field b; |
370 | 360 | unsigned short wDuration_ba; |
drivers/staging/vt6655/rxtx.c
... | ... | @@ -1071,26 +1071,29 @@ |
1071 | 1071 | memcpy(&pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); |
1072 | 1072 | |
1073 | 1073 | } else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) |
1074 | - PSCTS pBuf = (PSCTS)pvCTS; | |
1074 | + struct vnt_cts *buf = pvCTS; | |
1075 | 1075 | /* Get SignalField, ServiceField & Length */ |
1076 | 1076 | vnt_get_phy_field(pDevice, uCTSFrameLen, |
1077 | 1077 | pDevice->byTopCCKBasicRate, |
1078 | - PK_TYPE_11B, &pBuf->b); | |
1078 | + PK_TYPE_11B, &buf->b); | |
1079 | 1079 | |
1080 | - //Get CTSDuration_ba | |
1081 | - pBuf->wDuration_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data | |
1082 | - pBuf->wDuration_ba += pDevice->wCTSDuration; | |
1083 | - pBuf->wDuration_ba = cpu_to_le16(pBuf->wDuration_ba); | |
1080 | + /* Get CTSDuration_ba */ | |
1081 | + buf->duration_ba = | |
1082 | + cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, | |
1083 | + byPktType, wCurrentRate, bNeedAck, | |
1084 | + byFBOption)); | |
1085 | + buf->duration_ba += pDevice->wCTSDuration; | |
1086 | + buf->duration_ba = cpu_to_le16(buf->duration_ba); | |
1084 | 1087 | |
1085 | - //Get CTS Frame body | |
1086 | - pBuf->data.duration = pBuf->wDuration_ba; | |
1088 | + /* Get CTS Frame body */ | |
1089 | + buf->data.duration = buf->duration_ba; | |
1087 | 1090 | |
1088 | - pBuf->data.frame_control = | |
1091 | + buf->data.frame_control = | |
1089 | 1092 | cpu_to_le16(IEEE80211_FTYPE_CTL | |
1090 | 1093 | IEEE80211_STYPE_CTS); |
1091 | 1094 | |
1092 | - pBuf->reserved2 = 0x0; | |
1093 | - memcpy(&pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); | |
1095 | + buf->reserved2 = 0x0; | |
1096 | + memcpy(&buf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); | |
1094 | 1097 | } |
1095 | 1098 | } |
1096 | 1099 | } |
1097 | 1100 | |
... | ... | @@ -1390,10 +1393,11 @@ |
1390 | 1393 | pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); |
1391 | 1394 | pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts)); |
1392 | 1395 | pvRTS = NULL; |
1393 | - pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR); | |
1394 | - pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS)); | |
1396 | + pvCTS = (void *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR); | |
1397 | + pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + | |
1398 | + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(struct vnt_cts)); | |
1395 | 1399 | cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + |
1396 | - cbMICHDR + sizeof(SCTS) + sizeof(struct vnt_tx_datahead_g); | |
1400 | + cbMICHDR + sizeof(struct vnt_cts) + sizeof(struct vnt_tx_datahead_g); | |
1397 | 1401 | } |
1398 | 1402 | } else { |
1399 | 1403 | // Auto Fall Back |
... | ... | @@ -2126,7 +2130,7 @@ |
2126 | 2130 | unsigned char byPktType; |
2127 | 2131 | unsigned char *pbyTxBufferAddr; |
2128 | 2132 | void *pvRTS; |
2129 | - PSCTS pCTS; | |
2133 | + struct vnt_cts *pCTS; | |
2130 | 2134 | void *pvTxDataHd; |
2131 | 2135 | unsigned int uDuration; |
2132 | 2136 | unsigned int cbReqCount; |
2133 | 2137 | |
2134 | 2138 | |
... | ... | @@ -2264,12 +2268,12 @@ |
2264 | 2268 | pvRrvTime = (void *) (pbyTxBufferAddr + wTxBufSize); |
2265 | 2269 | pMICHDR = NULL; |
2266 | 2270 | pvRTS = NULL; |
2267 | - pCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + | |
2271 | + pCTS = (struct vnt_cts *)(pbyTxBufferAddr + wTxBufSize + | |
2268 | 2272 | sizeof(struct vnt_rrv_time_cts)); |
2269 | 2273 | pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + |
2270 | - sizeof(struct vnt_rrv_time_cts) + sizeof(SCTS)); | |
2274 | + sizeof(struct vnt_rrv_time_cts) + sizeof(struct vnt_cts)); | |
2271 | 2275 | cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + |
2272 | - sizeof(SCTS) + sizeof(struct vnt_tx_datahead_g); | |
2276 | + sizeof(struct vnt_cts) + sizeof(struct vnt_tx_datahead_g); | |
2273 | 2277 | } else { // 802.11a/b packet |
2274 | 2278 | pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); |
2275 | 2279 | pMICHDR = NULL; |
2276 | 2280 | |
2277 | 2281 | |
... | ... | @@ -2754,12 +2758,12 @@ |
2754 | 2758 | pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + |
2755 | 2759 | sizeof(struct vnt_rrv_time_cts)); |
2756 | 2760 | pvRTS = NULL; |
2757 | - pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + | |
2761 | + pvCTS = (struct vnt_cts *)(pbyTxBufferAddr + wTxBufSize + | |
2758 | 2762 | sizeof(struct vnt_rrv_time_cts) + cbMICHDR); |
2759 | 2763 | pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + |
2760 | - sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS)); | |
2764 | + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(struct vnt_cts)); | |
2761 | 2765 | cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + |
2762 | - cbMICHDR + sizeof(SCTS) + sizeof(struct vnt_tx_datahead_g); | |
2766 | + cbMICHDR + sizeof(struct vnt_cts) + sizeof(struct vnt_tx_datahead_g); | |
2763 | 2767 | |
2764 | 2768 | } else {//802.11a/b packet |
2765 | 2769 |
drivers/staging/vt6655/rxtx.h
... | ... | @@ -154,6 +154,15 @@ |
154 | 154 | struct ieee80211_rts data; |
155 | 155 | } __packed; |
156 | 156 | |
157 | +/* CTS buffer header */ | |
158 | +struct vnt_cts { | |
159 | + struct vnt_phy_field b; | |
160 | + __le16 duration_ba; | |
161 | + u16 reserved; | |
162 | + struct ieee80211_cts data; | |
163 | + u16 reserved2; | |
164 | +} __packed; | |
165 | + | |
157 | 166 | struct vnt_tx_short_buf_head { |
158 | 167 | __le16 fifo_ctl; |
159 | 168 | u16 time_stamp; |