Lines Matching refs:iwm
110 static int iwm_nonwifi_cmd_init(struct iwm_priv *iwm, in iwm_nonwifi_cmd_init() argument
116 spin_lock(&iwm->cmd_lock); in iwm_nonwifi_cmd_init()
120 cmd->seq_num = iwm->nonwifi_seq_num; in iwm_nonwifi_cmd_init()
123 iwm->nonwifi_seq_num++; in iwm_nonwifi_cmd_init()
124 iwm->nonwifi_seq_num %= UMAC_NONWIFI_SEQ_NUM_MAX; in iwm_nonwifi_cmd_init()
127 list_add_tail(&cmd->pending, &iwm->nonwifi_pending_cmd); in iwm_nonwifi_cmd_init()
129 spin_unlock(&iwm->cmd_lock); in iwm_nonwifi_cmd_init()
139 u16 iwm_alloc_wifi_cmd_seq(struct iwm_priv *iwm) in iwm_alloc_wifi_cmd_seq() argument
141 u16 seq_num = iwm->wifi_seq_num; in iwm_alloc_wifi_cmd_seq()
143 iwm->wifi_seq_num++; in iwm_alloc_wifi_cmd_seq()
144 iwm->wifi_seq_num %= UMAC_WIFI_SEQ_NUM_MAX; in iwm_alloc_wifi_cmd_seq()
149 static void iwm_wifi_cmd_init(struct iwm_priv *iwm, in iwm_wifi_cmd_init() argument
158 spin_lock(&iwm->cmd_lock); in iwm_wifi_cmd_init()
160 cmd->seq_num = iwm_alloc_wifi_cmd_seq(iwm); in iwm_wifi_cmd_init()
164 list_add_tail(&cmd->pending, &iwm->wifi_pending_cmd); in iwm_wifi_cmd_init()
166 spin_unlock(&iwm->cmd_lock); in iwm_wifi_cmd_init()
192 void iwm_cmd_flush(struct iwm_priv *iwm) in iwm_cmd_flush() argument
197 list_for_each_entry_safe(wcmd, wnext, &iwm->wifi_pending_cmd, pending) { in iwm_cmd_flush()
202 list_for_each_entry_safe(nwcmd, nwnext, &iwm->nonwifi_pending_cmd, in iwm_cmd_flush()
209 struct iwm_wifi_cmd *iwm_get_pending_wifi_cmd(struct iwm_priv *iwm, u16 seq_num) in iwm_get_pending_wifi_cmd() argument
213 list_for_each_entry(cmd, &iwm->wifi_pending_cmd, pending) in iwm_get_pending_wifi_cmd()
222 struct iwm_nonwifi_cmd *iwm_get_pending_nonwifi_cmd(struct iwm_priv *iwm, in iwm_get_pending_nonwifi_cmd() argument
227 list_for_each_entry(cmd, &iwm->nonwifi_pending_cmd, pending) in iwm_get_pending_nonwifi_cmd()
238 static void iwm_build_udma_nonwifi_hdr(struct iwm_priv *iwm, in iwm_build_udma_nonwifi_hdr() argument
258 static int iwm_send_udma_nonwifi_cmd(struct iwm_priv *iwm, in iwm_send_udma_nonwifi_cmd() argument
272 iwm_build_udma_nonwifi_hdr(iwm, udma_hdr, udma_cmd); in iwm_send_udma_nonwifi_cmd()
274 IWM_DBG_CMD(iwm, DBG, in iwm_send_udma_nonwifi_cmd()
281 trace_iwm_tx_nonwifi_cmd(iwm, udma_hdr); in iwm_send_udma_nonwifi_cmd()
282 return iwm_bus_send_chunk(iwm, buf->start, buf->len); in iwm_send_udma_nonwifi_cmd()
285 void iwm_udma_wifi_hdr_set_eop(struct iwm_priv *iwm, u8 *buf, u8 eop) in iwm_udma_wifi_hdr_set_eop() argument
292 void iwm_build_udma_wifi_hdr(struct iwm_priv *iwm, in iwm_build_udma_wifi_hdr() argument
309 void iwm_build_umac_hdr(struct iwm_priv *iwm, in iwm_build_umac_hdr() argument
324 static int iwm_send_udma_wifi_cmd(struct iwm_priv *iwm, in iwm_send_udma_wifi_cmd() argument
340 iwm_build_udma_wifi_hdr(iwm, &umac_hdr->hw_hdr, udma_cmd); in iwm_send_udma_wifi_cmd()
341 iwm_build_umac_hdr(iwm, &umac_hdr->sw_hdr, umac_cmd); in iwm_send_udma_wifi_cmd()
343 IWM_DBG_CMD(iwm, DBG, in iwm_send_udma_wifi_cmd()
352 IWM_DBG_CMD(iwm, DBG, "\tLMAC opcode: 0x%x\n", in iwm_send_udma_wifi_cmd()
355 ret = iwm_tx_credit_alloc(iwm, udma_cmd->credit_group, buf->len); in iwm_send_udma_wifi_cmd()
363 IWM_DBG_TX(iwm, DBG, "Failed to alloc tx credit for cmd %d\n", in iwm_send_udma_wifi_cmd()
368 trace_iwm_tx_wifi_cmd(iwm, umac_hdr); in iwm_send_udma_wifi_cmd()
369 return iwm_bus_send_chunk(iwm, buf->start, buf->len); in iwm_send_udma_wifi_cmd()
373 int iwm_hal_send_target_cmd(struct iwm_priv *iwm, in iwm_hal_send_target_cmd() argument
382 IWM_ERR(iwm, "Couldn't alloc memory for hal cmd\n"); in iwm_hal_send_target_cmd()
386 seq_num = iwm_nonwifi_cmd_init(iwm, cmd, udma_cmd); in iwm_hal_send_target_cmd()
394 ret = iwm_send_udma_nonwifi_cmd(iwm, cmd); in iwm_hal_send_target_cmd()
405 static void iwm_build_lmac_hdr(struct iwm_priv *iwm, struct iwm_lmac_hdr *hdr, in iwm_build_lmac_hdr() argument
421 int iwm_hal_send_host_cmd(struct iwm_priv *iwm, in iwm_hal_send_host_cmd() argument
434 IWM_ERR(iwm, "Couldn't alloc memory for wifi hal cmd\n"); in iwm_hal_send_host_cmd()
438 iwm_wifi_cmd_init(iwm, cmd, udma_cmd, umac_cmd, lmac_cmd, payload_size); in iwm_hal_send_host_cmd()
443 iwm_build_lmac_hdr(iwm, hdr, &cmd->lmac_cmd); in iwm_hal_send_host_cmd()
450 ret = iwm_send_udma_wifi_cmd(iwm, cmd); in iwm_hal_send_host_cmd()
463 int iwm_hal_send_umac_cmd(struct iwm_priv *iwm, in iwm_hal_send_umac_cmd() argument
468 return iwm_hal_send_host_cmd(iwm, udma_cmd, umac_cmd, NULL, in iwm_hal_send_umac_cmd()