mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacld-3.0: Check and kickstart the modules state if they are closed
There are few NL80211 commands which can be triggered from the upper layer even when the interfaces are down. Check the driver state machine when these commands gets triggered from the upper layer and start the modules if they are closed, so these commands can be honoured correctly. Change-Id: I4a1d2e95379a5e690b00eea37e80ceb8a91925fb CRs-Fixed: 1056959
This commit is contained in:
parent
b2f6c26fa4
commit
99286457f6
2 changed files with 47 additions and 7 deletions
|
|
@ -2048,6 +2048,15 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
|
|||
return ERR_PTR(-ENOSPC);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add interface can be requested from the upper layer at any time
|
||||
* check the statemachine for modules state and if they are closed
|
||||
* open the modules.
|
||||
*/
|
||||
ret = hdd_wlan_start_modules(pHddCtx, pAdapter, false);
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
if (NL80211_IFTYPE_AP == type) {
|
||||
ret = hdd_start_adapter(pAdapter);
|
||||
if (ret) {
|
||||
|
|
@ -2145,6 +2154,13 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
|
|||
if (0 != status)
|
||||
return status;
|
||||
|
||||
/*
|
||||
* check state machine state and kickstart modules if they are closed.
|
||||
*/
|
||||
status = hdd_wlan_start_modules(pHddCtx, pVirtAdapter, false);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
wlan_hdd_release_intf_addr(pHddCtx,
|
||||
pVirtAdapter->macAddressCurrent.bytes);
|
||||
|
||||
|
|
|
|||
|
|
@ -1919,6 +1919,14 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
|
|||
if (0 != status)
|
||||
return status;
|
||||
|
||||
mutex_lock(&pHddCtx->iface_change_lock);
|
||||
if (pHddCtx->driver_status != DRIVER_MODULES_ENABLED) {
|
||||
mutex_unlock(&pHddCtx->iface_change_lock);
|
||||
hdd_info("Driver Module not enabled return success");
|
||||
return 0;
|
||||
}
|
||||
mutex_unlock(&pHddCtx->iface_change_lock);
|
||||
|
||||
if ((DRIVER_POWER_MODE_AUTO == !mode) &&
|
||||
(true == pHddCtx->hdd_wlan_suspended) &&
|
||||
(pHddCtx->config->fhostArpOffload) &&
|
||||
|
|
@ -2081,8 +2089,9 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
|
|||
int *dbm)
|
||||
{
|
||||
|
||||
hdd_adapter_t *pAdapter;
|
||||
hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
|
||||
struct net_device *ndev = wdev->netdev;
|
||||
hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
|
||||
int status;
|
||||
|
||||
ENTER();
|
||||
|
|
@ -2098,17 +2107,32 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
|
|||
return status;
|
||||
}
|
||||
|
||||
pAdapter = hdd_get_adapter(pHddCtx, QDF_STA_MODE);
|
||||
if (NULL == pAdapter) {
|
||||
hdd_err("pAdapter is NULL");
|
||||
if (!adapter) {
|
||||
hdd_err("adapter is NULL");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* Validate adapter sessionId */
|
||||
if (adapter->sessionId == HDD_SESSION_ID_INVALID) {
|
||||
hdd_err("Adapter Session Invalid!");
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
mutex_lock(&pHddCtx->iface_change_lock);
|
||||
if (pHddCtx->driver_status != DRIVER_MODULES_ENABLED) {
|
||||
mutex_unlock(&pHddCtx->iface_change_lock);
|
||||
hdd_info("Driver Module not enabled return success");
|
||||
/* Send cached data to upperlayer*/
|
||||
*dbm = adapter->hdd_stats.ClassA_stat.max_pwr;
|
||||
return 0;
|
||||
}
|
||||
mutex_unlock(&pHddCtx->iface_change_lock);
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_GET_TXPOWER,
|
||||
pAdapter->sessionId, pAdapter->device_mode));
|
||||
wlan_hdd_get_class_astats(pAdapter);
|
||||
*dbm = pAdapter->hdd_stats.ClassA_stat.max_pwr;
|
||||
adapter->sessionId, adapter->device_mode));
|
||||
wlan_hdd_get_class_astats(adapter);
|
||||
*dbm = adapter->hdd_stats.ClassA_stat.max_pwr;
|
||||
|
||||
EXIT();
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue