}
static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
- u16 rate, struct vnt_tx_datahead_g *buf)
+ struct vnt_tx_datahead_g *buf)
{
struct vnt_private *priv = tx_context->priv;
struct ieee80211_hdr *hdr =
(struct ieee80211_hdr *)tx_context->skb->data;
u32 frame_len = tx_context->frame_len;
+ u16 rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
/* Get SignalField,ServiceField,Length */
}
static u16 vnt_rxtx_datahead_g_fb(struct vnt_usb_send_context *tx_context,
- u16 rate, struct vnt_tx_datahead_g_fb *buf)
+ struct vnt_tx_datahead_g_fb *buf)
{
struct vnt_private *priv = tx_context->priv;
u32 frame_len = tx_context->frame_len;
+ u16 rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
/* Get SignalField,ServiceField,Length */
}
static u16 vnt_rxtx_datahead_a_fb(struct vnt_usb_send_context *tx_context,
- u16 rate, struct vnt_tx_datahead_a_fb *buf)
+ struct vnt_tx_datahead_a_fb *buf)
{
struct vnt_private *priv = tx_context->priv;
+ u16 rate = tx_context->tx_rate;
u8 pkt_type = tx_context->pkt_type;
u8 need_ack = tx_context->need_ack;
u32 frame_len = tx_context->frame_len;
}
static u16 vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
- u16 rate, struct vnt_tx_datahead_ab *buf)
+ struct vnt_tx_datahead_ab *buf)
{
struct vnt_private *priv = tx_context->priv;
struct ieee80211_hdr *hdr =
(struct ieee80211_hdr *)tx_context->skb->data;
u32 frame_len = tx_context->frame_len;
+ u16 rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
/* Get SignalField,ServiceField,Length */
}
static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,
- struct vnt_rts_g *buf, u16 current_rate)
+ struct vnt_rts_g *buf)
{
struct vnt_private *priv = tx_context->priv;
u32 frame_len = tx_context->frame_len;
u16 rts_frame_len = 20;
+ u16 current_rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration_aa);
- return vnt_rxtx_datahead_g(tx_context, current_rate, &buf->data_head);
+ return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
}
static u16 vnt_rxtx_rts_g_fb_head(struct vnt_usb_send_context *tx_context,
- struct vnt_rts_g_fb *buf, u16 current_rate)
+ struct vnt_rts_g_fb *buf)
{
struct vnt_private *priv = tx_context->priv;
u32 frame_len = tx_context->frame_len;
+ u16 current_rate = tx_context->tx_rate;
u16 rts_frame_len = 20;
u8 need_ack = tx_context->need_ack;
-
vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
PK_TYPE_11B, &buf->b);
vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration_aa);
- return vnt_rxtx_datahead_g_fb(tx_context,
- current_rate, &buf->data_head);
+ return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
}
static u16 vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,
- struct vnt_rts_ab *buf, u16 current_rate)
+ struct vnt_rts_ab *buf)
{
struct vnt_private *priv = tx_context->priv;
u32 frame_len = tx_context->frame_len;
+ u16 current_rate = tx_context->tx_rate;
u16 rts_frame_len = 20;
u8 need_ack = tx_context->need_ack;
vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration);
- return vnt_rxtx_datahead_ab(tx_context, current_rate,
- &buf->data_head);
+ return vnt_rxtx_datahead_ab(tx_context, &buf->data_head);
}
static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context,
- struct vnt_rts_a_fb *buf, u16 current_rate)
+ struct vnt_rts_a_fb *buf)
{
struct vnt_private *priv = tx_context->priv;
u32 frame_len = tx_context->frame_len;
+ u16 current_rate = tx_context->tx_rate;
u16 rts_frame_len = 20;
u8 need_ack = tx_context->need_ack;
-
vnt_get_phy_field(priv, rts_frame_len,
priv->top_ofdm_basic_rate, tx_context->pkt_type, &buf->a);
vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration);
- return vnt_rxtx_datahead_a_fb(tx_context,
- current_rate, &buf->data_head);
+ return vnt_rxtx_datahead_a_fb(tx_context, &buf->data_head);
}
static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
- union vnt_tx_data_head *head, u16 current_rate)
+ union vnt_tx_data_head *head)
{
struct vnt_private *priv = tx_context->priv;
u32 frame_len = tx_context->frame_len;
u32 cts_frame_len = 14;
+ u16 current_rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
if (!head)
memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
- return vnt_rxtx_datahead_g_fb(tx_context, current_rate,
- &buf->data_head);
+ return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
} else {
struct vnt_cts *buf = &head->cts_g;
/* Get SignalField,ServiceField,Length */
memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
- return vnt_rxtx_datahead_g(tx_context, current_rate,
- &buf->data_head);
+ return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
}
return 0;
}
static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
- union vnt_tx_head *tx_head,
- u16 current_rate, bool need_mic)
+ union vnt_tx_head *tx_head, 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;
u32 frame_len = tx_context->frame_len;
+ u16 current_rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
buf->rts_rrv_time_aa = vnt_get_rtscts_rsvtime_le(priv, 2,
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,
- current_rate);
+ return vnt_rxtx_rts_g_fb_head(tx_context, &head->rts_g_fb);
- return vnt_rxtx_rts_g_head(tx_context, &head->rts_g, current_rate);
+ return vnt_rxtx_rts_g_head(tx_context, &head->rts_g);
}
static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context,
- union vnt_tx_head *tx_head, u16 current_rate, bool need_mic)
+ union vnt_tx_head *tx_head, 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;
u32 frame_len = tx_context->frame_len;
+ u16 current_rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
buf->rrv_time_a = vnt_rxtx_rsvtime_le16(priv, tx_context->pkt_type,
head = &tx_head->tx_cts.tx.mic.head;
/* Fill CTS */
- return vnt_fill_cts_head(tx_context, head, current_rate);
+ return vnt_fill_cts_head(tx_context, head);
}
static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,
- union vnt_tx_head *tx_head,
- u16 current_rate, bool need_rts, bool need_mic)
+ union vnt_tx_head *tx_head, 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;
u32 frame_len = tx_context->frame_len;
+ u16 current_rate = tx_context->tx_rate;
u8 need_ack = tx_context->need_ack;
buf->rrv_time = vnt_rxtx_rsvtime_le16(priv, tx_context->pkt_type,
if (tx_context->fb_option &&
tx_context->pkt_type == PK_TYPE_11A)
return vnt_rxtx_rts_a_fb_head(tx_context,
- &head->rts_a_fb,
- current_rate);
+ &head->rts_a_fb);
- return vnt_rxtx_rts_ab_head(tx_context, &head->rts_ab,
- current_rate);
+ return vnt_rxtx_rts_ab_head(tx_context, &head->rts_ab);
}
if (tx_context->pkt_type == PK_TYPE_11A)
- return vnt_rxtx_datahead_a_fb(tx_context, current_rate,
+ return vnt_rxtx_datahead_a_fb(tx_context,
&head->data_head_a_fb);
- return vnt_rxtx_datahead_ab(tx_context, current_rate,
- &head->data_head_ab);
+ return vnt_rxtx_datahead_ab(tx_context, &head->data_head_ab);
}
static u16 vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context,
- u16 current_rate, struct vnt_tx_buffer *tx_buffer,
+ struct vnt_tx_buffer *tx_buffer,
struct vnt_mic_hdr **mic_hdr, u32 need_mic,
bool need_rts)
{
tx_head.tx_rts.tx.mic.hdr;
return vnt_rxtx_rts(tx_context, &tx_buffer->tx_head,
- current_rate, need_mic);
+ 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,
- current_rate, need_mic);
+ return vnt_rxtx_cts(tx_context, &tx_buffer->tx_head, 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,
- current_rate, need_rts, need_mic);
+ return vnt_rxtx_ab(tx_context, &tx_buffer->tx_head, need_rts, need_mic);
}
static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
tx_context->pkt_type = pkt_type;
tx_context->need_ack = false;
tx_context->frame_len = skb->len + 4;
+ tx_context->tx_rate = current_rate;
spin_unlock_irqrestore(&priv->lock, flags);
tx_context->fb_option = fb_option;
- duration_id = vnt_generate_tx_parameter(tx_context, current_rate,
- tx_buffer, &mic_hdr, need_mic,
- need_rts);
+ duration_id = vnt_generate_tx_parameter(tx_context, tx_buffer, &mic_hdr,
+ need_mic, need_rts);
tx_header_size = tx_context->tx_hdr_size;
if (!tx_header_size) {