|
@@ -2148,7 +2148,7 @@ static int __hdd_mon_open(struct net_device *dev)
|
|
|
hdd_mon_mode_ether_setup(dev);
|
|
|
|
|
|
if (con_mode == QDF_GLOBAL_MONITOR_MODE) {
|
|
|
- ret = hdd_wlan_start_modules(hdd_ctx, adapter, false);
|
|
|
+ ret = hdd_wlan_start_modules(hdd_ctx, false);
|
|
|
if (ret) {
|
|
|
hdd_err("Failed to start WLAN modules return");
|
|
|
return ret;
|
|
@@ -2297,15 +2297,14 @@ int hdd_start_adapter(struct hdd_adapter *adapter)
|
|
|
if (hdd_set_fw_params(adapter))
|
|
|
hdd_err("Failed to set the FW params for the adapter!");
|
|
|
|
|
|
- /*
|
|
|
- * Action frame registered in one adapter which will
|
|
|
- * applicable to all interfaces
|
|
|
- */
|
|
|
- ret = wlan_hdd_cfg80211_register_frames(adapter);
|
|
|
- if (ret < 0) {
|
|
|
- hdd_err("Failed to register frames - ret %d", ret);
|
|
|
- goto err_start_adapter;
|
|
|
+ if (adapter->session_id != HDD_SESSION_ID_INVALID) {
|
|
|
+ ret = wlan_hdd_cfg80211_register_frames(adapter);
|
|
|
+ if (ret < 0) {
|
|
|
+ hdd_err("Failed to register frames - ret %d", ret);
|
|
|
+ goto err_start_adapter;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
wlan_hdd_update_dbs_scan_and_fw_mode_config();
|
|
|
|
|
|
exit_with_success:
|
|
@@ -2607,7 +2606,6 @@ static int hdd_update_country_code(struct hdd_context *hdd_ctx)
|
|
|
/**
|
|
|
* hdd_wlan_start_modules() - Single driver state machine for starting modules
|
|
|
* @hdd_ctx: HDD context
|
|
|
- * @adapter: HDD adapter
|
|
|
* @reinit: flag to indicate from SSR or normal path
|
|
|
*
|
|
|
* This function maintains the driver state machine it will be invoked from
|
|
@@ -2616,9 +2614,7 @@ static int hdd_update_country_code(struct hdd_context *hdd_ctx)
|
|
|
*
|
|
|
* Return: 0 for success; non-zero for failure
|
|
|
*/
|
|
|
-int hdd_wlan_start_modules(struct hdd_context *hdd_ctx,
|
|
|
- struct hdd_adapter *adapter,
|
|
|
- bool reinit)
|
|
|
+int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit)
|
|
|
{
|
|
|
int ret = 0;
|
|
|
qdf_device_t qdf_dev;
|
|
@@ -2759,18 +2755,13 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx,
|
|
|
case DRIVER_MODULES_OPENED:
|
|
|
hdd_info("Wlan transitioning (OPENED -> ENABLED)");
|
|
|
|
|
|
- if (!adapter) {
|
|
|
- hdd_alert("adapter is Null");
|
|
|
- ret = -EINVAL;
|
|
|
- goto post_disable;
|
|
|
- }
|
|
|
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
|
hdd_err("in ftm mode, no need to configure cds modules");
|
|
|
ret = -EINVAL;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- ret = hdd_configure_cds(hdd_ctx, adapter);
|
|
|
+ ret = hdd_configure_cds(hdd_ctx);
|
|
|
if (ret) {
|
|
|
hdd_err("Failed to Enable cds modules; errno: %d", ret);
|
|
|
goto post_disable;
|
|
@@ -2955,7 +2946,7 @@ static int __hdd_open(struct net_device *dev)
|
|
|
}
|
|
|
|
|
|
|
|
|
- ret = hdd_wlan_start_modules(hdd_ctx, adapter, false);
|
|
|
+ ret = hdd_wlan_start_modules(hdd_ctx, false);
|
|
|
if (ret) {
|
|
|
hdd_err("Failed to start WLAN modules return");
|
|
|
goto err_hdd_hdd_init_deinit_lock;
|
|
@@ -4904,6 +4895,9 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
|
|
|
|
|
hdd_enter();
|
|
|
|
|
|
+ if (adapter->session_id != HDD_SESSION_ID_INVALID)
|
|
|
+ wlan_hdd_cfg80211_deregister_frames(adapter);
|
|
|
+
|
|
|
hdd_nud_ignore_tracking(adapter, true);
|
|
|
hdd_nud_reset_tracking(adapter);
|
|
|
|
|
@@ -6297,7 +6291,6 @@ static inline QDF_STATUS hdd_unregister_wext_all_adapters(struct hdd_context *
|
|
|
adapter->device_mode == QDF_P2P_DEVICE_MODE ||
|
|
|
adapter->device_mode == QDF_SAP_MODE ||
|
|
|
adapter->device_mode == QDF_P2P_GO_MODE) {
|
|
|
- wlan_hdd_cfg80211_deregister_frames(adapter);
|
|
|
hdd_unregister_wext(adapter->dev);
|
|
|
}
|
|
|
}
|
|
@@ -8289,10 +8282,8 @@ void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
|
|
|
struct hdd_adapter *adapter = NULL;
|
|
|
int i;
|
|
|
|
|
|
- /* Get the HDD context.*/
|
|
|
- hdd_ctx = (struct hdd_context *)cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
-
|
|
|
- if (0 != wlan_hdd_validate_context(hdd_ctx))
|
|
|
+ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
+ if (wlan_hdd_validate_context(hdd_ctx))
|
|
|
return;
|
|
|
|
|
|
if (SME_SESSION_ID_ANY == frame_ind->sessionId) {
|
|
@@ -9978,13 +9969,12 @@ static int hdd_set_auto_shutdown_cb(struct hdd_context *hdd_ctx)
|
|
|
/**
|
|
|
* hdd_features_init() - Init features
|
|
|
* @hdd_ctx: HDD context
|
|
|
- * @adapter: Primary adapter context
|
|
|
*
|
|
|
* Initialize features and their feature context after WLAN firmware is up.
|
|
|
*
|
|
|
* Return: 0 on success and errno on failure.
|
|
|
*/
|
|
|
-static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
|
|
|
+static int hdd_features_init(struct hdd_context *hdd_ctx)
|
|
|
{
|
|
|
tSirTxPowerLimit hddtxlimit;
|
|
|
QDF_STATUS status;
|
|
@@ -10026,7 +10016,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad
|
|
|
ret = hdd_init_thermal_info(hdd_ctx);
|
|
|
if (ret) {
|
|
|
hdd_err("Error while initializing thermal information");
|
|
|
- goto deregister_frames;
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -10050,7 +10040,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad
|
|
|
ret = hdd_register_cb(hdd_ctx);
|
|
|
if (ret) {
|
|
|
hdd_err("Failed to register HDD callbacks!");
|
|
|
- goto deregister_frames;
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
if (hdd_ctx->config->goptimize_chan_avoid_event) {
|
|
@@ -10095,8 +10085,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad
|
|
|
|
|
|
deregister_cb:
|
|
|
hdd_deregister_cb(hdd_ctx);
|
|
|
-deregister_frames:
|
|
|
- wlan_hdd_cfg80211_deregister_frames(adapter);
|
|
|
+
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -10145,7 +10134,7 @@ static inline QDF_STATUS hdd_register_bcn_cb(struct hdd_context *hdd_ctx)
|
|
|
*
|
|
|
* Return: 0 on success and errno on failure.
|
|
|
*/
|
|
|
-int hdd_configure_cds(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
|
|
|
+int hdd_configure_cds(struct hdd_context *hdd_ctx)
|
|
|
{
|
|
|
int ret;
|
|
|
QDF_STATUS status;
|
|
@@ -10244,7 +10233,7 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
|
|
|
goto cds_disable;
|
|
|
}
|
|
|
|
|
|
- ret = hdd_features_init(hdd_ctx, adapter);
|
|
|
+ ret = hdd_features_init(hdd_ctx);
|
|
|
if (ret)
|
|
|
goto cds_disable;
|
|
|
|
|
@@ -10715,7 +10704,7 @@ int hdd_wlan_startup(struct device *dev)
|
|
|
|
|
|
hdd_driver_memdump_init();
|
|
|
|
|
|
- ret = hdd_wlan_start_modules(hdd_ctx, NULL, false);
|
|
|
+ ret = hdd_wlan_start_modules(hdd_ctx, false);
|
|
|
if (ret) {
|
|
|
hdd_err("Failed to start modules: %d", ret);
|
|
|
goto err_memdump_deinit;
|
|
@@ -12507,7 +12496,6 @@ static int __con_mode_handler(const char *kmessage,
|
|
|
struct hdd_context *hdd_ctx)
|
|
|
{
|
|
|
int ret;
|
|
|
- struct hdd_adapter *adapter;
|
|
|
enum QDF_GLOBAL_MODE curr_mode;
|
|
|
enum QDF_OPMODE adapter_mode;
|
|
|
int new_con_mode;
|
|
@@ -12576,19 +12564,21 @@ static int __con_mode_handler(const char *kmessage,
|
|
|
goto reset_flags;
|
|
|
}
|
|
|
|
|
|
- adapter = hdd_get_adapter(hdd_ctx, adapter_mode);
|
|
|
- if (!adapter) {
|
|
|
- hdd_err("Failed to get adapter:%d", adapter_mode);
|
|
|
- goto reset_flags;
|
|
|
- }
|
|
|
-
|
|
|
- ret = hdd_wlan_start_modules(hdd_ctx, adapter, false);
|
|
|
+ ret = hdd_wlan_start_modules(hdd_ctx, false);
|
|
|
if (ret) {
|
|
|
hdd_err("Start wlan modules failed: %d", ret);
|
|
|
goto reset_flags;
|
|
|
}
|
|
|
|
|
|
if (new_con_mode == QDF_GLOBAL_MONITOR_MODE) {
|
|
|
+ struct hdd_adapter *adapter =
|
|
|
+ hdd_get_adapter(hdd_ctx, adapter_mode);
|
|
|
+
|
|
|
+ if (!adapter) {
|
|
|
+ hdd_err("Failed to get adapter:%d", adapter_mode);
|
|
|
+ goto reset_flags;
|
|
|
+ }
|
|
|
+
|
|
|
if (hdd_start_adapter(adapter)) {
|
|
|
hdd_err("Failed to start %s adapter", kmessage);
|
|
|
ret = -EINVAL;
|