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
613 cmd_node = mwifiex_get_cmd_node(adapter); in mwifiex_send_cmd()
615 if (!cmd_node) { in mwifiex_send_cmd()
622 mwifiex_init_cmd_node(priv, cmd_node, cmd_no, data_buf, sync); in mwifiex_send_cmd()
624 if (!cmd_node->cmd_skb) { 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()
657 cmd_node->cmd_flag |= CMD_F_HOSTCMD; in mwifiex_send_cmd()
665 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_send_cmd()
672 mwifiex_queue_scan_cmd(priv, cmd_node); in mwifiex_send_cmd()
674 mwifiex_insert_cmd_to_pending_q(adapter, cmd_node); in mwifiex_send_cmd()
676 if (cmd_node->wait_q_enabled) in mwifiex_send_cmd()
677 ret = mwifiex_wait_queue_complete(adapter, cmd_node); in mwifiex_send_cmd()
692 struct cmd_ctrl_node *cmd_node) in mwifiex_insert_cmd_to_pending_q() argument
698 host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); 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()
744 struct cmd_ctrl_node *cmd_node; in mwifiex_exec_next_cmd() local
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()
778 list_del(&cmd_node->list); in mwifiex_exec_next_cmd()
782 ret = mwifiex_dnld_cmd_to_fw(priv, cmd_node); in mwifiex_exec_next_cmd()
934 struct cmd_ctrl_node *cmd_node; in mwifiex_cmd_timeout_func() local
942 cmd_node = adapter->curr_cmd; in mwifiex_cmd_timeout_func()
943 if (cmd_node) { in mwifiex_cmd_timeout_func()
1004 if (cmd_node->wait_q_enabled) { in mwifiex_cmd_timeout_func()
1024 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; in mwifiex_cancel_pending_scan_cmd() local
1028 list_for_each_entry_safe(cmd_node, tmp_node, 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()
1032 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); in mwifiex_cancel_pending_scan_cmd()
1047 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; in mwifiex_cancel_all_pending_cmd() local
1059 list_for_each_entry_safe(cmd_node, tmp_node, 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()
1065 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_all_pending_cmd()
1086 struct cmd_ctrl_node *cmd_node = NULL; in mwifiex_cancel_pending_ioctl() local
1091 cmd_node = adapter->curr_cmd; in mwifiex_cancel_pending_ioctl()
1103 mwifiex_recycle_cmd_node(adapter, cmd_node); in mwifiex_cancel_pending_ioctl()