aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/wmi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/wmi.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/wmi.h82
1 files changed, 67 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/wmi.h b/drivers/net/wireless/ath/ath9k/wmi.h
index 765db5faa2d3..fde6da619f30 100644
--- a/drivers/net/wireless/ath/ath9k/wmi.h
+++ b/drivers/net/wireless/ath/ath9k/wmi.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010 Atheros Communications Inc. 2 * Copyright (c) 2010-2011 Atheros Communications Inc.
3 * 3 *
4 * Permission to use, copy, modify, and/or distribute this software for any 4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above 5 * purpose with or without fee is hereby granted, provided that the above
@@ -17,7 +17,6 @@
17#ifndef WMI_H 17#ifndef WMI_H
18#define WMI_H 18#define WMI_H
19 19
20
21struct wmi_event_txrate { 20struct wmi_event_txrate {
22 __be32 txrate; 21 __be32 txrate;
23 struct { 22 struct {
@@ -31,8 +30,52 @@ struct wmi_cmd_hdr {
31 __be16 seq_no; 30 __be16 seq_no;
32} __packed; 31} __packed;
33 32
34struct wmi_swba { 33struct wmi_fw_version {
34 __be16 major;
35 __be16 minor;
36
37} __packed;
38
39struct wmi_event_swba {
40 __be64 tsf;
35 u8 beacon_pending; 41 u8 beacon_pending;
42};
43
44/*
45 * 64 - HTC header - WMI header - 1 / txstatus
46 * And some other hdr. space is also accounted for.
47 * 12 seems to be the magic number.
48 */
49#define HTC_MAX_TX_STATUS 12
50
51#define ATH9K_HTC_TXSTAT_ACK BIT(0)
52#define ATH9K_HTC_TXSTAT_FILT BIT(1)
53#define ATH9K_HTC_TXSTAT_RTC_CTS BIT(2)
54#define ATH9K_HTC_TXSTAT_MCS BIT(3)
55#define ATH9K_HTC_TXSTAT_CW40 BIT(4)
56#define ATH9K_HTC_TXSTAT_SGI BIT(5)
57
58/*
59 * Legacy rates are indicated as indices.
60 * HT rates are indicated as dot11 numbers.
61 * This allows us to resrict the rate field
62 * to 4 bits.
63 */
64#define ATH9K_HTC_TXSTAT_RATE 0x0f
65#define ATH9K_HTC_TXSTAT_RATE_S 0
66
67#define ATH9K_HTC_TXSTAT_EPID 0xf0
68#define ATH9K_HTC_TXSTAT_EPID_S 4
69
70struct __wmi_event_txstatus {
71 u8 cookie;
72 u8 ts_rate; /* Also holds EP ID */
73 u8 ts_flags;
74};
75
76struct wmi_event_txstatus {
77 u8 cnt;
78 struct __wmi_event_txstatus txstatus[HTC_MAX_TX_STATUS];
36} __packed; 79} __packed;
37 80
38enum wmi_cmd_id { 81enum wmi_cmd_id {
@@ -40,13 +83,12 @@ enum wmi_cmd_id {
40 WMI_ACCESS_MEMORY_CMDID, 83 WMI_ACCESS_MEMORY_CMDID,
41 84
42 /* Commands to Target */ 85 /* Commands to Target */
86 WMI_GET_FW_VERSION,
43 WMI_DISABLE_INTR_CMDID, 87 WMI_DISABLE_INTR_CMDID,
44 WMI_ENABLE_INTR_CMDID, 88 WMI_ENABLE_INTR_CMDID,
45 WMI_RX_LINK_CMDID,
46 WMI_ATH_INIT_CMDID, 89 WMI_ATH_INIT_CMDID,
47 WMI_ABORT_TXQ_CMDID, 90 WMI_ABORT_TXQ_CMDID,
48 WMI_STOP_TX_DMA_CMDID, 91 WMI_STOP_TX_DMA_CMDID,
49 WMI_STOP_DMA_RECV_CMDID,
50 WMI_ABORT_TX_DMA_CMDID, 92 WMI_ABORT_TX_DMA_CMDID,
51 WMI_DRAIN_TXQ_CMDID, 93 WMI_DRAIN_TXQ_CMDID,
52 WMI_DRAIN_TXQ_ALL_CMDID, 94 WMI_DRAIN_TXQ_ALL_CMDID,
@@ -54,23 +96,22 @@ enum wmi_cmd_id {
54 WMI_STOP_RECV_CMDID, 96 WMI_STOP_RECV_CMDID,
55 WMI_FLUSH_RECV_CMDID, 97 WMI_FLUSH_RECV_CMDID,
56 WMI_SET_MODE_CMDID, 98 WMI_SET_MODE_CMDID,
57 WMI_RESET_CMDID,
58 WMI_NODE_CREATE_CMDID, 99 WMI_NODE_CREATE_CMDID,
59 WMI_NODE_REMOVE_CMDID, 100 WMI_NODE_REMOVE_CMDID,
60 WMI_VAP_REMOVE_CMDID, 101 WMI_VAP_REMOVE_CMDID,
61 WMI_VAP_CREATE_CMDID, 102 WMI_VAP_CREATE_CMDID,
62 WMI_BEACON_UPDATE_CMDID,
63 WMI_REG_READ_CMDID, 103 WMI_REG_READ_CMDID,
64 WMI_REG_WRITE_CMDID, 104 WMI_REG_WRITE_CMDID,
65 WMI_RC_STATE_CHANGE_CMDID, 105 WMI_RC_STATE_CHANGE_CMDID,
66 WMI_RC_RATE_UPDATE_CMDID, 106 WMI_RC_RATE_UPDATE_CMDID,
67 WMI_DEBUG_INFO_CMDID,
68 WMI_HOST_ATTACH,
69 WMI_TARGET_IC_UPDATE_CMDID, 107 WMI_TARGET_IC_UPDATE_CMDID,
70 WMI_TGT_STATS_CMDID,
71 WMI_TX_AGGR_ENABLE_CMDID, 108 WMI_TX_AGGR_ENABLE_CMDID,
72 WMI_TGT_DETACH_CMDID, 109 WMI_TGT_DETACH_CMDID,
73 WMI_TGT_TXQ_ENABLE_CMDID, 110 WMI_NODE_UPDATE_CMDID,
111 WMI_INT_STATS_CMDID,
112 WMI_TX_STATS_CMDID,
113 WMI_RX_STATS_CMDID,
114 WMI_BITRATE_MASK_CMDID,
74}; 115};
75 116
76enum wmi_event_id { 117enum wmi_event_id {
@@ -79,9 +120,8 @@ enum wmi_event_id {
79 WMI_FATAL_EVENTID, 120 WMI_FATAL_EVENTID,
80 WMI_TXTO_EVENTID, 121 WMI_TXTO_EVENTID,
81 WMI_BMISS_EVENTID, 122 WMI_BMISS_EVENTID,
82 WMI_WLAN_TXCOMP_EVENTID,
83 WMI_DELBA_EVENTID, 123 WMI_DELBA_EVENTID,
84 WMI_TXRATE_EVENTID, 124 WMI_TXSTATUS_EVENTID,
85}; 125};
86 126
87#define MAX_CMD_NUMBER 62 127#define MAX_CMD_NUMBER 62
@@ -91,6 +131,12 @@ struct register_write {
91 __be32 val; 131 __be32 val;
92}; 132};
93 133
134struct ath9k_htc_tx_event {
135 int count;
136 struct __wmi_event_txstatus txs;
137 struct list_head list;
138};
139
94struct wmi { 140struct wmi {
95 struct ath9k_htc_priv *drv_priv; 141 struct ath9k_htc_priv *drv_priv;
96 struct htc_target *htc; 142 struct htc_target *htc;
@@ -98,12 +144,16 @@ struct wmi {
98 struct mutex op_mutex; 144 struct mutex op_mutex;
99 struct completion cmd_wait; 145 struct completion cmd_wait;
100 enum wmi_cmd_id last_cmd_id; 146 enum wmi_cmd_id last_cmd_id;
147 struct sk_buff_head wmi_event_queue;
148 struct tasklet_struct wmi_event_tasklet;
101 u16 tx_seq_id; 149 u16 tx_seq_id;
102 u8 *cmd_rsp_buf; 150 u8 *cmd_rsp_buf;
103 u32 cmd_rsp_len; 151 u32 cmd_rsp_len;
104 bool stopped; 152 bool stopped;
105 153
106 struct sk_buff *wmi_skb; 154 struct list_head pending_tx_events;
155 spinlock_t event_lock;
156
107 spinlock_t wmi_lock; 157 spinlock_t wmi_lock;
108 158
109 atomic_t mwrite_cnt; 159 atomic_t mwrite_cnt;
@@ -120,7 +170,9 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
120 u8 *cmd_buf, u32 cmd_len, 170 u8 *cmd_buf, u32 cmd_len,
121 u8 *rsp_buf, u32 rsp_len, 171 u8 *rsp_buf, u32 rsp_len,
122 u32 timeout); 172 u32 timeout);
123void ath9k_wmi_tasklet(unsigned long data); 173void ath9k_wmi_event_tasklet(unsigned long data);
174void ath9k_fatal_work(struct work_struct *work);
175void ath9k_wmi_event_drain(struct ath9k_htc_priv *priv);
124 176
125#define WMI_CMD(_wmi_cmd) \ 177#define WMI_CMD(_wmi_cmd) \
126 do { \ 178 do { \