mwifiex: add VHT MCS rate configuration support
authorAmitkumar Karwar <akarwar@marvell.com>
Sat, 8 Mar 2014 03:41:27 +0000 (19:41 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Mar 2014 18:49:13 +0000 (14:49 -0400)
During Tx rate configuration, newer firmware V15 expects bitmap
for VHT MCS rates as well.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/fw.h
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/sta_cmd.c
drivers/net/wireless/mwifiex/sta_cmdresp.c

index 5b3083488c04224fbf9a00d6c7f103466dc2129e..341e41978ac672e0bad127a02c1c0fc5d6ae2af7 100644 (file)
@@ -1105,6 +1105,7 @@ struct mwifiex_rate_scope {
        __le16 hr_dsss_rate_bitmap;
        __le16 ofdm_rate_bitmap;
        __le16 ht_mcs_rate_bitmap[8];
+       __le16 vht_mcs_rate_bitmap[8];
 } __packed;
 
 struct mwifiex_rate_drop_pattern {
index 5f9bfb0a161c74c6a8d14d59afdf59efaed514e7..713dd247a1533ba0670e9a74d0b1baacc88f13d3 100644 (file)
@@ -116,7 +116,7 @@ enum {
 #define MWIFIEX_TYPE_DATA                              0
 #define MWIFIEX_TYPE_EVENT                             3
 
-#define MAX_BITMAP_RATES_SIZE                  10
+#define MAX_BITMAP_RATES_SIZE                  18
 
 #define MAX_CHANNEL_BAND_BG     14
 #define MAX_CHANNEL_BAND_A      165
index 4315a3ba3b92377ff10d95cf7079dfaa3886c91b..e3cac1495cc705bcf3c05b479a16981578deff98 100644 (file)
@@ -185,6 +185,13 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
                     i++)
                        rate_scope->ht_mcs_rate_bitmap[i] =
                                cpu_to_le16(pbitmap_rates[2 + i]);
+               if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) {
+                       for (i = 0;
+                            i < ARRAY_SIZE(rate_scope->vht_mcs_rate_bitmap);
+                            i++)
+                               rate_scope->vht_mcs_rate_bitmap[i] =
+                                       cpu_to_le16(pbitmap_rates[10 + i]);
+               }
        } else {
                rate_scope->hr_dsss_rate_bitmap =
                        cpu_to_le16(priv->bitmap_rates[0]);
@@ -195,6 +202,13 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
                     i++)
                        rate_scope->ht_mcs_rate_bitmap[i] =
                                cpu_to_le16(priv->bitmap_rates[2 + i]);
+               if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) {
+                       for (i = 0;
+                            i < ARRAY_SIZE(rate_scope->vht_mcs_rate_bitmap);
+                            i++)
+                               rate_scope->vht_mcs_rate_bitmap[i] =
+                                       cpu_to_le16(priv->bitmap_rates[10 + i]);
+               }
        }
 
        rate_drop = (struct mwifiex_rate_drop_pattern *) ((u8 *) rate_scope +
index a8f7d545e22a94eb4365a534cb8018307f434136..bfebb0144df5ac5ae88bd78dd909888d4bb0a0ea 100644 (file)
@@ -304,6 +304,15 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
                                priv->bitmap_rates[2 + i] =
                                        le16_to_cpu(rate_scope->
                                                    ht_mcs_rate_bitmap[i]);
+
+                       if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) {
+                               for (i = 0; i < ARRAY_SIZE(rate_scope->
+                                                          vht_mcs_rate_bitmap);
+                                    i++)
+                                       priv->bitmap_rates[10 + i] =
+                                           le16_to_cpu(rate_scope->
+                                                       vht_mcs_rate_bitmap[i]);
+                       }
                        break;
                        /* Add RATE_DROP tlv here */
                }