staging: vt6656: vnt_rxtx_rsvtime_le16 to use ieee80211_generic_frame_duration.

ieee80211_generic_frame_duration is the mac80211 equivalent to
vnt_get_rsvtime use this to get our frame time.

There is a change where there is rrv_time_a and rrv_time_b
the frame duration is always the same so both are equal.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/acff7fcc-0add-652b-7d07-22001b641257@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Malcolm Priestley 2020-05-05 22:12:04 +01:00 committed by Greg Kroah-Hartman
parent c5de40e58f
commit 57b4b0e68d
1 changed files with 14 additions and 18 deletions

View File

@ -216,11 +216,16 @@ static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 pkt_type,
return data_time; return data_time;
} }
static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type, static __le16 vnt_rxtx_rsvtime_le16(struct vnt_usb_send_context *context)
u32 frame_length, u16 rate, int need_ack)
{ {
return cpu_to_le16((u16)vnt_get_rsvtime(priv, pkt_type, struct vnt_private *priv = context->priv;
frame_length, rate, need_ack)); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
struct ieee80211_rate *rate = ieee80211_get_tx_rate(priv->hw, info);
return ieee80211_generic_frame_duration(priv->hw,
info->control.vif, info->band,
context->frame_len,
rate);
} }
static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv, u8 rsv_type, static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv, u8 rsv_type,
@ -455,7 +460,6 @@ static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head; union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head;
u32 frame_len = tx_context->frame_len; u32 frame_len = tx_context->frame_len;
u16 current_rate = tx_context->tx_rate; 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, buf->rts_rrv_time_aa = vnt_get_rtscts_rsvtime_le(priv, 2,
tx_context->pkt_type, frame_len, current_rate); tx_context->pkt_type, frame_len, current_rate);
@ -464,11 +468,8 @@ static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
buf->rts_rrv_time_bb = vnt_get_rtscts_rsvtime_le(priv, 0, buf->rts_rrv_time_bb = vnt_get_rtscts_rsvtime_le(priv, 0,
tx_context->pkt_type, frame_len, current_rate); tx_context->pkt_type, frame_len, current_rate);
buf->rrv_time_a = vnt_rxtx_rsvtime_le16(priv, tx_context->pkt_type, buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
frame_len, current_rate, buf->rrv_time_b = buf->rrv_time_a;
need_ack);
buf->rrv_time_b = vnt_rxtx_rsvtime_le16(priv, PK_TYPE_11B, frame_len,
priv->top_cck_basic_rate, need_ack);
if (need_mic) if (need_mic)
head = &tx_head->tx_rts.tx.mic.head; head = &tx_head->tx_rts.tx.mic.head;
@ -484,12 +485,9 @@ static void vnt_rxtx_cts(struct vnt_usb_send_context *tx_context,
union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head; union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head;
u32 frame_len = tx_context->frame_len; u32 frame_len = tx_context->frame_len;
u16 current_rate = tx_context->tx_rate; 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, buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
frame_len, current_rate, need_ack); buf->rrv_time_b = buf->rrv_time_a;
buf->rrv_time_b = vnt_rxtx_rsvtime_le16(priv, PK_TYPE_11B,
frame_len, priv->top_cck_basic_rate, need_ack);
buf->cts_rrv_time_ba = vnt_get_rtscts_rsvtime_le(priv, 3, buf->cts_rrv_time_ba = vnt_get_rtscts_rsvtime_le(priv, 3,
tx_context->pkt_type, frame_len, current_rate); tx_context->pkt_type, frame_len, current_rate);
@ -509,10 +507,8 @@ static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,
union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head; union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head;
u32 frame_len = tx_context->frame_len; u32 frame_len = tx_context->frame_len;
u16 current_rate = tx_context->tx_rate; 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, buf->rrv_time = vnt_rxtx_rsvtime_le16(tx_context);
frame_len, current_rate, need_ack);
if (need_mic) if (need_mic)
head = &tx_head->tx_ab.tx.mic.head; head = &tx_head->tx_ab.tx.mic.head;