Commit adc89595 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville

mwifiex: check firmware capabilities while initialising 5GHz band parameters

There are some SD8787 cards which don't support 5GHz band.
Therefore initialise 5GHz band parameters only if hardware
supports the band.
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 49adc5ce
...@@ -1235,20 +1235,23 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, ...@@ -1235,20 +1235,23 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac,
wdev->wiphy->max_scan_ssids = 10; wdev->wiphy->max_scan_ssids = 10;
wdev->wiphy->interface_modes = wdev->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz; wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz;
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz; mwifiex_setup_ht_caps(
&wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap, priv);
if (priv->adapter->config_bands & BAND_A) {
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz;
mwifiex_setup_ht_caps(
&wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap, priv);
} else {
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
}
/* Initialize cipher suits */ /* Initialize cipher suits */
wdev->wiphy->cipher_suites = mwifiex_cipher_suites; wdev->wiphy->cipher_suites = mwifiex_cipher_suites;
wdev->wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites); wdev->wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites);
/* Initialize parameters for 2GHz band */
mwifiex_setup_ht_caps(&wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap,
priv);
mwifiex_setup_ht_caps(&wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap,
priv);
memcpy(wdev->wiphy->perm_addr, mac, 6); memcpy(wdev->wiphy->perm_addr, mac, 6);
wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment