diff options
-rw-r--r-- | drivers/net/wireless/mwifiex/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfp.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/fw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sdio.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sdio.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmdresp.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 4 |
8 files changed, 50 insertions, 20 deletions
diff --git a/drivers/net/wireless/mwifiex/Kconfig b/drivers/net/wireless/mwifiex/Kconfig index 8f2797aa0c60..2a078cea830a 100644 --- a/drivers/net/wireless/mwifiex/Kconfig +++ b/drivers/net/wireless/mwifiex/Kconfig | |||
@@ -10,12 +10,12 @@ config MWIFIEX | |||
10 | mwifiex. | 10 | mwifiex. |
11 | 11 | ||
12 | config MWIFIEX_SDIO | 12 | config MWIFIEX_SDIO |
13 | tristate "Marvell WiFi-Ex Driver for SD8787" | 13 | tristate "Marvell WiFi-Ex Driver for SD8787/SD8797" |
14 | depends on MWIFIEX && MMC | 14 | depends on MWIFIEX && MMC |
15 | select FW_LOADER | 15 | select FW_LOADER |
16 | ---help--- | 16 | ---help--- |
17 | This adds support for wireless adapters based on Marvell | 17 | This adds support for wireless adapters based on Marvell |
18 | 8787 chipset with SDIO interface. | 18 | 8787/8797 chipsets with SDIO interface. |
19 | 19 | ||
20 | If you choose to build it as a module, it will be called | 20 | If you choose to build it as a module, it will be called |
21 | mwifiex_sdio. | 21 | mwifiex_sdio. |
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 | */ |
78 | u32 mwifiex_index_to_data_rate(u8 index, u8 ht_info) | 78 | u32 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 */ |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 35cb29cbd96e..62b863907698 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -165,6 +165,7 @@ enum MWIFIEX_802_11_WEP_STATUS { | |||
165 | 165 | ||
166 | #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f) | 166 | #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f) |
167 | #define SETHT_MCS32(x) (x[4] |= 1) | 167 | #define SETHT_MCS32(x) (x[4] |= 1) |
168 | #define HT_STREAM_2X2 0x22 | ||
168 | 169 | ||
169 | #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4)) | 170 | #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4)) |
170 | 171 | ||
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 30f138b6fa4c..3861a617c0e1 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -775,7 +775,8 @@ struct mwifiex_chan_freq_power * | |||
775 | struct mwifiex_chan_freq_power *mwifiex_get_cfp_by_band_and_freq_from_cfg80211( | 775 | struct mwifiex_chan_freq_power *mwifiex_get_cfp_by_band_and_freq_from_cfg80211( |
776 | struct mwifiex_private *priv, | 776 | struct mwifiex_private *priv, |
777 | u8 band, u32 freq); | 777 | u8 band, u32 freq); |
778 | u32 mwifiex_index_to_data_rate(u8 index, u8 ht_info); | 778 | u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv, u8 index, |
779 | u8 ht_info); | ||
779 | u32 mwifiex_find_freq_from_band_chan(u8, u8); | 780 | u32 mwifiex_find_freq_from_band_chan(u8, u8); |
780 | int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask, | 781 | int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask, |
781 | u8 **buffer); | 782 | u8 **buffer); |
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index ffaf3f3a57df..702452b505c3 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -256,10 +256,13 @@ static int mwifiex_sdio_resume(struct device *dev) | |||
256 | 256 | ||
257 | /* Device ID for SD8787 */ | 257 | /* Device ID for SD8787 */ |
258 | #define SDIO_DEVICE_ID_MARVELL_8787 (0x9119) | 258 | #define SDIO_DEVICE_ID_MARVELL_8787 (0x9119) |
259 | /* Device ID for SD8797 */ | ||
260 | #define SDIO_DEVICE_ID_MARVELL_8797 (0x9129) | ||
259 | 261 | ||
260 | /* WLAN IDs */ | 262 | /* WLAN IDs */ |
261 | static const struct sdio_device_id mwifiex_ids[] = { | 263 | static const struct sdio_device_id mwifiex_ids[] = { |
262 | {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8787)}, | 264 | {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8787)}, |
265 | {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8797)}, | ||
263 | {}, | 266 | {}, |
264 | }; | 267 | }; |
265 | 268 | ||
@@ -1573,7 +1576,16 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
1573 | sdio_set_drvdata(func, card); | 1576 | sdio_set_drvdata(func, card); |
1574 | 1577 | ||
1575 | adapter->dev = &func->dev; | 1578 | adapter->dev = &func->dev; |
1576 | strcpy(adapter->fw_name, SD8787_DEFAULT_FW_NAME); | 1579 | |
1580 | switch (func->device) { | ||
1581 | case SDIO_DEVICE_ID_MARVELL_8797: | ||
1582 | strcpy(adapter->fw_name, SD8797_DEFAULT_FW_NAME); | ||
1583 | break; | ||
1584 | case SDIO_DEVICE_ID_MARVELL_8787: | ||
1585 | default: | ||
1586 | strcpy(adapter->fw_name, SD8787_DEFAULT_FW_NAME); | ||
1587 | break; | ||
1588 | } | ||
1577 | 1589 | ||
1578 | return 0; | 1590 | return 0; |
1579 | 1591 | ||
@@ -1774,4 +1786,5 @@ MODULE_AUTHOR("Marvell International Ltd."); | |||
1774 | MODULE_DESCRIPTION("Marvell WiFi-Ex SDIO Driver version " SDIO_VERSION); | 1786 | MODULE_DESCRIPTION("Marvell WiFi-Ex SDIO Driver version " SDIO_VERSION); |
1775 | MODULE_VERSION(SDIO_VERSION); | 1787 | MODULE_VERSION(SDIO_VERSION); |
1776 | MODULE_LICENSE("GPL v2"); | 1788 | MODULE_LICENSE("GPL v2"); |
1777 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); | 1789 | MODULE_FIRMWARE(SD8787_DEFAULT_FW_NAME); |
1790 | MODULE_FIRMWARE(SD8797_DEFAULT_FW_NAME); | ||
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h index 3f711801e58a..a3fb322205b0 100644 --- a/drivers/net/wireless/mwifiex/sdio.h +++ b/drivers/net/wireless/mwifiex/sdio.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "main.h" | 29 | #include "main.h" |
30 | 30 | ||
31 | #define SD8787_DEFAULT_FW_NAME "mrvl/sd8787_uapsta.bin" | 31 | #define SD8787_DEFAULT_FW_NAME "mrvl/sd8787_uapsta.bin" |
32 | #define SD8797_DEFAULT_FW_NAME "mrvl/sd8797_uapsta.bin" | ||
32 | 33 | ||
33 | #define BLOCK_MODE 1 | 34 | #define BLOCK_MODE 1 |
34 | #define BYTE_MODE 0 | 35 | #define BYTE_MODE 0 |
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 7a16b0c417af..e812db8b695c 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c | |||
@@ -508,7 +508,7 @@ static int mwifiex_ret_802_11_tx_rate_query(struct mwifiex_private *priv, | |||
508 | priv->tx_htinfo = resp->params.tx_rate.ht_info; | 508 | priv->tx_htinfo = resp->params.tx_rate.ht_info; |
509 | if (!priv->is_data_rate_auto) | 509 | if (!priv->is_data_rate_auto) |
510 | priv->data_rate = | 510 | priv->data_rate = |
511 | mwifiex_index_to_data_rate(priv->tx_rate, | 511 | mwifiex_index_to_data_rate(priv, priv->tx_rate, |
512 | priv->tx_htinfo); | 512 | priv->tx_htinfo); |
513 | 513 | ||
514 | return 0; | 514 | return 0; |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index ea4a29b7e331..4b6f5539657d 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -832,8 +832,8 @@ int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, | |||
832 | 832 | ||
833 | if (!ret) { | 833 | if (!ret) { |
834 | if (rate->is_rate_auto) | 834 | if (rate->is_rate_auto) |
835 | rate->rate = mwifiex_index_to_data_rate(priv->tx_rate, | 835 | rate->rate = mwifiex_index_to_data_rate(priv, |
836 | priv->tx_htinfo); | 836 | priv->tx_rate, priv->tx_htinfo); |
837 | else | 837 | else |
838 | rate->rate = priv->data_rate; | 838 | rate->rate = priv->data_rate; |
839 | } else { | 839 | } else { |