aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2007-11-28 22:10:00 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:26 -0500
commitfcd427bbba10fc315d1c958b85bba74448db4eb4 (patch)
tree88f66271649afb4699e095bd1cb69b4486bbb67f /drivers/net
parent14519a0b46085db68e610147098d03386c34801f (diff)
iwlwifi: move HT_IE_EXT_CHANNEL_* driver definitions to iwl-4965.h
Move HT_IE_EXT_CHANNEL_* driver definitions to iwl-4965.h Add comments to guide .h file usage (hw/api/driver definitions) Minor comment cleanup Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-hw.h32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-commands.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-hw.h35
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.h25
6 files changed, 68 insertions, 39 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index dc7498d5621c..794db78c932e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -60,6 +60,11 @@
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 * 61 *
62 *****************************************************************************/ 62 *****************************************************************************/
63/*
64 * Please use this file (iwl-3945-commands.h) only for uCode API definitions.
65 * Please use iwl-3945-hw.h for hardware-related definitions.
66 * Please use iwl-3945.h for driver implementation definitions.
67 */
63 68
64#ifndef __iwl_3945_commands_h__ 69#ifndef __iwl_3945_commands_h__
65#define __iwl_3945_commands_h__ 70#define __iwl_3945_commands_h__
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
index 4fa947d7bad5..5dde41030cd7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
@@ -60,6 +60,11 @@
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 * 61 *
62 *****************************************************************************/ 62 *****************************************************************************/
63/*
64 * Please use this file (iwl-3945-hw.h) only for hardware-related definitions.
65 * Please use iwl-3945-commands.h for uCode API definitions.
66 * Please use iwl-3945.h for driver implementation definitions.
67 */
63 68
64#ifndef __iwl_3945_hw__ 69#ifndef __iwl_3945_hw__
65#define __iwl_3945_hw__ 70#define __iwl_3945_hw__
@@ -73,9 +78,7 @@
73/* Tx rates */ 78/* Tx rates */
74#define IWL_CCK_RATES 4 79#define IWL_CCK_RATES 4
75#define IWL_OFDM_RATES 8 80#define IWL_OFDM_RATES 8
76
77#define IWL_HT_RATES 0 81#define IWL_HT_RATES 0
78
79#define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES) 82#define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES)
80 83
81/* Time constants */ 84/* Time constants */
@@ -545,11 +548,6 @@ struct iwl3945_eeprom {
545#define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000) 548#define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000)
546#define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008) 549#define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008)
547#define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010) 550#define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010)
548/* 18 - reserved */
549
550/* card static random access memory (SRAM) for processor data and instructs */
551#define RTC_INST_LOWER_BOUND (0x000000)
552#define RTC_DATA_LOWER_BOUND (0x800000)
553 551
554 552
555/* DBM */ 553/* DBM */
@@ -618,7 +616,6 @@ struct iwl3945_eeprom {
618#define TFD_QUEUE_MAX 6 616#define TFD_QUEUE_MAX 6
619#define TFD_QUEUE_SIZE_MAX (256) 617#define TFD_QUEUE_SIZE_MAX (256)
620 618
621/* spectrum and channel data structures */
622#define IWL_NUM_SCAN_RATES (2) 619#define IWL_NUM_SCAN_RATES (2)
623 620
624#define IWL_DEFAULT_TX_RETRY 15 621#define IWL_DEFAULT_TX_RETRY 15
@@ -634,11 +631,6 @@ struct iwl3945_eeprom {
634 631
635#define U32_PAD(n) ((4-(n))&0x3) 632#define U32_PAD(n) ((4-(n))&0x3)
636 633
637/*
638 * Generic queue structure
639 *
640 * Contains common data for Rx and Tx queues
641 */
642#define TFD_CTL_COUNT_SET(n) (n<<24) 634#define TFD_CTL_COUNT_SET(n) (n<<24)
643#define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7) 635#define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7)
644#define TFD_CTL_PAD_SET(n) (n<<28) 636#define TFD_CTL_PAD_SET(n) (n<<28)
@@ -656,18 +648,26 @@ struct iwl3945_eeprom {
656#define RX_FREE_BUFFERS 64 648#define RX_FREE_BUFFERS 64
657#define RX_LOW_WATERMARK 8 649#define RX_LOW_WATERMARK 8
658 650
659 651/* Size of one Rx buffer in host DRAM */
660#define IWL_RX_BUF_SIZE 3000 652#define IWL_RX_BUF_SIZE 3000
661/* card static random access memory (SRAM) for processor data and instructs */ 653
654/* Sizes and addresses for instruction and data memory (SRAM) in
655 * 3945's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */
656#define RTC_INST_LOWER_BOUND (0x000000)
662#define ALM_RTC_INST_UPPER_BOUND (0x014000) 657#define ALM_RTC_INST_UPPER_BOUND (0x014000)
658
659#define RTC_DATA_LOWER_BOUND (0x800000)
663#define ALM_RTC_DATA_UPPER_BOUND (0x808000) 660#define ALM_RTC_DATA_UPPER_BOUND (0x808000)
664 661
665#define ALM_RTC_INST_SIZE (ALM_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND) 662#define ALM_RTC_INST_SIZE (ALM_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
666#define ALM_RTC_DATA_SIZE (ALM_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND) 663#define ALM_RTC_DATA_SIZE (ALM_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
667 664
668#define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE
669#define IWL_MAX_INST_SIZE ALM_RTC_INST_SIZE 665#define IWL_MAX_INST_SIZE ALM_RTC_INST_SIZE
670#define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE 666#define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE
667
668/* Size of uCode instruction memory in bootstrap state machine */
669#define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE
670
671#define IWL_MAX_NUM_QUEUES 8 671#define IWL_MAX_NUM_QUEUES 8
672 672
673static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr) 673static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr)
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 2f3a8b41f991..75cef3ed9511 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -23,6 +23,11 @@
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 * 24 *
25 *****************************************************************************/ 25 *****************************************************************************/
26/*
27 * Please use this file (iwl-3945.h) for driver implementation definitions.
28 * Please use iwl-3945-commands.h for uCode API definitions.
29 * Please use iwl-3945-hw.h for hardware-related definitions.
30 */
26 31
27#ifndef __iwl_3945_h__ 32#ifndef __iwl_3945_h__
28#define __iwl_3945_h__ 33#define __iwl_3945_h__
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index 49582b90f8cf..9910939f5a32 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -60,6 +60,11 @@
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 * 61 *
62 *****************************************************************************/ 62 *****************************************************************************/
63/*
64 * Please use this file (iwl-4965-commands.h) only for uCode API definitions.
65 * Please use iwl-4965-hw.h for hardware-related definitions.
66 * Please use iwl-4965.h for driver implementation definitions.
67 */
63 68
64#ifndef __iwl4965_commands_h__ 69#ifndef __iwl4965_commands_h__
65#define __iwl4965_commands_h__ 70#define __iwl4965_commands_h__
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 962aef2f1ef2..3c09225c6623 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -60,6 +60,11 @@
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 * 61 *
62 *****************************************************************************/ 62 *****************************************************************************/
63/*
64 * Please use this file (iwl-4965-hw.h) only for hardware-related definitions.
65 * Use iwl-4965-commands.h for uCode API definitions.
66 * Use iwl-4965.h for driver implementation definitions.
67 */
63 68
64#ifndef __iwl_4965_hw_h__ 69#ifndef __iwl_4965_hw_h__
65#define __iwl_4965_hw_h__ 70#define __iwl_4965_hw_h__
@@ -77,9 +82,7 @@
77/* Tx rates */ 82/* Tx rates */
78#define IWL_CCK_RATES 4 83#define IWL_CCK_RATES 4
79#define IWL_OFDM_RATES 8 84#define IWL_OFDM_RATES 8
80
81#define IWL_HT_RATES 16 85#define IWL_HT_RATES 16
82
83#define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES) 86#define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES)
84 87
85/* Time constants */ 88/* Time constants */
@@ -449,8 +452,6 @@ struct iwl4965_eeprom {
449 */ 452 */
450#define CSR_HW_REV_WA_REG (CSR_BASE+0x22C) 453#define CSR_HW_REV_WA_REG (CSR_BASE+0x22C)
451 454
452#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
453
454/* interrupt flags in INTA, set by uCode or hardware (e.g. dma), 455/* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
455 * acknowledged (reset) by host writing "1" to flagged bits. */ 456 * acknowledged (reset) by host writing "1" to flagged bits. */
456#define CSR_INT_BIT_FH_RX (1<<31) /* Rx DMA, cmd responses, FH_INT[17:16] */ 457#define CSR_INT_BIT_FH_RX (1<<31) /* Rx DMA, cmd responses, FH_INT[17:16] */
@@ -592,17 +593,12 @@ struct iwl4965_eeprom {
592#define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000) 593#define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000)
593#define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008) 594#define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008)
594#define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010) 595#define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010)
595/* 18 - reserved */
596 596
597/* card static random access memory (SRAM) for processor data and instructs */
598#define RTC_INST_LOWER_BOUND (0x000000)
599#define RTC_DATA_LOWER_BOUND (0x800000)
600 597
601#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004) 598#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004)
602 599
603#define TFD_QUEUE_SIZE_MAX (256) 600#define TFD_QUEUE_SIZE_MAX (256)
604 601
605/* spectrum and channel data structures */
606#define IWL_NUM_SCAN_RATES (2) 602#define IWL_NUM_SCAN_RATES (2)
607 603
608#define IWL_DEFAULT_TX_RETRY 15 604#define IWL_DEFAULT_TX_RETRY 15
@@ -623,17 +619,26 @@ struct iwl4965_eeprom {
623#define RX_FREE_BUFFERS 64 619#define RX_FREE_BUFFERS 64
624#define RX_LOW_WATERMARK 8 620#define RX_LOW_WATERMARK 8
625 621
626 622/* Size of one Rx buffer in host DRAM */
627#define IWL_RX_BUF_SIZE (4 * 1024) 623#define IWL_RX_BUF_SIZE (4 * 1024)
628#define IWL_MAX_BSM_SIZE BSM_SRAM_SIZE 624
625/* Sizes and addresses for instruction and data memory (SRAM) in
626 * 4965's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */
627#define RTC_INST_LOWER_BOUND (0x000000)
629#define KDR_RTC_INST_UPPER_BOUND (0x018000) 628#define KDR_RTC_INST_UPPER_BOUND (0x018000)
629
630#define RTC_DATA_LOWER_BOUND (0x800000)
630#define KDR_RTC_DATA_UPPER_BOUND (0x80A000) 631#define KDR_RTC_DATA_UPPER_BOUND (0x80A000)
632
631#define KDR_RTC_INST_SIZE (KDR_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND) 633#define KDR_RTC_INST_SIZE (KDR_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
632#define KDR_RTC_DATA_SIZE (KDR_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND) 634#define KDR_RTC_DATA_SIZE (KDR_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
633 635
634#define IWL_MAX_INST_SIZE KDR_RTC_INST_SIZE 636#define IWL_MAX_INST_SIZE KDR_RTC_INST_SIZE
635#define IWL_MAX_DATA_SIZE KDR_RTC_DATA_SIZE 637#define IWL_MAX_DATA_SIZE KDR_RTC_DATA_SIZE
636 638
639/* Size of uCode instruction memory in bootstrap state machine */
640#define IWL_MAX_BSM_SIZE BSM_SRAM_SIZE
641
637static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr) 642static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
638{ 643{
639 return (addr >= RTC_DATA_LOWER_BOUND) && 644 return (addr >= RTC_DATA_LOWER_BOUND) &&
@@ -641,13 +646,6 @@ static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
641} 646}
642 647
643/********************* START TXPOWER *****************************************/ 648/********************* START TXPOWER *****************************************/
644enum {
645 HT_IE_EXT_CHANNEL_NONE = 0,
646 HT_IE_EXT_CHANNEL_ABOVE,
647 HT_IE_EXT_CHANNEL_INVALID,
648 HT_IE_EXT_CHANNEL_BELOW,
649 HT_IE_EXT_CHANNEL_MAX
650};
651 649
652enum { 650enum {
653 CALIB_CH_GROUP_1 = 0, 651 CALIB_CH_GROUP_1 = 0,
@@ -812,6 +810,7 @@ enum {
812#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x00000C00) 810#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x00000C00)
813#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100) 811#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100)
814#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200) 812#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200)
813#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
815 814
816static inline u8 iwl4965_hw_get_rate(__le32 rate_n_flags) 815static inline u8 iwl4965_hw_get_rate(__le32 rate_n_flags)
817{ 816{
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h
index 9438c635f454..4a1ec9442c81 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -23,6 +23,12 @@
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 * 24 *
25 *****************************************************************************/ 25 *****************************************************************************/
26/*
27 * Please use this file (iwl-4965.h) for driver implementation definitions.
28 * Please use iwl-4965-commands.h for uCode API definitions.
29 * Please use iwl-4965-hw.h for hardware-related definitions.
30 */
31
26#ifndef __iwl_4965_h__ 32#ifndef __iwl_4965_h__
27#define __iwl_4965_h__ 33#define __iwl_4965_h__
28 34
@@ -192,6 +198,15 @@ struct iwl4965_scan_power_info {
192 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ 198 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
193}; 199};
194 200
201/* For fat_extension_channel */
202enum {
203 HT_IE_EXT_CHANNEL_NONE = 0,
204 HT_IE_EXT_CHANNEL_ABOVE,
205 HT_IE_EXT_CHANNEL_INVALID,
206 HT_IE_EXT_CHANNEL_BELOW,
207 HT_IE_EXT_CHANNEL_MAX
208};
209
195/* 210/*
196 * One for each channel, holds all channel setup data 211 * One for each channel, holds all channel setup data
197 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant 212 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
@@ -202,14 +217,14 @@ struct iwl4965_scan_power_info {
202struct iwl4965_channel_info { 217struct iwl4965_channel_info {
203 struct iwl4965_channel_tgd_info tgd; 218 struct iwl4965_channel_tgd_info tgd;
204 struct iwl4965_channel_tgh_info tgh; 219 struct iwl4965_channel_tgh_info tgh;
205 struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */ 220 struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */
206 struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for 221 struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
207 * FAT channel */ 222 * FAT channel */
208 223
209 u8 channel; /* channel number */ 224 u8 channel; /* channel number */
210 u8 flags; /* flags copied from EEPROM */ 225 u8 flags; /* flags copied from EEPROM */
211 s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ 226 s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
212 s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */ 227 s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) limit */
213 s8 min_power; /* always 0 */ 228 s8 min_power; /* always 0 */
214 s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */ 229 s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */
215 230
@@ -228,7 +243,7 @@ struct iwl4965_channel_info {
228 s8 fat_min_power; /* always 0 */ 243 s8 fat_min_power; /* always 0 */
229 s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */ 244 s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */
230 u8 fat_flags; /* flags copied from EEPROM */ 245 u8 fat_flags; /* flags copied from EEPROM */
231 u8 fat_extension_channel; 246 u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */
232 247
233 /* Radio/DSP gain settings for each scan rate, for directed scans. */ 248 /* Radio/DSP gain settings for each scan rate, for directed scans. */
234 struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; 249 struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];