aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/hw.h
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2008-12-08 09:13:48 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-12 13:48:26 -0500
commite7594072a5b918510c937c1ab0acad4e8a931bc7 (patch)
tree50cc34039e87fc3152c54073b9349971249b050f /drivers/net/wireless/ath9k/hw.h
parente8fbc99edfe0efa0b42f04587a79a6b3371f961a (diff)
ath9k: Adding support for Atheros AR9285 chipset.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/hw.h')
-rw-r--r--drivers/net/wireless/ath9k/hw.h135
1 files changed, 130 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath9k/hw.h b/drivers/net/wireless/ath9k/hw.h
index 02256c3ec076..a4d52850bdd0 100644
--- a/drivers/net/wireless/ath9k/hw.h
+++ b/drivers/net/wireless/ath9k/hw.h
@@ -448,6 +448,17 @@ struct ar5416Stats {
448#define AR5416_EEP_TXGAIN_ORIGINAL 0 448#define AR5416_EEP_TXGAIN_ORIGINAL 0
449#define AR5416_EEP_TXGAIN_HIGH_POWER 1 449#define AR5416_EEP_TXGAIN_HIGH_POWER 1
450 450
451#define AR5416_EEP4K_START_LOC 64
452#define AR5416_EEP4K_NUM_2G_CAL_PIERS 3
453#define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS 3
454#define AR5416_EEP4K_NUM_2G_20_TARGET_POWERS 3
455#define AR5416_EEP4K_NUM_2G_40_TARGET_POWERS 3
456#define AR5416_EEP4K_NUM_CTLS 12
457#define AR5416_EEP4K_NUM_BAND_EDGES 4
458#define AR5416_EEP4K_NUM_PD_GAINS 2
459#define AR5416_EEP4K_PD_GAINS_IN_MASK 4
460#define AR5416_EEP4K_PD_GAIN_ICEPTS 5
461#define AR5416_EEP4K_MAX_CHAINS 1
451 462
452enum eeprom_param { 463enum eeprom_param {
453 EEP_NFTHRESH_5, 464 EEP_NFTHRESH_5,
@@ -507,6 +518,25 @@ struct base_eep_header {
507 u8 futureBase_3[25]; 518 u8 futureBase_3[25];
508} __packed; 519} __packed;
509 520
521struct base_eep_header_4k {
522 u16 length;
523 u16 checksum;
524 u16 version;
525 u8 opCapFlags;
526 u8 eepMisc;
527 u16 regDmn[2];
528 u8 macAddr[6];
529 u8 rxMask;
530 u8 txMask;
531 u16 rfSilent;
532 u16 blueToothOptions;
533 u16 deviceCap;
534 u32 binBuildNumber;
535 u8 deviceType;
536 u8 futureBase[1];
537} __packed;
538
539
510struct spur_chan { 540struct spur_chan {
511 u16 spurChan; 541 u16 spurChan;
512 u8 spurRangeLow; 542 u8 spurRangeLow;
@@ -559,11 +589,58 @@ struct modal_eep_header {
559 struct spur_chan spurChans[AR5416_EEPROM_MODAL_SPURS]; 589 struct spur_chan spurChans[AR5416_EEPROM_MODAL_SPURS];
560} __packed; 590} __packed;
561 591
592struct modal_eep_4k_header {
593 u32 antCtrlChain[AR5416_EEP4K_MAX_CHAINS];
594 u32 antCtrlCommon;
595 u8 antennaGainCh[AR5416_EEP4K_MAX_CHAINS];
596 u8 switchSettling;
597 u8 txRxAttenCh[AR5416_EEP4K_MAX_CHAINS];
598 u8 rxTxMarginCh[AR5416_EEP4K_MAX_CHAINS];
599 u8 adcDesiredSize;
600 u8 pgaDesiredSize;
601 u8 xlnaGainCh[AR5416_EEP4K_MAX_CHAINS];
602 u8 txEndToXpaOff;
603 u8 txEndToRxOn;
604 u8 txFrameToXpaOn;
605 u8 thresh62;
606 u8 noiseFloorThreshCh[AR5416_EEP4K_MAX_CHAINS];
607 u8 xpdGain;
608 u8 xpd;
609 u8 iqCalICh[AR5416_EEP4K_MAX_CHAINS];
610 u8 iqCalQCh[AR5416_EEP4K_MAX_CHAINS];
611 u8 pdGainOverlap;
612 u8 ob_01;
613 u8 db1_01;
614 u8 xpaBiasLvl;
615 u8 txFrameToDataStart;
616 u8 txFrameToPaOn;
617 u8 ht40PowerIncForPdadc;
618 u8 bswAtten[AR5416_EEP4K_MAX_CHAINS];
619 u8 bswMargin[AR5416_EEP4K_MAX_CHAINS];
620 u8 swSettleHt40;
621 u8 xatten2Db[AR5416_EEP4K_MAX_CHAINS];
622 u8 xatten2Margin[AR5416_EEP4K_MAX_CHAINS];
623 u8 db2_01;
624 u8 version;
625 u16 ob_234;
626 u16 db1_234;
627 u16 db2_234;
628 u8 futureModal[4];
629
630 struct spur_chan spurChans[AR5416_EEPROM_MODAL_SPURS];
631} __packed;
632
633
562struct cal_data_per_freq { 634struct cal_data_per_freq {
563 u8 pwrPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]; 635 u8 pwrPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
564 u8 vpdPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]; 636 u8 vpdPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
565} __packed; 637} __packed;
566 638
639struct cal_data_per_freq_4k {
640 u8 pwrPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_EEP4K_PD_GAIN_ICEPTS];
641 u8 vpdPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_EEP4K_PD_GAIN_ICEPTS];
642} __packed;
643
567struct cal_target_power_leg { 644struct cal_target_power_leg {
568 u8 bChannel; 645 u8 bChannel;
569 u8 tPow2x[4]; 646 u8 tPow2x[4];
@@ -574,6 +651,7 @@ struct cal_target_power_ht {
574 u8 tPow2x[8]; 651 u8 tPow2x[8];
575} __packed; 652} __packed;
576 653
654
577#ifdef __BIG_ENDIAN_BITFIELD 655#ifdef __BIG_ENDIAN_BITFIELD
578struct cal_ctl_edges { 656struct cal_ctl_edges {
579 u8 bChannel; 657 u8 bChannel;
@@ -588,10 +666,15 @@ struct cal_ctl_edges {
588 666
589struct cal_ctl_data { 667struct cal_ctl_data {
590 struct cal_ctl_edges 668 struct cal_ctl_edges
591 ctlEdges[AR5416_MAX_CHAINS][AR5416_NUM_BAND_EDGES]; 669 ctlEdges[AR5416_MAX_CHAINS][AR5416_NUM_BAND_EDGES];
670} __packed;
671
672struct cal_ctl_data_4k {
673 struct cal_ctl_edges
674 ctlEdges[AR5416_EEP4K_MAX_CHAINS][AR5416_EEP4K_NUM_BAND_EDGES];
592} __packed; 675} __packed;
593 676
594struct ar5416_eeprom { 677struct ar5416_eeprom_def {
595 struct base_eep_header baseEepHeader; 678 struct base_eep_header baseEepHeader;
596 u8 custData[64]; 679 u8 custData[64];
597 struct modal_eep_header modalHeader[2]; 680 struct modal_eep_header modalHeader[2];
@@ -620,6 +703,26 @@ struct ar5416_eeprom {
620 u8 padding; 703 u8 padding;
621} __packed; 704} __packed;
622 705
706struct ar5416_eeprom_4k {
707 struct base_eep_header_4k baseEepHeader;
708 u8 custData[20];
709 struct modal_eep_4k_header modalHeader;
710 u8 calFreqPier2G[AR5416_EEP4K_NUM_2G_CAL_PIERS];
711 struct cal_data_per_freq_4k
712 calPierData2G[AR5416_EEP4K_MAX_CHAINS][AR5416_EEP4K_NUM_2G_CAL_PIERS];
713 struct cal_target_power_leg
714 calTargetPowerCck[AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS];
715 struct cal_target_power_leg
716 calTargetPower2G[AR5416_EEP4K_NUM_2G_20_TARGET_POWERS];
717 struct cal_target_power_ht
718 calTargetPower2GHT20[AR5416_EEP4K_NUM_2G_20_TARGET_POWERS];
719 struct cal_target_power_ht
720 calTargetPower2GHT40[AR5416_EEP4K_NUM_2G_40_TARGET_POWERS];
721 u8 ctlIndex[AR5416_EEP4K_NUM_CTLS];
722 struct cal_ctl_data_4k ctlData[AR5416_EEP4K_NUM_CTLS];
723 u8 padding;
724} __packed;
725
623struct ar5416IniArray { 726struct ar5416IniArray {
624 u32 *ia_array; 727 u32 *ia_array;
625 u32 ia_rows; 728 u32 ia_rows;
@@ -687,9 +790,22 @@ struct hal_cal_list {
687 struct hal_cal_list *calNext; 790 struct hal_cal_list *calNext;
688}; 791};
689 792
793/*
794 * Enum to indentify the eeprom mappings
795 */
796enum hal_eep_map {
797 EEP_MAP_DEFAULT = 0x0,
798 EEP_MAP_4KBITS,
799 EEP_MAP_MAX
800};
801
802
690struct ath_hal_5416 { 803struct ath_hal_5416 {
691 struct ath_hal ah; 804 struct ath_hal ah;
692 struct ar5416_eeprom ah_eeprom; 805 union {
806 struct ar5416_eeprom_def def;
807 struct ar5416_eeprom_4k map4k;
808 } ah_eeprom;
693 struct ar5416Stats ah_stats; 809 struct ar5416Stats ah_stats;
694 struct ath9k_tx_queue_info ah_txq[ATH9K_NUM_TX_QUEUES]; 810 struct ath9k_tx_queue_info ah_txq[ATH9K_NUM_TX_QUEUES];
695 void __iomem *ah_cal_mem; 811 void __iomem *ah_cal_mem;
@@ -813,6 +929,8 @@ struct ath_hal_5416 {
813 struct ar5416IniArray ah_iniModesAdditional; 929 struct ar5416IniArray ah_iniModesAdditional;
814 struct ar5416IniArray ah_iniModesRxGain; 930 struct ar5416IniArray ah_iniModesRxGain;
815 struct ar5416IniArray ah_iniModesTxGain; 931 struct ar5416IniArray ah_iniModesTxGain;
932 /* To indicate EEPROM mapping used */
933 enum hal_eep_map ah_eep_map;
816}; 934};
817#define AH5416(_ah) ((struct ath_hal_5416 *)(_ah)) 935#define AH5416(_ah) ((struct ath_hal_5416 *)(_ah))
818 936
@@ -854,13 +972,20 @@ struct ath_hal_5416 {
854 (AR_SREV_9100(ah)) ? 0x1fff1000 : 0x503f1200 972 (AR_SREV_9100(ah)) ? 0x1fff1000 : 0x503f1200
855#define AR5416_EEPROM_MAX 0xae0 973#define AR5416_EEPROM_MAX 0xae0
856#define ar5416_get_eep_ver(_ahp) \ 974#define ar5416_get_eep_ver(_ahp) \
857 (((_ahp)->ah_eeprom.baseEepHeader.version >> 12) & 0xF) 975 (((_ahp)->ah_eeprom.def.baseEepHeader.version >> 12) & 0xF)
858#define ar5416_get_eep_rev(_ahp) \ 976#define ar5416_get_eep_rev(_ahp) \
859 (((_ahp)->ah_eeprom.baseEepHeader.version) & 0xFFF) 977 (((_ahp)->ah_eeprom.def.baseEepHeader.version) & 0xFFF)
860#define ar5416_get_ntxchains(_txchainmask) \ 978#define ar5416_get_ntxchains(_txchainmask) \
861 (((_txchainmask >> 2) & 1) + \ 979 (((_txchainmask >> 2) & 1) + \
862 ((_txchainmask >> 1) & 1) + (_txchainmask & 1)) 980 ((_txchainmask >> 1) & 1) + (_txchainmask & 1))
863 981
982/* EEPROM 4K bit map definations */
983#define ar5416_get_eep4k_ver(_ahp) \
984 (((_ahp)->ah_eeprom.map4k.baseEepHeader.version >> 12) & 0xF)
985#define ar5416_get_eep4k_rev(_ahp) \
986 (((_ahp)->ah_eeprom.map4k.baseEepHeader.version) & 0xFFF)
987
988
864#ifdef __BIG_ENDIAN 989#ifdef __BIG_ENDIAN
865#define AR5416_EEPROM_MAGIC 0x5aa5 990#define AR5416_EEPROM_MAGIC 0x5aa5
866#else 991#else