Lines Matching refs:cmd_node
29 struct cmd_ctrl_node *cmd_node, in mwifiex_init_cmd_node() argument
32 cmd_node->priv = priv; in mwifiex_init_cmd_node()
33 cmd_node->cmd_no = cmd_no; in mwifiex_init_cmd_node()
36 cmd_node->wait_q_enabled = true; in mwifiex_init_cmd_node()
37 cmd_node->cmd_wait_q_woken = false; in mwifiex_init_cmd_node()
38 cmd_node->condition = &cmd_node->cmd_wait_q_woken; in mwifiex_init_cmd_node()
40 cmd_node->data_buf = data_buf; in mwifiex_init_cmd_node()
41 cmd_node->cmd_skb = cmd_node->skb; in mwifiex_init_cmd_node()
51 struct cmd_ctrl_node *cmd_node; in mwifiex_get_cmd_node() local
60 cmd_node = list_first_entry(&adapter->cmd_free_q, in mwifiex_get_cmd_node()
62 list_del(&cmd_node->list); in mwifiex_get_cmd_node()
65 return cmd_node; in mwifiex_get_cmd_node()
81 struct cmd_ctrl_node *cmd_node) in mwifiex_clean_cmd_node() argument
83 cmd_node->cmd_no = 0; in mwifiex_clean_cmd_node()
84 cmd_node->cmd_flag = 0; in mwifiex_clean_cmd_node()
85 cmd_node->data_buf = NULL; in mwifiex_clean_cmd_node()
86 cmd_node->wait_q_enabled = false; in mwifiex_clean_cmd_node()
88 if (cmd_node->cmd_skb) in mwifiex_clean_cmd_node()
89 skb_trim(cmd_node->cmd_skb, 0); in mwifiex_clean_cmd_node()
91 if (cmd_node->resp_skb) { in mwifiex_clean_cmd_node()
92 adapter->if_ops.cmdrsp_complete(adapter, cmd_node->resp_skb); in mwifiex_clean_cmd_node()
93 cmd_node->resp_skb = NULL; in mwifiex_clean_cmd_node()
105 struct cmd_ctrl_node *cmd_node) in mwifiex_insert_cmd_to_free_q() argument
107 if (!cmd_node) in mwifiex_insert_cmd_to_free_q()
110 if (cmd_node->wait_q_enabled) in mwifiex_insert_cmd_to_free_q()
111 mwifiex_complete_cmd(adapter, cmd_node); in mwifiex_insert_cmd_to_free_q()
113 mwifiex_clean_cmd_node(adapter, cmd_node); in mwifiex_insert_cmd_to_free_q()
117 list_add_tail(&cmd_node->list, &adapter->cmd_free_q); in mwifiex_insert_cmd_to_free_q()
123 struct cmd_ctrl_node *cmd_node) in mwifiex_recycle_cmd_node() argument
125 struct host_cmd_ds_command *host_cmd = (void *)cmd_node->cmd_skb->data; in mwifiex_recycle_cmd_node()
127 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_recycle_cmd_node()
163 struct cmd_ctrl_node *cmd_node) in mwifiex_dnld_cmd_to_fw() argument
172 if (!adapter || !cmd_node) in mwifiex_dnld_cmd_to_fw()
175 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_dnld_cmd_to_fw()
182 if (cmd_node->wait_q_enabled) in mwifiex_dnld_cmd_to_fw()
184 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_dnld_cmd_to_fw()
189 cmd_node->cmd_no = cmd_code; in mwifiex_dnld_cmd_to_fw()
198 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_dnld_cmd_to_fw()
207 cmd_node->priv->bss_num, in mwifiex_dnld_cmd_to_fw()
208 cmd_node->priv->bss_type)); in mwifiex_dnld_cmd_to_fw()
211 adapter->curr_cmd = cmd_node; in mwifiex_dnld_cmd_to_fw()
215 if (cmd_node->cmd_skb->len > cmd_size) in mwifiex_dnld_cmd_to_fw()
220 skb_trim(cmd_node->cmd_skb, cmd_size); in mwifiex_dnld_cmd_to_fw()
221 else if (cmd_node->cmd_skb->len < cmd_size) in mwifiex_dnld_cmd_to_fw()
227 skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); in mwifiex_dnld_cmd_to_fw()
237 skb_push(cmd_node->cmd_skb, MWIFIEX_TYPE_LEN); in mwifiex_dnld_cmd_to_fw()
239 cmd_node->cmd_skb->data); in mwifiex_dnld_cmd_to_fw()
243 cmd_node->cmd_skb, NULL); in mwifiex_dnld_cmd_to_fw()
244 skb_pull(cmd_node->cmd_skb, MWIFIEX_TYPE_LEN); in mwifiex_dnld_cmd_to_fw()
246 cmd_node->cmd_skb = NULL; in mwifiex_dnld_cmd_to_fw()
248 skb_push(cmd_node->cmd_skb, adapter->intf_hdr_len); in mwifiex_dnld_cmd_to_fw()
250 cmd_node->cmd_skb, NULL); in mwifiex_dnld_cmd_to_fw()
251 skb_pull(cmd_node->cmd_skb, adapter->intf_hdr_len); in mwifiex_dnld_cmd_to_fw()
259 if (cmd_node->wait_q_enabled) in mwifiex_dnld_cmd_to_fw()
551 struct cmd_ctrl_node *cmd_node; in mwifiex_send_cmd() local
606 cmd_node = mwifiex_get_cmd_node(adapter); in mwifiex_send_cmd()
608 if (!cmd_node) { in mwifiex_send_cmd()
615 mwifiex_init_cmd_node(priv, cmd_node, cmd_no, data_buf, sync); in mwifiex_send_cmd()
617 if (!cmd_node->cmd_skb) { in mwifiex_send_cmd()
623 skb_put_zero(cmd_node->cmd_skb, sizeof(struct host_cmd_ds_command)); in mwifiex_send_cmd()
625 cmd_ptr = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_send_cmd()
650 cmd_node->cmd_flag |= CMD_F_HOSTCMD; in mwifiex_send_cmd()
658 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_send_cmd()
665 mwifiex_queue_scan_cmd(priv, cmd_node); in mwifiex_send_cmd()
667 mwifiex_insert_cmd_to_pending_q(adapter, cmd_node); in mwifiex_send_cmd()
669 if (cmd_node->wait_q_enabled) in mwifiex_send_cmd()
670 ret = mwifiex_wait_queue_complete(adapter, cmd_node); in mwifiex_send_cmd()
685 struct cmd_ctrl_node *cmd_node) in mwifiex_insert_cmd_to_pending_q() argument
691 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_insert_cmd_to_pending_q()
721 list_add_tail(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
723 list_add(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
746 struct cmd_ctrl_node *cmd_node; in mwifiex_exec_next_cmd() local
765 cmd_node = list_first_entry(&adapter->cmd_pending_q, in mwifiex_exec_next_cmd()
768 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_exec_next_cmd()
769 priv = cmd_node->priv; in mwifiex_exec_next_cmd()
780 list_del(&cmd_node->list); in mwifiex_exec_next_cmd()
784 ret = mwifiex_dnld_cmd_to_fw(priv, cmd_node); in mwifiex_exec_next_cmd()
936 struct cmd_ctrl_node *cmd_node; in mwifiex_cmd_timeout_func() local
944 cmd_node = adapter->curr_cmd; in mwifiex_cmd_timeout_func()
945 if (cmd_node) { in mwifiex_cmd_timeout_func()
1006 if (cmd_node->wait_q_enabled) { in mwifiex_cmd_timeout_func()
1026 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; in mwifiex_cancel_pending_scan_cmd() local
1030 list_for_each_entry_safe(cmd_node, tmp_node, in mwifiex_cancel_pending_scan_cmd()
1032 list_del(&cmd_node->list); in mwifiex_cancel_pending_scan_cmd()
1033 cmd_node->wait_q_enabled = false; in mwifiex_cancel_pending_scan_cmd()
1034 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_cancel_pending_scan_cmd()
1049 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; in mwifiex_cancel_all_pending_cmd() local
1061 list_for_each_entry_safe(cmd_node, tmp_node, in mwifiex_cancel_all_pending_cmd()
1063 list_del(&cmd_node->list); in mwifiex_cancel_all_pending_cmd()
1065 if (cmd_node->wait_q_enabled) in mwifiex_cancel_all_pending_cmd()
1067 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_all_pending_cmd()
1088 struct cmd_ctrl_node *cmd_node = NULL; in mwifiex_cancel_pending_ioctl() local
1093 cmd_node = adapter->curr_cmd; in mwifiex_cancel_pending_ioctl()
1105 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_pending_ioctl()