qcacld-3.0: correct phy_mode in hdd_chan_change_notify

qcacld-2.0 to qcacld-3.0 propagation

The sap Context related phyMode should be used
instead of the phyMode in hal. Otherwise, the incorrect
channel width will be reported to supplicant.

Change-Id: Ic0ce7861a786de5aef8b43c6aa0fde9f600b08b2
CRs-Fixed: 909668
This commit is contained in:
Liangwei Dong 2015-11-05 21:50:25 -05:00 • committed by Akash Patel
commit 3e502cb8f8
3 changed files with 43 additions and 1 deletions

View file

@ -604,6 +604,21 @@ static void hdd_issue_stored_joinreq(hdd_adapter_t *sta_adapter,
}
}
#ifdef WLAN_FEATURE_MBSSID
static eCsrPhyMode
hdd_sap_get_phymode(hdd_adapter_t *hostapd_adapter)
{
return wlansap_get_phymode(WLAN_HDD_GET_SAP_CTX_PTR(hostapd_adapter));
}
#else
static eCsrPhyMode
hdd_sap_get_phymode(hdd_adapter_t *hostapd_adapter)
{
return wlansap_get_phymode(
(WLAN_HDD_GET_CTX(hostapd_adapter))->pcds_context);
}
#endif
/**
* hdd_chan_change_notify() - Function to notify hostapd about channel change
* @hostapd_adapter hostapd adapter
@ -641,7 +656,7 @@ CDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
return CDF_STATUS_E_FAILURE;
}
phy_mode = sme_get_phy_mode(hal);
phy_mode = hdd_sap_get_phymode(hostapd_adapter);
if (oper_chan <= 14)
cb_mode = sme_get_cb_phy_state_from_cb_ini_value(
@ -669,6 +684,9 @@ CDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
break;
}
hdd_info("%s: phy_mode %d cb_mode %d chann_type %d oper_chan %d",
__func__, phy_mode, cb_mode, channel_type, oper_chan);
cfg80211_chandef_create(&chandef, chan, channel_type);
cfg80211_ch_switch_notify(dev, &chandef);

View file

@ -906,6 +906,7 @@ CDF_STATUS wlansap_acs_chselect(void *pvos_gctx,
tpWLAN_SAPEventCB pacs_event_callback,
tsap_Config_t *pconfig,
void *pusr_context);
eCsrPhyMode wlansap_get_phymode(void *pctx);
#ifdef __cplusplus
}
#endif

View file

@ -3299,3 +3299,26 @@ void wlan_sap_enable_phy_error_logs(tHalHandle hal, bool enable_log)
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
mac_ctx->sap.enable_dfs_phy_error_logs = enable_log;
}
/**
* wlansap_get_phymode() - get SAP phymode.
* @pctx: Pointer to the global vos context; a handle to SAP's control block
* can be extracted from its context. When MBSSID feature is enabled,
* SAP context is directly passed to SAP APIs.
*
* This function provides current phymode of SAP interface.
*
* Return: phymode with eCsrPhyMode type.
*/
eCsrPhyMode
wlansap_get_phymode(void *pctx)
{
ptSapContext sap_context = NULL;
sap_context = CDS_GET_SAP_CB(pctx);
if (NULL == sap_context) {
CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_ERROR,
"%s: Invalid SAP pointer from pctx", __func__);
return eCSR_DOT11_MODE_AUTO;
}
return sap_context->csr_roamProfile.phyMode;
}