Commit db1afd18e9cddffd957abea6287a6eae9edbeccc

Authored by Malcolm Priestley
Committed by Greg Kroah-Hartman
1 parent f5172b0edf

staging: vt6655: replace typedef struct tagSCTS_FB with struct vnt_cts_fb

Replacing members
b, wDuration_ba,  wReserved, wCTSDuration_ba_f0, wCTSDuration_ba_f1, data and
reserved2.

With
b, duration_ba, reserved, cts_duration_ba_f0, cts_duration_ba_f1, 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 40 additions and 35 deletions Side-by-side Diff

drivers/staging/vt6655/desc.h
... ... @@ -353,21 +353,6 @@
353 353 };
354 354  
355 355 //
356   -// CTS buffer header
357   -//
358   -typedef struct tagSCTS_FB {
359   - struct vnt_phy_field b;
360   - unsigned short wDuration_ba;
361   - unsigned short wReserved;
362   - unsigned short wCTSDuration_ba_f0;
363   - unsigned short wCTSDuration_ba_f1;
364   - struct ieee80211_cts data;
365   - u16 reserved2;
366   -} __attribute__ ((__packed__))
367   -SCTS_FB, *PSCTS_FB;
368   -typedef const SCTS_FB *PCSCTS_FB;
369   -
370   -//
371 356 // Tx FIFO header
372 357 //
373 358 typedef struct tagSTxBufHead {
drivers/staging/vt6655/rxtx.c
... ... @@ -1043,33 +1043,42 @@
1043 1043 if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
1044 1044 if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
1045 1045 // Auto Fall back
1046   - PSCTS_FB pBuf = (PSCTS_FB)pvCTS;
  1046 + struct vnt_cts_fb *buf = pvCTS;
1047 1047 /* Get SignalField, ServiceField & Length */
1048 1048 vnt_get_phy_field(pDevice, uCTSFrameLen,
1049 1049 pDevice->byTopCCKBasicRate,
1050   - PK_TYPE_11B, &pBuf->b);
  1050 + PK_TYPE_11B, &buf->b);
1051 1051  
1052   - pBuf->wDuration_ba = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data
1053   - pBuf->wDuration_ba += pDevice->wCTSDuration;
1054   - pBuf->wDuration_ba = cpu_to_le16(pBuf->wDuration_ba);
1055   - //Get CTSDuration_ba_f0
1056   - pBuf->wCTSDuration_ba_f0 = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //8:CTSDuration_ba_f0, 1:2.4G, 2,3:2.4G OFDM Data
1057   - pBuf->wCTSDuration_ba_f0 += pDevice->wCTSDuration;
1058   - pBuf->wCTSDuration_ba_f0 = cpu_to_le16(pBuf->wCTSDuration_ba_f0);
  1052 + buf->duration_ba = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength,
  1053 + byPktType, wCurrentRate, bNeedAck, byFBOption);
  1054 + buf->duration_ba += pDevice->wCTSDuration;
  1055 +
  1056 + buf->duration_ba = cpu_to_le16(buf->duration_ba);
  1057 + /* Get CTSDuration_ba_f0 */
  1058 + buf->cts_duration_ba_f0 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength,
  1059 + byPktType, wCurrentRate,
  1060 + bNeedAck, byFBOption);
  1061 +
  1062 + buf->cts_duration_ba_f0 += pDevice->wCTSDuration;
  1063 +
  1064 + buf->cts_duration_ba_f0 = cpu_to_le16(buf->cts_duration_ba_f0);
1059 1065 //Get CTSDuration_ba_f1
1060   - pBuf->wCTSDuration_ba_f1 = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //9:CTSDuration_ba_f1, 1:2.4G, 2,3:2.4G OFDM Data
1061   - pBuf->wCTSDuration_ba_f1 += pDevice->wCTSDuration;
1062   - pBuf->wCTSDuration_ba_f1 = cpu_to_le16(pBuf->wCTSDuration_ba_f1);
  1066 + buf->cts_duration_ba_f1 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength,
  1067 + byPktType, wCurrentRate,
  1068 + bNeedAck, byFBOption);
  1069 + buf->cts_duration_ba_f1 += pDevice->wCTSDuration;
  1070 +
  1071 + buf->cts_duration_ba_f1 = cpu_to_le16(buf->cts_duration_ba_f1);
1063 1072 /* Get CTS Frame body */
1064   - pBuf->data.duration = pBuf->wDuration_ba;
  1073 + buf->data.duration = buf->duration_ba;
1065 1074  
1066   - pBuf->data.frame_control =
  1075 + buf->data.frame_control =
1067 1076 cpu_to_le16(IEEE80211_FTYPE_CTL |
1068 1077 IEEE80211_STYPE_CTS);
1069 1078  
1070   - pBuf->reserved2 = 0x0;
1071   - memcpy(&pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
  1079 + buf->reserved2 = 0x0;
1072 1080  
  1081 + memcpy(&buf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
1073 1082 } else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
1074 1083 struct vnt_cts *buf = pvCTS;
1075 1084 /* Get SignalField, ServiceField & Length */
1076 1085  
... ... @@ -1414,10 +1423,11 @@
1414 1423 pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
1415 1424 pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
1416 1425 pvRTS = NULL;
1417   - pvCTS = (PSCTS_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
1418   - pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS_FB));
  1426 + pvCTS = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
  1427 + pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
  1428 + cbMICHDR + sizeof(struct vnt_cts_fb));
1419 1429 cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
1420   - cbMICHDR + sizeof(SCTS_FB) + sizeof(struct vnt_tx_datahead_g_fb);
  1430 + cbMICHDR + sizeof(struct vnt_cts_fb) + sizeof(struct vnt_tx_datahead_g_fb);
1421 1431 }
1422 1432 } // Auto Fall Back
1423 1433 } else {//802.11a/b packet
drivers/staging/vt6655/rxtx.h
... ... @@ -163,6 +163,16 @@
163 163 u16 reserved2;
164 164 } __packed;
165 165  
  166 +struct vnt_cts_fb {
  167 + struct vnt_phy_field b;
  168 + __le16 duration_ba;
  169 + u16 reserved;
  170 + __le16 cts_duration_ba_f0;
  171 + __le16 cts_duration_ba_f1;
  172 + struct ieee80211_cts data;
  173 + u16 reserved2;
  174 +} __packed;
  175 +
166 176 struct vnt_tx_short_buf_head {
167 177 __le16 fifo_ctl;
168 178 u16 time_stamp;