qcacld-3.0: Cleanup interface when loading/unloading timeout

When AP_DISCONNECT event occurs during IPA resource unloading in
progress, timeout could happen since suspending FW IPA Rx pipe took much
time. This could cause a subsequent AP_CONNECT event failed since no
interface is available.
Fix this by
- Adapter struct sanity check using hdd_validate_adapter()
- Call hdd_ipa_cleanup_iface() for AP_DISCONNECT/STA_DISCONNECT event
  in loading/unloading timeout case
- Assert when no interface is available in hdd_ipa_setup_iface()

Change-Id: Ie96e4f0e96ccffacf4ce5fcc976636c440214873
CRs-Fixed: 2208347
这个提交包含在:
Yun Park
2018-04-24 12:11:01 -07:00
提交者 nshrivas
父节点 b832282230
当前提交 21ec490dbd
修改 2 个文件,包含 22 行新增1 行删除

查看文件

@@ -1070,6 +1070,13 @@ static QDF_STATUS wlan_ipa_setup_iface(struct wlan_ipa_priv *ipa_ctx,
}
}
if (WLAN_IPA_MAX_IFACE == ipa_ctx->num_iface) {
ipa_err("Max interface reached %d", WLAN_IPA_MAX_IFACE);
status = QDF_STATUS_E_NOMEM;
QDF_ASSERT(0);
goto end;
}
for (i = 0; i < WLAN_IPA_MAX_IFACE; i++) {
if (ipa_ctx->iface_context[i].tl_context == NULL) {
iface_context = &(ipa_ctx->iface_context[i]);
@@ -1080,6 +1087,7 @@ static QDF_STATUS wlan_ipa_setup_iface(struct wlan_ipa_priv *ipa_ctx,
if (iface_context == NULL) {
ipa_err("All the IPA interfaces are in use");
status = QDF_STATUS_E_NOMEM;
QDF_ASSERT(0);
goto end;
}
@@ -1338,6 +1346,19 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
qdf_mutex_release(&ipa_ctx->ipa_lock);
/* Cleanup interface */
if (type == QDF_IPA_STA_DISCONNECT ||
type == QDF_IPA_AP_DISCONNECT) {
for (i = 0; i < WLAN_IPA_MAX_IFACE; i++) {
iface_ctx = &ipa_ctx->iface_context[i];
if (iface_ctx->dev == net_dev)
break;
}
if (iface_ctx)
wlan_ipa_cleanup_iface(iface_ctx);
}
return QDF_STATUS_SUCCESS;
}
ipa_info("IPA resource %s completed",