aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h66
1 files changed, 44 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 214e4658c495..22a6e3ec7094 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -48,8 +48,6 @@
48#include "iwl-agn-rs.h" 48#include "iwl-agn-rs.h"
49#include "iwl-agn-tt.h" 49#include "iwl-agn-tt.h"
50 50
51#define U32_PAD(n) ((4-(n))&0x3)
52
53struct iwl_tx_queue; 51struct iwl_tx_queue;
54 52
55/* CT-KILL constants */ 53/* CT-KILL constants */
@@ -83,7 +81,7 @@ struct iwl_tx_queue;
83#define MAX_RTS_THRESHOLD 2347U 81#define MAX_RTS_THRESHOLD 2347U
84#define MAX_MSDU_SIZE 2304U 82#define MAX_MSDU_SIZE 2304U
85#define MAX_MPDU_SIZE 2346U 83#define MAX_MPDU_SIZE 2346U
86#define DEFAULT_BEACON_INTERVAL 100U 84#define DEFAULT_BEACON_INTERVAL 200U
87#define DEFAULT_SHORT_RETRY_LIMIT 7U 85#define DEFAULT_SHORT_RETRY_LIMIT 7U
88#define DEFAULT_LONG_RETRY_LIMIT 4U 86#define DEFAULT_LONG_RETRY_LIMIT 4U
89 87
@@ -112,8 +110,6 @@ struct iwl_cmd_meta {
112 struct iwl_device_cmd *cmd, 110 struct iwl_device_cmd *cmd,
113 struct iwl_rx_packet *pkt); 111 struct iwl_rx_packet *pkt);
114 112
115 /* The CMD_SIZE_HUGE flag bit indicates that the command
116 * structure is stored at the end of the shared queue memory. */
117 u32 flags; 113 u32 flags;
118 114
119 DEFINE_DMA_UNMAP_ADDR(mapping); 115 DEFINE_DMA_UNMAP_ADDR(mapping);
@@ -123,7 +119,23 @@ struct iwl_cmd_meta {
123/* 119/*
124 * Generic queue structure 120 * Generic queue structure
125 * 121 *
126 * Contains common data for Rx and Tx queues 122 * Contains common data for Rx and Tx queues.
123 *
124 * Note the difference between n_bd and n_window: the hardware
125 * always assumes 256 descriptors, so n_bd is always 256 (unless
126 * there might be HW changes in the future). For the normal TX
127 * queues, n_window, which is the size of the software queue data
128 * is also 256; however, for the command queue, n_window is only
129 * 32 since we don't need so many commands pending. Since the HW
130 * still uses 256 BDs for DMA though, n_bd stays 256. As a result,
131 * the software buffers (in the variables @meta, @txb in struct
132 * iwl_tx_queue) only have 32 entries, while the HW buffers (@tfds
133 * in the same struct) have 256.
134 * This means that we end up with the following:
135 * HW entries: | 0 | ... | N * 32 | ... | N * 32 + 31 | ... | 255 |
136 * SW entries: | 0 | ... | 31 |
137 * where N is a number between 0 and 7. This means that the SW
138 * data is a window overlayed over the HW queue.
127 */ 139 */
128struct iwl_queue { 140struct iwl_queue {
129 int n_bd; /* number of BDs in this queue */ 141 int n_bd; /* number of BDs in this queue */
@@ -165,7 +177,7 @@ struct iwl_tx_info {
165 177
166struct iwl_tx_queue { 178struct iwl_tx_queue {
167 struct iwl_queue q; 179 struct iwl_queue q;
168 void *tfds; 180 struct iwl_tfd *tfds;
169 struct iwl_device_cmd **cmd; 181 struct iwl_device_cmd **cmd;
170 struct iwl_cmd_meta *meta; 182 struct iwl_cmd_meta *meta;
171 struct iwl_tx_info *txb; 183 struct iwl_tx_info *txb;
@@ -247,7 +259,6 @@ enum {
247 CMD_SYNC = 0, 259 CMD_SYNC = 0,
248 CMD_SIZE_NORMAL = 0, 260 CMD_SIZE_NORMAL = 0,
249 CMD_NO_SKB = 0, 261 CMD_NO_SKB = 0,
250 CMD_SIZE_HUGE = (1 << 0),
251 CMD_ASYNC = (1 << 1), 262 CMD_ASYNC = (1 << 1),
252 CMD_WANT_SKB = (1 << 2), 263 CMD_WANT_SKB = (1 << 2),
253 CMD_MAPPED = (1 << 3), 264 CMD_MAPPED = (1 << 3),
@@ -259,8 +270,8 @@ enum {
259 * struct iwl_device_cmd 270 * struct iwl_device_cmd
260 * 271 *
261 * For allocation of the command and tx queues, this establishes the overall 272 * For allocation of the command and tx queues, this establishes the overall
262 * size of the largest command we send to uCode, except for a scan command 273 * size of the largest command we send to uCode, except for commands that
263 * (which is relatively huge; space is allocated separately). 274 * aren't fully copied and use other TFD space.
264 */ 275 */
265struct iwl_device_cmd { 276struct iwl_device_cmd {
266 struct iwl_cmd_header hdr; /* uCode API */ 277 struct iwl_cmd_header hdr; /* uCode API */
@@ -277,15 +288,21 @@ struct iwl_device_cmd {
277 288
278#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd)) 289#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd))
279 290
291#define IWL_MAX_CMD_TFDS 2
292
293enum iwl_hcmd_dataflag {
294 IWL_HCMD_DFL_NOCOPY = BIT(0),
295};
280 296
281struct iwl_host_cmd { 297struct iwl_host_cmd {
282 const void *data; 298 const void *data[IWL_MAX_CMD_TFDS];
283 unsigned long reply_page; 299 unsigned long reply_page;
284 void (*callback)(struct iwl_priv *priv, 300 void (*callback)(struct iwl_priv *priv,
285 struct iwl_device_cmd *cmd, 301 struct iwl_device_cmd *cmd,
286 struct iwl_rx_packet *pkt); 302 struct iwl_rx_packet *pkt);
287 u32 flags; 303 u32 flags;
288 u16 len; 304 u16 len[IWL_MAX_CMD_TFDS];
305 u8 dataflags[IWL_MAX_CMD_TFDS];
289 u8 id; 306 u8 id;
290}; 307};
291 308
@@ -688,17 +705,8 @@ static inline int iwl_queue_used(const struct iwl_queue *q, int i)
688} 705}
689 706
690 707
691static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge) 708static inline u8 get_cmd_index(struct iwl_queue *q, u32 index)
692{ 709{
693 /*
694 * This is for init calibration result and scan command which
695 * required buffer > TFD_MAX_PAYLOAD_SIZE,
696 * the big buffer at end of command array
697 */
698 if (is_huge)
699 return q->n_window; /* must be power of 2 */
700
701 /* Otherwise, use normal size buffers */
702 return index & (q->n_window - 1); 710 return index & (q->n_window - 1);
703} 711}
704 712
@@ -1171,6 +1179,14 @@ enum iwl_scan_type {
1171 IWL_SCAN_OFFCH_TX, 1179 IWL_SCAN_OFFCH_TX,
1172}; 1180};
1173 1181
1182#ifdef CONFIG_IWLWIFI_DEVICE_SVTOOL
1183struct iwl_testmode_trace {
1184 u8 *cpu_addr;
1185 u8 *trace_addr;
1186 dma_addr_t dma_addr;
1187 bool trace_enabled;
1188};
1189#endif
1174struct iwl_priv { 1190struct iwl_priv {
1175 1191
1176 /* ieee device used by generic ieee processing code */ 1192 /* ieee device used by generic ieee processing code */
@@ -1452,6 +1468,7 @@ struct iwl_priv {
1452 struct work_struct beacon_update; 1468 struct work_struct beacon_update;
1453 struct iwl_rxon_context *beacon_ctx; 1469 struct iwl_rxon_context *beacon_ctx;
1454 struct sk_buff *beacon_skb; 1470 struct sk_buff *beacon_skb;
1471 void *beacon_cmd;
1455 1472
1456 struct work_struct tt_work; 1473 struct work_struct tt_work;
1457 struct work_struct ct_enter; 1474 struct work_struct ct_enter;
@@ -1501,6 +1518,11 @@ struct iwl_priv {
1501 struct led_classdev led; 1518 struct led_classdev led;
1502 unsigned long blink_on, blink_off; 1519 unsigned long blink_on, blink_off;
1503 bool led_registered; 1520 bool led_registered;
1521#ifdef CONFIG_IWLWIFI_DEVICE_SVTOOL
1522 struct iwl_testmode_trace testmode_trace;
1523#endif
1524 u32 dbg_fixed_rate;
1525
1504}; /*iwl_priv */ 1526}; /*iwl_priv */
1505 1527
1506static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id) 1528static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id)