19 static const char *wmi_cmd_to_name(
enum wmi_cmd_id wmi_cmd)
23 return "WMI_ECHO_CMDID";
25 return "WMI_ACCESS_MEMORY_CMDID";
27 return "WMI_GET_FW_VERSION";
29 return "WMI_DISABLE_INTR_CMDID";
31 return "WMI_ENABLE_INTR_CMDID";
33 return "WMI_ATH_INIT_CMDID";
35 return "WMI_ABORT_TXQ_CMDID";
37 return "WMI_STOP_TX_DMA_CMDID";
39 return "WMI_ABORT_TX_DMA_CMDID";
41 return "WMI_DRAIN_TXQ_CMDID";
43 return "WMI_DRAIN_TXQ_ALL_CMDID";
45 return "WMI_START_RECV_CMDID";
47 return "WMI_STOP_RECV_CMDID";
49 return "WMI_FLUSH_RECV_CMDID";
51 return "WMI_SET_MODE_CMDID";
53 return "WMI_NODE_CREATE_CMDID";
55 return "WMI_NODE_REMOVE_CMDID";
57 return "WMI_VAP_REMOVE_CMDID";
59 return "WMI_VAP_CREATE_CMDID";
61 return "WMI_REG_READ_CMDID";
63 return "WMI_REG_WRITE_CMDID";
65 return "WMI_RC_STATE_CHANGE_CMDID";
67 return "WMI_RC_RATE_UPDATE_CMDID";
69 return "WMI_TARGET_IC_UPDATE_CMDID";
71 return "WMI_TX_AGGR_ENABLE_CMDID";
73 return "WMI_TGT_DETACH_CMDID";
75 return "WMI_NODE_UPDATE_CMDID";
77 return "WMI_INT_STATS_CMDID";
79 return "WMI_TX_STATS_CMDID";
81 return "WMI_RX_STATS_CMDID";
83 return "WMI_BITRATE_MASK_CMDID";
129 __skb_queue_purge(&priv->
wmi->wmi_event_queue);
130 spin_unlock_irqrestore(&priv->
wmi->wmi_lock, flags);
135 struct wmi *
wmi = (
struct wmi *)data;
148 spin_unlock_irqrestore(&wmi->
wmi_lock, flags);
151 spin_unlock_irqrestore(&wmi->
wmi_lock, flags);
167 spin_lock_bh(&priv->
tx.tx_lock);
169 spin_unlock_bh(&priv->
tx.tx_lock);
172 spin_unlock_bh(&priv->
tx.tx_lock);
190 ath_dbg(common, FATAL,
"FATAL Event received, resetting device\n");
204 static void ath9k_wmi_ctrl_rx(
void *
priv,
struct sk_buff *skb,
207 struct wmi *wmi = (
struct wmi *) priv;
217 if (cmd_id & 0x1000) {
234 ath9k_wmi_rsp_callback(wmi, skb);
240 static void ath9k_wmi_ctrl_tx(
void *priv,
struct sk_buff *skb,
254 memset(&connect, 0,
sizeof(connect));
270 static int ath9k_wmi_cmd_issue(
struct wmi *wmi,
291 sizeof(struct wmi_cmd_hdr);
294 int time_left,
ret = 0;
300 skb = alloc_skb(headroom + cmd_len,
GFP_ATOMIC);
304 skb_reserve(skb, headroom);
306 if (cmd_len != 0 && cmd_buf !=
NULL) {
308 memcpy(data, cmd_buf, cmd_len);
325 spin_unlock_irqrestore(&wmi->
wmi_lock, flags);
327 ret = ath9k_wmi_cmd_issue(wmi, skb, cmd_id, cmd_len);
333 ath_dbg(common, WMI,
"Timeout waiting for WMI command: %s\n",
334 wmi_cmd_to_name(cmd_id));
344 ath_dbg(common, WMI,
"WMI failure for: %s\n", wmi_cmd_to_name(cmd_id));