aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfp.c')
-rw-r--r--drivers/net/wireless/mwifiex/cfp.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c
index f2e6de03805c..1782a77f15dc 100644
--- a/drivers/net/wireless/mwifiex/cfp.c
+++ b/drivers/net/wireless/mwifiex/cfp.c
@@ -75,18 +75,32 @@ static u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 };
75 * This function maps an index in supported rates table into 75 * This function maps an index in supported rates table into
76 * the corresponding data rate. 76 * the corresponding data rate.
77 */ 77 */
78u32 mwifiex_index_to_data_rate(u8 index, u8 ht_info) 78u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv, u8 index,
79 u8 ht_info)
79{ 80{
80 u16 mcs_rate[4][8] = { 81 /*
81 {0x1b, 0x36, 0x51, 0x6c, 0xa2, 0xd8, 0xf3, 0x10e} 82 * For every mcs_rate line, the first 8 bytes are for stream 1x1,
82 , /* LG 40M */ 83 * and all 16 bytes are for stream 2x2.
83 {0x1e, 0x3c, 0x5a, 0x78, 0xb4, 0xf0, 0x10e, 0x12c} 84 */
84 , /* SG 40M */ 85 u16 mcs_rate[4][16] = {
85 {0x0d, 0x1a, 0x27, 0x34, 0x4e, 0x68, 0x75, 0x82} 86 /* LGI 40M */
86 , /* LG 20M */ 87 { 0x1b, 0x36, 0x51, 0x6c, 0xa2, 0xd8, 0xf3, 0x10e,
87 {0x0e, 0x1c, 0x2b, 0x39, 0x56, 0x73, 0x82, 0x90} 88 0x36, 0x6c, 0xa2, 0xd8, 0x144, 0x1b0, 0x1e6, 0x21c },
88 }; /* SG 20M */ 89
89 90 /* SGI 40M */
91 { 0x1e, 0x3c, 0x5a, 0x78, 0xb4, 0xf0, 0x10e, 0x12c,
92 0x3c, 0x78, 0xb4, 0xf0, 0x168, 0x1e0, 0x21c, 0x258 },
93
94 /* LGI 20M */
95 { 0x0d, 0x1a, 0x27, 0x34, 0x4e, 0x68, 0x75, 0x82,
96 0x1a, 0x34, 0x4e, 0x68, 0x9c, 0xd0, 0xea, 0x104 },
97
98 /* SGI 20M */
99 { 0x0e, 0x1c, 0x2b, 0x39, 0x56, 0x73, 0x82, 0x90,
100 0x1c, 0x39, 0x56, 0x73, 0xad, 0xe7, 0x104, 0x120 }
101 };
102 u32 mcs_num_supp =
103 (priv->adapter->hw_dev_mcs_support == HT_STREAM_2X2) ? 16 : 8;
90 u32 rate; 104 u32 rate;
91 105
92 if (ht_info & BIT(0)) { 106 if (ht_info & BIT(0)) {
@@ -95,7 +109,7 @@ u32 mwifiex_index_to_data_rate(u8 index, u8 ht_info)
95 rate = 0x0D; /* MCS 32 SGI rate */ 109 rate = 0x0D; /* MCS 32 SGI rate */
96 else 110 else
97 rate = 0x0C; /* MCS 32 LGI rate */ 111 rate = 0x0C; /* MCS 32 LGI rate */
98 } else if (index < 8) { 112 } else if (index < mcs_num_supp) {
99 if (ht_info & BIT(1)) { 113 if (ht_info & BIT(1)) {
100 if (ht_info & BIT(2)) 114 if (ht_info & BIT(2))
101 /* SGI, 40M */ 115 /* SGI, 40M */