staging: vt6656: rxtx remove rate change and current_rate.
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 6 Apr 2020 19:33:16 +0000 (20:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Apr 2020 12:53:22 +0000 (14:53 +0200)
There is no longer any need to change power in vnt_tx_packet.

Remove current_rate in vnt_tx_packet and struct vnt_private as
it is no longer used elsewhere.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/3ba896aa-5ab2-affb-9ce5-7df8a9b3190a@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/device.h
drivers/staging/vt6656/rxtx.c

index e6ee9411f080731458327c48a634f3e43c83f5e2..41226cd599c6666a3a6254045d1a54884f871100 100644 (file)
@@ -344,7 +344,6 @@ struct vnt_private {
        u8 ofdm_pwr_tbl[14];
        u8 ofdm_a_pwr_tbl[42];
 
-       u16 current_rate;
        u16 tx_rate_fb0;
        u16 tx_rate_fb1;
 
index 9439d190f431978d3238e98d048c5f0452c89b60..8363d54cd8213ec1e455ae0d72a588249e784957 100644 (file)
@@ -547,7 +547,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
        struct vnt_tx_fifo_head *tx_buffer_head;
        struct vnt_usb_send_context *tx_context;
        unsigned long flags;
-       u16 tx_bytes, tx_header_size, tx_body_size, current_rate, duration_id;
+       u16 tx_bytes, tx_header_size, tx_body_size, duration_id;
        u8 pkt_type;
        bool need_rts = false;
        bool need_mic = false;
@@ -556,14 +556,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 
        rate = ieee80211_get_tx_rate(priv->hw, info);
 
-       current_rate = rate->hw_value;
-       if (priv->current_rate != current_rate &&
-           !(priv->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
-               priv->current_rate = current_rate;
-               vnt_schedule_command(priv, WLAN_CMD_SETPOWER);
-       }
-
-       if (current_rate > RATE_11M) {
+       if (rate->hw_value > RATE_11M) {
                if (info->band == NL80211_BAND_5GHZ) {
                        pkt_type = PK_TYPE_11A;
                } else {
@@ -593,7 +586,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
        tx_context->pkt_type = pkt_type;
        tx_context->need_ack = false;
        tx_context->frame_len = skb->len + 4;
-       tx_context->tx_rate = current_rate;
+       tx_context->tx_rate =  rate->hw_value;
 
        spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -666,7 +659,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
                tx_context->frame_len += tx_key->icv_len;
        }
 
-       tx_buffer_head->current_rate = cpu_to_le16(current_rate);
+       tx_buffer_head->current_rate = cpu_to_le16(rate->hw_value);
 
        duration_id = vnt_generate_tx_parameter(tx_context, tx_buffer, &mic_hdr,
                                                need_mic, need_rts);