Lines Matching full:adapter
46 * - Allocate adapter structure
47 * - Save interface specific operations table in adapter
50 * - Set default adapter structure parameters
59 struct mwifiex_adapter *adapter; in mwifiex_register() local
62 adapter = kzalloc(sizeof(struct mwifiex_adapter), GFP_KERNEL); in mwifiex_register()
63 if (!adapter) in mwifiex_register()
66 *padapter = adapter; in mwifiex_register()
67 adapter->dev = dev; in mwifiex_register()
68 adapter->card = card; in mwifiex_register()
70 /* Save interface specific operations in adapter */ in mwifiex_register()
71 memmove(&adapter->if_ops, if_ops, sizeof(struct mwifiex_if_ops)); in mwifiex_register()
72 adapter->debug_mask = debug_mask; in mwifiex_register()
75 if (adapter->if_ops.init_if) in mwifiex_register()
76 if (adapter->if_ops.init_if(adapter)) in mwifiex_register()
79 adapter->priv_num = 0; in mwifiex_register()
83 adapter->priv[i] = in mwifiex_register()
85 if (!adapter->priv[i]) in mwifiex_register()
88 adapter->priv[i]->adapter = adapter; in mwifiex_register()
89 adapter->priv_num++; in mwifiex_register()
91 mwifiex_init_lock_list(adapter); in mwifiex_register()
93 timer_setup(&adapter->cmd_timer, mwifiex_cmd_timeout_func, 0); in mwifiex_register()
98 mwifiex_dbg(adapter, ERROR, in mwifiex_register()
101 for (i = 0; i < adapter->priv_num; i++) in mwifiex_register()
102 kfree(adapter->priv[i]); in mwifiex_register()
104 kfree(adapter); in mwifiex_register()
117 * - Free adapter structure
119 static int mwifiex_unregister(struct mwifiex_adapter *adapter) in mwifiex_unregister() argument
123 if (adapter->if_ops.cleanup_if) in mwifiex_unregister()
124 adapter->if_ops.cleanup_if(adapter); in mwifiex_unregister()
126 timer_shutdown_sync(&adapter->cmd_timer); in mwifiex_unregister()
129 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_unregister()
130 mwifiex_free_curr_bcn(adapter->priv[i]); in mwifiex_unregister()
131 kfree(adapter->priv[i]); in mwifiex_unregister()
134 if (adapter->nd_info) { in mwifiex_unregister()
135 for (i = 0 ; i < adapter->nd_info->n_matches ; i++) in mwifiex_unregister()
136 kfree(adapter->nd_info->matches[i]); in mwifiex_unregister()
137 kfree(adapter->nd_info); in mwifiex_unregister()
138 adapter->nd_info = NULL; in mwifiex_unregister()
141 kfree(adapter->regd); in mwifiex_unregister()
143 kfree(adapter); in mwifiex_unregister()
147 void mwifiex_queue_main_work(struct mwifiex_adapter *adapter) in mwifiex_queue_main_work() argument
151 spin_lock_irqsave(&adapter->main_proc_lock, flags); in mwifiex_queue_main_work()
152 if (adapter->mwifiex_processing) { in mwifiex_queue_main_work()
153 adapter->more_task_flag = true; in mwifiex_queue_main_work()
154 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); in mwifiex_queue_main_work()
156 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); in mwifiex_queue_main_work()
157 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_queue_main_work()
162 static void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter) in mwifiex_queue_rx_work() argument
164 spin_lock_bh(&adapter->rx_proc_lock); in mwifiex_queue_rx_work()
165 if (adapter->rx_processing) { in mwifiex_queue_rx_work()
166 spin_unlock_bh(&adapter->rx_proc_lock); in mwifiex_queue_rx_work()
168 spin_unlock_bh(&adapter->rx_proc_lock); in mwifiex_queue_rx_work()
169 queue_work(adapter->rx_workqueue, &adapter->rx_work); in mwifiex_queue_rx_work()
173 static int mwifiex_process_rx(struct mwifiex_adapter *adapter) in mwifiex_process_rx() argument
178 spin_lock_bh(&adapter->rx_proc_lock); in mwifiex_process_rx()
179 if (adapter->rx_processing || adapter->rx_locked) { in mwifiex_process_rx()
180 spin_unlock_bh(&adapter->rx_proc_lock); in mwifiex_process_rx()
183 adapter->rx_processing = true; in mwifiex_process_rx()
184 spin_unlock_bh(&adapter->rx_proc_lock); in mwifiex_process_rx()
188 while ((skb = skb_dequeue(&adapter->rx_data_q))) { in mwifiex_process_rx()
189 atomic_dec(&adapter->rx_pending); in mwifiex_process_rx()
190 if ((adapter->delay_main_work || in mwifiex_process_rx()
191 adapter->iface_type == MWIFIEX_USB) && in mwifiex_process_rx()
192 (atomic_read(&adapter->rx_pending) < LOW_RX_PENDING)) { in mwifiex_process_rx()
193 if (adapter->if_ops.submit_rem_rx_urbs) in mwifiex_process_rx()
194 adapter->if_ops.submit_rem_rx_urbs(adapter); in mwifiex_process_rx()
195 adapter->delay_main_work = false; in mwifiex_process_rx()
196 mwifiex_queue_main_work(adapter); in mwifiex_process_rx()
200 if (adapter->if_ops.deaggr_pkt) in mwifiex_process_rx()
201 adapter->if_ops.deaggr_pkt(adapter, skb); in mwifiex_process_rx()
204 mwifiex_handle_rx_packet(adapter, skb); in mwifiex_process_rx()
207 spin_lock_bh(&adapter->rx_proc_lock); in mwifiex_process_rx()
208 adapter->rx_processing = false; in mwifiex_process_rx()
209 spin_unlock_bh(&adapter->rx_proc_lock); in mwifiex_process_rx()
215 static void maybe_quirk_fw_disable_ds(struct mwifiex_adapter *adapter) in maybe_quirk_fw_disable_ds() argument
217 struct mwifiex_private *priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA); in maybe_quirk_fw_disable_ds()
220 if (test_and_set_bit(MWIFIEX_IS_REQUESTING_FW_VEREXT, &adapter->work_flags)) in maybe_quirk_fw_disable_ds()
227 mwifiex_dbg(priv->adapter, MSG, in maybe_quirk_fw_disable_ds()
247 int mwifiex_main_process(struct mwifiex_adapter *adapter) in mwifiex_main_process() argument
252 spin_lock_irqsave(&adapter->main_proc_lock, flags); in mwifiex_main_process()
255 if (adapter->mwifiex_processing || adapter->main_locked) { in mwifiex_main_process()
256 adapter->more_task_flag = true; in mwifiex_main_process()
257 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); in mwifiex_main_process()
260 adapter->mwifiex_processing = true; in mwifiex_main_process()
261 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); in mwifiex_main_process()
265 if (adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY) in mwifiex_main_process()
275 if (atomic_read(&adapter->rx_pending) >= HIGH_RX_PENDING && in mwifiex_main_process()
276 adapter->iface_type != MWIFIEX_USB) { in mwifiex_main_process()
277 adapter->delay_main_work = true; in mwifiex_main_process()
278 mwifiex_queue_rx_work(adapter); in mwifiex_main_process()
283 if (adapter->int_status) { in mwifiex_main_process()
284 if (adapter->hs_activated) in mwifiex_main_process()
285 mwifiex_process_hs_config(adapter); in mwifiex_main_process()
286 if (adapter->if_ops.process_int_status) in mwifiex_main_process()
287 adapter->if_ops.process_int_status(adapter); in mwifiex_main_process()
290 if (adapter->rx_work_enabled && adapter->data_received) in mwifiex_main_process()
291 mwifiex_queue_rx_work(adapter); in mwifiex_main_process()
294 if ((adapter->ps_state == PS_STATE_SLEEP) && in mwifiex_main_process()
295 (adapter->pm_wakeup_card_req && in mwifiex_main_process()
296 !adapter->pm_wakeup_fw_try) && in mwifiex_main_process()
297 (is_command_pending(adapter) || in mwifiex_main_process()
298 !skb_queue_empty(&adapter->tx_data_q) || in mwifiex_main_process()
299 !mwifiex_bypass_txlist_empty(adapter) || in mwifiex_main_process()
300 !mwifiex_wmm_lists_empty(adapter))) { in mwifiex_main_process()
301 adapter->pm_wakeup_fw_try = true; in mwifiex_main_process()
302 mod_timer(&adapter->wakeup_timer, jiffies + (HZ*3)); in mwifiex_main_process()
303 adapter->if_ops.wakeup(adapter); in mwifiex_main_process()
307 if (IS_CARD_RX_RCVD(adapter)) { in mwifiex_main_process()
308 adapter->data_received = false; in mwifiex_main_process()
309 adapter->pm_wakeup_fw_try = false; in mwifiex_main_process()
310 del_timer(&adapter->wakeup_timer); in mwifiex_main_process()
311 if (adapter->ps_state == PS_STATE_SLEEP) in mwifiex_main_process()
312 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_main_process()
315 if (adapter->pm_wakeup_fw_try) in mwifiex_main_process()
317 if (adapter->ps_state == PS_STATE_PRE_SLEEP) in mwifiex_main_process()
318 mwifiex_check_ps_cond(adapter); in mwifiex_main_process()
320 if (adapter->ps_state != PS_STATE_AWAKE) in mwifiex_main_process()
322 if (adapter->tx_lock_flag) { in mwifiex_main_process()
323 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_main_process()
324 if (!adapter->usb_mc_setup) in mwifiex_main_process()
330 if ((!adapter->scan_chan_gap_enabled && in mwifiex_main_process()
331 adapter->scan_processing) || adapter->data_sent || in mwifiex_main_process()
333 (mwifiex_get_priv(adapter, in mwifiex_main_process()
335 (mwifiex_wmm_lists_empty(adapter) && in mwifiex_main_process()
336 mwifiex_bypass_txlist_empty(adapter) && in mwifiex_main_process()
337 skb_queue_empty(&adapter->tx_data_q))) { in mwifiex_main_process()
338 if (adapter->cmd_sent || adapter->curr_cmd || in mwifiex_main_process()
340 (mwifiex_get_priv(adapter, in mwifiex_main_process()
342 (!is_command_pending(adapter))) in mwifiex_main_process()
348 if (adapter->event_received) { in mwifiex_main_process()
349 adapter->event_received = false; in mwifiex_main_process()
350 mwifiex_process_event(adapter); in mwifiex_main_process()
354 if (adapter->cmd_resp_received) { in mwifiex_main_process()
355 adapter->cmd_resp_received = false; in mwifiex_main_process()
356 mwifiex_process_cmdresp(adapter); in mwifiex_main_process()
359 if (adapter->hw_status == MWIFIEX_HW_STATUS_INIT_DONE) { in mwifiex_main_process()
360 adapter->hw_status = MWIFIEX_HW_STATUS_READY; in mwifiex_main_process()
361 mwifiex_init_fw_complete(adapter); in mwifiex_main_process()
362 maybe_quirk_fw_disable_ds(adapter); in mwifiex_main_process()
368 if (adapter->ps_state == PS_STATE_PRE_SLEEP) in mwifiex_main_process()
369 mwifiex_check_ps_cond(adapter); in mwifiex_main_process()
374 if ((adapter->ps_state == PS_STATE_SLEEP) || in mwifiex_main_process()
375 (adapter->ps_state == PS_STATE_PRE_SLEEP) || in mwifiex_main_process()
376 (adapter->ps_state == PS_STATE_SLEEP_CFM)) { in mwifiex_main_process()
380 if (adapter->tx_lock_flag) { in mwifiex_main_process()
381 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_main_process()
382 if (!adapter->usb_mc_setup) in mwifiex_main_process()
388 if (!adapter->cmd_sent && !adapter->curr_cmd && in mwifiex_main_process()
390 (mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA))) { in mwifiex_main_process()
391 if (mwifiex_exec_next_cmd(adapter) == -1) { in mwifiex_main_process()
400 if (adapter->iface_type == MWIFIEX_USB && in mwifiex_main_process()
401 adapter->usb_mc_setup) in mwifiex_main_process()
404 if ((adapter->scan_chan_gap_enabled || in mwifiex_main_process()
405 !adapter->scan_processing) && in mwifiex_main_process()
406 !adapter->data_sent && in mwifiex_main_process()
407 !skb_queue_empty(&adapter->tx_data_q)) { in mwifiex_main_process()
408 if (adapter->hs_activated_manually) { in mwifiex_main_process()
409 mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_main_process()
411 adapter->hs_activated_manually = false; in mwifiex_main_process()
414 mwifiex_process_tx_queue(adapter); in mwifiex_main_process()
415 if (adapter->hs_activated) { in mwifiex_main_process()
417 &adapter->work_flags); in mwifiex_main_process()
420 (adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_main_process()
425 if ((adapter->scan_chan_gap_enabled || in mwifiex_main_process()
426 !adapter->scan_processing) && in mwifiex_main_process()
427 !adapter->data_sent && in mwifiex_main_process()
428 !mwifiex_bypass_txlist_empty(adapter) && in mwifiex_main_process()
430 (mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA))) { in mwifiex_main_process()
431 if (adapter->hs_activated_manually) { in mwifiex_main_process()
432 mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_main_process()
434 adapter->hs_activated_manually = false; in mwifiex_main_process()
437 mwifiex_process_bypass_tx(adapter); in mwifiex_main_process()
438 if (adapter->hs_activated) { in mwifiex_main_process()
440 &adapter->work_flags); in mwifiex_main_process()
443 (adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_main_process()
448 if ((adapter->scan_chan_gap_enabled || in mwifiex_main_process()
449 !adapter->scan_processing) && in mwifiex_main_process()
450 !adapter->data_sent && !mwifiex_wmm_lists_empty(adapter) && in mwifiex_main_process()
452 (mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA))) { in mwifiex_main_process()
453 if (adapter->hs_activated_manually) { in mwifiex_main_process()
454 mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_main_process()
456 adapter->hs_activated_manually = false; in mwifiex_main_process()
459 mwifiex_wmm_process_tx(adapter); in mwifiex_main_process()
460 if (adapter->hs_activated) { in mwifiex_main_process()
462 &adapter->work_flags); in mwifiex_main_process()
465 (adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_main_process()
470 if (adapter->delay_null_pkt && !adapter->cmd_sent && in mwifiex_main_process()
471 !adapter->curr_cmd && !is_command_pending(adapter) && in mwifiex_main_process()
472 (mwifiex_wmm_lists_empty(adapter) && in mwifiex_main_process()
473 mwifiex_bypass_txlist_empty(adapter) && in mwifiex_main_process()
474 skb_queue_empty(&adapter->tx_data_q))) { in mwifiex_main_process()
476 (mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA), in mwifiex_main_process()
479 adapter->delay_null_pkt = false; in mwifiex_main_process()
480 adapter->ps_state = PS_STATE_SLEEP; in mwifiex_main_process()
486 spin_lock_irqsave(&adapter->main_proc_lock, flags); in mwifiex_main_process()
487 if (adapter->more_task_flag) { in mwifiex_main_process()
488 adapter->more_task_flag = false; in mwifiex_main_process()
489 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); in mwifiex_main_process()
492 adapter->mwifiex_processing = false; in mwifiex_main_process()
493 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); in mwifiex_main_process()
500 * This function frees the adapter structure.
505 static void mwifiex_free_adapter(struct mwifiex_adapter *adapter) in mwifiex_free_adapter() argument
507 if (!adapter) { in mwifiex_free_adapter()
508 pr_err("%s: adapter is NULL\n", __func__); in mwifiex_free_adapter()
512 mwifiex_unregister(adapter); in mwifiex_free_adapter()
513 pr_debug("info: %s: free adapter\n", __func__); in mwifiex_free_adapter()
520 static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter) in mwifiex_terminate_workqueue() argument
522 if (adapter->workqueue) { in mwifiex_terminate_workqueue()
523 destroy_workqueue(adapter->workqueue); in mwifiex_terminate_workqueue()
524 adapter->workqueue = NULL; in mwifiex_terminate_workqueue()
527 if (adapter->rx_workqueue) { in mwifiex_terminate_workqueue()
528 destroy_workqueue(adapter->rx_workqueue); in mwifiex_terminate_workqueue()
529 adapter->rx_workqueue = NULL; in mwifiex_terminate_workqueue()
532 if (adapter->host_mlme_workqueue) { in mwifiex_terminate_workqueue()
533 destroy_workqueue(adapter->host_mlme_workqueue); in mwifiex_terminate_workqueue()
534 adapter->host_mlme_workqueue = NULL; in mwifiex_terminate_workqueue()
549 struct mwifiex_adapter *adapter = context; in _mwifiex_fw_dpc() local
553 struct completion *fw_done = adapter->fw_done; in _mwifiex_fw_dpc()
556 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
557 "Failed to get firmware %s\n", adapter->fw_name); in _mwifiex_fw_dpc()
562 adapter->firmware = firmware; in _mwifiex_fw_dpc()
563 fw.fw_buf = (u8 *) adapter->firmware->data; in _mwifiex_fw_dpc()
564 fw.fw_len = adapter->firmware->size; in _mwifiex_fw_dpc()
566 if (adapter->if_ops.dnld_fw) { in _mwifiex_fw_dpc()
567 ret = adapter->if_ops.dnld_fw(adapter, &fw); in _mwifiex_fw_dpc()
569 ret = mwifiex_dnld_fw(adapter, &fw); in _mwifiex_fw_dpc()
575 mwifiex_dbg(adapter, MSG, "WLAN FW is active\n"); in _mwifiex_fw_dpc()
578 if ((request_firmware(&adapter->cal_data, cal_data_cfg, in _mwifiex_fw_dpc()
579 adapter->dev)) < 0) in _mwifiex_fw_dpc()
580 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
585 if (adapter->if_ops.enable_int) { in _mwifiex_fw_dpc()
586 if (adapter->if_ops.enable_int(adapter)) in _mwifiex_fw_dpc()
590 adapter->init_wait_q_woken = false; in _mwifiex_fw_dpc()
591 ret = mwifiex_init_fw(adapter); in _mwifiex_fw_dpc()
595 adapter->hw_status = MWIFIEX_HW_STATUS_READY; in _mwifiex_fw_dpc()
599 if (!adapter->mfg_mode) { in _mwifiex_fw_dpc()
600 wait_event_interruptible(adapter->init_wait_q, in _mwifiex_fw_dpc()
601 adapter->init_wait_q_woken); in _mwifiex_fw_dpc()
602 if (adapter->hw_status != MWIFIEX_HW_STATUS_READY) in _mwifiex_fw_dpc()
606 if (!adapter->wiphy) { in _mwifiex_fw_dpc()
607 if (mwifiex_register_cfg80211(adapter)) { in _mwifiex_fw_dpc()
608 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
614 if (mwifiex_init_channel_scan_gap(adapter)) { in _mwifiex_fw_dpc()
615 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
626 wiphy_lock(adapter->wiphy); in _mwifiex_fw_dpc()
628 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM, in _mwifiex_fw_dpc()
631 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
633 wiphy_unlock(adapter->wiphy); in _mwifiex_fw_dpc()
639 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM, in _mwifiex_fw_dpc()
642 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
644 wiphy_unlock(adapter->wiphy); in _mwifiex_fw_dpc()
651 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d", NET_NAME_ENUM, in _mwifiex_fw_dpc()
654 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
656 wiphy_unlock(adapter->wiphy); in _mwifiex_fw_dpc()
661 wiphy_unlock(adapter->wiphy); in _mwifiex_fw_dpc()
664 mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1); in _mwifiex_fw_dpc()
665 mwifiex_dbg(adapter, MSG, "driver_version = %s\n", fmt); in _mwifiex_fw_dpc()
666 adapter->is_up = true; in _mwifiex_fw_dpc()
670 vfree(adapter->chan_stats); in _mwifiex_fw_dpc()
672 wiphy_unregister(adapter->wiphy); in _mwifiex_fw_dpc()
673 wiphy_free(adapter->wiphy); in _mwifiex_fw_dpc()
675 if (adapter->if_ops.disable_int) in _mwifiex_fw_dpc()
676 adapter->if_ops.disable_int(adapter); in _mwifiex_fw_dpc()
678 mwifiex_dbg(adapter, ERROR, in _mwifiex_fw_dpc()
680 if (adapter->if_ops.unregister_dev) in _mwifiex_fw_dpc()
681 adapter->if_ops.unregister_dev(adapter); in _mwifiex_fw_dpc()
683 set_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); in _mwifiex_fw_dpc()
684 mwifiex_terminate_workqueue(adapter); in _mwifiex_fw_dpc()
686 if (adapter->hw_status == MWIFIEX_HW_STATUS_READY) { in _mwifiex_fw_dpc()
688 mwifiex_shutdown_drv(adapter); in _mwifiex_fw_dpc()
689 mwifiex_free_cmd_buffers(adapter); in _mwifiex_fw_dpc()
694 if (adapter->firmware) { in _mwifiex_fw_dpc()
695 release_firmware(adapter->firmware); in _mwifiex_fw_dpc()
696 adapter->firmware = NULL; in _mwifiex_fw_dpc()
699 if (adapter->irq_wakeup >= 0) in _mwifiex_fw_dpc()
700 device_init_wakeup(adapter->dev, false); in _mwifiex_fw_dpc()
701 mwifiex_free_adapter(adapter); in _mwifiex_fw_dpc()
718 static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter, in mwifiex_init_hw_fw() argument
727 strscpy(adapter->fw_name, MFG_FIRMWARE, in mwifiex_init_hw_fw()
728 sizeof(adapter->fw_name)); in mwifiex_init_hw_fw()
731 ret = request_firmware_nowait(THIS_MODULE, 1, adapter->fw_name, in mwifiex_init_hw_fw()
732 adapter->dev, GFP_KERNEL, adapter, in mwifiex_init_hw_fw()
735 ret = request_firmware(&adapter->firmware, in mwifiex_init_hw_fw()
736 adapter->fw_name, in mwifiex_init_hw_fw()
737 adapter->dev); in mwifiex_init_hw_fw()
741 mwifiex_dbg(adapter, ERROR, "request_firmware%s error %d\n", in mwifiex_init_hw_fw()
772 mwifiex_dbg(priv->adapter, INFO, in mwifiex_close()
780 mwifiex_dbg(priv->adapter, INFO, in mwifiex_close()
798 ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info) && in mwifiex_bypass_tx_queue()
800 mwifiex_dbg(priv->adapter, DATA, in mwifiex_bypass_tx_queue()
805 mwifiex_dbg(priv->adapter, MSG, in mwifiex_bypass_tx_queue()
825 mwifiex_dbg(priv->adapter, DATA, in mwifiex_queue_tx_pkt()
831 atomic_inc(&priv->adapter->tx_pending); in mwifiex_queue_tx_pkt()
832 atomic_inc(&priv->adapter->bypass_tx_pending); in mwifiex_queue_tx_pkt()
835 atomic_inc(&priv->adapter->tx_pending); in mwifiex_queue_tx_pkt()
839 mwifiex_queue_main_work(priv->adapter); in mwifiex_queue_tx_pkt()
896 mwifiex_dbg(priv->adapter, DATA, in mwifiex_hard_start_xmit()
900 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &priv->adapter->work_flags)) { in mwifiex_hard_start_xmit()
906 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_hard_start_xmit()
913 mwifiex_dbg(priv->adapter, DATA, in mwifiex_hard_start_xmit()
920 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_hard_start_xmit()
928 mwifiex_dbg(priv->adapter, INFO, in mwifiex_hard_start_xmit()
943 priv->adapter->fw_api_ver == MWIFIEX_FW_V15)) in mwifiex_hard_start_xmit()
957 if (ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info) && in mwifiex_hard_start_xmit()
960 if (priv->adapter->auto_tdls && priv->check_tdls_tx) in mwifiex_hard_start_xmit()
990 } else if (priv->adapter->priv[0] != priv) { in mwifiex_set_mac_address()
1005 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_set_mac_address()
1056 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_tx_timeout()
1063 priv->adapter->if_ops.card_reset) { in mwifiex_tx_timeout()
1064 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_tx_timeout()
1067 priv->adapter->if_ops.card_reset(priv->adapter); in mwifiex_tx_timeout()
1071 void mwifiex_multi_chan_resync(struct mwifiex_adapter *adapter) in mwifiex_multi_chan_resync() argument
1073 struct usb_card_rec *card = adapter->card; in mwifiex_multi_chan_resync()
1081 mwifiex_dbg(adapter, WARN, "pending data urb in sys\n"); in mwifiex_multi_chan_resync()
1088 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_multi_chan_resync()
1092 mwifiex_dbg(adapter, ERROR, in mwifiex_multi_chan_resync()
1097 void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter) in mwifiex_upload_device_dump() argument
1102 mwifiex_dbg(adapter, MSG, in mwifiex_upload_device_dump()
1104 dev_coredumpv(adapter->dev, adapter->devdump_data, adapter->devdump_len, in mwifiex_upload_device_dump()
1106 mwifiex_dbg(adapter, MSG, in mwifiex_upload_device_dump()
1110 * after 5 min. Here reset adapter->devdump_data and ->devdump_len in mwifiex_upload_device_dump()
1113 adapter->devdump_data = NULL; in mwifiex_upload_device_dump()
1114 adapter->devdump_len = 0; in mwifiex_upload_device_dump()
1118 void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter) in mwifiex_drv_info_dump() argument
1129 mwifiex_dbg(adapter, MSG, "===mwifiex driverinfo dump start===\n"); in mwifiex_drv_info_dump()
1131 p = adapter->devdump_data; in mwifiex_drv_info_dump()
1136 mwifiex_drv_get_driver_version(adapter, drv_version, in mwifiex_drv_info_dump()
1140 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_drv_info_dump()
1141 cardp = (struct usb_card_rec *)adapter->card; in mwifiex_drv_info_dump()
1155 atomic_read(&adapter->tx_pending)); in mwifiex_drv_info_dump()
1157 atomic_read(&adapter->rx_pending)); in mwifiex_drv_info_dump()
1159 if (adapter->iface_type == MWIFIEX_SDIO) { in mwifiex_drv_info_dump()
1160 sdio_card = (struct sdio_mmc_card *)adapter->card; in mwifiex_drv_info_dump()
1167 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_drv_info_dump()
1168 if (!adapter->priv[i]->netdev) in mwifiex_drv_info_dump()
1170 priv = adapter->priv[i]; in mwifiex_drv_info_dump()
1195 if (adapter->iface_type == MWIFIEX_SDIO || in mwifiex_drv_info_dump()
1196 adapter->iface_type == MWIFIEX_PCIE) { in mwifiex_drv_info_dump()
1198 adapter->iface_type == MWIFIEX_SDIO ? in mwifiex_drv_info_dump()
1200 if (adapter->if_ops.reg_dump) in mwifiex_drv_info_dump()
1201 p += adapter->if_ops.reg_dump(adapter, p); in mwifiex_drv_info_dump()
1206 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_drv_info_dump()
1207 if (!adapter->priv[i]->netdev) in mwifiex_drv_info_dump()
1209 priv = adapter->priv[i]; in mwifiex_drv_info_dump()
1219 mwifiex_dbg(adapter, MSG, "===mwifiex driverinfo dump end===\n"); in mwifiex_drv_info_dump()
1220 adapter->devdump_len = p - (char *)adapter->devdump_data; in mwifiex_drv_info_dump()
1224 void mwifiex_prepare_fw_dump_info(struct mwifiex_adapter *adapter) in mwifiex_prepare_fw_dump_info() argument
1230 for (idx = 0; idx < adapter->num_mem_types; idx++) { in mwifiex_prepare_fw_dump_info()
1232 &adapter->mem_type_mapping_tbl[idx]; in mwifiex_prepare_fw_dump_info()
1243 if (dump_len + 1 + adapter->devdump_len > MWIFIEX_FW_DUMP_SIZE) { in mwifiex_prepare_fw_dump_info()
1245 fw_dump_ptr = vzalloc(dump_len + 1 + adapter->devdump_len); in mwifiex_prepare_fw_dump_info()
1246 mwifiex_dbg(adapter, MSG, "Realloc device dump data.\n"); in mwifiex_prepare_fw_dump_info()
1248 vfree(adapter->devdump_data); in mwifiex_prepare_fw_dump_info()
1249 mwifiex_dbg(adapter, ERROR, in mwifiex_prepare_fw_dump_info()
1254 memmove(fw_dump_ptr, adapter->devdump_data, in mwifiex_prepare_fw_dump_info()
1255 adapter->devdump_len); in mwifiex_prepare_fw_dump_info()
1256 vfree(adapter->devdump_data); in mwifiex_prepare_fw_dump_info()
1257 adapter->devdump_data = fw_dump_ptr; in mwifiex_prepare_fw_dump_info()
1260 fw_dump_ptr = (char *)adapter->devdump_data + adapter->devdump_len; in mwifiex_prepare_fw_dump_info()
1262 for (idx = 0; idx < adapter->num_mem_types; idx++) { in mwifiex_prepare_fw_dump_info()
1264 &adapter->mem_type_mapping_tbl[idx]; in mwifiex_prepare_fw_dump_info()
1284 adapter->devdump_len = fw_dump_ptr - (char *)adapter->devdump_data; in mwifiex_prepare_fw_dump_info()
1286 for (idx = 0; idx < adapter->num_mem_types; idx++) { in mwifiex_prepare_fw_dump_info()
1288 &adapter->mem_type_mapping_tbl[idx]; in mwifiex_prepare_fw_dump_info()
1366 ether_addr_copy(priv->curr_addr, priv->adapter->perm_addr); in mwifiex_init_priv_params()
1379 int is_command_pending(struct mwifiex_adapter *adapter) in is_command_pending() argument
1383 spin_lock_bh(&adapter->cmd_pending_q_lock); in is_command_pending()
1384 is_cmd_pend_q_empty = list_empty(&adapter->cmd_pending_q); in is_command_pending()
1385 spin_unlock_bh(&adapter->cmd_pending_q_lock); in is_command_pending()
1395 struct mwifiex_adapter *adapter = in mwifiex_host_mlme_work_queue() local
1398 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags)) in mwifiex_host_mlme_work_queue()
1402 if (adapter->host_mlme_link_lost) { in mwifiex_host_mlme_work_queue()
1403 if (adapter->priv_link_lost) { in mwifiex_host_mlme_work_queue()
1404 mwifiex_reset_connect_state(adapter->priv_link_lost, in mwifiex_host_mlme_work_queue()
1407 adapter->priv_link_lost = NULL; in mwifiex_host_mlme_work_queue()
1409 adapter->host_mlme_link_lost = false; in mwifiex_host_mlme_work_queue()
1413 if (adapter->assoc_resp_received) { in mwifiex_host_mlme_work_queue()
1414 mwifiex_process_assoc_resp(adapter); in mwifiex_host_mlme_work_queue()
1415 adapter->assoc_resp_received = false; in mwifiex_host_mlme_work_queue()
1426 struct mwifiex_adapter *adapter = in mwifiex_rx_work_queue() local
1429 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags)) in mwifiex_rx_work_queue()
1431 mwifiex_process_rx(adapter); in mwifiex_rx_work_queue()
1442 struct mwifiex_adapter *adapter = in mwifiex_main_work_queue() local
1445 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags)) in mwifiex_main_work_queue()
1447 mwifiex_main_process(adapter); in mwifiex_main_work_queue()
1451 static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter) in mwifiex_uninit_sw() argument
1459 if (adapter->if_ops.disable_int) in mwifiex_uninit_sw()
1460 adapter->if_ops.disable_int(adapter); in mwifiex_uninit_sw()
1462 set_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); in mwifiex_uninit_sw()
1463 mwifiex_terminate_workqueue(adapter); in mwifiex_uninit_sw()
1464 adapter->int_status = 0; in mwifiex_uninit_sw()
1467 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_uninit_sw()
1468 priv = adapter->priv[i]; in mwifiex_uninit_sw()
1470 mwifiex_stop_net_dev_queue(priv->netdev, adapter); in mwifiex_uninit_sw()
1477 mwifiex_dbg(adapter, CMD, "cmd: calling mwifiex_shutdown_drv...\n"); in mwifiex_uninit_sw()
1478 mwifiex_shutdown_drv(adapter); in mwifiex_uninit_sw()
1479 mwifiex_dbg(adapter, CMD, "cmd: mwifiex_shutdown_drv done\n"); in mwifiex_uninit_sw()
1481 if (atomic_read(&adapter->rx_pending) || in mwifiex_uninit_sw()
1482 atomic_read(&adapter->tx_pending) || in mwifiex_uninit_sw()
1483 atomic_read(&adapter->cmd_pending)) { in mwifiex_uninit_sw()
1484 mwifiex_dbg(adapter, ERROR, in mwifiex_uninit_sw()
1487 atomic_read(&adapter->rx_pending), in mwifiex_uninit_sw()
1488 atomic_read(&adapter->tx_pending), in mwifiex_uninit_sw()
1489 atomic_read(&adapter->cmd_pending)); in mwifiex_uninit_sw()
1492 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_uninit_sw()
1493 priv = adapter->priv[i]; in mwifiex_uninit_sw()
1503 wiphy_lock(adapter->wiphy); in mwifiex_uninit_sw()
1504 mwifiex_del_virtual_intf(adapter->wiphy, &priv->wdev); in mwifiex_uninit_sw()
1505 wiphy_unlock(adapter->wiphy); in mwifiex_uninit_sw()
1510 wiphy_unregister(adapter->wiphy); in mwifiex_uninit_sw()
1511 wiphy_free(adapter->wiphy); in mwifiex_uninit_sw()
1512 adapter->wiphy = NULL; in mwifiex_uninit_sw()
1514 vfree(adapter->chan_stats); in mwifiex_uninit_sw()
1515 mwifiex_free_cmd_buffers(adapter); in mwifiex_uninit_sw()
1519 * This function can be used for shutting down the adapter SW.
1521 int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) in mwifiex_shutdown_sw() argument
1525 if (!adapter) in mwifiex_shutdown_sw()
1528 wait_for_completion(adapter->fw_done); in mwifiex_shutdown_sw()
1530 reinit_completion(adapter->fw_done); in mwifiex_shutdown_sw()
1532 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_shutdown_sw()
1537 mwifiex_uninit_sw(adapter); in mwifiex_shutdown_sw()
1538 adapter->is_up = false; in mwifiex_shutdown_sw()
1540 if (adapter->if_ops.down_dev) in mwifiex_shutdown_sw()
1541 adapter->if_ops.down_dev(adapter); in mwifiex_shutdown_sw()
1547 /* This function can be used for reinitting the adapter SW. Required
1551 mwifiex_reinit_sw(struct mwifiex_adapter *adapter) in mwifiex_reinit_sw() argument
1555 mwifiex_init_lock_list(adapter); in mwifiex_reinit_sw()
1556 if (adapter->if_ops.up_dev) in mwifiex_reinit_sw()
1557 adapter->if_ops.up_dev(adapter); in mwifiex_reinit_sw()
1559 adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING; in mwifiex_reinit_sw()
1560 clear_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); in mwifiex_reinit_sw()
1561 init_waitqueue_head(&adapter->init_wait_q); in mwifiex_reinit_sw()
1562 clear_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags); in mwifiex_reinit_sw()
1563 adapter->hs_activated = false; in mwifiex_reinit_sw()
1564 clear_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags); in mwifiex_reinit_sw()
1565 init_waitqueue_head(&adapter->hs_activate_wait_q); in mwifiex_reinit_sw()
1566 init_waitqueue_head(&adapter->cmd_wait_q.wait); in mwifiex_reinit_sw()
1567 adapter->cmd_wait_q.status = 0; in mwifiex_reinit_sw()
1568 adapter->scan_wait_q_woken = false; in mwifiex_reinit_sw()
1570 if ((num_possible_cpus() > 1) || adapter->iface_type == MWIFIEX_USB) in mwifiex_reinit_sw()
1571 adapter->rx_work_enabled = true; in mwifiex_reinit_sw()
1573 adapter->workqueue = in mwifiex_reinit_sw()
1576 if (!adapter->workqueue) in mwifiex_reinit_sw()
1579 INIT_WORK(&adapter->main_work, mwifiex_main_work_queue); in mwifiex_reinit_sw()
1581 if (adapter->rx_work_enabled) { in mwifiex_reinit_sw()
1582 adapter->rx_workqueue = alloc_workqueue("MWIFIEX_RX_WORK_QUEUE", in mwifiex_reinit_sw()
1586 if (!adapter->rx_workqueue) in mwifiex_reinit_sw()
1588 INIT_WORK(&adapter->rx_work, mwifiex_rx_work_queue); in mwifiex_reinit_sw()
1591 if (adapter->host_mlme_enabled) { in mwifiex_reinit_sw()
1592 adapter->host_mlme_workqueue = in mwifiex_reinit_sw()
1597 if (!adapter->host_mlme_workqueue) in mwifiex_reinit_sw()
1599 INIT_WORK(&adapter->host_mlme_work, in mwifiex_reinit_sw()
1607 mwifiex_dbg(adapter, INFO, "%s, mwifiex_init_hw_fw()...\n", __func__); in mwifiex_reinit_sw()
1609 if (mwifiex_init_hw_fw(adapter, false)) { in mwifiex_reinit_sw()
1610 mwifiex_dbg(adapter, ERROR, in mwifiex_reinit_sw()
1616 ret = _mwifiex_fw_dpc(adapter->firmware, adapter); in mwifiex_reinit_sw()
1618 pr_err("Failed to bring up adapter: %d\n", ret); in mwifiex_reinit_sw()
1621 mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__); in mwifiex_reinit_sw()
1626 mwifiex_dbg(adapter, ERROR, "info: %s: unregister device\n", __func__); in mwifiex_reinit_sw()
1627 if (adapter->if_ops.unregister_dev) in mwifiex_reinit_sw()
1628 adapter->if_ops.unregister_dev(adapter); in mwifiex_reinit_sw()
1631 set_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); in mwifiex_reinit_sw()
1632 mwifiex_terminate_workqueue(adapter); in mwifiex_reinit_sw()
1633 if (adapter->hw_status == MWIFIEX_HW_STATUS_READY) { in mwifiex_reinit_sw()
1634 mwifiex_dbg(adapter, ERROR, in mwifiex_reinit_sw()
1636 mwifiex_shutdown_drv(adapter); in mwifiex_reinit_sw()
1637 mwifiex_free_cmd_buffers(adapter); in mwifiex_reinit_sw()
1640 complete_all(adapter->fw_done); in mwifiex_reinit_sw()
1641 mwifiex_dbg(adapter, INFO, "%s, error\n", __func__); in mwifiex_reinit_sw()
1649 struct mwifiex_adapter *adapter = priv; in mwifiex_irq_wakeup_handler() local
1651 dev_dbg(adapter->dev, "%s: wake by wifi", __func__); in mwifiex_irq_wakeup_handler()
1652 adapter->wake_by_wifi = true; in mwifiex_irq_wakeup_handler()
1656 pm_wakeup_event(adapter->dev, 0); in mwifiex_irq_wakeup_handler()
1662 static void mwifiex_probe_of(struct mwifiex_adapter *adapter) in mwifiex_probe_of() argument
1665 struct device *dev = adapter->dev; in mwifiex_probe_of()
1670 adapter->dt_node = dev->of_node; in mwifiex_probe_of()
1671 adapter->irq_wakeup = irq_of_parse_and_map(adapter->dt_node, 0); in mwifiex_probe_of()
1672 if (!adapter->irq_wakeup) { in mwifiex_probe_of()
1677 ret = devm_request_irq(dev, adapter->irq_wakeup, in mwifiex_probe_of()
1680 "wifi_wake", adapter); in mwifiex_probe_of()
1683 adapter->irq_wakeup, ret); in mwifiex_probe_of()
1694 adapter->irq_wakeup = -1; in mwifiex_probe_of()
1703 * adapter structure
1715 struct mwifiex_adapter *adapter; in mwifiex_add_card() local
1717 if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) { in mwifiex_add_card()
1722 mwifiex_probe_of(adapter); in mwifiex_add_card()
1724 adapter->iface_type = iface_type; in mwifiex_add_card()
1725 adapter->fw_done = fw_done; in mwifiex_add_card()
1727 adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING; in mwifiex_add_card()
1728 clear_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); in mwifiex_add_card()
1729 init_waitqueue_head(&adapter->init_wait_q); in mwifiex_add_card()
1730 clear_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags); in mwifiex_add_card()
1731 adapter->hs_activated = false; in mwifiex_add_card()
1732 init_waitqueue_head(&adapter->hs_activate_wait_q); in mwifiex_add_card()
1733 init_waitqueue_head(&adapter->cmd_wait_q.wait); in mwifiex_add_card()
1734 adapter->cmd_wait_q.status = 0; in mwifiex_add_card()
1735 adapter->scan_wait_q_woken = false; in mwifiex_add_card()
1737 if ((num_possible_cpus() > 1) || adapter->iface_type == MWIFIEX_USB) in mwifiex_add_card()
1738 adapter->rx_work_enabled = true; in mwifiex_add_card()
1740 adapter->workqueue = in mwifiex_add_card()
1743 if (!adapter->workqueue) in mwifiex_add_card()
1746 INIT_WORK(&adapter->main_work, mwifiex_main_work_queue); in mwifiex_add_card()
1748 if (adapter->rx_work_enabled) { in mwifiex_add_card()
1749 adapter->rx_workqueue = alloc_workqueue("MWIFIEX_RX_WORK_QUEUE", in mwifiex_add_card()
1753 if (!adapter->rx_workqueue) in mwifiex_add_card()
1756 INIT_WORK(&adapter->rx_work, mwifiex_rx_work_queue); in mwifiex_add_card()
1761 if (adapter->if_ops.register_dev(adapter)) { in mwifiex_add_card()
1766 if (adapter->host_mlme_enabled) { in mwifiex_add_card()
1767 adapter->host_mlme_workqueue = in mwifiex_add_card()
1772 if (!adapter->host_mlme_workqueue) in mwifiex_add_card()
1774 INIT_WORK(&adapter->host_mlme_work, in mwifiex_add_card()
1778 if (mwifiex_init_hw_fw(adapter, true)) { in mwifiex_add_card()
1787 if (adapter->if_ops.unregister_dev) in mwifiex_add_card()
1788 adapter->if_ops.unregister_dev(adapter); in mwifiex_add_card()
1790 set_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags); in mwifiex_add_card()
1791 mwifiex_terminate_workqueue(adapter); in mwifiex_add_card()
1792 if (adapter->hw_status == MWIFIEX_HW_STATUS_READY) { in mwifiex_add_card()
1794 mwifiex_shutdown_drv(adapter); in mwifiex_add_card()
1795 mwifiex_free_cmd_buffers(adapter); in mwifiex_add_card()
1798 if (adapter->irq_wakeup >= 0) in mwifiex_add_card()
1799 device_init_wakeup(adapter->dev, false); in mwifiex_add_card()
1800 mwifiex_free_adapter(adapter); in mwifiex_add_card()
1817 * - Free the adapter structure
1819 int mwifiex_remove_card(struct mwifiex_adapter *adapter) in mwifiex_remove_card() argument
1821 if (!adapter) in mwifiex_remove_card()
1824 if (adapter->is_up) in mwifiex_remove_card()
1825 mwifiex_uninit_sw(adapter); in mwifiex_remove_card()
1827 if (adapter->irq_wakeup >= 0) in mwifiex_remove_card()
1828 device_init_wakeup(adapter->dev, false); in mwifiex_remove_card()
1831 mwifiex_dbg(adapter, INFO, in mwifiex_remove_card()
1833 if (adapter->if_ops.unregister_dev) in mwifiex_remove_card()
1834 adapter->if_ops.unregister_dev(adapter); in mwifiex_remove_card()
1835 /* Free adapter structure */ in mwifiex_remove_card()
1836 mwifiex_dbg(adapter, INFO, in mwifiex_remove_card()
1837 "info: free adapter\n"); in mwifiex_remove_card()
1838 mwifiex_free_adapter(adapter); in mwifiex_remove_card()
1844 void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask, in _mwifiex_dbg() argument
1850 if (!(adapter->debug_mask & mask)) in _mwifiex_dbg()
1858 if (adapter->dev) in _mwifiex_dbg()
1859 dev_info(adapter->dev, "%pV", &vaf); in _mwifiex_dbg()