qcacld-3.0: Update correct wiphy band capabilities

Driver is updating wiphy band capabilities incorrectly as
it is always updating 2G band as always supported, in case
if 2G band is disabled from ini "BandCapability", driver
should not update 2G band capabilities to wiphy.

To avoid above issue, add a api to check if 2G band is
supported and then only update 2G band capabilities to
wiphy.

Change-Id: Ib921fa106158d93bfdb7aa57cfd5aa4370fab7d8
CRs-Fixed: 2470067
This commit is contained in:
Ashish Kumar Dhanotiya 2019-06-12 12:53:59 +05:30 committed by nshrivas
parent df86b86ada
commit 34507e052f
3 changed files with 32 additions and 7 deletions

View File

@ -2372,6 +2372,17 @@ hdd_get_con_sap_adapter(struct hdd_adapter *this_sap_adapter,
bool hdd_is_5g_supported(struct hdd_context *hdd_ctx);
/**
* hdd_is_2g_supported() - check if 2GHz channels are supported
* @hdd_ctx: Pointer to the hdd context
*
* HDD function to know if 2GHz channels are supported
*
* Return: true if 2GHz channels are supported
*/
bool hdd_is_2g_supported(struct hdd_context *hdd_ctx);
int wlan_hdd_scan_abort(struct hdd_adapter *adapter);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD

View File

@ -13863,13 +13863,16 @@ QDF_STATUS wlan_hdd_update_wiphy_supported_band(struct hdd_context *hdd_ctx)
if (wiphy->registered)
return QDF_STATUS_SUCCESS;
if (!hdd_ctx->channels_2ghz)
return QDF_STATUS_E_NOMEM;
wiphy->bands[HDD_NL80211_BAND_2GHZ] = &wlan_hdd_band_2_4_ghz;
wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels = hdd_ctx->channels_2ghz;
qdf_mem_copy(wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels,
&hdd_channels_2_4_ghz[0], sizeof(hdd_channels_2_4_ghz));
if (hdd_is_2g_supported(hdd_ctx)) {
if (!hdd_ctx->channels_2ghz)
return QDF_STATUS_E_NOMEM;
wiphy->bands[HDD_NL80211_BAND_2GHZ] = &wlan_hdd_band_2_4_ghz;
wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels =
hdd_ctx->channels_2ghz;
qdf_mem_copy(wiphy->bands[HDD_NL80211_BAND_2GHZ]->channels,
&hdd_channels_2_4_ghz[0],
sizeof(hdd_channels_2_4_ghz));
}
if (!hdd_is_5g_supported(hdd_ctx) ||
(eHDD_DOT11_MODE_11b == cfg->dot11Mode) ||
(eHDD_DOT11_MODE_11g == cfg->dot11Mode) ||

View File

@ -7660,6 +7660,17 @@ bool hdd_is_5g_supported(struct hdd_context *hdd_ctx)
return false;
}
bool hdd_is_2g_supported(struct hdd_context *hdd_ctx)
{
if (!hdd_ctx)
return false;
if (hdd_ctx->curr_band != BAND_5G)
return true;
else
return false;
}
static int hdd_wiphy_init(struct hdd_context *hdd_ctx)
{
struct wiphy *wiphy;