staging: vt6656: rxtx remove struct ethhdr from functions
PATCH 1/16 staging: vt6656: rxtx remove struct ethhdr from functions
ethhdr is nolonger used by driver.
--- drivers/staging/vt6656/rxtx.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-)
drivers/staging/vt6656/rxtx.c +19 -23
@@ -86,7 +86,7 @@ static struct vnt_usb_send_context *s_vGetFreeContext(struct vnt_private *);static u16 s_vGenerateTxParameter (struct vnt_usb_send_context *tx_context,u8 byPktType,u16 wCurrentRate,struct vnt_tx_buffer *tx_buffer,struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 cbFrameSize, -int bNeedACK,struct ethhdr *psEthHeader,bool need_rts); +int bNeedACK,bool need_rts);static unsigned int s_uGetTxRsvTime (struct vnt_private *pDevice,u8 byPktType,u32 cbFrameLength,u16 wRate,int bNeedAck);
@@ -100,7 +100,7 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context,static u16 s_vFillRTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck, -struct ethhdr *psEthHeader,u16 wCurrentRate,u8 byFBOption); +u16 wCurrentRate,u8 byFBOption);static __le16 s_uGetDataDuration (struct vnt_private *pDevice,u8 byPktType,int bNeedAck);
@@ -425,8 +425,7 @@ static int vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context, }static u16 vnt_rxtx_rts_g_head (struct vnt_usb_send_context *tx_context, -struct vnt_rts_g *buf,struct ethhdr *eth_hdr, -u8 pkt_type,u32 frame_len,int need_ack, +struct vnt_rts_g *buf,u8 pkt_type,u32 frame_len,int need_ack,u16 current_rate,u8 fb_option) {struct vnt_private *priv = tx_context->priv;
@@ -451,8 +450,7 @@ static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context, }static u16 vnt_rxtx_rts_g_fb_head (struct vnt_usb_send_context *tx_context, -struct vnt_rts_g_fb *buf,struct ethhdr *eth_hdr, -u8 pkt_type,u32 frame_len,int need_ack, +struct vnt_rts_g_fb *buf,u8 pkt_type,u32 frame_len,int need_ack,u16 current_rate,u8 fb_option) {struct vnt_private *priv = tx_context->priv;
@@ -488,8 +486,7 @@ static u16 vnt_rxtx_rts_g_fb_head(struct vnt_usb_send_context *tx_context, }static u16 vnt_rxtx_rts_ab_head (struct vnt_usb_send_context *tx_context, -struct vnt_rts_ab *buf,struct ethhdr *eth_hdr, -u8 pkt_type,u32 frame_len,int need_ack, +struct vnt_rts_ab *buf,u8 pkt_type,u32 frame_len,int need_ack,u16 current_rate,u8 fb_option) {struct vnt_private *priv = tx_context->priv;
@@ -508,8 +505,7 @@ static u16 vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context, }static u16 vnt_rxtx_rts_a_fb_head (struct vnt_usb_send_context *tx_context, -struct vnt_rts_a_fb *buf,struct ethhdr *eth_hdr, -u8 pkt_type,u32 frame_len,int need_ack, +struct vnt_rts_a_fb *buf,u8 pkt_type,u32 frame_len,int need_ack,u16 current_rate,u8 fb_option) {struct vnt_private *priv = tx_context->priv;
@@ -535,7 +531,7 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context,static u16 s_vFillRTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck, -struct ethhdr *psEthHeader,u16 wCurrentRate,u8 byFBOption) +u16 wCurrentRate,u8 byFBOption) {if (!head)
@@ -551,26 +547,26 @@ static u16 s_vFillRTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType,case PK_TYPE_11GA :if (byFBOption ==AUTO_FB_NONE )return vnt_rxtx_rts_g_head (tx_context, &head->rts_g, - psEthHeader, byPktType, cbFrameLength, + byPktType, cbFrameLength, bNeedAck, wCurrentRate, byFBOption);else return vnt_rxtx_rts_g_fb_head (tx_context, - &head->rts_g_fb, psEthHeader, byPktType, + &head->rts_g_fb, byPktType, cbFrameLength, bNeedAck, wCurrentRate, byFBOption);break ;case PK_TYPE_11A :if (byFBOption) {return vnt_rxtx_rts_a_fb_head (tx_context, - &head->rts_a_fb, psEthHeader, byPktType, + &head->rts_a_fb, byPktType, cbFrameLength, bNeedAck, wCurrentRate, byFBOption);break ; }case PK_TYPE_11B :return vnt_rxtx_rts_ab_head (tx_context, &head->rts_ab, - psEthHeader, byPktType, cbFrameLength, - bNeedAck, wCurrentRate, byFBOption); + byPktType, cbFrameLength, bNeedAck, + wCurrentRate, byFBOption); }return 0 ;
@@ -661,7 +657,7 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context,static u16 s_vGenerateTxParameter (struct vnt_usb_send_context *tx_context,u8 byPktType,u16 wCurrentRate,struct vnt_tx_buffer *tx_buffer,struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 cbFrameSize, -int bNeedACK,struct ethhdr *psEthHeader,bool need_rts) +int bNeedACK,bool need_rts) {struct vnt_private *pDevice = tx_context->priv;struct vnt_tx_fifo_head *pFifoHead = &tx_buffer->fifo_head;
@@ -705,7 +701,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, - cbFrameSize, bNeedACK, psEthHeader, + cbFrameSize, bNeedACK, wCurrentRate, byFBOption); }else {
@@ -754,8 +750,8 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, - cbFrameSize, bNeedACK, psEthHeader, - wCurrentRate, byFBOption); + cbFrameSize, bNeedACK, + wCurrentRate, byFBOption); }else {struct vnt_rrv_time_ab *pBuf = &tx_buffer-> tx_head.tx_ab.ab;
@@ -789,8 +785,8 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, - cbFrameSize, - bNeedACK, psEthHeader, wCurrentRate, byFBOption); + cbFrameSize, bNeedACK, + wCurrentRate, byFBOption); }else {struct vnt_rrv_time_ab *pBuf = &tx_buffer-> tx_head.tx_ab.ab;
@@ -1025,7 +1021,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) duration_id =s_vGenerateTxParameter (tx_context, pkt_type, current_rate, tx_buffer, &mic_hdr, need_mic, frame_size, - need_ack,NULL , need_rts); + need_ack, need_rts); tx_header_size = tx_context->tx_hdr_size;if (!tx_header_size) {
Signature · 1 line
1.9.1
PATCH 2/16 staging: vt6656: rxtx: move tx_context->fb_option into function structure.
Replace fb_option in function calls with tx_context->fb_option.
Namely functions s_vFillCTSHead and s_vFillRTSHead
--- drivers/staging/vt6656/rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/vt6656/rxtx.c +3 -3
@@ -545,7 +545,7 @@ static u16 s_vFillRTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType,switch (byPktType) {case PK_TYPE_11GB :case PK_TYPE_11GA : -if (byFBOption ==AUTO_FB_NONE ) +if (!tx_context->fb_option)return vnt_rxtx_rts_g_head (tx_context, &head->rts_g, byPktType, cbFrameLength, bNeedAck, wCurrentRate, byFBOption);
@@ -556,7 +556,7 @@ static u16 s_vFillRTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType, byFBOption);break ;case PK_TYPE_11A : -if (byFBOption) { +if (tx_context->fb_option) { return vnt_rxtx_rts_a_fb_head(tx_context, &head->rts_a_fb, byPktType, cbFrameLength, bNeedAck, wCurrentRate,
@@ -582,7 +582,7 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context,if (!head)return 0 ; -if (byFBOption !=AUTO_FB_NONE ) { +if (tx_context->fb_option) {/* Auto Fall back */ struct vnt_cts_fb *pBuf = &head->cts_g_fb;/* Get SignalField,ServiceField,Length */
Signature · 1 line
1.9.1
PATCH 3/16 staging: vt6656: rxtx remove fb_option from functions.
In reply to Malcolm PriestleyThis is now dead code.
--- drivers/staging/vt6656/rxtx.c | 84 +++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 48 deletions(-)
drivers/staging/vt6656/rxtx.c +36 -48
@@ -96,18 +96,18 @@ static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,static u16 s_vFillCTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength, -int bNeedAck,u16 wCurrentRate,u8 byFBOption); +int bNeedAck,u16 wCurrentRate);static u16 s_vFillRTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck, -u16 wCurrentRate,u8 byFBOption); +u16 wCurrentRate);static __le16 s_uGetDataDuration (struct vnt_private *pDevice,u8 byPktType,int bNeedAck);static __le16 s_uGetRTSCTSDuration (struct vnt_private *pDevice,u8 byDurType,u32 cbFrameLength,u8 byPktType,u16 wRate, -int bNeedAck,u8 byFBOption); +int bNeedAck);static struct vnt_usb_send_context *s_vGetFreeContext (struct vnt_private *priv)
@@ -243,8 +243,7 @@ static __le16 s_uGetDataDuration(struct vnt_private *pDevice,//byFreqType: 0=>5GHZ 1=>2.4GHZ static __le16 s_uGetRTSCTSDuration (struct vnt_private *pDevice,u8 byDurType, -u32 cbFrameLength,u8 byPktType,u16 wRate,int bNeedAck, -u8 byFBOption) +u32 cbFrameLength,u8 byPktType,u16 wRate,int bNeedAck) {u32 uCTSTime =0 , uDurTime =0 ;
@@ -426,7 +425,7 @@ static int vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_rts_g_head (struct vnt_usb_send_context *tx_context,struct vnt_rts_g *buf,u8 pkt_type,u32 frame_len,int need_ack, -u16 current_rate,u8 fb_option) +u16 current_rate) {struct vnt_private *priv = tx_context->priv;u16 rts_frame_len =20 ;
@@ -437,11 +436,11 @@ static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context, priv->byTopOFDMBasicRate, pkt_type, &buf->a); buf->duration_bb =s_uGetRTSCTSDuration (priv,RTSDUR_BB , frame_len, -PK_TYPE_11B , priv->byTopCCKBasicRate, need_ack, fb_option); +PK_TYPE_11B , priv->byTopCCKBasicRate, need_ack); buf->duration_aa =s_uGetRTSCTSDuration (priv,RTSDUR_AA , frame_len, - pkt_type, current_rate, need_ack, fb_option); + pkt_type, current_rate, need_ack); buf->duration_ba =s_uGetRTSCTSDuration (priv,RTSDUR_BA , frame_len, - pkt_type, current_rate, need_ack, fb_option); + pkt_type, current_rate, need_ack);vnt_fill_ieee80211_rts (tx_context, &buf->data, buf->duration_aa);
@@ -451,7 +450,7 @@ static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_rts_g_fb_head (struct vnt_usb_send_context *tx_context,struct vnt_rts_g_fb *buf,u8 pkt_type,u32 frame_len,int need_ack, -u16 current_rate,u8 fb_option) +u16 current_rate) {struct vnt_private *priv = tx_context->priv;u16 rts_frame_len =20 ;
@@ -463,21 +462,21 @@ static u16 vnt_rxtx_rts_g_fb_head(struct vnt_usb_send_context *tx_context, buf->duration_bb =s_uGetRTSCTSDuration (priv,RTSDUR_BB , frame_len, -PK_TYPE_11B , priv->byTopCCKBasicRate, need_ack, fb_option); +PK_TYPE_11B , priv->byTopCCKBasicRate, need_ack); buf->duration_aa =s_uGetRTSCTSDuration (priv,RTSDUR_AA , frame_len, - pkt_type, current_rate, need_ack, fb_option); + pkt_type, current_rate, need_ack); buf->duration_ba =s_uGetRTSCTSDuration (priv,RTSDUR_BA , frame_len, - pkt_type, current_rate, need_ack, fb_option); + pkt_type, current_rate, need_ack); buf->rts_duration_ba_f0 =s_uGetRTSCTSDuration (priv,RTSDUR_BA_F0 , - frame_len, pkt_type, priv->tx_rate_fb0, need_ack, fb_option); + frame_len, pkt_type, priv->tx_rate_fb0, need_ack); buf->rts_duration_aa_f0 =s_uGetRTSCTSDuration (priv,RTSDUR_AA_F0 , - frame_len, pkt_type, priv->tx_rate_fb0, need_ack, fb_option); + frame_len, pkt_type, priv->tx_rate_fb0, need_ack); buf->rts_duration_ba_f1 =s_uGetRTSCTSDuration (priv,RTSDUR_BA_F1 , - frame_len, pkt_type, priv->tx_rate_fb1, need_ack, fb_option); + frame_len, pkt_type, priv->tx_rate_fb1, need_ack); buf->rts_duration_aa_f1 =s_uGetRTSCTSDuration (priv,RTSDUR_AA_F1 , - frame_len, pkt_type, priv->tx_rate_fb1, need_ack, fb_option); + frame_len, pkt_type, priv->tx_rate_fb1, need_ack);vnt_fill_ieee80211_rts (tx_context, &buf->data, buf->duration_aa);
@@ -487,7 +486,7 @@ static u16 vnt_rxtx_rts_g_fb_head(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_rts_ab_head (struct vnt_usb_send_context *tx_context,struct vnt_rts_ab *buf,u8 pkt_type,u32 frame_len,int need_ack, -u16 current_rate,u8 fb_option) +u16 current_rate) {struct vnt_private *priv = tx_context->priv;u16 rts_frame_len =20 ;
@@ -496,7 +495,7 @@ static u16 vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context, priv->byTopOFDMBasicRate, pkt_type, &buf->ab); buf->duration =s_uGetRTSCTSDuration (priv,RTSDUR_AA , frame_len, - pkt_type, current_rate, need_ack, fb_option); + pkt_type, current_rate, need_ack);vnt_fill_ieee80211_rts (tx_context, &buf->data, buf->duration);
@@ -506,7 +505,7 @@ static u16 vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_rts_a_fb_head (struct vnt_usb_send_context *tx_context,struct vnt_rts_a_fb *buf,u8 pkt_type,u32 frame_len,int need_ack, -u16 current_rate,u8 fb_option) +u16 current_rate) {struct vnt_private *priv = tx_context->priv;u16 rts_frame_len =20 ;
@@ -515,13 +514,13 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context, priv->byTopOFDMBasicRate, pkt_type, &buf->a); buf->duration =s_uGetRTSCTSDuration (priv,RTSDUR_AA , frame_len, - pkt_type, current_rate, need_ack, fb_option); + pkt_type, current_rate, need_ack); buf->rts_duration_f0 =s_uGetRTSCTSDuration (priv,RTSDUR_AA_F0 , - frame_len, pkt_type, priv->tx_rate_fb0, need_ack, fb_option); + frame_len, pkt_type, priv->tx_rate_fb0, need_ack); buf->rts_duration_f1 =s_uGetRTSCTSDuration (priv,RTSDUR_AA_F1 , - frame_len, pkt_type, priv->tx_rate_fb1, need_ack, fb_option); + frame_len, pkt_type, priv->tx_rate_fb1, need_ack);vnt_fill_ieee80211_rts (tx_context, &buf->data, buf->duration);
@@ -531,7 +530,7 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context,static u16 s_vFillRTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck, -u16 wCurrentRate,u8 byFBOption) +u16 wCurrentRate) {if (!head)
@@ -548,25 +547,23 @@ static u16 s_vFillRTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType,if (!tx_context->fb_option)return vnt_rxtx_rts_g_head (tx_context, &head->rts_g, byPktType, cbFrameLength, - bNeedAck, wCurrentRate, byFBOption); + bNeedAck, wCurrentRate);else return vnt_rxtx_rts_g_fb_head (tx_context, &head->rts_g_fb, byPktType, - cbFrameLength, bNeedAck, wCurrentRate, - byFBOption); + cbFrameLength, bNeedAck, wCurrentRate);break ;case PK_TYPE_11A :if (tx_context->fb_option) {return vnt_rxtx_rts_a_fb_head (tx_context, &head->rts_a_fb, byPktType, - cbFrameLength, bNeedAck, wCurrentRate, - byFBOption); + cbFrameLength, bNeedAck, wCurrentRate);break ; }case PK_TYPE_11B :return vnt_rxtx_rts_ab_head (tx_context, &head->rts_ab, byPktType, cbFrameLength, bNeedAck, - wCurrentRate, byFBOption); + wCurrentRate); }return 0 ;
@@ -574,7 +571,7 @@ static u16 s_vFillRTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType,static u16 s_vFillCTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength, -int bNeedAck,u16 wCurrentRate,u8 byFBOption) +int bNeedAck,u16 wCurrentRate) {struct vnt_private *pDevice = tx_context->priv;u32 uCTSFrameLen =14 ;
@@ -590,15 +587,15 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context, pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b); pBuf->duration_ba =s_uGetRTSCTSDuration (pDevice,CTSDUR_BA , cbFrameLength, byPktType, - wCurrentRate, bNeedAck, byFBOption); + wCurrentRate, bNeedAck);/* Get CTSDuration_ba_f0 */ pBuf->cts_duration_ba_f0 =s_uGetRTSCTSDuration (pDevice,CTSDUR_BA_F0 , cbFrameLength, byPktType, - pDevice->tx_rate_fb0, bNeedAck, byFBOption); + pDevice->tx_rate_fb0, bNeedAck);/* Get CTSDuration_ba_f1 */ pBuf->cts_duration_ba_f1 =s_uGetRTSCTSDuration (pDevice,CTSDUR_BA_F1 , cbFrameLength, byPktType, - pDevice->tx_rate_fb1, bNeedAck, byFBOption); + pDevice->tx_rate_fb1, bNeedAck);/* Get CTS Frame body */ pBuf->data.duration = pBuf->duration_ba; pBuf->data.frame_control =
@@ -617,7 +614,7 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context,/* Get CTSDuration_ba */ pBuf->duration_ba =s_uGetRTSCTSDuration (pDevice,CTSDUR_BA , cbFrameLength, byPktType, - wCurrentRate, bNeedAck, byFBOption); + wCurrentRate, bNeedAck);/*Get CTS Frame body*/ pBuf->data.duration = pBuf->duration_ba; pBuf->data.frame_control =
@@ -662,16 +659,8 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,struct vnt_private *pDevice = tx_context->priv;struct vnt_tx_fifo_head *pFifoHead = &tx_buffer->fifo_head;union vnt_tx_data_head *head =NULL ; -u16 wFifoCtl; -u8 byFBOption =AUTO_FB_NONE ; pFifoHead->current_rate =cpu_to_le16 (wCurrentRate); - wFifoCtl = pFifoHead->wFIFOCtl; - -if (wFifoCtl &FIFOCTL_AUTO_FB_0 ) - byFBOption =AUTO_FB_0 ; -else if (wFifoCtl &FIFOCTL_AUTO_FB_1 ) - byFBOption =AUTO_FB_1 ;if (byPktType ==PK_TYPE_11GB || byPktType ==PK_TYPE_11GA ) {if (need_rts) {
@@ -702,7 +691,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, cbFrameSize, bNeedACK, - wCurrentRate, byFBOption); + wCurrentRate); }else { struct vnt_rrv_time_cts *pBuf = &tx_buffer->
@@ -727,8 +716,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill CTS */ return s_vFillCTSHead (tx_context, byPktType, - head, cbFrameSize, bNeedACK, wCurrentRate, - byFBOption); + head, cbFrameSize, bNeedACK, wCurrentRate); } }else if (byPktType ==PK_TYPE_11A ) {if (need_mic) {
@@ -751,7 +739,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, cbFrameSize, bNeedACK, - wCurrentRate, byFBOption); + wCurrentRate); }else {struct vnt_rrv_time_ab *pBuf = &tx_buffer-> tx_head.tx_ab.ab;
@@ -786,7 +774,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, cbFrameSize, bNeedACK, - wCurrentRate, byFBOption); + wCurrentRate); }else {struct vnt_rrv_time_ab *pBuf = &tx_buffer-> tx_head.tx_ab.ab;
Signature · 1 line
1.9.1
PATCH 4/16 staging: vt6656: move current_rate setting out of s_vGenerateTxParameter
In reply to Malcolm PriestleyRemoving unneeded pointers
--- drivers/staging/vt6656/rxtx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/vt6656/rxtx.c +2 -3
@@ -657,11 +657,8 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, int bNeedACK, bool need_rts) {struct vnt_private *pDevice = tx_context->priv; -struct vnt_tx_fifo_head *pFifoHead = &tx_buffer->fifo_head;union vnt_tx_data_head *head =NULL ; - pFifoHead->current_rate =cpu_to_le16 (wCurrentRate); -if (byPktType ==PK_TYPE_11GB || byPktType ==PK_TYPE_11GA ) {if (need_rts) { struct vnt_rrv_time_rts *pBuf =
@@ -982,6 +979,8 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) frame_size += tx_key->icv_len; } + tx_buffer_head->current_rate =cpu_to_le16 (current_rate); +/* legacy rates TODO use ieee80211_tx_rate */ if (current_rate >=RATE_18M &&ieee80211_is_data (hdr->frame_control)) {if (priv->byAutoFBCtrl ==AUTO_FB_0 ) {
Signature · 1 line
1.9.1
PATCH 5/16 staging: vt6656: s_vGenerateTxParameter Parse out struct vnt_rrv_time_rts
In reply to Malcolm PriestleyCreat new function vnt_rxtx_rts that will eventually carry onward functions.
--- drivers/staging/vt6656/rxtx.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-)
drivers/staging/vt6656/rxtx.c +24 -15
@@ -629,6 +629,28 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context,return 0 ; } +static u16 vnt_rxtx_rts (struct vnt_usb_send_context *tx_context, +union vnt_tx_head *tx_head,u8 pkt_type,u32 frame_size, +int need_ack,u16 current_rate) +{ +struct vnt_private *priv = tx_context->priv; +struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts; + + buf->rts_rrv_time_aa =s_uGetRTSCTSRsvTime (priv,2 , + pkt_type, frame_size, current_rate); + buf->rts_rrv_time_ba =s_uGetRTSCTSRsvTime (priv,1 , + pkt_type, frame_size, current_rate); + buf->rts_rrv_time_bb =s_uGetRTSCTSRsvTime (priv,0 , + pkt_type, frame_size, current_rate); + + buf->rrv_time_a =vnt_rxtx_rsvtime_le16 (priv, pkt_type, frame_size, + current_rate, need_ack); + buf->rrv_time_b =vnt_rxtx_rsvtime_le16 (priv,PK_TYPE_11B , frame_size, + priv->byTopCCKBasicRate, need_ack); + +return 0 ; +} +/*+ * * Description:
@@ -661,21 +683,8 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,if (byPktType ==PK_TYPE_11GB || byPktType ==PK_TYPE_11GA ) {if (need_rts) { -struct vnt_rrv_time_rts *pBuf = - &tx_buffer->tx_head.tx_rts.rts; - - pBuf->rts_rrv_time_aa =s_uGetRTSCTSRsvTime (pDevice,2 , - byPktType, cbFrameSize, wCurrentRate); - pBuf->rts_rrv_time_ba =s_uGetRTSCTSRsvTime (pDevice,1 , - byPktType, cbFrameSize, wCurrentRate); - pBuf->rts_rrv_time_bb =s_uGetRTSCTSRsvTime (pDevice,0 , - byPktType, cbFrameSize, wCurrentRate); - - pBuf->rrv_time_a =vnt_rxtx_rsvtime_le16 (pDevice, - byPktType, cbFrameSize, wCurrentRate, bNeedACK); - pBuf->rrv_time_b =vnt_rxtx_rsvtime_le16 (pDevice, -PK_TYPE_11B , cbFrameSize, - pDevice->byTopCCKBasicRate, bNeedACK); +vnt_rxtx_rts (tx_context, &tx_buffer->tx_head, + byPktType, cbFrameSize, bNeedACK, wCurrentRate);if (need_mic) { *mic_hdr = &tx_buffer->
Signature · 1 line
1.9.1
PATCH 6/16 staging: vt6656: s_vGenerateTxParameter Parse out struct vnt_rrv_time_cts
In reply to Malcolm PriestleyCreate new function vnt_rxtx_cts that will eventually carry onward function.
--- drivers/staging/vt6656/rxtx.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-)
drivers/staging/vt6656/rxtx.c +20 -11
@@ -651,6 +651,24 @@ static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,return 0 ; } +static u16 vnt_rxtx_cts (struct vnt_usb_send_context *tx_context, +union vnt_tx_head *tx_head,u8 pkt_type,u32 frame_size, +int need_ack,u16 current_rate) +{ +struct vnt_private *priv = tx_context->priv; +struct vnt_rrv_time_cts *buf = &tx_head->tx_cts.cts; + + buf->rrv_time_a =vnt_rxtx_rsvtime_le16 (priv, pkt_type, + frame_size, current_rate, need_ack); + buf->rrv_time_b =vnt_rxtx_rsvtime_le16 (priv,PK_TYPE_11B , + frame_size, priv->byTopCCKBasicRate, need_ack); + + buf->cts_rrv_time_ba =s_uGetRTSCTSRsvTime (priv,3 , + pkt_type, frame_size, current_rate); + +return 0 ; +} +/*+ * * Description:
@@ -700,17 +718,8 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, wCurrentRate); }else { -struct vnt_rrv_time_cts *pBuf = &tx_buffer-> - tx_head.tx_cts.cts; - - pBuf->rrv_time_a =vnt_rxtx_rsvtime_le16 (pDevice, - byPktType, cbFrameSize, wCurrentRate, bNeedACK); - pBuf->rrv_time_b =vnt_rxtx_rsvtime_le16 (pDevice, -PK_TYPE_11B , cbFrameSize, - pDevice->byTopCCKBasicRate, bNeedACK); - - pBuf->cts_rrv_time_ba =s_uGetRTSCTSRsvTime (pDevice,3 , - byPktType, cbFrameSize, wCurrentRate); +vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, + byPktType, cbFrameSize, bNeedACK, wCurrentRate);if (need_mic) { *mic_hdr = &tx_buffer->
Signature · 1 line
1.9.1
PATCH 7/16 staging: vt6656: s_vGenerateTxParameter rxtx.c s_vGenerateTxParameter pBuf->rrv_time always the calling pkt_type
In reply to Malcolm PriestleyUse byPktType instead of macro.
The pkt_type has already been filtered in this function so its always set to the correct one.
--- drivers/staging/vt6656/rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/vt6656/rxtx.c +3 -3
@@ -760,7 +760,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, tx_head.tx_ab.ab; pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, -PK_TYPE_11A , cbFrameSize, + byPktType, cbFrameSize, wCurrentRate, bNeedACK); return vnt_rxtx_datahead_a_fb(tx_context, byPktType,
@@ -783,7 +783,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, byPktType, cbFrameSize, wCurrentRate); pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, -PK_TYPE_11B , cbFrameSize, wCurrentRate, + byPktType, cbFrameSize, wCurrentRate, bNeedACK);/* Fill RTS */
@@ -795,7 +795,7 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, tx_head.tx_ab.ab; pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, -PK_TYPE_11B , cbFrameSize, + byPktType, cbFrameSize, wCurrentRate, bNeedACK); return vnt_rxtx_datahead_ab(tx_context, byPktType,
Signature · 1 line
1.9.1
PATCH 8/16 staging: vt6656: s_vGenerateTxParameter parse out vnt_rrv_time_ab
In reply to Malcolm Priestleycreate new function vnt_rxtx_ab which will eventually carry onward functions
--- drivers/staging/vt6656/rxtx.c | 59 ++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 29 deletions(-)
drivers/staging/vt6656/rxtx.c +30 -29
@@ -669,6 +669,28 @@ static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context,return 0 ; } +static u16 vnt_rxtx_ab (struct vnt_usb_send_context *tx_context, +union vnt_tx_head *tx_head,u8 pkt_type,u32 frame_size, +int need_ack,u16 current_rate,bool need_rts) +{ +struct vnt_private *priv = tx_context->priv; +struct vnt_rrv_time_ab *buf = &tx_head->tx_ab.ab; + + buf->rrv_time =vnt_rxtx_rsvtime_le16 (priv, pkt_type, + frame_size, current_rate, need_ack); + +if (need_rts) { +if (pkt_type ==PK_TYPE_11B ) + buf->rts_rrv_time =s_uGetRTSCTSRsvTime (priv,0 , + pkt_type, frame_size, current_rate); +else /* PK_TYPE_11A */ + buf->rts_rrv_time =s_uGetRTSCTSRsvTime (priv,2 , + pkt_type, frame_size, current_rate); + } + +return 0 ; +} +/*+ * * Description:
@@ -696,7 +718,6 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, struct vnt_mic_hdr **mic_hdr, u32 need_mic, u32 cbFrameSize, int bNeedACK, bool need_rts) { - struct vnt_private *pDevice = tx_context->priv; union vnt_tx_data_head *head = NULL;if (byPktType ==PK_TYPE_11GB || byPktType ==PK_TYPE_11GA ) {
@@ -742,26 +763,17 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, }if (need_rts) { -struct vnt_rrv_time_ab *pBuf = &tx_buffer-> - tx_head.tx_ab.ab; - - pBuf->rts_rrv_time =s_uGetRTSCTSRsvTime (pDevice,2 , - byPktType, cbFrameSize, wCurrentRate); +vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, + cbFrameSize, bNeedACK, wCurrentRate, need_rts); - pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, - byPktType, cbFrameSize, wCurrentRate, bNeedACK);/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, cbFrameSize, bNeedACK, wCurrentRate); }else { -struct vnt_rrv_time_ab *pBuf = &tx_buffer-> - tx_head.tx_ab.ab; - - pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, - byPktType, cbFrameSize, - wCurrentRate, bNeedACK); +vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, + cbFrameSize, bNeedACK, wCurrentRate, need_rts); return vnt_rxtx_datahead_a_fb(tx_context, byPktType, wCurrentRate, &head->data_head_a_fb,
@@ -776,27 +788,16 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, }if (need_rts) { -struct vnt_rrv_time_ab *pBuf = &tx_buffer-> - tx_head.tx_ab.ab; - - pBuf->rts_rrv_time =s_uGetRTSCTSRsvTime (pDevice,0 , - byPktType, cbFrameSize, wCurrentRate); - - pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, - byPktType, cbFrameSize, wCurrentRate, - bNeedACK); +vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, + cbFrameSize, bNeedACK, wCurrentRate, need_rts);/* Fill RTS */ return s_vFillRTSHead (tx_context, byPktType, head, cbFrameSize, bNeedACK, wCurrentRate); }else { -struct vnt_rrv_time_ab *pBuf = &tx_buffer-> - tx_head.tx_ab.ab; - - pBuf->rrv_time =vnt_rxtx_rsvtime_le16 (pDevice, - byPktType, cbFrameSize, - wCurrentRate, bNeedACK); +vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, + cbFrameSize, bNeedACK, wCurrentRate, need_rts); return vnt_rxtx_datahead_ab(tx_context, byPktType, wCurrentRate, &head->data_head_ab,
Signature · 1 line
1.9.1
PATCH 9/16 staging: vt6656: merge PK_TYPE_11GB and PK_TYPE_11GA into vnt_rxtx_rts
In reply to Malcolm Priestleyadd to vnt_rxtx_rts calls from s_vFillRTSHead.
add need_mic and union vnt_tx_data_head head positions from s_vGenerateTxParameter.
--- drivers/staging/vt6656/rxtx.c | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-)
drivers/staging/vt6656/rxtx.c +15 -26
@@ -542,17 +542,6 @@ static u16 s_vFillRTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType,* Otherwise, we need to modified codes for them. */ switch (byPktType) { -case PK_TYPE_11GB : -case PK_TYPE_11GA : -if (!tx_context->fb_option) -return vnt_rxtx_rts_g_head (tx_context, &head->rts_g, - byPktType, cbFrameLength, - bNeedAck, wCurrentRate); -else -return vnt_rxtx_rts_g_fb_head (tx_context, - &head->rts_g_fb, byPktType, - cbFrameLength, bNeedAck, wCurrentRate); -break ;case PK_TYPE_11A :if (tx_context->fb_option) { return vnt_rxtx_rts_a_fb_head(tx_context,
@@ -631,10 +620,11 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_rts (struct vnt_usb_send_context *tx_context,union vnt_tx_head *tx_head,u8 pkt_type,u32 frame_size, -int need_ack,u16 current_rate) +int need_ack,u16 current_rate,bool need_mic) {struct vnt_private *priv = tx_context->priv;struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts; +union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head; buf->rts_rrv_time_aa =s_uGetRTSCTSRsvTime (priv,2 , pkt_type, frame_size, current_rate);
@@ -648,7 +638,15 @@ static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context, buf->rrv_time_b =vnt_rxtx_rsvtime_le16 (priv,PK_TYPE_11B , frame_size, priv->byTopCCKBasicRate, need_ack); -return 0 ; +if (need_mic) + head = &tx_head->tx_rts.tx.mic.head; + +if (tx_context->fb_option) +return vnt_rxtx_rts_g_fb_head (tx_context, &head->rts_g_fb, + pkt_type, frame_size, need_ack, current_rate); + +return vnt_rxtx_rts_g_head (tx_context, &head->rts_g, + pkt_type, frame_size, need_ack, current_rate); } static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context,
@@ -722,22 +720,13 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,if (byPktType ==PK_TYPE_11GB || byPktType ==PK_TYPE_11GA ) {if (need_rts) { -vnt_rxtx_rts (tx_context, &tx_buffer->tx_head, - byPktType, cbFrameSize, bNeedACK, wCurrentRate); - -if (need_mic) { +if (need_mic) *mic_hdr = &tx_buffer-> tx_head.tx_rts.tx.mic.hdr; - head = &tx_buffer->tx_head.tx_rts.tx.mic.head; - }else { - head = &tx_buffer->tx_head.tx_rts.tx.head; - } - -/* Fill RTS */ -return s_vFillRTSHead (tx_context, byPktType, head, - cbFrameSize, bNeedACK, - wCurrentRate); +return vnt_rxtx_rts (tx_context, &tx_buffer->tx_head, + byPktType, cbFrameSize, bNeedACK, + wCurrentRate, need_mic); }else {vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, byPktType, cbFrameSize, bNeedACK, wCurrentRate);
Signature · 1 line
1.9.1
PATCH 10/16 staging: vt6656: move s_vFillCTSHead to vnt_rxtx_cts
In reply to Malcolm Priestleyadd need_mic and union vnt_tx_data_head head positions from s_vGenerateTxParameter.
--- drivers/staging/vt6656/rxtx.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/staging/vt6656/rxtx.c +14 -14
@@ -651,10 +651,12 @@ static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_cts (struct vnt_usb_send_context *tx_context,union vnt_tx_head *tx_head,u8 pkt_type,u32 frame_size, -int need_ack,u16 current_rate) +int need_ack,u16 current_rate,bool need_mic) {struct vnt_private *priv = tx_context->priv;struct vnt_rrv_time_cts *buf = &tx_head->tx_cts.cts; +union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head; + buf->rrv_time_a =vnt_rxtx_rsvtime_le16 (priv, pkt_type, frame_size, current_rate, need_ack);
@@ -664,7 +666,12 @@ static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context, buf->cts_rrv_time_ba =s_uGetRTSCTSRsvTime (priv,3 , pkt_type, frame_size, current_rate); -return 0 ; +if (need_mic) + head = &tx_head->tx_cts.tx.mic.head; + +/* Fill CTS */ +return s_vFillCTSHead (tx_context, pkt_type, head, frame_size, + need_ack, current_rate); } static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,
@@ -728,20 +735,13 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, byPktType, cbFrameSize, bNeedACK, wCurrentRate, need_mic); }else { -vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, - byPktType, cbFrameSize, bNeedACK, wCurrentRate); - -if (need_mic) { +if (need_mic) *mic_hdr = &tx_buffer-> tx_head.tx_cts.tx.mic.hdr; - head = &tx_buffer->tx_head.tx_cts.tx.mic.head; - }else { - head = &tx_buffer->tx_head.tx_cts.tx.head; - } - -/* Fill CTS */ -return s_vFillCTSHead (tx_context, byPktType, - head, cbFrameSize, bNeedACK, wCurrentRate); + +return vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, + byPktType, cbFrameSize, bNeedACK, + wCurrentRate, need_mic); } }else if (byPktType ==PK_TYPE_11A ) {if (need_mic) {
Signature · 1 line
1.9.1
PATCH 11/16 staging: vt6656: merge data positions for packet types a and b into vnt_rxtx_ab
In reply to Malcolm Priestleyadd rts positions from s_vFillRTSHead
add need_mic and remaining union vnt_tx_data_head head positions from s_vGenerateTxParameter for packet type PK_TYPE_11A and PK_TYPE_11B..
As there are no other possibilities for packet types in s_vGenerateTxParameter the if becomes else.
--- drivers/staging/vt6656/rxtx.c | 109 ++++++++++-------------------------------- 1 file changed, 25 insertions(+), 84 deletions(-)
drivers/staging/vt6656/rxtx.c +25 -84
@@ -98,10 +98,6 @@ static u16 s_vFillCTSHead(struct vnt_usb_send_context *tx_context, u8 byPktType, union vnt_tx_data_head *head, u32 cbFrameLength, int bNeedAck, u16 wCurrentRate); -static u16 s_vFillRTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType, -union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck, -u16 wCurrentRate); -static __le16 s_uGetDataDuration (struct vnt_private *pDevice,u8 byPktType,int bNeedAck);
@@ -528,36 +524,6 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context, &buf->data_head, frame_len, need_ack); } -static u16 s_vFillRTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType, -union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck, -u16 wCurrentRate) -{ - -if (!head) -return 0 ; - -/* Note: So far RTSHead doesn't appear in ATIM -* & Beacom DMA, so we don't need to take them -* into account. -* Otherwise, we need to modified codes for them. -*/ -switch (byPktType) { -case PK_TYPE_11A : -if (tx_context->fb_option) { -return vnt_rxtx_rts_a_fb_head (tx_context, - &head->rts_a_fb, byPktType, - cbFrameLength, bNeedAck, wCurrentRate); -break ; - } -case PK_TYPE_11B : -return vnt_rxtx_rts_ab_head (tx_context, &head->rts_ab, - byPktType, cbFrameLength, bNeedAck, - wCurrentRate); - } - -return 0 ; -} -static u16 s_vFillCTSHead (struct vnt_usb_send_context *tx_context,u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength,int bNeedAck,u16 wCurrentRate)
@@ -676,14 +642,18 @@ static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context,static u16 vnt_rxtx_ab (struct vnt_usb_send_context *tx_context,union vnt_tx_head *tx_head,u8 pkt_type,u32 frame_size, -int need_ack,u16 current_rate,bool need_rts) +int need_ack,u16 current_rate,bool need_rts,bool need_mic) {struct vnt_private *priv = tx_context->priv;struct vnt_rrv_time_ab *buf = &tx_head->tx_ab.ab; +union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head; buf->rrv_time =vnt_rxtx_rsvtime_le16 (priv, pkt_type, frame_size, current_rate, need_ack); +if (need_mic) + head = &tx_head->tx_ab.tx.mic.head; +if (need_rts) {if (pkt_type ==PK_TYPE_11B ) buf->rts_rrv_time = s_uGetRTSCTSRsvTime(priv, 0,
@@ -691,9 +661,23 @@ static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,else /* PK_TYPE_11A */ buf->rts_rrv_time =s_uGetRTSCTSRsvTime (priv,2 , pkt_type, frame_size, current_rate); + +if (tx_context->fb_option && pkt_type ==PK_TYPE_11A ) +return vnt_rxtx_rts_a_fb_head (tx_context, + &head->rts_a_fb, pkt_type, frame_size, + need_ack, current_rate); + +return vnt_rxtx_rts_ab_head (tx_context, &head->rts_ab, + pkt_type, frame_size, need_ack, current_rate); } -return 0 ; +if (pkt_type ==PK_TYPE_11A ) +return vnt_rxtx_datahead_a_fb (tx_context, pkt_type, + current_rate, &head->data_head_a_fb, + frame_size, need_ack); + +return vnt_rxtx_datahead_ab (tx_context, pkt_type, current_rate, + &head->data_head_ab, frame_size, need_ack); }/*+
@@ -723,7 +707,6 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, struct vnt_mic_hdr **mic_hdr, u32 need_mic, u32 cbFrameSize, int bNeedACK, bool need_rts) { - union vnt_tx_data_head *head = NULL; if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) { if (need_rts) {
@@ -743,55 +726,13 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context, byPktType, cbFrameSize, bNeedACK, wCurrentRate, need_mic); } - }else if (byPktType ==PK_TYPE_11A ) { -if (need_mic) { - *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; - head = &tx_buffer->tx_head.tx_ab.tx.mic.head; - }else { - head = &tx_buffer->tx_head.tx_ab.tx.head; - } - -if (need_rts) { -vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, - cbFrameSize, bNeedACK, wCurrentRate, need_rts); - - -/* Fill RTS */ -return s_vFillRTSHead (tx_context, byPktType, head, - cbFrameSize, bNeedACK, - wCurrentRate); - }else { -vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, - cbFrameSize, bNeedACK, wCurrentRate, need_rts); - -return vnt_rxtx_datahead_a_fb (tx_context, byPktType, - wCurrentRate, &head->data_head_a_fb, - cbFrameSize, bNeedACK); - } - }else if (byPktType ==PK_TYPE_11B ) { -if (need_mic) { + }else { +if (need_mic) *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; - head = &tx_buffer->tx_head.tx_ab.tx.mic.head; - }else { - head = &tx_buffer->tx_head.tx_ab.tx.head; - } -if (need_rts) { -vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, - cbFrameSize, bNeedACK, wCurrentRate, need_rts); - -/* Fill RTS */ -return s_vFillRTSHead (tx_context, byPktType, head, - cbFrameSize, bNeedACK, - wCurrentRate); - }else { -vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, - cbFrameSize, bNeedACK, wCurrentRate, need_rts); - -return vnt_rxtx_datahead_ab (tx_context, byPktType, - wCurrentRate, &head->data_head_ab, - cbFrameSize, bNeedACK); - } +return vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, + byPktType, cbFrameSize, bNeedACK, + wCurrentRate, need_rts, need_mic); }return 0 ;
Signature · 1 line
1.9.1
PATCH 12/16 staging: vt6656: s_vGenerateTxParameter remove else from if statements
In reply to Malcolm PriestleyThe function returns out at if statements so drop else.
--- drivers/staging/vt6656/rxtx.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
drivers/staging/vt6656/rxtx.c +9 -14
@@ -717,25 +717,20 @@ static u16 s_vGenerateTxParameter(struct vnt_usb_send_context *tx_context,return vnt_rxtx_rts (tx_context, &tx_buffer->tx_head, byPktType, cbFrameSize, bNeedACK, wCurrentRate, need_mic); - }else { -if (need_mic) - *mic_hdr = &tx_buffer-> - tx_head.tx_cts.tx.mic.hdr; - -return vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, - byPktType, cbFrameSize, bNeedACK, - wCurrentRate, need_mic); } - }else { +if (need_mic) - *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; + *mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr; -return vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, - byPktType, cbFrameSize, bNeedACK, - wCurrentRate, need_rts, need_mic); +return vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, byPktType, + cbFrameSize, bNeedACK, wCurrentRate, need_mic); } -return 0 ; +if (need_mic) + *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; + +return vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, + cbFrameSize, bNeedACK, wCurrentRate, need_rts, need_mic); } static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
Signature · 1 line
1.9.1
PATCH 13/16 staging: vt6656: s_vGenerateTxParameter remove camel case
In reply to Malcolm PriestleyCamel case changes
byPktType -> pkt_type
wCurrentRate -> current_rate
cbFrameSize -> frame_size
bNeedACK -> need_ack
--- drivers/staging/vt6656/rxtx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/rxtx.c +10 -10
@@ -703,34 +703,34 @@ static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,-*/ static u16 s_vGenerateTxParameter (struct vnt_usb_send_context *tx_context, -u8 byPktType,u16 wCurrentRate,struct vnt_tx_buffer *tx_buffer, -struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 cbFrameSize, -int bNeedACK,bool need_rts) +u8 pkt_type,u16 current_rate,struct vnt_tx_buffer *tx_buffer, +struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 frame_size, +int need_ack,bool need_rts) { -if (byPktType ==PK_TYPE_11GB || byPktType ==PK_TYPE_11GA ) { +if (pkt_type ==PK_TYPE_11GB || pkt_type ==PK_TYPE_11GA ) {if (need_rts) {if (need_mic) *mic_hdr = &tx_buffer-> tx_head.tx_rts.tx.mic.hdr;return vnt_rxtx_rts (tx_context, &tx_buffer->tx_head, - byPktType, cbFrameSize, bNeedACK, - wCurrentRate, need_mic); + pkt_type, frame_size, need_ack, + current_rate, need_mic); }if (need_mic) *mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr; -return vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, byPktType, - cbFrameSize, bNeedACK, wCurrentRate, need_mic); +return vnt_rxtx_cts (tx_context, &tx_buffer->tx_head, pkt_type, + frame_size, need_ack, current_rate, need_mic); }if (need_mic) *mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr; -return vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, byPktType, - cbFrameSize, bNeedACK, wCurrentRate, need_rts, need_mic); +return vnt_rxtx_ab (tx_context, &tx_buffer->tx_head, pkt_type, + frame_size, need_ack, current_rate, need_rts, need_mic); } static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
Signature · 1 line
1.9.1
PATCH 14/16 staging: vt6656: rename s_vGenerateTxParameter to vnt_generate_tx_parameter
In reply to Malcolm PriestleyRemoving static declaration
--- drivers/staging/vt6656/rxtx.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/staging/vt6656/rxtx.c +4 -9
@@ -25,7 +25,7 @@* Date: May 20, 2003 * * Functions: -* s_vGenerateTxParameter - Generate tx dma required parameter. +* vnt_generate_tx_parameter - Generate tx dma required parameter. * csBeacon_xmit - beacon tx function * csMgmt_xmit - management tx function * s_uGetDataDuration - get tx data required duration
@@ -83,11 +83,6 @@ static const u16 wFB_Opt1[2][5] = {static struct vnt_usb_send_context *s_vGetFreeContext (struct vnt_private *); -static u16 s_vGenerateTxParameter (struct vnt_usb_send_context *tx_context, -u8 byPktType,u16 wCurrentRate,struct vnt_tx_buffer *tx_buffer, -struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 cbFrameSize, -int bNeedACK,bool need_rts); -static unsigned int s_uGetTxRsvTime (struct vnt_private *pDevice,u8 byPktType,u32 cbFrameLength,u16 wRate,int bNeedAck);
@@ -702,7 +697,7 @@ static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,* -*/ -static u16 s_vGenerateTxParameter (struct vnt_usb_send_context *tx_context, +static u16 vnt_generate_tx_parameter (struct vnt_usb_send_context *tx_context,u8 pkt_type,u16 current_rate,struct vnt_tx_buffer *tx_buffer,struct vnt_mic_hdr **mic_hdr,u32 need_mic,u32 frame_size,int need_ack,bool need_rts)
@@ -950,8 +945,8 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) tx_context->fb_option = fb_option; - duration_id =s_vGenerateTxParameter (tx_context, pkt_type, current_rate, - tx_buffer, &mic_hdr, need_mic, frame_size, + duration_id =vnt_generate_tx_parameter (tx_context, pkt_type, + current_rate, tx_buffer, &mic_hdr, need_mic, frame_size, need_ack, need_rts); tx_header_size = tx_context->tx_hdr_size;
Signature · 1 line
1.9.1
PATCH 15/16 staging: vt6656: s_vFillCTSHead remove camel case
In reply to Malcolm PriestleyCamel case changes
byPktType -> pkt_type
cbFrameLength -> frame_len
bNeedAck -> need_ack
pDevice -> priv
uCTSFrameLen -> cts_frame_len
--- drivers/staging/vt6656/rxtx.c | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-)
drivers/staging/vt6656/rxtx.c +33 -33
@@ -520,60 +520,60 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context, }static u16 s_vFillCTSHead (struct vnt_usb_send_context *tx_context, -u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength, -int bNeedAck,u16 wCurrentRate) +u8 pkt_type,union vnt_tx_data_head *head,u32 frame_len, +int need_ack,u16 current_rate) { -struct vnt_private *pDevice = tx_context->priv; -u32 uCTSFrameLen =14 ; +struct vnt_private *priv = tx_context->priv; +u32 cts_frame_len =14 ;if (!head)return 0 ;if (tx_context->fb_option) {/* Auto Fall back */ -struct vnt_cts_fb *pBuf = &head->cts_g_fb; +struct vnt_cts_fb *buf = &head->cts_g_fb;/* Get SignalField,ServiceField,Length */ -vnt_get_phy_field (pDevice, uCTSFrameLen, - pDevice->byTopCCKBasicRate,PK_TYPE_11B , &pBuf->b); - pBuf->duration_ba =s_uGetRTSCTSDuration (pDevice,CTSDUR_BA , - cbFrameLength, byPktType, - wCurrentRate, bNeedAck); +vnt_get_phy_field (priv, cts_frame_len, + priv->byTopCCKBasicRate,PK_TYPE_11B , &buf->b); + buf->duration_ba =s_uGetRTSCTSDuration (priv,CTSDUR_BA , + frame_len, pkt_type, + current_rate, need_ack);/* Get CTSDuration_ba_f0 */ - pBuf->cts_duration_ba_f0 =s_uGetRTSCTSDuration (pDevice, -CTSDUR_BA_F0 , cbFrameLength, byPktType, - pDevice->tx_rate_fb0, bNeedAck); + buf->cts_duration_ba_f0 =s_uGetRTSCTSDuration (priv, +CTSDUR_BA_F0 , frame_len, pkt_type, + priv->tx_rate_fb0, need_ack);/* Get CTSDuration_ba_f1 */ - pBuf->cts_duration_ba_f1 =s_uGetRTSCTSDuration (pDevice, -CTSDUR_BA_F1 , cbFrameLength, byPktType, - pDevice->tx_rate_fb1, bNeedAck); + buf->cts_duration_ba_f1 =s_uGetRTSCTSDuration (priv, +CTSDUR_BA_F1 , frame_len, pkt_type, + priv->tx_rate_fb1, need_ack);/* Get CTS Frame body */ - pBuf->data.duration = pBuf->duration_ba; - pBuf->data.frame_control = + buf->data.duration = buf->duration_ba; + buf->data.frame_control =cpu_to_le16 (IEEE80211_FTYPE_CTL |IEEE80211_STYPE_CTS ); -memcpy (pBuf->data.ra, pDevice->abyCurrentNetAddr,ETH_ALEN ); +memcpy (buf->data.ra, priv->abyCurrentNetAddr,ETH_ALEN ); -return vnt_rxtx_datahead_g_fb (tx_context, byPktType, - wCurrentRate, &pBuf->data_head, cbFrameLength, - bNeedAck); +return vnt_rxtx_datahead_g_fb (tx_context, pkt_type, + current_rate, &buf->data_head, frame_len, + need_ack); }else { -struct vnt_cts *pBuf = &head->cts_g; +struct vnt_cts *buf = &head->cts_g;/* Get SignalField,ServiceField,Length */ -vnt_get_phy_field (pDevice, uCTSFrameLen, - pDevice->byTopCCKBasicRate,PK_TYPE_11B , &pBuf->b); +vnt_get_phy_field (priv, cts_frame_len, + priv->byTopCCKBasicRate,PK_TYPE_11B , &buf->b);/* Get CTSDuration_ba */ - pBuf->duration_ba =s_uGetRTSCTSDuration (pDevice, -CTSDUR_BA , cbFrameLength, byPktType, - wCurrentRate, bNeedAck); + buf->duration_ba =s_uGetRTSCTSDuration (priv, +CTSDUR_BA , frame_len, pkt_type, + current_rate, need_ack);/*Get CTS Frame body*/ - pBuf->data.duration = pBuf->duration_ba; - pBuf->data.frame_control = + buf->data.duration = buf->duration_ba; + buf->data.frame_control =cpu_to_le16 (IEEE80211_FTYPE_CTL |IEEE80211_STYPE_CTS ); -memcpy (pBuf->data.ra, pDevice->abyCurrentNetAddr,ETH_ALEN ); +memcpy (buf->data.ra, priv->abyCurrentNetAddr,ETH_ALEN ); -return vnt_rxtx_datahead_g (tx_context, byPktType, wCurrentRate, - &pBuf->data_head, cbFrameLength, bNeedAck); +return vnt_rxtx_datahead_g (tx_context, pkt_type, current_rate, + &buf->data_head, frame_len, need_ack); }return 0 ;
Signature · 1 line
1.9.1
PATCH 16/16 staging: vt6656: rename s_vFillCTSHead to vnt_fill_cts_head
In reply to Malcolm PriestleyRemoving static declaration.
--- drivers/staging/vt6656/rxtx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/staging/vt6656/rxtx.c +3 -7
@@ -33,7 +33,7 @@* s_uGetRTSCTSDuration- get rtx/cts required duration * s_uGetRTSCTSRsvTime- get rts/cts reserved time * s_uGetTxRsvTime- get frame reserved time -* s_vFillCTSHead- fulfill CTS ctl header +* vnt_fill_cts_head- fulfill CTS ctl header * s_vFillFragParameter- Set fragment ctl parameter. * s_vFillRTSHead- fulfill RTS ctl header * vDMA0_tx_80211- tx 802.11 frame via dma0
@@ -89,10 +89,6 @@ static unsigned int s_uGetTxRsvTime(struct vnt_private *pDevice, u8 byPktType,static __le16 s_uGetRTSCTSRsvTime (struct vnt_private *priv,u8 rsv_type,u8 pkt_type,u32 frame_length,u16 current_rate); -static u16 s_vFillCTSHead (struct vnt_usb_send_context *tx_context, -u8 byPktType,union vnt_tx_data_head *head,u32 cbFrameLength, -int bNeedAck,u16 wCurrentRate); -static __le16 s_uGetDataDuration (struct vnt_private *pDevice,u8 byPktType,int bNeedAck);
@@ -519,7 +515,7 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context, &buf->data_head, frame_len, need_ack); } -static u16 s_vFillCTSHead (struct vnt_usb_send_context *tx_context, +static u16 vnt_fill_cts_head (struct vnt_usb_send_context *tx_context,u8 pkt_type,union vnt_tx_data_head *head,u32 frame_len,int need_ack,u16 current_rate) {
@@ -631,7 +627,7 @@ static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context, head = &tx_head->tx_cts.tx.mic.head;/* Fill CTS */ -return s_vFillCTSHead (tx_context, pkt_type, head, frame_size, +return vnt_fill_cts_head (tx_context, pkt_type, head, frame_size, need_ack, current_rate); }
Signature · 1 line
1.9.1