Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vt6656: rxtx.c Move rts_cts pointer assignment to s_vGenerateTxParameter

Move rts/cts pointers to relevant vnt_tx_data_head position.

Remove old rts_cts pointers in calling functions.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
b9cc2fc0 f0e0d505

+23 -21
+23 -21
drivers/staging/vt6656/rxtx.c
··· 847 847 struct ethhdr *psEthHeader, bool need_rts) 848 848 { 849 849 struct vnt_tx_fifo_head *pFifoHead = &tx_buffer->fifo_head; 850 - union vnt_tx_data_head *head = rts_cts; 850 + union vnt_tx_data_head *head = NULL; 851 851 u32 cbMACHdLen = WLAN_HDR_ADDR3_LEN; /* 24 */ 852 852 u16 wFifoCtl; 853 853 u8 byFBOption = AUTO_FB_NONE; ··· 885 885 pBuf->wTxRrvTime_b = vnt_rxtx_rsvtime_le16(pDevice, 886 886 PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, 887 887 bNeedACK); 888 - if (need_mic) 888 + 889 + if (need_mic) { 889 890 *mic_hdr = &tx_buffer->tx_head.tx_rts.tx.mic.hdr; 891 + head = &tx_buffer->tx_head.tx_rts.tx.mic.head; 892 + } else { 893 + head = &tx_buffer->tx_head.tx_rts.tx.head; 894 + } 890 895 891 896 /* Fill RTS */ 892 897 s_vFillRTSHead(pDevice, byPktType, head, cbFrameSize, ··· 909 904 pBuf->wCTSTxRrvTime_ba = s_uGetRTSCTSRsvTime(pDevice, 3, 910 905 byPktType, cbFrameSize, wCurrentRate); 911 906 912 - if (need_mic) 907 + if (need_mic) { 913 908 *mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr; 909 + head = &tx_buffer->tx_head.tx_cts.tx.mic.head; 910 + } else { 911 + head = &tx_buffer->tx_head.tx_cts.tx.head; 912 + } 914 913 915 914 /* Fill CTS */ 916 915 s_vFillCTSHead(pDevice, uDMAIdx, byPktType, head, ··· 930 921 byPktType, cbFrameSize, wCurrentRate); 931 922 pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, byPktType, 932 923 cbFrameSize, wCurrentRate, bNeedACK); 933 - if (need_mic) 924 + 925 + if (need_mic) { 934 926 *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; 927 + head = &tx_buffer->tx_head.tx_ab.tx.mic.head; 928 + } else { 929 + head = &tx_buffer->tx_head.tx_ab.tx.head; 930 + } 935 931 936 932 /* Fill RTS */ 937 933 s_vFillRTSHead(pDevice, byPktType, head, cbFrameSize, ··· 962 948 pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, 963 949 cbFrameSize, wCurrentRate, bNeedACK); 964 950 965 - if (need_mic) 951 + if (need_mic) { 966 952 *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; 953 + head = &tx_buffer->tx_head.tx_ab.tx.mic.head; 954 + } else { 955 + head = &tx_buffer->tx_head.tx_ab.tx.head; 956 + } 967 957 968 958 /* Fill RTS */ 969 959 s_vFillRTSHead(pDevice, byPktType, head, cbFrameSize, ··· 1148 1130 if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet 1149 1131 if (byFBOption == AUTO_FB_NONE) { 1150 1132 if (bRTS == true) {//RTS_need 1151 - rts_cts = (struct vnt_rts_g *) (pbyTxBufferAddr + wTxBufSize + 1152 - sizeof(struct vnt_rrv_time_rts) + cbMICHDR); 1153 1133 pvTxDataHd = (struct vnt_tx_datahead_g *) (pbyTxBufferAddr + 1154 1134 wTxBufSize + sizeof(struct vnt_rrv_time_rts) + 1155 1135 cbMICHDR + sizeof(struct vnt_rts_g)); ··· 1156 1140 sizeof(struct vnt_tx_datahead_g); 1157 1141 } 1158 1142 else { //RTS_needless 1159 - rts_cts = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize + 1160 - sizeof(struct vnt_rrv_time_cts) + cbMICHDR); 1161 1143 pvTxDataHd = (struct vnt_tx_datahead_g *)(pbyTxBufferAddr + 1162 1144 wTxBufSize + sizeof(struct vnt_rrv_time_cts) + 1163 1145 cbMICHDR + sizeof(struct vnt_cts)); ··· 1166 1152 } else { 1167 1153 // Auto Fall Back 1168 1154 if (bRTS == true) {//RTS_need 1169 - rts_cts = (struct vnt_rts_g_fb *)(pbyTxBufferAddr + wTxBufSize + 1170 - sizeof(struct vnt_rrv_time_rts) + cbMICHDR); 1171 1155 pvTxDataHd = (struct vnt_tx_datahead_g_fb *) (pbyTxBufferAddr + 1172 1156 wTxBufSize + sizeof(struct vnt_rrv_time_rts) + 1173 1157 cbMICHDR + sizeof(struct vnt_rts_g_fb)); ··· 1174 1162 sizeof(struct vnt_tx_datahead_g_fb); 1175 1163 } 1176 1164 else if (bRTS == false) { //RTS_needless 1177 - rts_cts = (struct vnt_cts_fb *) (pbyTxBufferAddr + wTxBufSize + 1178 - sizeof(struct vnt_rrv_time_cts) + cbMICHDR); 1179 1165 pvTxDataHd = (struct vnt_tx_datahead_g_fb *) (pbyTxBufferAddr + 1180 1166 wTxBufSize + sizeof(struct vnt_rrv_time_cts) + 1181 1167 cbMICHDR + sizeof(struct vnt_cts_fb)); ··· 1186 1176 else {//802.11a/b packet 1187 1177 if (byFBOption == AUTO_FB_NONE) { 1188 1178 if (bRTS == true) {//RTS_need 1189 - rts_cts = (struct vnt_rts_ab *) (pbyTxBufferAddr + wTxBufSize + 1190 - sizeof(struct vnt_rrv_time_ab) + cbMICHDR); 1191 1179 pvTxDataHd = (struct vnt_tx_datahead_ab *)(pbyTxBufferAddr + 1192 1180 wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + 1193 1181 sizeof(struct vnt_rts_ab)); ··· 1202 1194 } else { 1203 1195 // Auto Fall Back 1204 1196 if (bRTS == true) {//RTS_need 1205 - rts_cts = (struct vnt_rts_a_fb *)(pbyTxBufferAddr + wTxBufSize + 1206 - sizeof(struct vnt_rrv_time_ab) + cbMICHDR); 1207 1197 pvTxDataHd = (struct vnt_tx_datahead_a_fb *)(pbyTxBufferAddr + 1208 1198 wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + 1209 1199 sizeof(struct vnt_rts_a_fb)); ··· 1603 1597 1604 1598 //Set RrvTime/RTS/CTS Buffer 1605 1599 if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet 1606 - rts_cts = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize + 1607 - sizeof(struct vnt_rrv_time_cts)); 1608 1600 pvTxDataHd = (struct vnt_tx_datahead_g *)(pbyTxBufferAddr + wTxBufSize + 1609 1601 sizeof(struct vnt_rrv_time_cts) + sizeof(struct vnt_cts)); 1610 1602 cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + ··· 2007 2003 //the rest of pTxBufHead->wFragCtl:FragTyp will be set later in s_vFillFragParameter() 2008 2004 2009 2005 if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet 2010 - rts_cts = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize + 2011 - sizeof(struct vnt_rrv_time_cts) + cbMICHDR); 2012 2006 pvTxDataHd = (struct vnt_tx_datahead_g *) (pbyTxBufferAddr + 2013 2007 wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + 2014 2008 sizeof(struct vnt_cts));