diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-fh.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-fh.h | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index 55b8370bc6d4..6dfa806aefec 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
7 | * | 7 | * |
8 | * Copyright(c) 2005 - 2010 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of version 2 of the GNU General Public License as | 11 | * it under the terms of version 2 of the GNU General Public License as |
@@ -30,7 +30,7 @@ | |||
30 | * | 30 | * |
31 | * BSD LICENSE | 31 | * BSD LICENSE |
32 | * | 32 | * |
33 | * Copyright(c) 2005 - 2010 Intel Corporation. All rights reserved. | 33 | * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. |
34 | * All rights reserved. | 34 | * All rights reserved. |
35 | * | 35 | * |
36 | * Redistribution and use in source and binary forms, with or without | 36 | * Redistribution and use in source and binary forms, with or without |
@@ -77,14 +77,14 @@ | |||
77 | /** | 77 | /** |
78 | * Keep-Warm (KW) buffer base address. | 78 | * Keep-Warm (KW) buffer base address. |
79 | * | 79 | * |
80 | * Driver must allocate a 4KByte buffer that is used by 4965 for keeping the | 80 | * Driver must allocate a 4KByte buffer that is for keeping the |
81 | * host DRAM powered on (via dummy accesses to DRAM) to maintain low-latency | 81 | * host DRAM powered on (via dummy accesses to DRAM) to maintain low-latency |
82 | * DRAM access when 4965 is Txing or Rxing. The dummy accesses prevent host | 82 | * DRAM access when doing Txing or Rxing. The dummy accesses prevent host |
83 | * from going into a power-savings mode that would cause higher DRAM latency, | 83 | * from going into a power-savings mode that would cause higher DRAM latency, |
84 | * and possible data over/under-runs, before all Tx/Rx is complete. | 84 | * and possible data over/under-runs, before all Tx/Rx is complete. |
85 | * | 85 | * |
86 | * Driver loads FH_KW_MEM_ADDR_REG with the physical address (bits 35:4) | 86 | * Driver loads FH_KW_MEM_ADDR_REG with the physical address (bits 35:4) |
87 | * of the buffer, which must be 4K aligned. Once this is set up, the 4965 | 87 | * of the buffer, which must be 4K aligned. Once this is set up, the device |
88 | * automatically invokes keep-warm accesses when normal accesses might not | 88 | * automatically invokes keep-warm accesses when normal accesses might not |
89 | * be sufficient to maintain fast DRAM response. | 89 | * be sufficient to maintain fast DRAM response. |
90 | * | 90 | * |
@@ -97,7 +97,7 @@ | |||
97 | /** | 97 | /** |
98 | * TFD Circular Buffers Base (CBBC) addresses | 98 | * TFD Circular Buffers Base (CBBC) addresses |
99 | * | 99 | * |
100 | * 4965 has 16 base pointer registers, one for each of 16 host-DRAM-resident | 100 | * Device has 16 base pointer registers, one for each of 16 host-DRAM-resident |
101 | * circular buffers (CBs/queues) containing Transmit Frame Descriptors (TFDs) | 101 | * circular buffers (CBs/queues) containing Transmit Frame Descriptors (TFDs) |
102 | * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 | 102 | * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 |
103 | * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte | 103 | * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte |
@@ -116,16 +116,16 @@ | |||
116 | /** | 116 | /** |
117 | * Rx SRAM Control and Status Registers (RSCSR) | 117 | * Rx SRAM Control and Status Registers (RSCSR) |
118 | * | 118 | * |
119 | * These registers provide handshake between driver and 4965 for the Rx queue | 119 | * These registers provide handshake between driver and device for the Rx queue |
120 | * (this queue handles *all* command responses, notifications, Rx data, etc. | 120 | * (this queue handles *all* command responses, notifications, Rx data, etc. |
121 | * sent from 4965 uCode to host driver). Unlike Tx, there is only one Rx | 121 | * sent from uCode to host driver). Unlike Tx, there is only one Rx |
122 | * queue, and only one Rx DMA/FIFO channel. Also unlike Tx, which can | 122 | * queue, and only one Rx DMA/FIFO channel. Also unlike Tx, which can |
123 | * concatenate up to 20 DRAM buffers to form a Tx frame, each Receive Buffer | 123 | * concatenate up to 20 DRAM buffers to form a Tx frame, each Receive Buffer |
124 | * Descriptor (RBD) points to only one Rx Buffer (RB); there is a 1:1 | 124 | * Descriptor (RBD) points to only one Rx Buffer (RB); there is a 1:1 |
125 | * mapping between RBDs and RBs. | 125 | * mapping between RBDs and RBs. |
126 | * | 126 | * |
127 | * Driver must allocate host DRAM memory for the following, and set the | 127 | * Driver must allocate host DRAM memory for the following, and set the |
128 | * physical address of each into 4965 registers: | 128 | * physical address of each into device registers: |
129 | * | 129 | * |
130 | * 1) Receive Buffer Descriptor (RBD) circular buffer (CB), typically with 256 | 130 | * 1) Receive Buffer Descriptor (RBD) circular buffer (CB), typically with 256 |
131 | * entries (although any power of 2, up to 4096, is selectable by driver). | 131 | * entries (although any power of 2, up to 4096, is selectable by driver). |
@@ -140,20 +140,20 @@ | |||
140 | * Driver sets physical address [35:8] of base of RBD circular buffer | 140 | * Driver sets physical address [35:8] of base of RBD circular buffer |
141 | * into FH_RSCSR_CHNL0_RBDCB_BASE_REG [27:0]. | 141 | * into FH_RSCSR_CHNL0_RBDCB_BASE_REG [27:0]. |
142 | * | 142 | * |
143 | * 2) Rx status buffer, 8 bytes, in which 4965 indicates which Rx Buffers | 143 | * 2) Rx status buffer, 8 bytes, in which uCode indicates which Rx Buffers |
144 | * (RBs) have been filled, via a "write pointer", actually the index of | 144 | * (RBs) have been filled, via a "write pointer", actually the index of |
145 | * the RB's corresponding RBD within the circular buffer. Driver sets | 145 | * the RB's corresponding RBD within the circular buffer. Driver sets |
146 | * physical address [35:4] into FH_RSCSR_CHNL0_STTS_WPTR_REG [31:0]. | 146 | * physical address [35:4] into FH_RSCSR_CHNL0_STTS_WPTR_REG [31:0]. |
147 | * | 147 | * |
148 | * Bit fields in lower dword of Rx status buffer (upper dword not used | 148 | * Bit fields in lower dword of Rx status buffer (upper dword not used |
149 | * by driver; see struct iwl4965_shared, val0): | 149 | * by driver: |
150 | * 31-12: Not used by driver | 150 | * 31-12: Not used by driver |
151 | * 11- 0: Index of last filled Rx buffer descriptor | 151 | * 11- 0: Index of last filled Rx buffer descriptor |
152 | * (4965 writes, driver reads this value) | 152 | * (device writes, driver reads this value) |
153 | * | 153 | * |
154 | * As the driver prepares Receive Buffers (RBs) for 4965 to fill, driver must | 154 | * As the driver prepares Receive Buffers (RBs) for device to fill, driver must |
155 | * enter pointers to these RBs into contiguous RBD circular buffer entries, | 155 | * enter pointers to these RBs into contiguous RBD circular buffer entries, |
156 | * and update the 4965's "write" index register, | 156 | * and update the device's "write" index register, |
157 | * FH_RSCSR_CHNL0_RBDCB_WPTR_REG. | 157 | * FH_RSCSR_CHNL0_RBDCB_WPTR_REG. |
158 | * | 158 | * |
159 | * This "write" index corresponds to the *next* RBD that the driver will make | 159 | * This "write" index corresponds to the *next* RBD that the driver will make |
@@ -162,12 +162,12 @@ | |||
162 | * RBs), should be 8 after preparing the first 8 RBs (for example), and must | 162 | * RBs), should be 8 after preparing the first 8 RBs (for example), and must |
163 | * wrap back to 0 at the end of the circular buffer (but don't wrap before | 163 | * wrap back to 0 at the end of the circular buffer (but don't wrap before |
164 | * "read" index has advanced past 1! See below). | 164 | * "read" index has advanced past 1! See below). |
165 | * NOTE: 4965 EXPECTS THE WRITE INDEX TO BE INCREMENTED IN MULTIPLES OF 8. | 165 | * NOTE: DEVICE EXPECTS THE WRITE INDEX TO BE INCREMENTED IN MULTIPLES OF 8. |
166 | * | 166 | * |
167 | * As the 4965 fills RBs (referenced from contiguous RBDs within the circular | 167 | * As the device fills RBs (referenced from contiguous RBDs within the circular |
168 | * buffer), it updates the Rx status buffer in host DRAM, 2) described above, | 168 | * buffer), it updates the Rx status buffer in host DRAM, 2) described above, |
169 | * to tell the driver the index of the latest filled RBD. The driver must | 169 | * to tell the driver the index of the latest filled RBD. The driver must |
170 | * read this "read" index from DRAM after receiving an Rx interrupt from 4965. | 170 | * read this "read" index from DRAM after receiving an Rx interrupt from device |
171 | * | 171 | * |
172 | * The driver must also internally keep track of a third index, which is the | 172 | * The driver must also internally keep track of a third index, which is the |
173 | * next RBD to process. When receiving an Rx interrupt, driver should process | 173 | * next RBD to process. When receiving an Rx interrupt, driver should process |
@@ -176,7 +176,7 @@ | |||
176 | * driver may process the RB pointed to by RBD 0. Depending on volume of | 176 | * driver may process the RB pointed to by RBD 0. Depending on volume of |
177 | * traffic, there may be many RBs to process. | 177 | * traffic, there may be many RBs to process. |
178 | * | 178 | * |
179 | * If read index == write index, 4965 thinks there is no room to put new data. | 179 | * If read index == write index, device thinks there is no room to put new data. |
180 | * Due to this, the maximum number of filled RBs is 255, instead of 256. To | 180 | * Due to this, the maximum number of filled RBs is 255, instead of 256. To |
181 | * be safe, make sure that there is a gap of at least 2 RBDs between "write" | 181 | * be safe, make sure that there is a gap of at least 2 RBDs between "write" |
182 | * and "read" indexes; that is, make sure that there are no more than 254 | 182 | * and "read" indexes; that is, make sure that there are no more than 254 |
@@ -303,7 +303,7 @@ | |||
303 | /** | 303 | /** |
304 | * Transmit DMA Channel Control/Status Registers (TCSR) | 304 | * Transmit DMA Channel Control/Status Registers (TCSR) |
305 | * | 305 | * |
306 | * 4965 has one configuration register for each of 8 Tx DMA/FIFO channels | 306 | * Device has one configuration register for each of 8 Tx DMA/FIFO channels |
307 | * supported in hardware (don't confuse these with the 16 Tx queues in DRAM, | 307 | * supported in hardware (don't confuse these with the 16 Tx queues in DRAM, |
308 | * which feed the DMA/FIFO channels); config regs are separated by 0x20 bytes. | 308 | * which feed the DMA/FIFO channels); config regs are separated by 0x20 bytes. |
309 | * | 309 | * |
@@ -326,7 +326,6 @@ | |||
326 | #define FH_TCSR_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xE60) | 326 | #define FH_TCSR_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xE60) |
327 | 327 | ||
328 | /* Find Control/Status reg for given Tx DMA/FIFO channel */ | 328 | /* Find Control/Status reg for given Tx DMA/FIFO channel */ |
329 | #define FH49_TCSR_CHNL_NUM (7) | ||
330 | #define FH50_TCSR_CHNL_NUM (8) | 329 | #define FH50_TCSR_CHNL_NUM (8) |
331 | 330 | ||
332 | /* TCSR: tx_config register values */ | 331 | /* TCSR: tx_config register values */ |
@@ -424,7 +423,6 @@ | |||
424 | #define RX_LOW_WATERMARK 8 | 423 | #define RX_LOW_WATERMARK 8 |
425 | 424 | ||
426 | /* Size of one Rx buffer in host DRAM */ | 425 | /* Size of one Rx buffer in host DRAM */ |
427 | #define IWL_RX_BUF_SIZE_3K (3 * 1000) /* 3945 only */ | ||
428 | #define IWL_RX_BUF_SIZE_4K (4 * 1024) | 426 | #define IWL_RX_BUF_SIZE_4K (4 * 1024) |
429 | #define IWL_RX_BUF_SIZE_8K (8 * 1024) | 427 | #define IWL_RX_BUF_SIZE_8K (8 * 1024) |
430 | 428 | ||
@@ -436,14 +434,14 @@ | |||
436 | * @finished_rb_num [0:11] - Indicates the index of the current RB | 434 | * @finished_rb_num [0:11] - Indicates the index of the current RB |
437 | * in which the last frame was written to | 435 | * in which the last frame was written to |
438 | * @finished_fr_num [0:11] - Indicates the index of the RX Frame | 436 | * @finished_fr_num [0:11] - Indicates the index of the RX Frame |
439 | * which was transfered | 437 | * which was transferred |
440 | */ | 438 | */ |
441 | struct iwl_rb_status { | 439 | struct iwl_rb_status { |
442 | __le16 closed_rb_num; | 440 | __le16 closed_rb_num; |
443 | __le16 closed_fr_num; | 441 | __le16 closed_fr_num; |
444 | __le16 finished_rb_num; | 442 | __le16 finished_rb_num; |
445 | __le16 finished_fr_nam; | 443 | __le16 finished_fr_nam; |
446 | __le32 __unused; /* 3945 only */ | 444 | __le32 __unused; |
447 | } __packed; | 445 | } __packed; |
448 | 446 | ||
449 | 447 | ||