Lines Matching +full:event +full:- +full:deep

4  * Copyright 2011-2020 NXP
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
44 cmd_node->priv = priv; in mwifiex_init_cmd_node()
45 cmd_node->cmd_no = cmd_no; in mwifiex_init_cmd_node()
48 cmd_node->wait_q_enabled = true; in mwifiex_init_cmd_node()
49 cmd_node->cmd_wait_q_woken = false; in mwifiex_init_cmd_node()
50 cmd_node->condition = &cmd_node->cmd_wait_q_woken; in mwifiex_init_cmd_node()
52 cmd_node->data_buf = data_buf; in mwifiex_init_cmd_node()
53 cmd_node->cmd_skb = cmd_node->skb; in mwifiex_init_cmd_node()
65 spin_lock_bh(&adapter->cmd_free_q_lock); in mwifiex_get_cmd_node()
66 if (list_empty(&adapter->cmd_free_q)) { in mwifiex_get_cmd_node()
69 spin_unlock_bh(&adapter->cmd_free_q_lock); in mwifiex_get_cmd_node()
72 cmd_node = list_first_entry(&adapter->cmd_free_q, in mwifiex_get_cmd_node()
74 list_del(&cmd_node->list); in mwifiex_get_cmd_node()
75 spin_unlock_bh(&adapter->cmd_free_q_lock); in mwifiex_get_cmd_node()
95 cmd_node->cmd_no = 0; in mwifiex_clean_cmd_node()
96 cmd_node->cmd_flag = 0; in mwifiex_clean_cmd_node()
97 cmd_node->data_buf = NULL; in mwifiex_clean_cmd_node()
98 cmd_node->wait_q_enabled = false; in mwifiex_clean_cmd_node()
100 if (cmd_node->cmd_skb) in mwifiex_clean_cmd_node()
101 skb_trim(cmd_node->cmd_skb, 0); in mwifiex_clean_cmd_node()
103 if (cmd_node->resp_skb) { in mwifiex_clean_cmd_node()
104 adapter->if_ops.cmdrsp_complete(adapter, cmd_node->resp_skb); in mwifiex_clean_cmd_node()
105 cmd_node->resp_skb = NULL; in mwifiex_clean_cmd_node()
113 * cleaning the command node and re-inserting it into the free queue.
122 if (cmd_node->wait_q_enabled) in mwifiex_insert_cmd_to_free_q()
128 spin_lock_bh(&adapter->cmd_free_q_lock); 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_bh(&adapter->cmd_free_q_lock); in mwifiex_insert_cmd_to_free_q()
137 struct host_cmd_ds_command *host_cmd = (void *)cmd_node->cmd_skb->data; in mwifiex_recycle_cmd_node()
141 atomic_dec(&adapter->cmd_pending); in mwifiex_recycle_cmd_node()
144 le16_to_cpu(host_cmd->command), in mwifiex_recycle_cmd_node()
145 atomic_read(&adapter->cmd_pending)); in mwifiex_recycle_cmd_node()
160 memcpy(cmd, pcmd_ptr->cmd, pcmd_ptr->len); in mwifiex_cmd_host_cmd()
161 mwifiex_dbg(priv->adapter, CMD, in mwifiex_cmd_host_cmd()
162 "cmd: host cmd size = %d\n", pcmd_ptr->len); in mwifiex_cmd_host_cmd()
178 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_dnld_cmd_to_fw()
185 return -1; in mwifiex_dnld_cmd_to_fw()
187 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_dnld_cmd_to_fw()
190 if (host_cmd == NULL || host_cmd->size == 0) { in mwifiex_dnld_cmd_to_fw()
194 if (cmd_node->wait_q_enabled) in mwifiex_dnld_cmd_to_fw()
195 adapter->cmd_wait_q.status = -1; in mwifiex_dnld_cmd_to_fw()
197 return -1; in mwifiex_dnld_cmd_to_fw()
200 cmd_code = le16_to_cpu(host_cmd->command); in mwifiex_dnld_cmd_to_fw()
201 cmd_node->cmd_no = cmd_code; in mwifiex_dnld_cmd_to_fw()
202 cmd_size = le16_to_cpu(host_cmd->size); in mwifiex_dnld_cmd_to_fw()
204 if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET && in mwifiex_dnld_cmd_to_fw()
211 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_dnld_cmd_to_fw()
212 return -1; in mwifiex_dnld_cmd_to_fw()
216 adapter->seq_num++; in mwifiex_dnld_cmd_to_fw()
217 host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO in mwifiex_dnld_cmd_to_fw()
218 (adapter->seq_num, in mwifiex_dnld_cmd_to_fw()
219 cmd_node->priv->bss_num, in mwifiex_dnld_cmd_to_fw()
220 cmd_node->priv->bss_type)); in mwifiex_dnld_cmd_to_fw()
222 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_dnld_cmd_to_fw()
223 adapter->curr_cmd = cmd_node; in mwifiex_dnld_cmd_to_fw()
224 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_dnld_cmd_to_fw()
227 if (cmd_node->cmd_skb->len > cmd_size) in mwifiex_dnld_cmd_to_fw()
232 skb_trim(cmd_node->cmd_skb, cmd_size); in mwifiex_dnld_cmd_to_fw()
233 else if (cmd_node->cmd_skb->len < cmd_size) in mwifiex_dnld_cmd_to_fw()
239 skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); in mwifiex_dnld_cmd_to_fw()
245 cmd_size, le16_to_cpu(host_cmd->seq_num)); in mwifiex_dnld_cmd_to_fw()
248 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_dnld_cmd_to_fw()
249 skb_push(cmd_node->cmd_skb, MWIFIEX_TYPE_LEN); in mwifiex_dnld_cmd_to_fw()
251 cmd_node->cmd_skb->data); in mwifiex_dnld_cmd_to_fw()
252 adapter->cmd_sent = true; in mwifiex_dnld_cmd_to_fw()
253 ret = adapter->if_ops.host_to_card(adapter, in mwifiex_dnld_cmd_to_fw()
255 cmd_node->cmd_skb, NULL); in mwifiex_dnld_cmd_to_fw()
256 skb_pull(cmd_node->cmd_skb, MWIFIEX_TYPE_LEN); in mwifiex_dnld_cmd_to_fw()
257 if (ret == -EBUSY) in mwifiex_dnld_cmd_to_fw()
258 cmd_node->cmd_skb = NULL; in mwifiex_dnld_cmd_to_fw()
260 skb_push(cmd_node->cmd_skb, adapter->intf_hdr_len); in mwifiex_dnld_cmd_to_fw()
261 ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, in mwifiex_dnld_cmd_to_fw()
262 cmd_node->cmd_skb, NULL); in mwifiex_dnld_cmd_to_fw()
263 skb_pull(cmd_node->cmd_skb, adapter->intf_hdr_len); in mwifiex_dnld_cmd_to_fw()
266 if (ret == -1) { in mwifiex_dnld_cmd_to_fw()
269 if (adapter->iface_type == MWIFIEX_USB) in mwifiex_dnld_cmd_to_fw()
270 adapter->cmd_sent = false; in mwifiex_dnld_cmd_to_fw()
271 if (cmd_node->wait_q_enabled) in mwifiex_dnld_cmd_to_fw()
272 adapter->cmd_wait_q.status = -1; in mwifiex_dnld_cmd_to_fw()
273 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_dnld_cmd_to_fw()
275 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_dnld_cmd_to_fw()
276 adapter->curr_cmd = NULL; in mwifiex_dnld_cmd_to_fw()
277 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_dnld_cmd_to_fw()
279 adapter->dbg.num_cmd_host_to_card_failure++; in mwifiex_dnld_cmd_to_fw()
280 return -1; in mwifiex_dnld_cmd_to_fw()
284 adapter->dbg.last_cmd_index = in mwifiex_dnld_cmd_to_fw()
285 (adapter->dbg.last_cmd_index + 1) % DBG_CMD_NUM; in mwifiex_dnld_cmd_to_fw()
286 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index] = cmd_code; in mwifiex_dnld_cmd_to_fw()
287 adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] = in mwifiex_dnld_cmd_to_fw()
294 mod_timer(&adapter->cmd_timer, in mwifiex_dnld_cmd_to_fw()
318 adapter->sleep_cfm->data; in mwifiex_dnld_sleep_confirm_cmd()
323 adapter->seq_num++; in mwifiex_dnld_sleep_confirm_cmd()
324 sleep_cfm_buf->seq_num = in mwifiex_dnld_sleep_confirm_cmd()
326 (adapter->seq_num, priv->bss_num, in mwifiex_dnld_sleep_confirm_cmd()
327 priv->bss_type)); in mwifiex_dnld_sleep_confirm_cmd()
331 le16_to_cpu(sleep_cfm_buf->command), in mwifiex_dnld_sleep_confirm_cmd()
332 le16_to_cpu(sleep_cfm_buf->action), in mwifiex_dnld_sleep_confirm_cmd()
333 le16_to_cpu(sleep_cfm_buf->size), in mwifiex_dnld_sleep_confirm_cmd()
334 le16_to_cpu(sleep_cfm_buf->seq_num)); in mwifiex_dnld_sleep_confirm_cmd()
336 le16_to_cpu(sleep_cfm_buf->size)); in mwifiex_dnld_sleep_confirm_cmd()
338 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_dnld_sleep_confirm_cmd()
345 return -ENOMEM; in mwifiex_dnld_sleep_confirm_cmd()
350 put_unaligned_le32(MWIFIEX_USB_TYPE_CMD, sleep_cfm_tmp->data); in mwifiex_dnld_sleep_confirm_cmd()
351 memcpy(sleep_cfm_tmp->data + MWIFIEX_TYPE_LEN, in mwifiex_dnld_sleep_confirm_cmd()
352 adapter->sleep_cfm->data, in mwifiex_dnld_sleep_confirm_cmd()
354 ret = adapter->if_ops.host_to_card(adapter, in mwifiex_dnld_sleep_confirm_cmd()
357 if (ret != -EBUSY) in mwifiex_dnld_sleep_confirm_cmd()
360 skb_push(adapter->sleep_cfm, adapter->intf_hdr_len); in mwifiex_dnld_sleep_confirm_cmd()
361 ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, in mwifiex_dnld_sleep_confirm_cmd()
362 adapter->sleep_cfm, NULL); in mwifiex_dnld_sleep_confirm_cmd()
363 skb_pull(adapter->sleep_cfm, adapter->intf_hdr_len); in mwifiex_dnld_sleep_confirm_cmd()
366 if (ret == -1) { in mwifiex_dnld_sleep_confirm_cmd()
368 adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure++; in mwifiex_dnld_sleep_confirm_cmd()
369 return -1; in mwifiex_dnld_sleep_confirm_cmd()
372 if (!le16_to_cpu(sleep_cfm_buf->resp_ctrl)) in mwifiex_dnld_sleep_confirm_cmd()
374 adapter->ps_state = PS_STATE_SLEEP; in mwifiex_dnld_sleep_confirm_cmd()
376 adapter->ps_state = PS_STATE_SLEEP_CFM; in mwifiex_dnld_sleep_confirm_cmd()
378 if (!le16_to_cpu(sleep_cfm_buf->resp_ctrl) && in mwifiex_dnld_sleep_confirm_cmd()
379 (test_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags) && in mwifiex_dnld_sleep_confirm_cmd()
380 !adapter->sleep_period.period)) { in mwifiex_dnld_sleep_confirm_cmd()
381 adapter->pm_wakeup_card_req = true; in mwifiex_dnld_sleep_confirm_cmd()
410 return -ENOMEM; in mwifiex_alloc_cmd_buffer()
412 adapter->cmd_pool = cmd_array; in mwifiex_alloc_cmd_buffer()
420 return -ENOMEM; in mwifiex_alloc_cmd_buffer()
442 if (!adapter->cmd_pool) { in mwifiex_free_cmd_buffer()
448 cmd_array = adapter->cmd_pool; in mwifiex_free_cmd_buffer()
460 if (adapter->iface_type == MWIFIEX_USB) in mwifiex_free_cmd_buffer()
461 adapter->if_ops.cmdrsp_complete(adapter, in mwifiex_free_cmd_buffer()
467 if (adapter->cmd_pool) { in mwifiex_free_cmd_buffer()
470 kfree(adapter->cmd_pool); in mwifiex_free_cmd_buffer()
471 adapter->cmd_pool = NULL; in mwifiex_free_cmd_buffer()
478 * Event body of events received from firmware are not used (though they are
479 * saved), only the event ID is used. Some events are re-invoked by
480 * the driver, with a new event body.
490 struct sk_buff *skb = adapter->event_skb; in mwifiex_process_event()
494 if ((adapter->event_cause & EVENT_ID_MASK) == EVENT_RADAR_DETECTED) { in mwifiex_process_event()
495 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_process_event()
496 priv = adapter->priv[i]; in mwifiex_process_event()
498 adapter->event_cause |= in mwifiex_process_event()
499 ((priv->bss_num & 0xff) << 16) | in mwifiex_process_event()
500 ((priv->bss_type & 0xff) << 24); in mwifiex_process_event()
506 eventcause = adapter->event_cause; in mwifiex_process_event()
508 /* Save the last event to debug log */ in mwifiex_process_event()
509 adapter->dbg.last_event_index = in mwifiex_process_event()
510 (adapter->dbg.last_event_index + 1) % DBG_CMD_NUM; in mwifiex_process_event()
511 adapter->dbg.last_event[adapter->dbg.last_event_index] = in mwifiex_process_event()
520 /* Clear BSS_NO_BITS from event */ in mwifiex_process_event()
522 adapter->event_cause = eventcause; in mwifiex_process_event()
527 rx_info->bss_num = priv->bss_num; in mwifiex_process_event()
528 rx_info->bss_type = priv->bss_type; in mwifiex_process_event()
529 mwifiex_dbg_dump(adapter, EVT_D, "Event Buf:", in mwifiex_process_event()
530 skb->data, skb->len); in mwifiex_process_event()
533 mwifiex_dbg(adapter, EVENT, "EVENT: cause: %#x\n", eventcause); in mwifiex_process_event()
535 if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) in mwifiex_process_event()
540 adapter->event_cause = 0; in mwifiex_process_event()
541 adapter->event_skb = NULL; in mwifiex_process_event()
542 adapter->if_ops.event_complete(adapter, skb); in mwifiex_process_event()
550 * Preparation includes -
551 * - Sanity tests to make sure the card is still present or the FW
553 * - Getting a new command node from the command free queue
554 * - Initializing the command node for default parameters
555 * - Fill up the non-default parameters and buffer pointers
556 * - Add the command to pending queue
562 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_send_cmd()
568 return -1; in mwifiex_send_cmd()
571 if (test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) { in mwifiex_send_cmd()
574 return -1; in mwifiex_send_cmd()
577 if (test_bit(MWIFIEX_IS_HS_ENABLING, &adapter->work_flags) && in mwifiex_send_cmd()
581 return -1; in mwifiex_send_cmd()
584 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags)) { in mwifiex_send_cmd()
587 return -1; in mwifiex_send_cmd()
590 if (test_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags)) { in mwifiex_send_cmd()
593 return -1; in mwifiex_send_cmd()
596 if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET) { in mwifiex_send_cmd()
600 return -1; in mwifiex_send_cmd()
606 if (adapter->mfg_mode && cmd_no) { in mwifiex_send_cmd()
607 dev_dbg(adapter->dev, "Ignoring commands in manufacturing mode\n"); in mwifiex_send_cmd()
608 return -1; in mwifiex_send_cmd()
618 return -1; in mwifiex_send_cmd()
624 if (!cmd_node->cmd_skb) { in mwifiex_send_cmd()
627 return -1; in mwifiex_send_cmd()
630 skb_put_zero(cmd_node->cmd_skb, sizeof(struct host_cmd_ds_command)); in mwifiex_send_cmd()
632 cmd_ptr = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_send_cmd()
633 cmd_ptr->command = cpu_to_le16(cmd_no); in mwifiex_send_cmd()
634 cmd_ptr->result = 0; in mwifiex_send_cmd()
657 cmd_node->cmd_flag |= CMD_F_HOSTCMD; in mwifiex_send_cmd()
666 return -1; in mwifiex_send_cmd()
675 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_send_cmd()
676 if (cmd_node->wait_q_enabled) in mwifiex_send_cmd()
698 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_insert_cmd_to_pending_q()
704 command = le16_to_cpu(host_cmd->command); in mwifiex_insert_cmd_to_pending_q()
709 &host_cmd->params.psmode_enh; in mwifiex_insert_cmd_to_pending_q()
710 if ((le16_to_cpu(pm->action) == DIS_PS) || in mwifiex_insert_cmd_to_pending_q()
711 (le16_to_cpu(pm->action) == DIS_AUTO_PS)) { in mwifiex_insert_cmd_to_pending_q()
712 if (adapter->ps_state != PS_STATE_AWAKE) in mwifiex_insert_cmd_to_pending_q()
717 spin_lock_bh(&adapter->cmd_pending_q_lock); in mwifiex_insert_cmd_to_pending_q()
719 list_add_tail(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
721 list_add(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
722 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_insert_cmd_to_pending_q()
724 atomic_inc(&adapter->cmd_pending); in mwifiex_insert_cmd_to_pending_q()
727 command, atomic_read(&adapter->cmd_pending)); in mwifiex_insert_cmd_to_pending_q()
738 * host sleep configuration command will de-activate the host sleep. For PS
749 if (adapter->curr_cmd) { in mwifiex_exec_next_cmd()
752 return -1; in mwifiex_exec_next_cmd()
755 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_exec_next_cmd()
757 spin_lock_bh(&adapter->cmd_pending_q_lock); in mwifiex_exec_next_cmd()
758 if (list_empty(&adapter->cmd_pending_q)) { in mwifiex_exec_next_cmd()
759 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_exec_next_cmd()
760 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_exec_next_cmd()
763 cmd_node = list_first_entry(&adapter->cmd_pending_q, in mwifiex_exec_next_cmd()
766 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_exec_next_cmd()
767 priv = cmd_node->priv; in mwifiex_exec_next_cmd()
769 if (adapter->ps_state != PS_STATE_AWAKE) { in mwifiex_exec_next_cmd()
773 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_exec_next_cmd()
774 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_exec_next_cmd()
778 list_del(&cmd_node->list); in mwifiex_exec_next_cmd()
779 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_exec_next_cmd()
781 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_exec_next_cmd()
785 * mode should de-configure host sleep. We should skip the in mwifiex_exec_next_cmd()
788 if (priv && (host_cmd->command != in mwifiex_exec_next_cmd()
790 if (adapter->hs_activated) { in mwifiex_exec_next_cmd()
792 &adapter->work_flags); in mwifiex_exec_next_cmd()
816 if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) { in mwifiex_process_cmdresp()
817 resp = (struct host_cmd_ds_command *) adapter->upld_buf; in mwifiex_process_cmdresp()
820 le16_to_cpu(resp->command)); in mwifiex_process_cmdresp()
821 return -1; in mwifiex_process_cmdresp()
824 resp = (struct host_cmd_ds_command *)adapter->curr_cmd->resp_skb->data; in mwifiex_process_cmdresp()
825 orig_cmdresp_no = le16_to_cpu(resp->command); in mwifiex_process_cmdresp()
828 if (adapter->curr_cmd->cmd_no != cmdresp_no) { in mwifiex_process_cmdresp()
831 adapter->curr_cmd->cmd_no, cmdresp_no); in mwifiex_process_cmdresp()
832 return -1; in mwifiex_process_cmdresp()
835 del_timer_sync(&adapter->cmd_timer); in mwifiex_process_cmdresp()
836 clear_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags); in mwifiex_process_cmdresp()
838 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { in mwifiex_process_cmdresp()
841 uint16_t size = le16_to_cpu(resp->size); in mwifiex_process_cmdresp()
845 if (adapter->curr_cmd->data_buf) { in mwifiex_process_cmdresp()
846 hostcmd = adapter->curr_cmd->data_buf; in mwifiex_process_cmdresp()
847 hostcmd->len = size; in mwifiex_process_cmdresp()
848 memcpy(hostcmd->cmd, resp, size); in mwifiex_process_cmdresp()
854 HostCmd_GET_BSS_NO(le16_to_cpu(resp->seq_num)), in mwifiex_process_cmdresp()
855 HostCmd_GET_BSS_TYPE(le16_to_cpu(resp->seq_num))); in mwifiex_process_cmdresp()
859 resp->command = cpu_to_le16(orig_cmdresp_no & HostCmd_CMD_ID_MASK); in mwifiex_process_cmdresp()
861 cmdresp_no = le16_to_cpu(resp->command); in mwifiex_process_cmdresp()
862 cmdresp_result = le16_to_cpu(resp->result); in mwifiex_process_cmdresp()
865 adapter->dbg.last_cmd_resp_index = in mwifiex_process_cmdresp()
866 (adapter->dbg.last_cmd_resp_index + 1) % DBG_CMD_NUM; in mwifiex_process_cmdresp()
867 adapter->dbg.last_cmd_resp_id[adapter->dbg.last_cmd_resp_index] = in mwifiex_process_cmdresp()
873 le16_to_cpu(resp->size), le16_to_cpu(resp->seq_num)); in mwifiex_process_cmdresp()
875 le16_to_cpu(resp->size)); in mwifiex_process_cmdresp()
879 if (adapter->curr_cmd->wait_q_enabled) in mwifiex_process_cmdresp()
880 adapter->cmd_wait_q.status = -1; in mwifiex_process_cmdresp()
882 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_process_cmdresp()
883 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_process_cmdresp()
884 adapter->curr_cmd = NULL; in mwifiex_process_cmdresp()
885 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_process_cmdresp()
886 return -1; in mwifiex_process_cmdresp()
889 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { in mwifiex_process_cmdresp()
890 adapter->curr_cmd->cmd_flag &= ~CMD_F_HOSTCMD; in mwifiex_process_cmdresp()
900 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { in mwifiex_process_cmdresp()
906 return -1; in mwifiex_process_cmdresp()
907 } else if (adapter->last_init_cmd == cmdresp_no) in mwifiex_process_cmdresp()
908 adapter->hw_status = MWIFIEX_HW_STATUS_INIT_DONE; in mwifiex_process_cmdresp()
911 if (adapter->curr_cmd) { in mwifiex_process_cmdresp()
912 if (adapter->curr_cmd->wait_q_enabled) in mwifiex_process_cmdresp()
913 adapter->cmd_wait_q.status = ret; in mwifiex_process_cmdresp()
915 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_process_cmdresp()
917 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_process_cmdresp()
918 adapter->curr_cmd = NULL; in mwifiex_process_cmdresp()
919 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_process_cmdresp()
928 * It will re-send the same command again.
936 set_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags); in mwifiex_cmd_timeout_func()
937 if (!adapter->curr_cmd) { in mwifiex_cmd_timeout_func()
942 cmd_node = adapter->curr_cmd; in mwifiex_cmd_timeout_func()
944 adapter->dbg.timeout_cmd_id = in mwifiex_cmd_timeout_func()
945 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; in mwifiex_cmd_timeout_func()
946 adapter->dbg.timeout_cmd_act = in mwifiex_cmd_timeout_func()
947 adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index]; in mwifiex_cmd_timeout_func()
950 adapter->dbg.timeout_cmd_id, in mwifiex_cmd_timeout_func()
951 adapter->dbg.timeout_cmd_act); in mwifiex_cmd_timeout_func()
955 adapter->dbg.num_tx_host_to_card_failure); in mwifiex_cmd_timeout_func()
958 adapter->dbg.num_cmd_host_to_card_failure); in mwifiex_cmd_timeout_func()
963 &adapter->work_flags)); in mwifiex_cmd_timeout_func()
966 adapter->dbg.num_tx_timeout); in mwifiex_cmd_timeout_func()
970 adapter->dbg.last_cmd_index); in mwifiex_cmd_timeout_func()
973 (int)sizeof(adapter->dbg.last_cmd_id), in mwifiex_cmd_timeout_func()
974 adapter->dbg.last_cmd_id); in mwifiex_cmd_timeout_func()
977 (int)sizeof(adapter->dbg.last_cmd_act), in mwifiex_cmd_timeout_func()
978 adapter->dbg.last_cmd_act); in mwifiex_cmd_timeout_func()
982 adapter->dbg.last_cmd_resp_index); in mwifiex_cmd_timeout_func()
985 (int)sizeof(adapter->dbg.last_cmd_resp_id), in mwifiex_cmd_timeout_func()
986 adapter->dbg.last_cmd_resp_id); in mwifiex_cmd_timeout_func()
990 adapter->dbg.last_event_index); in mwifiex_cmd_timeout_func()
993 (int)sizeof(adapter->dbg.last_event), in mwifiex_cmd_timeout_func()
994 adapter->dbg.last_event); in mwifiex_cmd_timeout_func()
998 adapter->data_sent, adapter->cmd_sent); in mwifiex_cmd_timeout_func()
1002 adapter->ps_mode, adapter->ps_state); in mwifiex_cmd_timeout_func()
1004 if (cmd_node->wait_q_enabled) { in mwifiex_cmd_timeout_func()
1005 adapter->cmd_wait_q.status = -ETIMEDOUT; in mwifiex_cmd_timeout_func()
1009 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { in mwifiex_cmd_timeout_func()
1014 if (adapter->if_ops.device_dump) in mwifiex_cmd_timeout_func()
1015 adapter->if_ops.device_dump(adapter); in mwifiex_cmd_timeout_func()
1017 if (adapter->if_ops.card_reset) in mwifiex_cmd_timeout_func()
1018 adapter->if_ops.card_reset(adapter); in mwifiex_cmd_timeout_func()
1027 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_cancel_pending_scan_cmd()
1029 &adapter->scan_pending_q, list) { in mwifiex_cancel_pending_scan_cmd()
1030 list_del(&cmd_node->list); in mwifiex_cancel_pending_scan_cmd()
1031 cmd_node->wait_q_enabled = false; in mwifiex_cancel_pending_scan_cmd()
1034 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_cancel_pending_scan_cmd()
1049 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_all_pending_cmd()
1051 if ((adapter->curr_cmd) && (adapter->curr_cmd->wait_q_enabled)) { in mwifiex_cancel_all_pending_cmd()
1052 adapter->cmd_wait_q.status = -1; in mwifiex_cancel_all_pending_cmd()
1053 mwifiex_complete_cmd(adapter, adapter->curr_cmd); in mwifiex_cancel_all_pending_cmd()
1054 adapter->curr_cmd->wait_q_enabled = false; in mwifiex_cancel_all_pending_cmd()
1058 spin_lock_bh(&adapter->cmd_pending_q_lock); in mwifiex_cancel_all_pending_cmd()
1060 &adapter->cmd_pending_q, list) { in mwifiex_cancel_all_pending_cmd()
1061 list_del(&cmd_node->list); in mwifiex_cancel_all_pending_cmd()
1063 if (cmd_node->wait_q_enabled) in mwifiex_cancel_all_pending_cmd()
1064 adapter->cmd_wait_q.status = -1; in mwifiex_cancel_all_pending_cmd()
1067 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_cancel_all_pending_cmd()
1068 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_all_pending_cmd()
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_bh(&adapter->mwifiex_cmd_lock); 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_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_pending_ioctl()
1114 * data response or event response is awaiting handling, or if we
1121 if (!adapter->cmd_sent && !atomic_read(&adapter->tx_hw_pending) && in mwifiex_check_ps_cond()
1122 !adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter)) in mwifiex_check_ps_cond()
1127 (adapter->cmd_sent) ? "D" : "", in mwifiex_check_ps_cond()
1128 atomic_read(&adapter->tx_hw_pending) ? "T" : "", in mwifiex_check_ps_cond()
1129 (adapter->curr_cmd) ? "C" : "", in mwifiex_check_ps_cond()
1134 * This function sends a Host Sleep activated event to applications.
1136 * This event is generated by the driver, with a blank event body.
1143 &priv->adapter->work_flags)) { in mwifiex_hs_activated_event()
1144 priv->adapter->hs_activated = true; in mwifiex_hs_activated_event()
1145 mwifiex_update_rxreor_flags(priv->adapter, in mwifiex_hs_activated_event()
1147 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_hs_activated_event()
1148 "event: hs_activated\n"); in mwifiex_hs_activated_event()
1149 priv->adapter->hs_activate_wait_q_woken = true; in mwifiex_hs_activated_event()
1151 &priv->adapter->hs_activate_wait_q); in mwifiex_hs_activated_event()
1153 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_hs_activated_event()
1154 "event: HS not configured\n"); in mwifiex_hs_activated_event()
1157 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_hs_activated_event()
1158 "event: hs_deactivated\n"); in mwifiex_hs_activated_event()
1159 priv->adapter->hs_activated = false; in mwifiex_hs_activated_event()
1170 * In case host sleep status change, the function generates an event to
1176 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_hs_cfg()
1178 &resp->params.opt_hs_cfg; in mwifiex_ret_802_11_hs_cfg()
1179 uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions); in mwifiex_ret_802_11_hs_cfg()
1181 if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) && in mwifiex_ret_802_11_hs_cfg()
1182 adapter->iface_type != MWIFIEX_USB) { in mwifiex_ret_802_11_hs_cfg()
1189 resp->result, conditions, in mwifiex_ret_802_11_hs_cfg()
1190 phs_cfg->params.hs_config.gpio, in mwifiex_ret_802_11_hs_cfg()
1191 phs_cfg->params.hs_config.gap); in mwifiex_ret_802_11_hs_cfg()
1194 set_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); in mwifiex_ret_802_11_hs_cfg()
1195 if (adapter->iface_type == MWIFIEX_USB) in mwifiex_ret_802_11_hs_cfg()
1198 clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); in mwifiex_ret_802_11_hs_cfg()
1199 if (adapter->hs_activated) in mwifiex_ret_802_11_hs_cfg()
1208 * cancel event on receiving the power up interrupt.
1218 adapter->if_ops.wakeup(adapter); in mwifiex_process_hs_config()
1219 adapter->hs_activated = false; in mwifiex_process_hs_config()
1220 clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); in mwifiex_process_hs_config()
1221 clear_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags); in mwifiex_process_hs_config()
1240 uint16_t result = le16_to_cpu(cmd->result); in mwifiex_process_sleep_confirm_resp()
1241 uint16_t command = le16_to_cpu(cmd->command); in mwifiex_process_sleep_confirm_resp()
1242 uint16_t seq_num = le16_to_cpu(cmd->seq_num); in mwifiex_process_sleep_confirm_resp()
1252 command, result, le16_to_cpu(cmd->size), seq_num); in mwifiex_process_sleep_confirm_resp()
1276 adapter->pm_wakeup_card_req = false; in mwifiex_process_sleep_confirm_resp()
1277 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_process_sleep_confirm_resp()
1280 adapter->pm_wakeup_card_req = true; in mwifiex_process_sleep_confirm_resp()
1281 if (test_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags)) in mwifiex_process_sleep_confirm_resp()
1285 adapter->ps_state = PS_STATE_SLEEP; in mwifiex_process_sleep_confirm_resp()
1286 cmd->command = cpu_to_le16(command); in mwifiex_process_sleep_confirm_resp()
1287 cmd->seq_num = cpu_to_le16(seq_num); in mwifiex_process_sleep_confirm_resp()
1295 * power save with auto PS or STA PS or auto deep sleep.
1297 * Preparation includes -
1298 * - Setting command ID, action and proper size
1299 * - Setting Power Save bitmap, PS parameters TLV, PS mode TLV,
1300 * auto deep sleep TLV (as required)
1301 * - Ensuring correct endian-ness
1309 &cmd->params.psmode_enh; in mwifiex_cmd_enh_power_mode()
1313 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); in mwifiex_cmd_enh_power_mode()
1315 psmode_enh->action = cpu_to_le16(DIS_AUTO_PS); in mwifiex_cmd_enh_power_mode()
1316 psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap); in mwifiex_cmd_enh_power_mode()
1317 cmd->size = cpu_to_le16(S_DS_GEN + sizeof(psmode_enh->action) + in mwifiex_cmd_enh_power_mode()
1318 sizeof(psmode_enh->params.ps_bitmap)); in mwifiex_cmd_enh_power_mode()
1320 psmode_enh->action = cpu_to_le16(GET_PS); in mwifiex_cmd_enh_power_mode()
1321 psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap); in mwifiex_cmd_enh_power_mode()
1322 cmd->size = cpu_to_le16(S_DS_GEN + sizeof(psmode_enh->action) + in mwifiex_cmd_enh_power_mode()
1323 sizeof(psmode_enh->params.ps_bitmap)); in mwifiex_cmd_enh_power_mode()
1325 psmode_enh->action = cpu_to_le16(EN_AUTO_PS); in mwifiex_cmd_enh_power_mode()
1326 psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap); in mwifiex_cmd_enh_power_mode()
1327 cmd_size = S_DS_GEN + sizeof(psmode_enh->action) + in mwifiex_cmd_enh_power_mode()
1328 sizeof(psmode_enh->params.ps_bitmap); in mwifiex_cmd_enh_power_mode()
1331 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_cmd_enh_power_mode()
1334 struct mwifiex_ps_param *ps_mode = &ps_tlv->param; in mwifiex_cmd_enh_power_mode()
1335 ps_tlv->header.type = cpu_to_le16(TLV_TYPE_PS_PARAM); in mwifiex_cmd_enh_power_mode()
1336 ps_tlv->header.len = cpu_to_le16(sizeof(*ps_tlv) - in mwifiex_cmd_enh_power_mode()
1340 mwifiex_dbg(priv->adapter, CMD, in mwifiex_cmd_enh_power_mode()
1342 ps_mode->null_pkt_interval = in mwifiex_cmd_enh_power_mode()
1343 cpu_to_le16(adapter->null_pkt_interval); in mwifiex_cmd_enh_power_mode()
1344 ps_mode->multiple_dtims = in mwifiex_cmd_enh_power_mode()
1345 cpu_to_le16(adapter->multiple_dtim); in mwifiex_cmd_enh_power_mode()
1346 ps_mode->bcn_miss_timeout = in mwifiex_cmd_enh_power_mode()
1347 cpu_to_le16(adapter->bcn_miss_time_out); in mwifiex_cmd_enh_power_mode()
1348 ps_mode->local_listen_interval = in mwifiex_cmd_enh_power_mode()
1349 cpu_to_le16(adapter->local_listen_interval); in mwifiex_cmd_enh_power_mode()
1350 ps_mode->adhoc_wake_period = in mwifiex_cmd_enh_power_mode()
1351 cpu_to_le16(adapter->adhoc_awake_period); in mwifiex_cmd_enh_power_mode()
1352 ps_mode->delay_to_ps = in mwifiex_cmd_enh_power_mode()
1353 cpu_to_le16(adapter->delay_to_ps); in mwifiex_cmd_enh_power_mode()
1354 ps_mode->mode = cpu_to_le16(adapter->enhanced_ps_mode); in mwifiex_cmd_enh_power_mode()
1362 auto_ds_tlv->header.type = in mwifiex_cmd_enh_power_mode()
1364 auto_ds_tlv->header.len = in mwifiex_cmd_enh_power_mode()
1365 cpu_to_le16(sizeof(*auto_ds_tlv) - in mwifiex_cmd_enh_power_mode()
1370 idletime = auto_ds->idle_time; in mwifiex_cmd_enh_power_mode()
1371 mwifiex_dbg(priv->adapter, CMD, in mwifiex_cmd_enh_power_mode()
1372 "cmd: PS Command: Enter Auto Deep Sleep\n"); in mwifiex_cmd_enh_power_mode()
1373 auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime); in mwifiex_cmd_enh_power_mode()
1375 cmd->size = cpu_to_le16(cmd_size); in mwifiex_cmd_enh_power_mode()
1391 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_enh_power_mode()
1393 &resp->params.psmode_enh; in mwifiex_ret_enh_power_mode()
1394 uint16_t action = le16_to_cpu(ps_mode->action); in mwifiex_ret_enh_power_mode()
1395 uint16_t ps_bitmap = le16_to_cpu(ps_mode->params.ps_bitmap); in mwifiex_ret_enh_power_mode()
1397 le16_to_cpu(ps_mode->params.ps_bitmap); in mwifiex_ret_enh_power_mode()
1401 __func__, resp->result, action); in mwifiex_ret_enh_power_mode()
1405 "cmd: Enabled auto deep sleep\n"); in mwifiex_ret_enh_power_mode()
1406 priv->adapter->is_deep_sleep = true; in mwifiex_ret_enh_power_mode()
1411 if (adapter->sleep_period.period) in mwifiex_ret_enh_power_mode()
1417 priv->adapter->is_deep_sleep = false; in mwifiex_ret_enh_power_mode()
1419 "cmd: Disabled auto deep sleep\n"); in mwifiex_ret_enh_power_mode()
1424 if (adapter->sleep_period.period) { in mwifiex_ret_enh_power_mode()
1425 adapter->delay_null_pkt = false; in mwifiex_ret_enh_power_mode()
1426 adapter->tx_lock_flag = false; in mwifiex_ret_enh_power_mode()
1427 adapter->pps_uapsd_mode = false; in mwifiex_ret_enh_power_mode()
1432 adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP; in mwifiex_ret_enh_power_mode()
1434 adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM; in mwifiex_ret_enh_power_mode()
1442 pm_cfg->param.ps_mode = 1; in mwifiex_ret_enh_power_mode()
1444 pm_cfg->param.ps_mode = 0; in mwifiex_ret_enh_power_mode()
1453 * Preparation includes -
1454 * - Setting command ID, action and proper size
1455 * - Setting permanent address parameter
1456 * - Ensuring correct endian-ness
1461 struct host_cmd_ds_get_hw_spec *hw_spec = &cmd->params.hw_spec; in mwifiex_cmd_get_hw_spec()
1463 cmd->command = cpu_to_le16(HostCmd_CMD_GET_HW_SPEC); in mwifiex_cmd_get_hw_spec()
1464 cmd->size = in mwifiex_cmd_get_hw_spec()
1466 memcpy(hw_spec->permanent_addr, priv->curr_addr, ETH_ALEN); in mwifiex_cmd_get_hw_spec()
1476 * and saving/updating the following parameters in driver -
1477 * - Firmware capability information
1478 * - Firmware band settings
1479 * - Ad-hoc start band and channel
1480 * - Ad-hoc 11n activation status
1481 * - Firmware release number
1482 * - Number of antennas
1483 * - Hardware address
1484 * - Hardware interface version
1485 * - Firmware version
1486 * - Region code
1487 * - 11n capabilities
1488 * - MCS support fields
1489 * - MP end port
1494 struct host_cmd_ds_get_hw_spec *hw_spec = &resp->params.hw_spec; in mwifiex_ret_get_hw_spec()
1495 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_get_hw_spec()
1502 adapter->fw_cap_info = le32_to_cpu(hw_spec->fw_cap_info); in mwifiex_ret_get_hw_spec()
1505 adapter->fw_bands = (u8) GET_FW_DEFAULT_BANDS(adapter); in mwifiex_ret_get_hw_spec()
1507 adapter->fw_bands = BAND_B; in mwifiex_ret_get_hw_spec()
1509 adapter->config_bands = adapter->fw_bands; in mwifiex_ret_get_hw_spec()
1511 if (adapter->fw_bands & BAND_A) { in mwifiex_ret_get_hw_spec()
1512 if (adapter->fw_bands & BAND_GN) { in mwifiex_ret_get_hw_spec()
1513 adapter->config_bands |= BAND_AN; in mwifiex_ret_get_hw_spec()
1514 adapter->fw_bands |= BAND_AN; in mwifiex_ret_get_hw_spec()
1516 if (adapter->fw_bands & BAND_AN) { in mwifiex_ret_get_hw_spec()
1517 adapter->adhoc_start_band = BAND_A | BAND_AN; in mwifiex_ret_get_hw_spec()
1518 adapter->adhoc_11n_enabled = true; in mwifiex_ret_get_hw_spec()
1520 adapter->adhoc_start_band = BAND_A; in mwifiex_ret_get_hw_spec()
1522 priv->adhoc_channel = DEFAULT_AD_HOC_CHANNEL_A; in mwifiex_ret_get_hw_spec()
1523 } else if (adapter->fw_bands & BAND_GN) { in mwifiex_ret_get_hw_spec()
1524 adapter->adhoc_start_band = BAND_G | BAND_B | BAND_GN; in mwifiex_ret_get_hw_spec()
1525 priv->adhoc_channel = DEFAULT_AD_HOC_CHANNEL; in mwifiex_ret_get_hw_spec()
1526 adapter->adhoc_11n_enabled = true; in mwifiex_ret_get_hw_spec()
1527 } else if (adapter->fw_bands & BAND_G) { in mwifiex_ret_get_hw_spec()
1528 adapter->adhoc_start_band = BAND_G | BAND_B; in mwifiex_ret_get_hw_spec()
1529 priv->adhoc_channel = DEFAULT_AD_HOC_CHANNEL; in mwifiex_ret_get_hw_spec()
1530 } else if (adapter->fw_bands & BAND_B) { in mwifiex_ret_get_hw_spec()
1531 adapter->adhoc_start_band = BAND_B; in mwifiex_ret_get_hw_spec()
1532 priv->adhoc_channel = DEFAULT_AD_HOC_CHANNEL; in mwifiex_ret_get_hw_spec()
1535 adapter->fw_release_number = le32_to_cpu(hw_spec->fw_release_number); in mwifiex_ret_get_hw_spec()
1536 adapter->fw_api_ver = (adapter->fw_release_number >> 16) & 0xff; in mwifiex_ret_get_hw_spec()
1537 adapter->number_of_antenna = in mwifiex_ret_get_hw_spec()
1538 le16_to_cpu(hw_spec->number_of_antenna) & 0xf; in mwifiex_ret_get_hw_spec()
1540 if (le32_to_cpu(hw_spec->dot_11ac_dev_cap)) { in mwifiex_ret_get_hw_spec()
1541 adapter->is_hw_11ac_capable = true; in mwifiex_ret_get_hw_spec()
1544 adapter->hw_dot_11ac_dev_cap = in mwifiex_ret_get_hw_spec()
1545 le32_to_cpu(hw_spec->dot_11ac_dev_cap); in mwifiex_ret_get_hw_spec()
1546 adapter->usr_dot_11ac_dev_cap_bg = adapter->hw_dot_11ac_dev_cap in mwifiex_ret_get_hw_spec()
1548 adapter->usr_dot_11ac_dev_cap_a = adapter->hw_dot_11ac_dev_cap in mwifiex_ret_get_hw_spec()
1552 adapter->hw_dot_11ac_mcs_support = in mwifiex_ret_get_hw_spec()
1553 le32_to_cpu(hw_spec->dot_11ac_mcs_support); in mwifiex_ret_get_hw_spec()
1554 adapter->usr_dot_11ac_mcs_support = in mwifiex_ret_get_hw_spec()
1555 adapter->hw_dot_11ac_mcs_support; in mwifiex_ret_get_hw_spec()
1557 adapter->is_hw_11ac_capable = false; in mwifiex_ret_get_hw_spec()
1560 resp_size = le16_to_cpu(resp->size) - S_DS_GEN; in mwifiex_ret_get_hw_spec()
1563 left_len = resp_size - sizeof(struct host_cmd_ds_get_hw_spec); in mwifiex_ret_get_hw_spec()
1565 tlv = (void *)&hw_spec->tlvs + parsed_len; in mwifiex_ret_get_hw_spec()
1566 switch (le16_to_cpu(tlv->type)) { in mwifiex_ret_get_hw_spec()
1569 api_id = le16_to_cpu(api_rev->api_id); in mwifiex_ret_get_hw_spec()
1572 adapter->key_api_major_ver = in mwifiex_ret_get_hw_spec()
1573 api_rev->major_ver; in mwifiex_ret_get_hw_spec()
1574 adapter->key_api_minor_ver = in mwifiex_ret_get_hw_spec()
1575 api_rev->minor_ver; in mwifiex_ret_get_hw_spec()
1578 adapter->key_api_major_ver, in mwifiex_ret_get_hw_spec()
1579 adapter->key_api_minor_ver); in mwifiex_ret_get_hw_spec()
1582 adapter->fw_api_ver = in mwifiex_ret_get_hw_spec()
1583 api_rev->major_ver; in mwifiex_ret_get_hw_spec()
1586 adapter->fw_api_ver, in mwifiex_ret_get_hw_spec()
1587 api_rev->minor_ver); in mwifiex_ret_get_hw_spec()
1592 api_rev->major_ver, in mwifiex_ret_get_hw_spec()
1593 api_rev->minor_ver); in mwifiex_ret_get_hw_spec()
1598 api_rev->major_ver, in mwifiex_ret_get_hw_spec()
1599 api_rev->minor_ver); in mwifiex_ret_get_hw_spec()
1610 adapter->max_p2p_conn = max_conn->max_p2p_conn; in mwifiex_ret_get_hw_spec()
1611 adapter->max_sta_conn = max_conn->max_sta_conn; in mwifiex_ret_get_hw_spec()
1614 adapter->max_p2p_conn); in mwifiex_ret_get_hw_spec()
1617 adapter->max_sta_conn); in mwifiex_ret_get_hw_spec()
1622 le16_to_cpu(tlv->type)); in mwifiex_ret_get_hw_spec()
1625 parsed_len += le16_to_cpu(tlv->len) + in mwifiex_ret_get_hw_spec()
1627 left_len -= le16_to_cpu(tlv->len) + in mwifiex_ret_get_hw_spec()
1633 "info: GET_HW_SPEC: fw_release_number- %#x\n", in mwifiex_ret_get_hw_spec()
1634 adapter->fw_release_number); in mwifiex_ret_get_hw_spec()
1637 hw_spec->permanent_addr); in mwifiex_ret_get_hw_spec()
1640 le16_to_cpu(hw_spec->hw_if_version), in mwifiex_ret_get_hw_spec()
1641 le16_to_cpu(hw_spec->version)); in mwifiex_ret_get_hw_spec()
1643 ether_addr_copy(priv->adapter->perm_addr, hw_spec->permanent_addr); in mwifiex_ret_get_hw_spec()
1644 adapter->region_code = le16_to_cpu(hw_spec->region_code); in mwifiex_ret_get_hw_spec()
1648 if (adapter->region_code == region_code_index[i]) in mwifiex_ret_get_hw_spec()
1653 adapter->region_code = 0x00; in mwifiex_ret_get_hw_spec()
1658 adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap); in mwifiex_ret_get_hw_spec()
1659 adapter->hw_dev_mcs_support = hw_spec->dev_mcs_support; in mwifiex_ret_get_hw_spec()
1660 adapter->user_dev_mcs_support = adapter->hw_dev_mcs_support; in mwifiex_ret_get_hw_spec()
1662 if (adapter->if_ops.update_mp_end_port) in mwifiex_ret_get_hw_spec()
1663 adapter->if_ops.update_mp_end_port(adapter, in mwifiex_ret_get_hw_spec()
1664 le16_to_cpu(hw_spec->mp_end_port)); in mwifiex_ret_get_hw_spec()
1666 if (adapter->fw_api_ver == MWIFIEX_FW_V15) in mwifiex_ret_get_hw_spec()
1667 adapter->scan_chan_gap_enabled = true; in mwifiex_ret_get_hw_spec()
1679 wakeup_reason->wakeup_reason = in mwifiex_ret_wakeup_reason()
1680 resp->params.hs_wakeup_reason.wakeup_reason; in mwifiex_ret_wakeup_reason()