diff options
author | Luciano Coelho <coelho@ti.com> | 2012-05-10 05:14:15 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-05 08:58:42 -0400 |
commit | 8334271882b46e4bc15337ed27428be121156165 (patch) | |
tree | a0cbc0721deaf898ec0bc6e795324c7050880083 /drivers | |
parent | 60462b4885450410df03cf3829367b285baf9ab8 (diff) |
wl18xx: add module parameter to force SISO 20MHz
In some cases it may be useful to force narrow-band SISO channels.
Add a new value to the ht_mode module parameter to force the device to
operate in SISO 20MHz.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 6a81edf702eb..07955984face 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -1055,7 +1055,7 @@ static struct wlcore_ops wl18xx_ops = { | |||
1055 | }; | 1055 | }; |
1056 | 1056 | ||
1057 | /* HT cap appropriate for wide channels */ | 1057 | /* HT cap appropriate for wide channels */ |
1058 | static struct ieee80211_sta_ht_cap wl18xx_ht_cap = { | 1058 | static struct ieee80211_sta_ht_cap wl18xx_siso40_ht_cap = { |
1059 | .cap = IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | | 1059 | .cap = IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | |
1060 | IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_DSSSCCK40, | 1060 | IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_DSSSCCK40, |
1061 | .ht_supported = true, | 1061 | .ht_supported = true, |
@@ -1068,6 +1068,19 @@ static struct ieee80211_sta_ht_cap wl18xx_ht_cap = { | |||
1068 | }, | 1068 | }, |
1069 | }; | 1069 | }; |
1070 | 1070 | ||
1071 | /* HT cap appropriate for SISO 20 */ | ||
1072 | static struct ieee80211_sta_ht_cap wl18xx_siso20_ht_cap = { | ||
1073 | .cap = IEEE80211_HT_CAP_SGI_20, | ||
1074 | .ht_supported = true, | ||
1075 | .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K, | ||
1076 | .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, | ||
1077 | .mcs = { | ||
1078 | .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, | ||
1079 | .rx_highest = cpu_to_le16(72), | ||
1080 | .tx_params = IEEE80211_HT_MCS_TX_DEFINED, | ||
1081 | }, | ||
1082 | }; | ||
1083 | |||
1071 | /* HT cap appropriate for MIMO rates in 20mhz channel */ | 1084 | /* HT cap appropriate for MIMO rates in 20mhz channel */ |
1072 | static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap = { | 1085 | static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap = { |
1073 | .cap = IEEE80211_HT_CAP_SGI_20, | 1086 | .cap = IEEE80211_HT_CAP_SGI_20, |
@@ -1108,10 +1121,20 @@ int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1108 | wl->fw_status_priv_len = sizeof(struct wl18xx_fw_status_priv); | 1121 | wl->fw_status_priv_len = sizeof(struct wl18xx_fw_status_priv); |
1109 | wl->stats.fw_stats_len = sizeof(struct wl18xx_acx_statistics); | 1122 | wl->stats.fw_stats_len = sizeof(struct wl18xx_acx_statistics); |
1110 | wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv); | 1123 | wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv); |
1111 | memcpy(&wl->ht_cap, &wl18xx_ht_cap, sizeof(wl18xx_ht_cap)); | 1124 | |
1112 | if (!strcmp(ht_mode_param, "mimo")) | 1125 | if (!strcmp(ht_mode_param, "wide")) { |
1126 | memcpy(&wl->ht_cap, &wl18xx_siso40_ht_cap, | ||
1127 | sizeof(wl18xx_siso40_ht_cap)); | ||
1128 | } else if (!strcmp(ht_mode_param, "mimo")) { | ||
1113 | memcpy(&wl->ht_cap, &wl18xx_mimo_ht_cap, | 1129 | memcpy(&wl->ht_cap, &wl18xx_mimo_ht_cap, |
1114 | sizeof(wl18xx_mimo_ht_cap)); | 1130 | sizeof(wl18xx_mimo_ht_cap)); |
1131 | } else if (!strcmp(ht_mode_param, "siso20")) { | ||
1132 | memcpy(&wl->ht_cap, &wl18xx_siso20_ht_cap, | ||
1133 | sizeof(wl18xx_siso20_ht_cap)); | ||
1134 | } else { | ||
1135 | wl1271_error("invalid ht_mode '%s'", ht_mode_param); | ||
1136 | goto out_free; | ||
1137 | } | ||
1115 | 1138 | ||
1116 | wl18xx_conf_init(wl); | 1139 | wl18xx_conf_init(wl); |
1117 | 1140 | ||
@@ -1131,8 +1154,7 @@ int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1131 | priv->conf.phy.low_band_component_type = 0x06; | 1154 | priv->conf.phy.low_band_component_type = 0x06; |
1132 | } else { | 1155 | } else { |
1133 | wl1271_error("invalid board type '%s'", board_type_param); | 1156 | wl1271_error("invalid board type '%s'", board_type_param); |
1134 | wlcore_free_hw(wl); | 1157 | goto out_free; |
1135 | return -EINVAL; | ||
1136 | } | 1158 | } |
1137 | 1159 | ||
1138 | if (!checksum_param) { | 1160 | if (!checksum_param) { |
@@ -1143,6 +1165,10 @@ int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1143 | wl->enable_11a = enable_11a_param; | 1165 | wl->enable_11a = enable_11a_param; |
1144 | 1166 | ||
1145 | return wlcore_probe(wl, pdev); | 1167 | return wlcore_probe(wl, pdev); |
1168 | |||
1169 | out_free: | ||
1170 | wlcore_free_hw(wl); | ||
1171 | return -EINVAL; | ||
1146 | } | 1172 | } |
1147 | 1173 | ||
1148 | static const struct platform_device_id wl18xx_id_table[] __devinitconst = { | 1174 | static const struct platform_device_id wl18xx_id_table[] __devinitconst = { |
@@ -1174,7 +1200,7 @@ static void __exit wl18xx_exit(void) | |||
1174 | module_exit(wl18xx_exit); | 1200 | module_exit(wl18xx_exit); |
1175 | 1201 | ||
1176 | module_param_named(ht_mode, ht_mode_param, charp, S_IRUSR); | 1202 | module_param_named(ht_mode, ht_mode_param, charp, S_IRUSR); |
1177 | MODULE_PARM_DESC(ht_mode, "Force HT mode: wide or mimo"); | 1203 | MODULE_PARM_DESC(ht_mode, "Force HT mode: wide (default), mimo or siso20"); |
1178 | 1204 | ||
1179 | module_param_named(board_type, board_type_param, charp, S_IRUSR); | 1205 | module_param_named(board_type, board_type_param, charp, S_IRUSR); |
1180 | MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or " | 1206 | MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or " |