aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2007-11-28 22:09:58 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:25 -0500
commit2248d8d8bc9799baf7f0a08afee7cb3afcc20ed3 (patch)
tree59bcda05a16f6a5a837271d6d912c4f5273c0a7d /drivers
parent9948b5445614a75112b85ae3bc8f6e2f6655c7df (diff)
iwlwifi: clean up unused definitions in iwl-4965-hw.h
Clean up unused definitions in iwl-4965-hw.h 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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-hw.h395
1 files changed, 3 insertions, 392 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index e7bce8239357..02ea71ec1d3e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -106,10 +106,6 @@
106#define IWL_EEPROM_ACCESS_TIMEOUT 5000 /* uSec */ 106#define IWL_EEPROM_ACCESS_TIMEOUT 5000 /* uSec */
107#define IWL_EEPROM_ACCESS_DELAY 10 /* uSec */ 107#define IWL_EEPROM_ACCESS_DELAY 10 /* uSec */
108 108
109/* EEPROM field values */
110#define ANTENNA_SWITCH_NORMAL 0
111#define ANTENNA_SWITCH_INVERSE 1
112
113/* 109/*
114 * Regulatory channel usage flags in EEPROM struct iwl4965_eeprom_channel.flags. 110 * Regulatory channel usage flags in EEPROM struct iwl4965_eeprom_channel.flags.
115 * 111 *
@@ -133,39 +129,13 @@ enum {
133 EEPROM_CHANNEL_ACTIVE = (1 << 3), /* active scanning allowed */ 129 EEPROM_CHANNEL_ACTIVE = (1 << 3), /* active scanning allowed */
134 EEPROM_CHANNEL_RADAR = (1 << 4), /* radar detection required */ 130 EEPROM_CHANNEL_RADAR = (1 << 4), /* radar detection required */
135 EEPROM_CHANNEL_WIDE = (1 << 5), /* 20 MHz channel okay */ 131 EEPROM_CHANNEL_WIDE = (1 << 5), /* 20 MHz channel okay */
136 EEPROM_CHANNEL_NARROW = (1 << 6), /* 10 MHz channel, not used */ 132 EEPROM_CHANNEL_NARROW = (1 << 6), /* 10 MHz channel (not used) */
137 EEPROM_CHANNEL_DFS = (1 << 7), /* dynamic freq selection candidate */ 133 EEPROM_CHANNEL_DFS = (1 << 7), /* dynamic freq selection candidate */
138}; 134};
139 135
140/* EEPROM field lengths */
141#define EEPROM_BOARD_PBA_NUMBER_LENGTH 11
142
143/* EEPROM field lengths */
144#define EEPROM_BOARD_PBA_NUMBER_LENGTH 11
145#define EEPROM_REGULATORY_SKU_ID_LENGTH 4
146#define EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH 14
147#define EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH 13
148#define EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH 12
149#define EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH 11
150#define EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH 6
151
152#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS_LENGTH 7
153#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS_LENGTH 11
154#define EEPROM_REGULATORY_CHANNELS_LENGTH ( \
155 EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH + \
156 EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH + \
157 EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH + \
158 EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH + \
159 EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH + \
160 EEPROM_REGULATORY_BAND_24_FAT_CHANNELS_LENGTH + \
161 EEPROM_REGULATORY_BAND_52_FAT_CHANNELS_LENGTH)
162
163#define EEPROM_REGULATORY_NUMBER_OF_BANDS 5
164
165/* SKU Capabilities */ 136/* SKU Capabilities */
166#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0) 137#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0)
167#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1) 138#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1)
168#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
169 139
170/* *regulatory* channel data format in eeprom, one for each channel. 140/* *regulatory* channel data format in eeprom, one for each channel.
171 * There are separate entries for FAT (40 MHz) vs. normal (20 MHz) channels. */ 141 * There are separate entries for FAT (40 MHz) vs. normal (20 MHz) channels. */
@@ -479,13 +449,6 @@ struct iwl4965_eeprom {
479 */ 449 */
480#define CSR_HW_REV_WA_REG (CSR_BASE+0x22C) 450#define CSR_HW_REV_WA_REG (CSR_BASE+0x22C)
481 451
482/* HW I/F configuration */
483#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB (0x00000100)
484#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM (0x00000200)
485#define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC (0x00000400)
486#define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE (0x00000800)
487#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000)
488#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000)
489#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000) 452#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
490 453
491/* interrupt flags in INTA, set by uCode or hardware (e.g. dma), 454/* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
@@ -514,20 +477,16 @@ struct iwl4965_eeprom {
514/* interrupt flags in FH (flow handler) (PCI busmaster DMA) */ 477/* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
515#define CSR_FH_INT_BIT_ERR (1<<31) /* Error */ 478#define CSR_FH_INT_BIT_ERR (1<<31) /* Error */
516#define CSR_FH_INT_BIT_HI_PRIOR (1<<30) /* High priority Rx, bypass coalescing */ 479#define CSR_FH_INT_BIT_HI_PRIOR (1<<30) /* High priority Rx, bypass coalescing */
517#define CSR_FH_INT_BIT_RX_CHNL2 (1<<18) /* Rx channel 2 (3945 only) */
518#define CSR_FH_INT_BIT_RX_CHNL1 (1<<17) /* Rx channel 1 */ 480#define CSR_FH_INT_BIT_RX_CHNL1 (1<<17) /* Rx channel 1 */
519#define CSR_FH_INT_BIT_RX_CHNL0 (1<<16) /* Rx channel 0 */ 481#define CSR_FH_INT_BIT_RX_CHNL0 (1<<16) /* Rx channel 0 */
520#define CSR_FH_INT_BIT_TX_CHNL6 (1<<6) /* Tx channel 6 (3945 only) */
521#define CSR_FH_INT_BIT_TX_CHNL1 (1<<1) /* Tx channel 1 */ 482#define CSR_FH_INT_BIT_TX_CHNL1 (1<<1) /* Tx channel 1 */
522#define CSR_FH_INT_BIT_TX_CHNL0 (1<<0) /* Tx channel 0 */ 483#define CSR_FH_INT_BIT_TX_CHNL0 (1<<0) /* Tx channel 0 */
523 484
524#define CSR_FH_INT_RX_MASK (CSR_FH_INT_BIT_HI_PRIOR | \ 485#define CSR_FH_INT_RX_MASK (CSR_FH_INT_BIT_HI_PRIOR | \
525 CSR_FH_INT_BIT_RX_CHNL2 | \
526 CSR_FH_INT_BIT_RX_CHNL1 | \ 486 CSR_FH_INT_BIT_RX_CHNL1 | \
527 CSR_FH_INT_BIT_RX_CHNL0) 487 CSR_FH_INT_BIT_RX_CHNL0)
528 488
529#define CSR_FH_INT_TX_MASK (CSR_FH_INT_BIT_TX_CHNL6 | \ 489#define CSR_FH_INT_TX_MASK (CSR_FH_INT_BIT_TX_CHNL1 | \
530 CSR_FH_INT_BIT_TX_CHNL1 | \
531 CSR_FH_INT_BIT_TX_CHNL0) 490 CSR_FH_INT_BIT_TX_CHNL0)
532 491
533 492
@@ -619,30 +578,6 @@ struct iwl4965_eeprom {
619/*=== FH (data Flow Handler) ===*/ 578/*=== FH (data Flow Handler) ===*/
620#define FH_BASE (0x800) 579#define FH_BASE (0x800)
621 580
622#define FH_CBCC_TABLE (FH_BASE+0x140)
623#define FH_TFDB_TABLE (FH_BASE+0x180)
624#define FH_RCSR_TABLE (FH_BASE+0x400)
625#define FH_RSSR_TABLE (FH_BASE+0x4c0)
626#define FH_TCSR_TABLE (FH_BASE+0x500)
627#define FH_TSSR_TABLE (FH_BASE+0x680)
628
629/* TFDB (Transmit Frame Buffer Descriptor) */
630#define FH_TFDB(_channel, buf) \
631 (FH_TFDB_TABLE+((_channel)*2+(buf))*0x28)
632#define ALM_FH_TFDB_CHNL_BUF_CTRL_REG(_channel) \
633 (FH_TFDB_TABLE + 0x50 * _channel)
634/* CBCC _channel is [0,2] */
635#define FH_CBCC(_channel) (FH_CBCC_TABLE+(_channel)*0x8)
636#define FH_CBCC_CTRL(_channel) (FH_CBCC(_channel)+0x00)
637#define FH_CBCC_BASE(_channel) (FH_CBCC(_channel)+0x04)
638
639/* RCSR _channel is [0,2] */
640#define FH_RCSR(_channel) (FH_RCSR_TABLE+(_channel)*0x40)
641#define FH_RCSR_CONFIG(_channel) (FH_RCSR(_channel)+0x00)
642#define FH_RCSR_RBD_BASE(_channel) (FH_RCSR(_channel)+0x04)
643#define FH_RCSR_WPTR(_channel) (FH_RCSR(_channel)+0x20)
644#define FH_RCSR_RPTR_ADDR(_channel) (FH_RCSR(_channel)+0x24)
645
646#define FH_RSCSR_CHNL0_WPTR (FH_RSCSR_CHNL0_RBDCB_WPTR_REG) 581#define FH_RSCSR_CHNL0_WPTR (FH_RSCSR_CHNL0_RBDCB_WPTR_REG)
647 582
648/* RSSR */ 583/* RSSR */
@@ -663,202 +598,19 @@ struct iwl4965_eeprom {
663#define RTC_INST_LOWER_BOUND (0x000000) 598#define RTC_INST_LOWER_BOUND (0x000000)
664#define RTC_DATA_LOWER_BOUND (0x800000) 599#define RTC_DATA_LOWER_BOUND (0x800000)
665 600
666
667/* DBM */
668
669#define ALM_FH_SRVC_CHNL (6)
670
671#define ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE (20)
672#define ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH (4)
673
674#define ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN (0x08000000)
675
676#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE (0x80000000)
677
678#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE (0x20000000)
679
680#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 (0x01000000)
681
682#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST (0x00001000)
683
684#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH (0x00000000)
685
686#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF (0x00000000)
687#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER (0x00000001)
688
689#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL (0x00000000)
690#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008)
691
692#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD (0x00200000)
693
694#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT (0x00000000)
695
696#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE (0x00000000)
697#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000)
698
699#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID (0x00004000)
700
701#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR (0x00000001)
702
703#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON (0xFF000000)
704#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON (0x00FF0000)
705
706#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B (0x00000400)
707
708#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON (0x00000100)
709#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON (0x00000080)
710
711#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH (0x00000020)
712#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH (0x00000005)
713
714#define ALM_TB_MAX_BYTES_COUNT (0xFFF0)
715
716#define ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) \
717 ((1LU << _channel) << 24)
718#define ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel) \
719 ((1LU << _channel) << 16)
720
721#define ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_channel) \
722 (ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) | \
723 ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel))
724#define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */
725#define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */
726
727#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004) 601#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004)
728 602
729#define TFD_QUEUE_MIN 0
730#define TFD_QUEUE_MAX 6
731#define TFD_QUEUE_SIZE_MAX (256) 603#define TFD_QUEUE_SIZE_MAX (256)
732 604
733/* spectrum and channel data structures */ 605/* spectrum and channel data structures */
734#define IWL_NUM_SCAN_RATES (2) 606#define IWL_NUM_SCAN_RATES (2)
735 607
736#define IWL_SCAN_FLAG_24GHZ (1<<0)
737#define IWL_SCAN_FLAG_52GHZ (1<<1)
738#define IWL_SCAN_FLAG_ACTIVE (1<<2)
739#define IWL_SCAN_FLAG_DIRECT (1<<3)
740
741#define IWL_MAX_CMD_SIZE 1024
742
743#define IWL_DEFAULT_TX_RETRY 15 608#define IWL_DEFAULT_TX_RETRY 15
744#define IWL_MAX_TX_RETRY 16
745
746/*********************************************/
747
748#define RFD_SIZE 4
749#define NUM_TFD_CHUNKS 4
750 609
751#define RX_QUEUE_SIZE 256 610#define RX_QUEUE_SIZE 256
752#define RX_QUEUE_MASK 255 611#define RX_QUEUE_MASK 255
753#define RX_QUEUE_SIZE_LOG 8 612#define RX_QUEUE_SIZE_LOG 8
754 613
755/* QoS definitions */
756
757#define CW_MIN_OFDM 15
758#define CW_MAX_OFDM 1023
759#define CW_MIN_CCK 31
760#define CW_MAX_CCK 1023
761
762#define QOS_TX0_CW_MIN_OFDM CW_MIN_OFDM
763#define QOS_TX1_CW_MIN_OFDM CW_MIN_OFDM
764#define QOS_TX2_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
765#define QOS_TX3_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 4 - 1)
766
767#define QOS_TX0_CW_MIN_CCK CW_MIN_CCK
768#define QOS_TX1_CW_MIN_CCK CW_MIN_CCK
769#define QOS_TX2_CW_MIN_CCK ((CW_MIN_CCK + 1) / 2 - 1)
770#define QOS_TX3_CW_MIN_CCK ((CW_MIN_CCK + 1) / 4 - 1)
771
772#define QOS_TX0_CW_MAX_OFDM CW_MAX_OFDM
773#define QOS_TX1_CW_MAX_OFDM CW_MAX_OFDM
774#define QOS_TX2_CW_MAX_OFDM CW_MIN_OFDM
775#define QOS_TX3_CW_MAX_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
776
777#define QOS_TX0_CW_MAX_CCK CW_MAX_CCK
778#define QOS_TX1_CW_MAX_CCK CW_MAX_CCK
779#define QOS_TX2_CW_MAX_CCK CW_MIN_CCK
780#define QOS_TX3_CW_MAX_CCK ((CW_MIN_CCK + 1) / 2 - 1)
781
782#define QOS_TX0_AIFS 3
783#define QOS_TX1_AIFS 7
784#define QOS_TX2_AIFS 2
785#define QOS_TX3_AIFS 2
786
787#define QOS_TX0_ACM 0
788#define QOS_TX1_ACM 0
789#define QOS_TX2_ACM 0
790#define QOS_TX3_ACM 0
791
792#define QOS_TX0_TXOP_LIMIT_CCK 0
793#define QOS_TX1_TXOP_LIMIT_CCK 0
794#define QOS_TX2_TXOP_LIMIT_CCK 6016
795#define QOS_TX3_TXOP_LIMIT_CCK 3264
796
797#define QOS_TX0_TXOP_LIMIT_OFDM 0
798#define QOS_TX1_TXOP_LIMIT_OFDM 0
799#define QOS_TX2_TXOP_LIMIT_OFDM 3008
800#define QOS_TX3_TXOP_LIMIT_OFDM 1504
801
802#define DEF_TX0_CW_MIN_OFDM CW_MIN_OFDM
803#define DEF_TX1_CW_MIN_OFDM CW_MIN_OFDM
804#define DEF_TX2_CW_MIN_OFDM CW_MIN_OFDM
805#define DEF_TX3_CW_MIN_OFDM CW_MIN_OFDM
806
807#define DEF_TX0_CW_MIN_CCK CW_MIN_CCK
808#define DEF_TX1_CW_MIN_CCK CW_MIN_CCK
809#define DEF_TX2_CW_MIN_CCK CW_MIN_CCK
810#define DEF_TX3_CW_MIN_CCK CW_MIN_CCK
811
812#define DEF_TX0_CW_MAX_OFDM CW_MAX_OFDM
813#define DEF_TX1_CW_MAX_OFDM CW_MAX_OFDM
814#define DEF_TX2_CW_MAX_OFDM CW_MAX_OFDM
815#define DEF_TX3_CW_MAX_OFDM CW_MAX_OFDM
816
817#define DEF_TX0_CW_MAX_CCK CW_MAX_CCK
818#define DEF_TX1_CW_MAX_CCK CW_MAX_CCK
819#define DEF_TX2_CW_MAX_CCK CW_MAX_CCK
820#define DEF_TX3_CW_MAX_CCK CW_MAX_CCK
821
822#define DEF_TX0_AIFS (2)
823#define DEF_TX1_AIFS (2)
824#define DEF_TX2_AIFS (2)
825#define DEF_TX3_AIFS (2)
826
827#define DEF_TX0_ACM 0
828#define DEF_TX1_ACM 0
829#define DEF_TX2_ACM 0
830#define DEF_TX3_ACM 0
831
832#define DEF_TX0_TXOP_LIMIT_CCK 0
833#define DEF_TX1_TXOP_LIMIT_CCK 0
834#define DEF_TX2_TXOP_LIMIT_CCK 0
835#define DEF_TX3_TXOP_LIMIT_CCK 0
836
837#define DEF_TX0_TXOP_LIMIT_OFDM 0
838#define DEF_TX1_TXOP_LIMIT_OFDM 0
839#define DEF_TX2_TXOP_LIMIT_OFDM 0
840#define DEF_TX3_TXOP_LIMIT_OFDM 0
841
842#define QOS_QOS_SETS 3
843#define QOS_PARAM_SET_ACTIVE 0
844#define QOS_PARAM_SET_DEF_CCK 1
845#define QOS_PARAM_SET_DEF_OFDM 2
846
847#define CTRL_QOS_NO_ACK (0x0020)
848#define DCT_FLAG_EXT_QOS_ENABLED (0x10)
849
850#define U32_PAD(n) ((4-(n))&0x3)
851
852/*
853 * Generic queue structure
854 *
855 * Contains common data for Rx and Tx queues
856 */
857#define TFD_CTL_COUNT_SET(n) (n<<24)
858#define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7)
859#define TFD_CTL_PAD_SET(n) (n<<28)
860#define TFD_CTL_PAD_GET(ctl) (ctl>>28)
861
862#define TFD_TX_CMD_SLOTS 256 614#define TFD_TX_CMD_SLOTS 256
863#define TFD_CMD_SLOTS 32 615#define TFD_CMD_SLOTS 32
864 616
@@ -917,28 +669,13 @@ enum {
917 (((t) < IWL_TX_POWER_TEMPERATURE_MIN) || \ 669 (((t) < IWL_TX_POWER_TEMPERATURE_MIN) || \
918 ((t) > IWL_TX_POWER_TEMPERATURE_MAX)) 670 ((t) > IWL_TX_POWER_TEMPERATURE_MAX))
919 671
920#define IWL_TX_POWER_ILLEGAL_TEMPERATURE (300)
921
922#define IWL_TX_POWER_TEMPERATURE_DIFFERENCE (2)
923
924#define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6) 672#define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6)
925 673
926#define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */ 674#define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */
927#define IWL_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */ 675#define IWL_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */
928 676
929/* timeout equivalent to 3 minutes */
930#define IWL_TX_POWER_TIMELIMIT_NOCALIB 1800000000
931
932#define IWL_TX_POWER_CCK_COMPENSATION (9)
933
934#define MIN_TX_GAIN_INDEX (0) 677#define MIN_TX_GAIN_INDEX (0)
935#define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9) 678#define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9)
936#define MAX_TX_GAIN_INDEX_52GHZ (98)
937#define MIN_TX_GAIN_52GHZ (98)
938#define MAX_TX_GAIN_INDEX_24GHZ (98)
939#define MIN_TX_GAIN_24GHZ (98)
940#define MAX_TX_GAIN (0)
941#define MAX_TX_GAIN_52GHZ_EXT (-9)
942 679
943#define IWL_TX_POWER_DEFAULT_REGULATORY_24 (34) 680#define IWL_TX_POWER_DEFAULT_REGULATORY_24 (34)
944#define IWL_TX_POWER_DEFAULT_REGULATORY_52 (34) 681#define IWL_TX_POWER_DEFAULT_REGULATORY_52 (34)
@@ -949,48 +686,6 @@ enum {
949#define IWL_TX_POWER_SATURATION_MIN (20) 686#define IWL_TX_POWER_SATURATION_MIN (20)
950#define IWL_TX_POWER_SATURATION_MAX (50) 687#define IWL_TX_POWER_SATURATION_MAX (50)
951 688
952/* dv *0.4 = dt; so that 5 degrees temperature diff equals
953 * 12.5 in voltage diff */
954#define IWL_TX_TEMPERATURE_UPDATE_LIMIT 9
955
956#define IWL_INVALID_CHANNEL (0xffffffff)
957#define IWL_TX_POWER_REGITRY_BIT (2)
958
959#define MIN_IWL_TX_POWER_CALIB_DUR (100)
960#define IWL_CCK_FROM_OFDM_POWER_DIFF (-5)
961#define IWL_CCK_FROM_OFDM_INDEX_DIFF (9)
962
963/* Number of entries in the gain table */
964#define POWER_GAIN_NUM_ENTRIES 78
965#define TX_POW_MAX_SESSION_NUM 5
966/* timeout equivalent to 3 minutes */
967#define TX_IWL_TIMELIMIT_NOCALIB 1800000000
968
969/* Kedron TX_CALIB_STATES */
970#define IWL_TX_CALIB_STATE_SEND_TX 0x00000001
971#define IWL_TX_CALIB_WAIT_TX_RESPONSE 0x00000002
972#define IWL_TX_CALIB_ENABLED 0x00000004
973#define IWL_TX_CALIB_XVT_ON 0x00000008
974#define IWL_TX_CALIB_TEMPERATURE_CORRECT 0x00000010
975#define IWL_TX_CALIB_WORKING_WITH_XVT 0x00000020
976#define IWL_TX_CALIB_XVT_PERIODICAL 0x00000040
977
978#define NUM_IWL_TX_CALIB_SETTINS 5 /* Number of tx correction groups */
979
980#define IWL_MIN_POWER_IN_VP_TABLE 1 /* 0.5dBm multiplied by 2 */
981#define IWL_MAX_POWER_IN_VP_TABLE 40 /* 20dBm - multiplied by 2 (because
982 * entries are for each 0.5dBm) */
983#define IWL_STEP_IN_VP_TABLE 1 /* 0.5dB - multiplied by 2 */
984#define IWL_NUM_POINTS_IN_VPTABLE \
985 (1 + IWL_MAX_POWER_IN_VP_TABLE - IWL_MIN_POWER_IN_VP_TABLE)
986
987#define MIN_TX_GAIN_INDEX (0)
988#define MAX_TX_GAIN_INDEX_52GHZ (98)
989#define MIN_TX_GAIN_52GHZ (98)
990#define MAX_TX_GAIN_INDEX_24GHZ (98)
991#define MIN_TX_GAIN_24GHZ (98)
992#define MAX_TX_GAIN (0)
993
994/* First and last channels of all groups */ 689/* First and last channels of all groups */
995#define CALIB_IWL_TX_ATTEN_GR1_FCH 34 690#define CALIB_IWL_TX_ATTEN_GR1_FCH 34
996#define CALIB_IWL_TX_ATTEN_GR1_LCH 43 691#define CALIB_IWL_TX_ATTEN_GR1_LCH 43
@@ -1003,7 +698,6 @@ enum {
1003#define CALIB_IWL_TX_ATTEN_GR5_FCH 1 698#define CALIB_IWL_TX_ATTEN_GR5_FCH 1
1004#define CALIB_IWL_TX_ATTEN_GR5_LCH 20 699#define CALIB_IWL_TX_ATTEN_GR5_LCH 20
1005 700
1006
1007union iwl4965_tx_power_dual_stream { 701union iwl4965_tx_power_dual_stream {
1008 struct { 702 struct {
1009 u8 radio_tx_gain[2]; 703 u8 radio_tx_gain[2];
@@ -1043,23 +737,6 @@ union iwl4965_tx_power_dual_stream {
1043#define RXON_RX_CHAIN_MIMO_FORCE_POS (14) 737#define RXON_RX_CHAIN_MIMO_FORCE_POS (14)
1044 738
1045 739
1046#define MCS_DUP_6M_PLCP 0x20
1047
1048/* OFDM HT rate masks */
1049/* ***************************************** */
1050#define R_MCS_6M_MSK 0x1
1051#define R_MCS_12M_MSK 0x2
1052#define R_MCS_18M_MSK 0x4
1053#define R_MCS_24M_MSK 0x8
1054#define R_MCS_36M_MSK 0x10
1055#define R_MCS_48M_MSK 0x20
1056#define R_MCS_54M_MSK 0x40
1057#define R_MCS_60M_MSK 0x80
1058#define R_MCS_12M_DUAL_MSK 0x100
1059#define R_MCS_24M_DUAL_MSK 0x200
1060#define R_MCS_36M_DUAL_MSK 0x400
1061#define R_MCS_48M_DUAL_MSK 0x800
1062
1063/* Flow Handler Definitions */ 740/* Flow Handler Definitions */
1064 741
1065/**********************/ 742/**********************/
@@ -1107,7 +784,6 @@ union iwl4965_tx_power_dual_stream {
1107#define IWL_FH_TCSR_LOWER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xD00) 784#define IWL_FH_TCSR_LOWER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xD00)
1108#define IWL_FH_TCSR_UPPER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xE60) 785#define IWL_FH_TCSR_UPPER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xE60)
1109 786
1110#define IWL_FH_TCSR_CHNL_NUM (7)
1111#define IWL_FH_TCSR_CHNL_TX_CONFIG_REG(_chnl) \ 787#define IWL_FH_TCSR_CHNL_TX_CONFIG_REG(_chnl) \
1112 (IWL_FH_TCSR_LOWER_BOUND + 0x20 * _chnl) 788 (IWL_FH_TCSR_LOWER_BOUND + 0x20 * _chnl)
1113 789
@@ -1116,23 +792,8 @@ union iwl4965_tx_power_dual_stream {
1116#define IWL_FH_TSSR_LOWER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xEA0) 792#define IWL_FH_TSSR_LOWER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xEA0)
1117#define IWL_FH_TSSR_UPPER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xEC0) 793#define IWL_FH_TSSR_UPPER_BOUND (IWL_FH_REGS_LOWER_BOUND + 0xEC0)
1118 794
1119#define IWL_FH_TSSR_TX_MSG_CONFIG_REG (IWL_FH_TSSR_LOWER_BOUND + 0x008)
1120#define IWL_FH_TSSR_TX_STATUS_REG (IWL_FH_TSSR_LOWER_BOUND + 0x010) 795#define IWL_FH_TSSR_TX_STATUS_REG (IWL_FH_TSSR_LOWER_BOUND + 0x010)
1121 796
1122#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON (0xFF000000)
1123#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON (0x00FF0000)
1124
1125#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_64B (0x00000000)
1126#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B (0x00000400)
1127#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_256B (0x00000800)
1128#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_512B (0x00000C00)
1129
1130#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON (0x00000100)
1131#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON (0x00000080)
1132
1133#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH (0x00000020)
1134#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH (0x00000005)
1135
1136#define IWL_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) \ 797#define IWL_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) \
1137 ((1 << (_chnl)) << 24) 798 ((1 << (_chnl)) << 24)
1138#define IWL_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl) \ 799#define IWL_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl) \
@@ -1142,60 +803,21 @@ union iwl4965_tx_power_dual_stream {
1142 (IWL_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) | \ 803 (IWL_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) | \
1143 IWL_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl)) 804 IWL_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl))
1144 805
1145/* TCSR: tx_config register values */
1146#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF (0x00000000)
1147#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER (0x00000001)
1148#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_ARC (0x00000002)
1149
1150#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL (0x00000000)
1151#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008) 806#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008)
1152 807
1153#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_NOINT (0x00000000)
1154#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD (0x00100000)
1155#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD (0x00200000)
1156
1157#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT (0x00000000)
1158#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_ENDTFD (0x00400000)
1159#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_IFTFD (0x00800000)
1160
1161#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE (0x00000000)
1162#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE_EOF (0x40000000)
1163#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000) 808#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000)
1164 809
1165#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_EMPTY (0x00000000)
1166#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_WAIT (0x00002000)
1167#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID (0x00000003)
1168
1169#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR (0x00000001)
1170
1171#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM (20)
1172#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_IDX (12)
1173
1174/* RCSR: channel 0 rx_config register defines */ 810/* RCSR: channel 0 rx_config register defines */
1175#define FH_RCSR_CHNL0_RX_CONFIG_DMA_CHNL_EN_MASK (0xC0000000) /* bits 30-31 */
1176#define FH_RCSR_CHNL0_RX_CONFIG_RBDBC_SIZE_MASK (0x00F00000) /* bits 20-23 */
1177#define FH_RCSR_CHNL0_RX_CONFIG_RB_SIZE_MASK (0x00030000) /* bits 16-17 */
1178#define FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MASK (0x00008000) /* bit 15 */
1179#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_MASK (0x00001000) /* bit 12 */
1180#define FH_RCSR_CHNL0_RX_CONFIG_RB_TIMEOUT_MASK (0x00000FF0) /* bit 4-11 */
1181 811
1182#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT (20) 812#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT (20)
1183#define FH_RCSR_RX_CONFIG_RB_SIZE_BITSHIFT (16)
1184 813
1185/* RCSR: rx_config register values */
1186#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_VAL (0x00000000)
1187#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_EOF_VAL (0x40000000)
1188#define FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL (0x80000000) 814#define FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL (0x80000000)
1189 815
1190#define IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K (0x00000000) 816#define IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K (0x00000000)
1191 817
1192/* RCSR channel 0 config register values */ 818/* RCSR channel 0 config register values */
1193#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_NO_INT_VAL (0x00000000)
1194#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL (0x00001000) 819#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL (0x00001000)
1195 820
1196/* RSCSR: defs used in normal mode */
1197#define FH_RSCSR_CHNL0_RBDCB_WPTR_MASK (0x00000FFF) /* bits 0-11 */
1198
1199#define SCD_WIN_SIZE 64 821#define SCD_WIN_SIZE 64
1200#define SCD_FRAME_LIMIT 64 822#define SCD_FRAME_LIMIT 64
1201 823
@@ -1210,12 +832,6 @@ union iwl4965_tx_power_dual_stream {
1210#define SCD_TXFACT_REG_TXFIFO_MASK(lo, hi) \ 832#define SCD_TXFACT_REG_TXFIFO_MASK(lo, hi) \
1211 ((1<<(hi))|((1<<(hi))-(1<<(lo)))) 833 ((1<<(hi))|((1<<(hi))-(1<<(lo))))
1212 834
1213
1214#define SCD_MODE_REG_BIT_SEARCH_MODE (1<<0)
1215#define SCD_MODE_REG_BIT_SBYP_MODE (1<<1)
1216
1217#define SCD_TXFIFO_POS_TID (0)
1218#define SCD_TXFIFO_POS_RA (4)
1219#define SCD_QUEUE_STTS_REG_POS_ACTIVE (0) 835#define SCD_QUEUE_STTS_REG_POS_ACTIVE (0)
1220#define SCD_QUEUE_STTS_REG_POS_TXF (1) 836#define SCD_QUEUE_STTS_REG_POS_TXF (1)
1221#define SCD_QUEUE_STTS_REG_POS_WSL (5) 837#define SCD_QUEUE_STTS_REG_POS_WSL (5)
@@ -1223,14 +839,9 @@ union iwl4965_tx_power_dual_stream {
1223#define SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN (10) 839#define SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN (10)
1224#define SCD_QUEUE_STTS_REG_MSK (0x0007FC00) 840#define SCD_QUEUE_STTS_REG_MSK (0x0007FC00)
1225 841
1226#define SCD_QUEUE_RA_TID_MAP_RATID_MSK (0x01FF)
1227
1228#define SCD_QUEUE_CTX_REG1_WIN_SIZE_POS (0) 842#define SCD_QUEUE_CTX_REG1_WIN_SIZE_POS (0)
1229#define SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK (0x0000007F) 843#define SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK (0x0000007F)
1230#define SCD_QUEUE_CTX_REG1_CREDIT_POS (8) 844
1231#define SCD_QUEUE_CTX_REG1_CREDIT_MSK (0x00FFFF00)
1232#define SCD_QUEUE_CTX_REG1_SUPER_CREDIT_POS (24)
1233#define SCD_QUEUE_CTX_REG1_SUPER_CREDIT_MSK (0xFF000000)
1234#define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS (16) 845#define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS (16)
1235#define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK (0x007F0000) 846#define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK (0x007F0000)
1236 847