Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 1 | #ifndef _R819XU_PHY_H |
| 2 | #define _R819XU_PHY_H |
| 3 | |
Xenia Ragiadakou | 2703d1b | 2013-06-25 02:28:59 +0300 | [diff] [blame] | 4 | /* Channel switch: The size of command tables for switch channel */ |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 5 | #define MAX_PRECMD_CNT 16 |
| 6 | #define MAX_RFDEPENDCMD_CNT 16 |
| 7 | #define MAX_POSTCMD_CNT 16 |
| 8 | |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 9 | typedef enum _SwChnlCmdID { |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 10 | CmdID_End, |
| 11 | CmdID_SetTxPowerLevel, |
| 12 | CmdID_BBRegWrite10, |
| 13 | CmdID_WritePortUlong, |
| 14 | CmdID_WritePortUshort, |
| 15 | CmdID_WritePortUchar, |
| 16 | CmdID_RF_WriteReg, |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 17 | } SwChnlCmdID; |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 18 | |
Xenia Ragiadakou | 2703d1b | 2013-06-25 02:28:59 +0300 | [diff] [blame] | 19 | /* -----------------------Define structure---------------------- */ |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 20 | /* 1. Switch channel related */ |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 21 | typedef struct _SwChnlCmd { |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 22 | SwChnlCmdID CmdID; |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 23 | u32 Para1; |
| 24 | u32 Para2; |
| 25 | u32 msDelay; |
| 26 | } __attribute__ ((packed)) SwChnlCmd; |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 27 | |
| 28 | extern u32 rtl819XMACPHY_Array_PG[]; |
| 29 | extern u32 rtl819XPHY_REG_1T2RArray[]; |
| 30 | extern u32 rtl819XAGCTAB_Array[]; |
| 31 | extern u32 rtl819XRadioA_Array[]; |
| 32 | extern u32 rtl819XRadioB_Array[]; |
| 33 | extern u32 rtl819XRadioC_Array[]; |
| 34 | extern u32 rtl819XRadioD_Array[]; |
| 35 | |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 36 | typedef enum _HW90_BLOCK { |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 37 | HW90_BLOCK_MAC = 0, |
| 38 | HW90_BLOCK_PHY0 = 1, |
| 39 | HW90_BLOCK_PHY1 = 2, |
| 40 | HW90_BLOCK_RF = 3, |
Xenia Ragiadakou | 2703d1b | 2013-06-25 02:28:59 +0300 | [diff] [blame] | 41 | HW90_BLOCK_MAXIMUM = 4, /* Never use this */ |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 42 | } HW90_BLOCK_E, *PHW90_BLOCK_E; |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 43 | |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 44 | typedef enum _RF90_RADIO_PATH { |
Xenia Ragiadakou | 2703d1b | 2013-06-25 02:28:59 +0300 | [diff] [blame] | 45 | RF90_PATH_A = 0, /* Radio Path A */ |
| 46 | RF90_PATH_B = 1, /* Radio Path B */ |
| 47 | RF90_PATH_C = 2, /* Radio Path C */ |
| 48 | RF90_PATH_D = 3, /* Radio Path D */ |
| 49 | RF90_PATH_MAX /* Max RF number 92 support */ |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 50 | } RF90_RADIO_PATH_E, *PRF90_RADIO_PATH_E; |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 51 | |
| 52 | #define bMaskByte0 0xff |
| 53 | #define bMaskByte1 0xff00 |
| 54 | #define bMaskByte2 0xff0000 |
| 55 | #define bMaskByte3 0xff000000 |
| 56 | #define bMaskHWord 0xffff0000 |
| 57 | #define bMaskLWord 0x0000ffff |
| 58 | #define bMaskDWord 0xffffffff |
| 59 | |
Xenia Ragiadakou | 88d8fe2 | 2013-05-11 17:22:22 +0300 | [diff] [blame] | 60 | extern u8 rtl8192_phy_CheckIsLegalRFPath(struct net_device *dev, u32 eRFPath); |
Xenia Ragiadakou | 59f30ae | 2013-06-25 02:29:01 +0300 | [diff] [blame^] | 61 | extern void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr, |
| 62 | u32 bitmask, u32 data); |
| 63 | extern u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, |
| 64 | u32 bitmask); |
| 65 | extern void rtl8192_phy_SetRFReg(struct net_device *dev, |
| 66 | RF90_RADIO_PATH_E eRFPath, u32 reg_addr, u32 bitmask, u32 data); |
| 67 | extern u32 rtl8192_phy_QueryRFReg(struct net_device *dev, |
| 68 | RF90_RADIO_PATH_E eRFPath, u32 reg_addr, u32 bitmask); |
Xenia Ragiadakou | 88d8fe2 | 2013-05-11 17:22:22 +0300 | [diff] [blame] | 69 | extern void rtl8192_phy_configmac(struct net_device *dev); |
| 70 | extern void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType); |
Xenia Ragiadakou | 59f30ae | 2013-06-25 02:29:01 +0300 | [diff] [blame^] | 71 | extern u8 rtl8192_phy_checkBBAndRF(struct net_device *dev, |
| 72 | HW90_BLOCK_E CheckBlock, RF90_RADIO_PATH_E eRFPath); |
Xenia Ragiadakou | 88d8fe2 | 2013-05-11 17:22:22 +0300 | [diff] [blame] | 73 | extern void rtl8192_BBConfig(struct net_device *dev); |
| 74 | extern void rtl8192_phy_getTxPower(struct net_device *dev); |
| 75 | extern void rtl8192_phy_setTxPower(struct net_device *dev, u8 channel); |
| 76 | extern void rtl8192_phy_RFConfig(struct net_device *dev); |
| 77 | extern void rtl8192_phy_updateInitGain(struct net_device *dev); |
Xenia Ragiadakou | 59f30ae | 2013-06-25 02:29:01 +0300 | [diff] [blame^] | 78 | extern u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_device *dev, |
| 79 | RF90_RADIO_PATH_E eRFPath); |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 80 | |
Xenia Ragiadakou | 88d8fe2 | 2013-05-11 17:22:22 +0300 | [diff] [blame] | 81 | extern u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel); |
Xenia Ragiadakou | 59f30ae | 2013-06-25 02:29:01 +0300 | [diff] [blame^] | 82 | extern void rtl8192_SetBWMode(struct net_device *dev, |
| 83 | HT_CHANNEL_WIDTH bandwidth, HT_EXTCHNL_OFFSET offset); |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 84 | extern void rtl8192_SwChnl_WorkItem(struct net_device *dev); |
| 85 | void rtl8192_SetBWModeWorkItem(struct net_device *dev); |
Xenia Ragiadakou | 59f30ae | 2013-06-25 02:29:01 +0300 | [diff] [blame^] | 86 | extern bool rtl8192_SetRFPowerState(struct net_device *dev, |
| 87 | RT_RF_POWER_STATE eRFPowerState); |
Xenia Ragiadakou | 19e918f | 2013-06-25 02:28:58 +0300 | [diff] [blame] | 88 | extern void InitialGain819xUsb(struct net_device *dev, u8 Operation); |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 89 | |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 90 | extern void InitialGainOperateWorkItemCallBack(struct work_struct *work); |
Jerry Chuang | 8fc8598 | 2009-11-03 07:17:11 -0200 | [diff] [blame] | 91 | |
| 92 | #endif |