staging: vt6656: Disable and remove fall back rates from driver.
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 2 Feb 2020 19:46:18 +0000 (19:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2020 00:22:56 +0000 (16:22 -0800)
The fall back rates are not properly implemented in driver and
form part of the legacy driver.

mac80211 has no indication that this is happening and it
does appear the driver does function considerably better
without them so remove them.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/47cc31e5-226b-f84f-3655-51a269735130@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/int.c
drivers/staging/vt6656/main_usb.c
drivers/staging/vt6656/rxtx.c

index af21586..3fa61c3 100644 (file)
 #include "power.h"
 #include "usbpipe.h"
 
-static const u8 fallback_rate0[5][5] = {
-       {RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M},
-       {RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M},
-       {RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M},
-       {RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M},
-       {RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M}
-};
-
-static const u8 fallback_rate1[5][5] = {
-       {RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M},
-       {RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M},
-       {RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M},
-       {RATE_48M, RATE_48M, RATE_24M, RATE_12M, RATE_12M},
-       {RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M}
-};
-
 int vnt_int_start_interrupt(struct vnt_private *priv)
 {
        int ret = 0;
@@ -59,7 +43,6 @@ static int vnt_int_report_rate(struct vnt_private *priv, u8 pkt_no, u8 tsr)
 {
        struct vnt_usb_send_context *context;
        struct ieee80211_tx_info *info;
-       struct ieee80211_rate *rate;
        u8 tx_retry = (tsr & 0xf0) >> 4;
        s8 idx;
 
@@ -74,27 +57,6 @@ static int vnt_int_report_rate(struct vnt_private *priv, u8 pkt_no, u8 tsr)
        info = IEEE80211_SKB_CB(context->skb);
        idx = info->control.rates[0].idx;
 
-       if (context->fb_option && !(tsr & (TSR_TMO | TSR_RETRYTMO))) {
-               u8 tx_rate;
-               u8 retry = tx_retry;
-
-               rate = ieee80211_get_tx_rate(priv->hw, info);
-               tx_rate = rate->hw_value - RATE_18M;
-
-               if (retry > 4)
-                       retry = 4;
-
-               if (context->fb_option == AUTO_FB_0)
-                       tx_rate = fallback_rate0[tx_rate][retry];
-               else if (context->fb_option == AUTO_FB_1)
-                       tx_rate = fallback_rate1[tx_rate][retry];
-
-               if (info->band == NL80211_BAND_5GHZ)
-                       idx = tx_rate - RATE_6M;
-               else
-                       idx = tx_rate;
-       }
-
        ieee80211_tx_info_clear_status(info);
 
        info->status.rates[0].count = tx_retry;
index 5e48b3d..17a3dae 100644 (file)
@@ -99,7 +99,6 @@ static void vnt_set_options(struct vnt_private *priv)
        priv->op_mode = NL80211_IFTYPE_UNSPECIFIED;
        priv->bb_type = BBP_TYPE_DEF;
        priv->packet_type = priv->bb_type;
-       priv->auto_fb_ctrl = AUTO_FB_0;
        priv->preamble_type = 0;
        priv->exist_sw_net_addr = false;
 }
@@ -261,9 +260,6 @@ static int vnt_init_registers(struct vnt_private *priv)
        if (ret)
                goto end;
 
-       /* get Auto Fall Back type */
-       priv->auto_fb_ctrl = AUTO_FB_0;
-
        /* default Auto Mode */
        priv->bb_type = BB_TYPE_11G;
 
index 29caba7..0fabeb3 100644 (file)
@@ -792,7 +792,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
        struct vnt_usb_send_context *tx_context;
        unsigned long flags;
        u16 tx_bytes, tx_header_size, tx_body_size, current_rate, duration_id;
-       u8 pkt_type, fb_option = AUTO_FB_NONE;
+       u8 pkt_type;
        bool need_rts = false;
        bool need_mic = false;
 
@@ -912,33 +912,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 
        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->auto_fb_ctrl == AUTO_FB_0) {
-                       tx_buffer_head->fifo_ctl |=
-                                               cpu_to_le16(FIFOCTL_AUTO_FB_0);
-
-                       priv->tx_rate_fb0 =
-                               vnt_fb_opt0[FB_RATE0][current_rate - RATE_18M];
-                       priv->tx_rate_fb1 =
-                               vnt_fb_opt0[FB_RATE1][current_rate - RATE_18M];
-
-                       fb_option = AUTO_FB_0;
-               } else if (priv->auto_fb_ctrl == AUTO_FB_1) {
-                       tx_buffer_head->fifo_ctl |=
-                                               cpu_to_le16(FIFOCTL_AUTO_FB_1);
-
-                       priv->tx_rate_fb0 =
-                               vnt_fb_opt1[FB_RATE0][current_rate - RATE_18M];
-                       priv->tx_rate_fb1 =
-                               vnt_fb_opt1[FB_RATE1][current_rate - RATE_18M];
-
-                       fb_option = AUTO_FB_1;
-               }
-       }
-
-       tx_context->fb_option = fb_option;
-
        duration_id = vnt_generate_tx_parameter(tx_context, tx_buffer, &mic_hdr,
                                                need_mic, need_rts);