Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
0004  * All rights reserved.
0005  *
0006  * Purpose: Implement functions to access eeprom
0007  *
0008  * Author: Jerry Chen
0009  *
0010  * Date: Jan 29, 2003
0011  */
0012 
0013 #ifndef __SROM_H__
0014 #define __SROM_H__
0015 
0016 /*---------------------  Export Definitions -------------------------*/
0017 
0018 #define EEP_MAX_CONTEXT_SIZE    256
0019 
0020 #define CB_EEPROM_READBYTE_WAIT 900     /* us */
0021 
0022 #define W_MAX_I2CRETRY          0x0fff
0023 
0024 /* Contents in the EEPROM */
0025 #define EEP_OFS_PAR         0x00        /* physical address */
0026 #define EEP_OFS_ANTENNA     0x16
0027 #define EEP_OFS_RADIOCTL    0x17
0028 #define EEP_OFS_RFTYPE      0x1B        /* for select RF */
0029 #define EEP_OFS_MINCHANNEL  0x1C        /* Min Channel # */
0030 #define EEP_OFS_MAXCHANNEL  0x1D        /* Max Channel # */
0031 #define EEP_OFS_SIGNATURE   0x1E
0032 #define EEP_OFS_ZONETYPE    0x1F
0033 #define EEP_OFS_RFTABLE     0x20        /* RF POWER TABLE */
0034 #define EEP_OFS_PWR_CCK     0x20
0035 #define EEP_OFS_SETPT_CCK   0x21
0036 #define EEP_OFS_PWR_OFDMG   0x23
0037 #define EEP_OFS_SETPT_OFDMG 0x24
0038 #define EEP_OFS_PWR_FORMULA_OST  0x26
0039 #define EEP_OFS_MAJOR_VER 0x2E
0040 #define EEP_OFS_MINOR_VER 0x2F
0041 #define EEP_OFS_CCK_PWR_TBL     0x30
0042 #define EEP_OFS_CCK_PWR_dBm     0x3F
0043 #define EEP_OFS_OFDM_PWR_TBL    0x40
0044 #define EEP_OFS_OFDM_PWR_dBm    0x4F
0045 /*{{ RobertYu: 20041124 */
0046 #define EEP_OFS_SETPT_OFDMA         0x4E
0047 #define EEP_OFS_OFDMA_PWR_TBL       0x50
0048 /*}}*/
0049 #define EEP_OFS_OFDMA_PWR_dBm       0xD2
0050 
0051 /*----------need to remove --------------------*/
0052 #define EEP_OFS_BBTAB_LEN   0x70        /* BB Table Length */
0053 #define EEP_OFS_BBTAB_ADR   0x71        /* BB Table Offset */
0054 #define EEP_OFS_CHECKSUM    0xFF        /* reserved area for baseband 28h~78h */
0055 
0056 #define EEP_I2C_DEV_ID      0x50        /* EEPROM device address on I2C bus */
0057 
0058 /* Bits in EEP_OFS_ANTENNA */
0059 #define EEP_ANTENNA_MAIN    0x01
0060 #define EEP_ANTENNA_AUX     0x02
0061 #define EEP_ANTINV          0x04
0062 
0063 /* Bits in EEP_OFS_RADIOCTL */
0064 #define EEP_RADIOCTL_ENABLE 0x80
0065 #define EEP_RADIOCTL_INV    0x01
0066 
0067 /*---------------------  Export Types  ------------------------------*/
0068 
0069 /*---------------------  Export Macros ------------------------------*/
0070 
0071 /*---------------------  Export Classes  ----------------------------*/
0072 
0073 /*---------------------  Export Variables  --------------------------*/
0074 
0075 /*---------------------  Export Functions  --------------------------*/
0076 
0077 unsigned char SROMbyReadEmbedded(void __iomem *iobase,
0078                  unsigned char byContntOffset);
0079 
0080 void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);
0081 
0082 void SROMvReadEtherAddress(void __iomem *iobase,
0083                unsigned char *pbyEtherAddress);
0084 
0085 #endif /* __EEPROM_H__*/