Lines Matching refs:cmd_node
41 struct cmd_ctrl_node *cmd_node, in mwifiex_init_cmd_node() argument
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()
63 struct cmd_ctrl_node *cmd_node; in mwifiex_get_cmd_node() local
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()
77 return cmd_node; in mwifiex_get_cmd_node()
93 struct cmd_ctrl_node *cmd_node) in mwifiex_clean_cmd_node() argument
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()
117 struct cmd_ctrl_node *cmd_node) in mwifiex_insert_cmd_to_free_q() argument
119 if (!cmd_node) in mwifiex_insert_cmd_to_free_q()
122 if (cmd_node->wait_q_enabled) in mwifiex_insert_cmd_to_free_q()
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()
129 list_add_tail(&cmd_node->list, &adapter->cmd_free_q); in mwifiex_insert_cmd_to_free_q()
135 struct cmd_ctrl_node *cmd_node) in mwifiex_recycle_cmd_node() argument
137 struct host_cmd_ds_command *host_cmd = (void *)cmd_node->cmd_skb->data; in mwifiex_recycle_cmd_node()
139 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_recycle_cmd_node()
175 struct cmd_ctrl_node *cmd_node) in mwifiex_dnld_cmd_to_fw() argument
184 if (!adapter || !cmd_node) 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()
194 if (cmd_node->wait_q_enabled) in mwifiex_dnld_cmd_to_fw()
196 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_dnld_cmd_to_fw()
201 cmd_node->cmd_no = cmd_code; in mwifiex_dnld_cmd_to_fw()
210 mwifiex_recycle_cmd_node(adapter, cmd_node); 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()
223 adapter->curr_cmd = cmd_node; 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()
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()
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()
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()
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()
271 if (cmd_node->wait_q_enabled) in mwifiex_dnld_cmd_to_fw()
563 struct cmd_ctrl_node *cmd_node; in mwifiex_send_cmd() local
618 cmd_node = mwifiex_get_cmd_node(adapter); in mwifiex_send_cmd()
620 if (!cmd_node) { in mwifiex_send_cmd()
627 mwifiex_init_cmd_node(priv, cmd_node, cmd_no, data_buf, sync); in mwifiex_send_cmd()
629 if (!cmd_node->cmd_skb) { in mwifiex_send_cmd()
635 skb_put_zero(cmd_node->cmd_skb, sizeof(struct host_cmd_ds_command)); in mwifiex_send_cmd()
637 cmd_ptr = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_send_cmd()
662 cmd_node->cmd_flag |= CMD_F_HOSTCMD; in mwifiex_send_cmd()
670 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_send_cmd()
677 mwifiex_queue_scan_cmd(priv, cmd_node); in mwifiex_send_cmd()
679 mwifiex_insert_cmd_to_pending_q(adapter, cmd_node); in mwifiex_send_cmd()
681 if (cmd_node->wait_q_enabled) in mwifiex_send_cmd()
682 ret = mwifiex_wait_queue_complete(adapter, cmd_node); in mwifiex_send_cmd()
697 struct cmd_ctrl_node *cmd_node) in mwifiex_insert_cmd_to_pending_q() argument
703 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_insert_cmd_to_pending_q()
733 list_add_tail(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
735 list_add(&cmd_node->list, &adapter->cmd_pending_q); in mwifiex_insert_cmd_to_pending_q()
758 struct cmd_ctrl_node *cmd_node; in mwifiex_exec_next_cmd() local
777 cmd_node = list_first_entry(&adapter->cmd_pending_q, in mwifiex_exec_next_cmd()
780 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); in mwifiex_exec_next_cmd()
781 priv = cmd_node->priv; in mwifiex_exec_next_cmd()
792 list_del(&cmd_node->list); in mwifiex_exec_next_cmd()
796 ret = mwifiex_dnld_cmd_to_fw(priv, cmd_node); in mwifiex_exec_next_cmd()
948 struct cmd_ctrl_node *cmd_node; in mwifiex_cmd_timeout_func() local
956 cmd_node = adapter->curr_cmd; in mwifiex_cmd_timeout_func()
957 if (cmd_node) { in mwifiex_cmd_timeout_func()
1018 if (cmd_node->wait_q_enabled) { in mwifiex_cmd_timeout_func()
1038 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; in mwifiex_cancel_pending_scan_cmd() local
1042 list_for_each_entry_safe(cmd_node, tmp_node, in mwifiex_cancel_pending_scan_cmd()
1044 list_del(&cmd_node->list); in mwifiex_cancel_pending_scan_cmd()
1045 cmd_node->wait_q_enabled = false; in mwifiex_cancel_pending_scan_cmd()
1046 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_cancel_pending_scan_cmd()
1061 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; in mwifiex_cancel_all_pending_cmd() local
1073 list_for_each_entry_safe(cmd_node, tmp_node, in mwifiex_cancel_all_pending_cmd()
1075 list_del(&cmd_node->list); in mwifiex_cancel_all_pending_cmd()
1077 if (cmd_node->wait_q_enabled) in mwifiex_cancel_all_pending_cmd()
1079 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_all_pending_cmd()
1100 struct cmd_ctrl_node *cmd_node = NULL; in mwifiex_cancel_pending_ioctl() local
1105 cmd_node = adapter->curr_cmd; in mwifiex_cancel_pending_ioctl()
1117 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_pending_ioctl()