• Home
  • Raw
  • Download

Lines Matching refs:adapter

58 mwifiex_get_cmd_node(struct mwifiex_adapter *adapter)  in mwifiex_get_cmd_node()  argument
63 spin_lock_irqsave(&adapter->cmd_free_q_lock, flags); in mwifiex_get_cmd_node()
64 if (list_empty(&adapter->cmd_free_q)) { in mwifiex_get_cmd_node()
65 mwifiex_dbg(adapter, ERROR, in mwifiex_get_cmd_node()
67 spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); in mwifiex_get_cmd_node()
70 cmd_node = list_first_entry(&adapter->cmd_free_q, in mwifiex_get_cmd_node()
73 spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); in mwifiex_get_cmd_node()
90 mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter, in mwifiex_clean_cmd_node() argument
102 adapter->if_ops.cmdrsp_complete(adapter, cmd_node->resp_skb); in mwifiex_clean_cmd_node()
114 mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter, in mwifiex_insert_cmd_to_free_q() argument
123 mwifiex_complete_cmd(adapter, cmd_node); in mwifiex_insert_cmd_to_free_q()
125 mwifiex_clean_cmd_node(adapter, cmd_node); in mwifiex_insert_cmd_to_free_q()
128 spin_lock_irqsave(&adapter->cmd_free_q_lock, flags); in mwifiex_insert_cmd_to_free_q()
129 list_add_tail(&cmd_node->list, &adapter->cmd_free_q); in mwifiex_insert_cmd_to_free_q()
130 spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); in mwifiex_insert_cmd_to_free_q()
134 void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter, in mwifiex_recycle_cmd_node() argument
139 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_recycle_cmd_node()
141 atomic_dec(&adapter->cmd_pending); in mwifiex_recycle_cmd_node()
142 mwifiex_dbg(adapter, CMD, in mwifiex_recycle_cmd_node()
145 atomic_read(&adapter->cmd_pending)); in mwifiex_recycle_cmd_node()
161 mwifiex_dbg(priv->adapter, CMD, in mwifiex_cmd_host_cmd()
178 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_dnld_cmd_to_fw() local
186 if (!adapter || !cmd_node) in mwifiex_dnld_cmd_to_fw()
193 mwifiex_dbg(adapter, ERROR, in mwifiex_dnld_cmd_to_fw()
197 adapter->cmd_wait_q.status = -1; in mwifiex_dnld_cmd_to_fw()
198 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_dnld_cmd_to_fw()
205 if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET && in mwifiex_dnld_cmd_to_fw()
208 mwifiex_dbg(adapter, ERROR, in mwifiex_dnld_cmd_to_fw()
211 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_dnld_cmd_to_fw()
212 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_dnld_cmd_to_fw()
217 adapter->seq_num++; in mwifiex_dnld_cmd_to_fw()
219 (adapter->seq_num, in mwifiex_dnld_cmd_to_fw()
223 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); in mwifiex_dnld_cmd_to_fw()
224 adapter->curr_cmd = cmd_node; in mwifiex_dnld_cmd_to_fw()
225 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); in mwifiex_dnld_cmd_to_fw()
242 mwifiex_dbg(adapter, CMD, in mwifiex_dnld_cmd_to_fw()
247 mwifiex_dbg_dump(adapter, CMD_D, "cmd buffer:", host_cmd, cmd_size); in mwifiex_dnld_cmd_to_fw()
249 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_dnld_cmd_to_fw()
253 adapter->cmd_sent = true; in mwifiex_dnld_cmd_to_fw()
254 ret = adapter->if_ops.host_to_card(adapter, in mwifiex_dnld_cmd_to_fw()
262 ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, in mwifiex_dnld_cmd_to_fw()
268 mwifiex_dbg(adapter, ERROR, in mwifiex_dnld_cmd_to_fw()
270 if (adapter->iface_type == MWIFIEX_USB) in mwifiex_dnld_cmd_to_fw()
271 adapter->cmd_sent = false; in mwifiex_dnld_cmd_to_fw()
273 adapter->cmd_wait_q.status = -1; in mwifiex_dnld_cmd_to_fw()
274 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_dnld_cmd_to_fw()
276 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); in mwifiex_dnld_cmd_to_fw()
277 adapter->curr_cmd = NULL; in mwifiex_dnld_cmd_to_fw()
278 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); in mwifiex_dnld_cmd_to_fw()
280 adapter->dbg.num_cmd_host_to_card_failure++; in mwifiex_dnld_cmd_to_fw()
285 adapter->dbg.last_cmd_index = in mwifiex_dnld_cmd_to_fw()
286 (adapter->dbg.last_cmd_index + 1) % DBG_CMD_NUM; in mwifiex_dnld_cmd_to_fw()
287 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index] = cmd_code; in mwifiex_dnld_cmd_to_fw()
288 adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] = in mwifiex_dnld_cmd_to_fw()
295 mod_timer(&adapter->cmd_timer, in mwifiex_dnld_cmd_to_fw()
310 static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) in mwifiex_dnld_sleep_confirm_cmd() argument
316 adapter->sleep_cfm->data; in mwifiex_dnld_sleep_confirm_cmd()
320 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_dnld_sleep_confirm_cmd()
322 adapter->seq_num++; in mwifiex_dnld_sleep_confirm_cmd()
325 (adapter->seq_num, priv->bss_num, in mwifiex_dnld_sleep_confirm_cmd()
328 mwifiex_dbg(adapter, CMD, in mwifiex_dnld_sleep_confirm_cmd()
334 mwifiex_dbg_dump(adapter, CMD_D, "SLEEP_CFM buffer: ", sleep_cfm_buf, in mwifiex_dnld_sleep_confirm_cmd()
337 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_dnld_sleep_confirm_cmd()
346 adapter->sleep_cfm->data, in mwifiex_dnld_sleep_confirm_cmd()
348 ret = adapter->if_ops.host_to_card(adapter, in mwifiex_dnld_sleep_confirm_cmd()
354 skb_push(adapter->sleep_cfm, INTF_HEADER_LEN); in mwifiex_dnld_sleep_confirm_cmd()
355 ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, in mwifiex_dnld_sleep_confirm_cmd()
356 adapter->sleep_cfm, NULL); in mwifiex_dnld_sleep_confirm_cmd()
357 skb_pull(adapter->sleep_cfm, INTF_HEADER_LEN); in mwifiex_dnld_sleep_confirm_cmd()
361 mwifiex_dbg(adapter, ERROR, "SLEEP_CFM: failed\n"); in mwifiex_dnld_sleep_confirm_cmd()
362 adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure++; in mwifiex_dnld_sleep_confirm_cmd()
368 adapter->ps_state = PS_STATE_SLEEP; in mwifiex_dnld_sleep_confirm_cmd()
370 adapter->ps_state = PS_STATE_SLEEP_CFM; in mwifiex_dnld_sleep_confirm_cmd()
373 (adapter->is_hs_configured && in mwifiex_dnld_sleep_confirm_cmd()
374 !adapter->sleep_period.period)) { in mwifiex_dnld_sleep_confirm_cmd()
375 adapter->pm_wakeup_card_req = true; in mwifiex_dnld_sleep_confirm_cmd()
377 (adapter, MWIFIEX_BSS_ROLE_ANY), true); in mwifiex_dnld_sleep_confirm_cmd()
395 int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter) in mwifiex_alloc_cmd_buffer() argument
406 adapter->cmd_pool = cmd_array; in mwifiex_alloc_cmd_buffer()
412 mwifiex_dbg(adapter, ERROR, in mwifiex_alloc_cmd_buffer()
419 mwifiex_insert_cmd_to_free_q(adapter, &cmd_array[i]); in mwifiex_alloc_cmd_buffer()
430 int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter) in mwifiex_free_cmd_buffer() argument
436 if (!adapter->cmd_pool) { in mwifiex_free_cmd_buffer()
437 mwifiex_dbg(adapter, FATAL, in mwifiex_free_cmd_buffer()
442 cmd_array = adapter->cmd_pool; in mwifiex_free_cmd_buffer()
447 mwifiex_dbg(adapter, CMD, in mwifiex_free_cmd_buffer()
454 if (adapter->iface_type == MWIFIEX_USB) in mwifiex_free_cmd_buffer()
455 adapter->if_ops.cmdrsp_complete(adapter, in mwifiex_free_cmd_buffer()
461 if (adapter->cmd_pool) { in mwifiex_free_cmd_buffer()
462 mwifiex_dbg(adapter, CMD, in mwifiex_free_cmd_buffer()
464 kfree(adapter->cmd_pool); in mwifiex_free_cmd_buffer()
465 adapter->cmd_pool = NULL; in mwifiex_free_cmd_buffer()
481 int mwifiex_process_event(struct mwifiex_adapter *adapter) in mwifiex_process_event() argument
485 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_process_event()
486 struct sk_buff *skb = adapter->event_skb; in mwifiex_process_event()
490 if ((adapter->event_cause & EVENT_ID_MASK) == EVENT_RADAR_DETECTED) { in mwifiex_process_event()
491 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_process_event()
492 priv = adapter->priv[i]; in mwifiex_process_event()
494 adapter->event_cause |= in mwifiex_process_event()
502 eventcause = adapter->event_cause; in mwifiex_process_event()
505 adapter->dbg.last_event_index = in mwifiex_process_event()
506 (adapter->dbg.last_event_index + 1) % DBG_CMD_NUM; in mwifiex_process_event()
507 adapter->dbg.last_event[adapter->dbg.last_event_index] = in mwifiex_process_event()
511 priv = mwifiex_get_priv_by_id(adapter, EVENT_GET_BSS_NUM(eventcause), in mwifiex_process_event()
514 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_process_event()
518 adapter->event_cause = eventcause; in mwifiex_process_event()
525 mwifiex_dbg_dump(adapter, EVT_D, "Event Buf:", in mwifiex_process_event()
529 mwifiex_dbg(adapter, EVENT, "EVENT: cause: %#x\n", eventcause); in mwifiex_process_event()
536 adapter->event_cause = 0; in mwifiex_process_event()
537 adapter->event_skb = NULL; in mwifiex_process_event()
538 adapter->if_ops.event_complete(adapter, skb); in mwifiex_process_event()
558 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_send_cmd() local
562 if (!adapter) { in mwifiex_send_cmd()
567 if (adapter->is_suspended) { in mwifiex_send_cmd()
568 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
573 if (adapter->hs_enabling && cmd_no != HostCmd_CMD_802_11_HS_CFG_ENH) { in mwifiex_send_cmd()
574 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
579 if (adapter->surprise_removed) { in mwifiex_send_cmd()
580 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
585 if (adapter->is_cmd_timedout) { in mwifiex_send_cmd()
586 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
591 if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET) { in mwifiex_send_cmd()
593 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
601 if (adapter->mfg_mode && cmd_no) { in mwifiex_send_cmd()
602 dev_dbg(adapter->dev, "Ignoring commands in manufacturing mode\n"); in mwifiex_send_cmd()
608 cmd_node = mwifiex_get_cmd_node(adapter); in mwifiex_send_cmd()
611 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
620 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
658 mwifiex_dbg(adapter, ERROR, in mwifiex_send_cmd()
661 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_send_cmd()
670 mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, true); in mwifiex_send_cmd()
671 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_send_cmd()
673 ret = mwifiex_wait_queue_complete(adapter, cmd_node); in mwifiex_send_cmd()
687 mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, in mwifiex_insert_cmd_to_pending_q() argument
696 mwifiex_dbg(adapter, ERROR, "QUEUE_CMD: host_cmd is NULL\n"); in mwifiex_insert_cmd_to_pending_q()
708 if (adapter->ps_state != PS_STATE_AWAKE) in mwifiex_insert_cmd_to_pending_q()
713 spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); in mwifiex_insert_cmd_to_pending_q()
715 list_add_tail(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
717 list_add(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
718 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); in mwifiex_insert_cmd_to_pending_q()
720 atomic_inc(&adapter->cmd_pending); in mwifiex_insert_cmd_to_pending_q()
721 mwifiex_dbg(adapter, CMD, in mwifiex_insert_cmd_to_pending_q()
723 command, atomic_read(&adapter->cmd_pending)); in mwifiex_insert_cmd_to_pending_q()
737 int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter) in mwifiex_exec_next_cmd() argument
747 if (adapter->curr_cmd) { in mwifiex_exec_next_cmd()
748 mwifiex_dbg(adapter, FATAL, in mwifiex_exec_next_cmd()
753 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_exec_next_cmd()
755 spin_lock_irqsave(&adapter->cmd_pending_q_lock, cmd_pending_q_flags); in mwifiex_exec_next_cmd()
756 if (list_empty(&adapter->cmd_pending_q)) { in mwifiex_exec_next_cmd()
757 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, in mwifiex_exec_next_cmd()
759 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_exec_next_cmd()
762 cmd_node = list_first_entry(&adapter->cmd_pending_q, in mwifiex_exec_next_cmd()
764 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, in mwifiex_exec_next_cmd()
770 if (adapter->ps_state != PS_STATE_AWAKE) { in mwifiex_exec_next_cmd()
771 mwifiex_dbg(adapter, ERROR, in mwifiex_exec_next_cmd()
774 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_exec_next_cmd()
778 spin_lock_irqsave(&adapter->cmd_pending_q_lock, cmd_pending_q_flags); in mwifiex_exec_next_cmd()
780 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, in mwifiex_exec_next_cmd()
783 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_exec_next_cmd()
785 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_exec_next_cmd()
792 if (adapter->hs_activated) { in mwifiex_exec_next_cmd()
793 adapter->is_hs_configured = false; in mwifiex_exec_next_cmd()
807 int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) in mwifiex_process_cmdresp() argument
811 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_process_cmdresp()
819 del_timer_sync(&adapter->cmd_timer); in mwifiex_process_cmdresp()
821 if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) { in mwifiex_process_cmdresp()
822 resp = (struct host_cmd_ds_command *) adapter->upld_buf; in mwifiex_process_cmdresp()
823 mwifiex_dbg(adapter, ERROR, in mwifiex_process_cmdresp()
829 adapter->is_cmd_timedout = 0; in mwifiex_process_cmdresp()
831 resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data; in mwifiex_process_cmdresp()
832 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { in mwifiex_process_cmdresp()
836 mwifiex_dbg(adapter, INFO, in mwifiex_process_cmdresp()
839 if (adapter->curr_cmd->data_buf) { in mwifiex_process_cmdresp()
840 hostcmd = adapter->curr_cmd->data_buf; in mwifiex_process_cmdresp()
848 priv = mwifiex_get_priv_by_id(adapter, in mwifiex_process_cmdresp()
852 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_process_cmdresp()
860 adapter->dbg.last_cmd_resp_index = in mwifiex_process_cmdresp()
861 (adapter->dbg.last_cmd_resp_index + 1) % DBG_CMD_NUM; in mwifiex_process_cmdresp()
862 adapter->dbg.last_cmd_resp_id[adapter->dbg.last_cmd_resp_index] = in mwifiex_process_cmdresp()
865 mwifiex_dbg(adapter, CMD, in mwifiex_process_cmdresp()
869 mwifiex_dbg_dump(adapter, CMD_D, "CMD_RESP buffer:", resp, in mwifiex_process_cmdresp()
873 mwifiex_dbg(adapter, ERROR, "CMD_RESP: invalid cmd resp\n"); in mwifiex_process_cmdresp()
874 if (adapter->curr_cmd->wait_q_enabled) in mwifiex_process_cmdresp()
875 adapter->cmd_wait_q.status = -1; in mwifiex_process_cmdresp()
877 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_process_cmdresp()
878 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); in mwifiex_process_cmdresp()
879 adapter->curr_cmd = NULL; in mwifiex_process_cmdresp()
880 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); in mwifiex_process_cmdresp()
884 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { in mwifiex_process_cmdresp()
885 adapter->curr_cmd->cmd_flag &= ~CMD_F_HOSTCMD; in mwifiex_process_cmdresp()
895 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { in mwifiex_process_cmdresp()
897 mwifiex_dbg(adapter, ERROR, in mwifiex_process_cmdresp()
900 mwifiex_init_fw_complete(adapter); in mwifiex_process_cmdresp()
902 } else if (adapter->last_init_cmd == cmdresp_no) in mwifiex_process_cmdresp()
903 adapter->hw_status = MWIFIEX_HW_STATUS_INIT_DONE; in mwifiex_process_cmdresp()
906 if (adapter->curr_cmd) { in mwifiex_process_cmdresp()
907 if (adapter->curr_cmd->wait_q_enabled) in mwifiex_process_cmdresp()
908 adapter->cmd_wait_q.status = ret; in mwifiex_process_cmdresp()
910 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_process_cmdresp()
912 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); in mwifiex_process_cmdresp()
913 adapter->curr_cmd = NULL; in mwifiex_process_cmdresp()
914 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); in mwifiex_process_cmdresp()
928 struct mwifiex_adapter *adapter = in mwifiex_cmd_timeout_func() local
932 adapter->is_cmd_timedout = 1; in mwifiex_cmd_timeout_func()
933 if (!adapter->curr_cmd) { in mwifiex_cmd_timeout_func()
934 mwifiex_dbg(adapter, ERROR, in mwifiex_cmd_timeout_func()
938 cmd_node = adapter->curr_cmd; in mwifiex_cmd_timeout_func()
940 adapter->dbg.timeout_cmd_id = in mwifiex_cmd_timeout_func()
941 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; in mwifiex_cmd_timeout_func()
942 adapter->dbg.timeout_cmd_act = in mwifiex_cmd_timeout_func()
943 adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index]; in mwifiex_cmd_timeout_func()
944 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
946 adapter->dbg.timeout_cmd_id, in mwifiex_cmd_timeout_func()
947 adapter->dbg.timeout_cmd_act); in mwifiex_cmd_timeout_func()
949 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
951 adapter->dbg.num_tx_host_to_card_failure); in mwifiex_cmd_timeout_func()
952 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
954 adapter->dbg.num_cmd_host_to_card_failure); in mwifiex_cmd_timeout_func()
956 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
958 adapter->is_cmd_timedout); in mwifiex_cmd_timeout_func()
959 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
961 adapter->dbg.num_tx_timeout); in mwifiex_cmd_timeout_func()
963 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
965 adapter->dbg.last_cmd_index); in mwifiex_cmd_timeout_func()
966 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
968 (int)sizeof(adapter->dbg.last_cmd_id), in mwifiex_cmd_timeout_func()
969 adapter->dbg.last_cmd_id); in mwifiex_cmd_timeout_func()
970 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
972 (int)sizeof(adapter->dbg.last_cmd_act), in mwifiex_cmd_timeout_func()
973 adapter->dbg.last_cmd_act); in mwifiex_cmd_timeout_func()
975 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
977 adapter->dbg.last_cmd_resp_index); in mwifiex_cmd_timeout_func()
978 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
980 (int)sizeof(adapter->dbg.last_cmd_resp_id), in mwifiex_cmd_timeout_func()
981 adapter->dbg.last_cmd_resp_id); in mwifiex_cmd_timeout_func()
983 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
985 adapter->dbg.last_event_index); in mwifiex_cmd_timeout_func()
986 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
988 (int)sizeof(adapter->dbg.last_event), in mwifiex_cmd_timeout_func()
989 adapter->dbg.last_event); in mwifiex_cmd_timeout_func()
991 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
993 adapter->data_sent, adapter->cmd_sent); in mwifiex_cmd_timeout_func()
995 mwifiex_dbg(adapter, MSG, in mwifiex_cmd_timeout_func()
997 adapter->ps_mode, adapter->ps_state); in mwifiex_cmd_timeout_func()
1000 adapter->cmd_wait_q.status = -ETIMEDOUT; in mwifiex_cmd_timeout_func()
1001 mwifiex_cancel_pending_ioctl(adapter); in mwifiex_cmd_timeout_func()
1004 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { in mwifiex_cmd_timeout_func()
1005 mwifiex_init_fw_complete(adapter); in mwifiex_cmd_timeout_func()
1009 if (adapter->if_ops.device_dump) in mwifiex_cmd_timeout_func()
1010 adapter->if_ops.device_dump(adapter); in mwifiex_cmd_timeout_func()
1012 if (adapter->if_ops.card_reset) in mwifiex_cmd_timeout_func()
1013 adapter->if_ops.card_reset(adapter); in mwifiex_cmd_timeout_func()
1017 mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter) in mwifiex_cancel_pending_scan_cmd() argument
1023 spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); in mwifiex_cancel_pending_scan_cmd()
1025 &adapter->scan_pending_q, list) { in mwifiex_cancel_pending_scan_cmd()
1028 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_cancel_pending_scan_cmd()
1030 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); in mwifiex_cancel_pending_scan_cmd()
1041 mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter) in mwifiex_cancel_all_pending_cmd() argument
1046 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_cancel_all_pending_cmd()
1048 if ((adapter->curr_cmd) && (adapter->curr_cmd->wait_q_enabled)) { in mwifiex_cancel_all_pending_cmd()
1049 adapter->cmd_wait_q.status = -1; in mwifiex_cancel_all_pending_cmd()
1050 mwifiex_complete_cmd(adapter, adapter->curr_cmd); in mwifiex_cancel_all_pending_cmd()
1051 adapter->curr_cmd->wait_q_enabled = false; in mwifiex_cancel_all_pending_cmd()
1055 spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); in mwifiex_cancel_all_pending_cmd()
1057 &adapter->cmd_pending_q, list) { in mwifiex_cancel_all_pending_cmd()
1059 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); in mwifiex_cancel_all_pending_cmd()
1062 adapter->cmd_wait_q.status = -1; in mwifiex_cancel_all_pending_cmd()
1063 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_all_pending_cmd()
1064 spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); in mwifiex_cancel_all_pending_cmd()
1066 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); in mwifiex_cancel_all_pending_cmd()
1067 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_cancel_all_pending_cmd()
1069 mwifiex_cancel_scan(adapter); in mwifiex_cancel_all_pending_cmd()
1083 mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter) in mwifiex_cancel_pending_ioctl() argument
1088 if ((adapter->curr_cmd) && in mwifiex_cancel_pending_ioctl()
1089 (adapter->curr_cmd->wait_q_enabled)) { in mwifiex_cancel_pending_ioctl()
1090 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_cancel_pending_ioctl()
1091 cmd_node = adapter->curr_cmd; in mwifiex_cancel_pending_ioctl()
1100 adapter->curr_cmd = NULL; in mwifiex_cancel_pending_ioctl()
1101 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); in mwifiex_cancel_pending_ioctl()
1103 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_pending_ioctl()
1106 mwifiex_cancel_scan(adapter); in mwifiex_cancel_pending_ioctl()
1119 mwifiex_check_ps_cond(struct mwifiex_adapter *adapter) in mwifiex_check_ps_cond() argument
1121 if (!adapter->cmd_sent && in mwifiex_check_ps_cond()
1122 !adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter)) in mwifiex_check_ps_cond()
1123 mwifiex_dnld_sleep_confirm_cmd(adapter); in mwifiex_check_ps_cond()
1125 mwifiex_dbg(adapter, CMD, in mwifiex_check_ps_cond()
1127 (adapter->cmd_sent) ? "D" : "", in mwifiex_check_ps_cond()
1128 (adapter->curr_cmd) ? "C" : "", in mwifiex_check_ps_cond()
1129 (IS_CARD_RX_RCVD(adapter)) ? "R" : ""); in mwifiex_check_ps_cond()
1141 if (priv->adapter->is_hs_configured) { in mwifiex_hs_activated_event()
1142 priv->adapter->hs_activated = true; in mwifiex_hs_activated_event()
1143 mwifiex_update_rxreor_flags(priv->adapter, in mwifiex_hs_activated_event()
1145 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_hs_activated_event()
1147 priv->adapter->hs_activate_wait_q_woken = true; in mwifiex_hs_activated_event()
1149 &priv->adapter->hs_activate_wait_q); in mwifiex_hs_activated_event()
1151 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_hs_activated_event()
1155 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_hs_activated_event()
1157 priv->adapter->hs_activated = false; in mwifiex_hs_activated_event()
1174 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_hs_cfg() local
1180 adapter->iface_type != MWIFIEX_USB) { in mwifiex_ret_802_11_hs_cfg()
1184 mwifiex_dbg(adapter, CMD, in mwifiex_ret_802_11_hs_cfg()
1192 adapter->is_hs_configured = true; in mwifiex_ret_802_11_hs_cfg()
1193 if (adapter->iface_type == MWIFIEX_USB) in mwifiex_ret_802_11_hs_cfg()
1196 adapter->is_hs_configured = false; in mwifiex_ret_802_11_hs_cfg()
1197 if (adapter->hs_activated) in mwifiex_ret_802_11_hs_cfg()
1209 mwifiex_process_hs_config(struct mwifiex_adapter *adapter) in mwifiex_process_hs_config() argument
1211 mwifiex_dbg(adapter, INFO, in mwifiex_process_hs_config()
1216 adapter->if_ops.wakeup(adapter); in mwifiex_process_hs_config()
1217 adapter->hs_activated = false; in mwifiex_process_hs_config()
1218 adapter->is_hs_configured = false; in mwifiex_process_hs_config()
1219 adapter->is_suspended = false; in mwifiex_process_hs_config()
1220 mwifiex_hs_activated_event(mwifiex_get_priv(adapter, in mwifiex_process_hs_config()
1232 mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter, in mwifiex_process_sleep_confirm_resp() argument
1237 mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_process_sleep_confirm_resp()
1243 mwifiex_dbg(adapter, ERROR, in mwifiex_process_sleep_confirm_resp()
1248 mwifiex_dbg(adapter, CMD, in mwifiex_process_sleep_confirm_resp()
1253 priv = mwifiex_get_priv_by_id(adapter, HostCmd_GET_BSS_NO(seq_num), in mwifiex_process_sleep_confirm_resp()
1256 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); in mwifiex_process_sleep_confirm_resp()
1264 mwifiex_dbg(adapter, ERROR, in mwifiex_process_sleep_confirm_resp()
1271 mwifiex_dbg(adapter, ERROR, in mwifiex_process_sleep_confirm_resp()
1274 adapter->pm_wakeup_card_req = false; in mwifiex_process_sleep_confirm_resp()
1275 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_process_sleep_confirm_resp()
1278 adapter->pm_wakeup_card_req = true; in mwifiex_process_sleep_confirm_resp()
1279 if (adapter->is_hs_configured) in mwifiex_process_sleep_confirm_resp()
1281 (adapter, MWIFIEX_BSS_ROLE_ANY), in mwifiex_process_sleep_confirm_resp()
1283 adapter->ps_state = PS_STATE_SLEEP; in mwifiex_process_sleep_confirm_resp()
1329 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_cmd_enh_power_mode() local
1338 mwifiex_dbg(priv->adapter, CMD, in mwifiex_cmd_enh_power_mode()
1341 cpu_to_le16(adapter->null_pkt_interval); in mwifiex_cmd_enh_power_mode()
1343 cpu_to_le16(adapter->multiple_dtim); in mwifiex_cmd_enh_power_mode()
1345 cpu_to_le16(adapter->bcn_miss_time_out); in mwifiex_cmd_enh_power_mode()
1347 cpu_to_le16(adapter->local_listen_interval); in mwifiex_cmd_enh_power_mode()
1349 cpu_to_le16(adapter->adhoc_awake_period); in mwifiex_cmd_enh_power_mode()
1351 cpu_to_le16(adapter->delay_to_ps); in mwifiex_cmd_enh_power_mode()
1352 ps_mode->mode = cpu_to_le16(adapter->enhanced_ps_mode); in mwifiex_cmd_enh_power_mode()
1369 mwifiex_dbg(priv->adapter, CMD, in mwifiex_cmd_enh_power_mode()
1389 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_enh_power_mode() local
1397 mwifiex_dbg(adapter, INFO, in mwifiex_ret_enh_power_mode()
1402 mwifiex_dbg(adapter, CMD, in mwifiex_ret_enh_power_mode()
1404 priv->adapter->is_deep_sleep = true; in mwifiex_ret_enh_power_mode()
1407 mwifiex_dbg(adapter, CMD, in mwifiex_ret_enh_power_mode()
1409 if (adapter->sleep_period.period) in mwifiex_ret_enh_power_mode()
1410 mwifiex_dbg(adapter, CMD, in mwifiex_ret_enh_power_mode()
1415 priv->adapter->is_deep_sleep = false; in mwifiex_ret_enh_power_mode()
1416 mwifiex_dbg(adapter, CMD, in mwifiex_ret_enh_power_mode()
1420 mwifiex_dbg(adapter, CMD, in mwifiex_ret_enh_power_mode()
1422 if (adapter->sleep_period.period) { in mwifiex_ret_enh_power_mode()
1423 adapter->delay_null_pkt = false; in mwifiex_ret_enh_power_mode()
1424 adapter->tx_lock_flag = false; in mwifiex_ret_enh_power_mode()
1425 adapter->pps_uapsd_mode = false; in mwifiex_ret_enh_power_mode()
1430 adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP; in mwifiex_ret_enh_power_mode()
1432 adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM; in mwifiex_ret_enh_power_mode()
1434 mwifiex_dbg(adapter, CMD, in mwifiex_ret_enh_power_mode()
1493 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_get_hw_spec() local
1499 adapter->fw_cap_info = le32_to_cpu(hw_spec->fw_cap_info); in mwifiex_ret_get_hw_spec()
1501 if (IS_SUPPORT_MULTI_BANDS(adapter)) in mwifiex_ret_get_hw_spec()
1502 adapter->fw_bands = (u8) GET_FW_DEFAULT_BANDS(adapter); in mwifiex_ret_get_hw_spec()
1504 adapter->fw_bands = BAND_B; in mwifiex_ret_get_hw_spec()
1506 adapter->config_bands = adapter->fw_bands; in mwifiex_ret_get_hw_spec()
1508 if (adapter->fw_bands & BAND_A) { in mwifiex_ret_get_hw_spec()
1509 if (adapter->fw_bands & BAND_GN) { in mwifiex_ret_get_hw_spec()
1510 adapter->config_bands |= BAND_AN; in mwifiex_ret_get_hw_spec()
1511 adapter->fw_bands |= BAND_AN; in mwifiex_ret_get_hw_spec()
1513 if (adapter->fw_bands & BAND_AN) { in mwifiex_ret_get_hw_spec()
1514 adapter->adhoc_start_band = BAND_A | BAND_AN; in mwifiex_ret_get_hw_spec()
1515 adapter->adhoc_11n_enabled = true; in mwifiex_ret_get_hw_spec()
1517 adapter->adhoc_start_band = BAND_A; in mwifiex_ret_get_hw_spec()
1520 } else if (adapter->fw_bands & BAND_GN) { in mwifiex_ret_get_hw_spec()
1521 adapter->adhoc_start_band = BAND_G | BAND_B | BAND_GN; in mwifiex_ret_get_hw_spec()
1523 adapter->adhoc_11n_enabled = true; in mwifiex_ret_get_hw_spec()
1524 } else if (adapter->fw_bands & BAND_G) { in mwifiex_ret_get_hw_spec()
1525 adapter->adhoc_start_band = BAND_G | BAND_B; in mwifiex_ret_get_hw_spec()
1527 } else if (adapter->fw_bands & BAND_B) { in mwifiex_ret_get_hw_spec()
1528 adapter->adhoc_start_band = BAND_B; in mwifiex_ret_get_hw_spec()
1532 adapter->fw_release_number = le32_to_cpu(hw_spec->fw_release_number); in mwifiex_ret_get_hw_spec()
1533 adapter->fw_api_ver = (adapter->fw_release_number >> 16) & 0xff; in mwifiex_ret_get_hw_spec()
1534 adapter->number_of_antenna = le16_to_cpu(hw_spec->number_of_antenna); in mwifiex_ret_get_hw_spec()
1537 adapter->is_hw_11ac_capable = true; in mwifiex_ret_get_hw_spec()
1540 adapter->hw_dot_11ac_dev_cap = in mwifiex_ret_get_hw_spec()
1542 adapter->usr_dot_11ac_dev_cap_bg = adapter->hw_dot_11ac_dev_cap in mwifiex_ret_get_hw_spec()
1544 adapter->usr_dot_11ac_dev_cap_a = adapter->hw_dot_11ac_dev_cap in mwifiex_ret_get_hw_spec()
1548 adapter->hw_dot_11ac_mcs_support = in mwifiex_ret_get_hw_spec()
1550 adapter->usr_dot_11ac_mcs_support = in mwifiex_ret_get_hw_spec()
1551 adapter->hw_dot_11ac_mcs_support; in mwifiex_ret_get_hw_spec()
1553 adapter->is_hw_11ac_capable = false; in mwifiex_ret_get_hw_spec()
1568 adapter->key_api_major_ver = in mwifiex_ret_get_hw_spec()
1570 adapter->key_api_minor_ver = in mwifiex_ret_get_hw_spec()
1572 mwifiex_dbg(adapter, INFO, in mwifiex_ret_get_hw_spec()
1574 adapter->key_api_major_ver, in mwifiex_ret_get_hw_spec()
1575 adapter->key_api_minor_ver); in mwifiex_ret_get_hw_spec()
1578 adapter->fw_api_ver = in mwifiex_ret_get_hw_spec()
1580 mwifiex_dbg(adapter, INFO, in mwifiex_ret_get_hw_spec()
1582 adapter->fw_api_ver); in mwifiex_ret_get_hw_spec()
1585 mwifiex_dbg(adapter, FATAL, in mwifiex_ret_get_hw_spec()
1592 mwifiex_dbg(adapter, FATAL, in mwifiex_ret_get_hw_spec()
1604 mwifiex_dbg(adapter, INFO, in mwifiex_ret_get_hw_spec()
1606 adapter->fw_release_number); in mwifiex_ret_get_hw_spec()
1607 mwifiex_dbg(adapter, INFO, in mwifiex_ret_get_hw_spec()
1610 mwifiex_dbg(adapter, INFO, in mwifiex_ret_get_hw_spec()
1615 ether_addr_copy(priv->adapter->perm_addr, hw_spec->permanent_addr); in mwifiex_ret_get_hw_spec()
1616 adapter->region_code = le16_to_cpu(hw_spec->region_code); in mwifiex_ret_get_hw_spec()
1620 if (adapter->region_code == region_code_index[i]) in mwifiex_ret_get_hw_spec()
1625 adapter->region_code = 0x00; in mwifiex_ret_get_hw_spec()
1626 mwifiex_dbg(adapter, WARN, in mwifiex_ret_get_hw_spec()
1630 adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap); in mwifiex_ret_get_hw_spec()
1631 adapter->hw_dev_mcs_support = hw_spec->dev_mcs_support; in mwifiex_ret_get_hw_spec()
1632 adapter->user_dev_mcs_support = adapter->hw_dev_mcs_support; in mwifiex_ret_get_hw_spec()
1634 if (adapter->if_ops.update_mp_end_port) in mwifiex_ret_get_hw_spec()
1635 adapter->if_ops.update_mp_end_port(adapter, in mwifiex_ret_get_hw_spec()
1638 if (adapter->fw_api_ver == MWIFIEX_FW_V15) in mwifiex_ret_get_hw_spec()
1639 adapter->scan_chan_gap_enabled = true; in mwifiex_ret_get_hw_spec()