rtl871x_eeprom.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __RTL871X_EEPROM_H__
  21. #define __RTL871X_EEPROM_H__
  22. #include "osdep_service.h"
  23. #define RTL8712_EEPROM_ID 0x8712
  24. #define EEPROM_MAX_SIZE 256
  25. #define CLOCK_RATE 50 /*100us*/
  26. /*- EEPROM opcodes*/
  27. #define EEPROM_READ_OPCODE 06
  28. #define EEPROM_WRITE_OPCODE 05
  29. #define EEPROM_ERASE_OPCODE 07
  30. #define EEPROM_EWEN_OPCODE 19 /* Erase/write enable*/
  31. #define EEPROM_EWDS_OPCODE 16 /* Erase/write disable*/
  32. #define EEPROM_CID_DEFAULT 0x0
  33. #define EEPROM_CID_ALPHA 0x1
  34. #define EEPROM_CID_Senao 0x3
  35. #define EEPROM_CID_NetCore 0x5
  36. #define EEPROM_CID_CAMEO 0X8
  37. #define EEPROM_CID_SITECOM 0x9
  38. #define EEPROM_CID_COREGA 0xB
  39. #define EEPROM_CID_EDIMAX_BELKIN 0xC
  40. #define EEPROM_CID_SERCOMM_BELKIN 0xE
  41. #define EEPROM_CID_CAMEO1 0xF
  42. #define EEPROM_CID_WNC_COREGA 0x12
  43. #define EEPROM_CID_CLEVO 0x13
  44. #define EEPROM_CID_WHQL 0xFE
  45. enum RT_CUSTOMER_ID {
  46. RT_CID_DEFAULT = 0,
  47. RT_CID_8187_ALPHA0 = 1,
  48. RT_CID_8187_SERCOMM_PS = 2,
  49. RT_CID_8187_HW_LED = 3,
  50. RT_CID_8187_NETGEAR = 4,
  51. RT_CID_WHQL = 5,
  52. RT_CID_819x_CAMEO = 6,
  53. RT_CID_819x_RUNTOP = 7,
  54. RT_CID_819x_Senao = 8,
  55. RT_CID_TOSHIBA = 9,
  56. RT_CID_819x_Netcore = 10,
  57. RT_CID_Nettronix = 11,
  58. RT_CID_DLINK = 12,
  59. RT_CID_PRONET = 13,
  60. RT_CID_COREGA = 14,
  61. RT_CID_819x_ALPHA = 15,
  62. RT_CID_819x_Sitecom = 16,
  63. RT_CID_CCX = 17,
  64. RT_CID_819x_Lenovo = 18,
  65. RT_CID_819x_QMI = 19,
  66. RT_CID_819x_Edimax_Belkin = 20,
  67. RT_CID_819x_Sercomm_Belkin = 21,
  68. RT_CID_819x_CAMEO1 = 22,
  69. RT_CID_819x_MSI = 23,
  70. RT_CID_819x_Acer = 24,
  71. RT_CID_819x_AzWave_ASUS = 25,
  72. RT_CID_819x_AzWave = 26,
  73. RT_CID_819x_WNC_COREGA = 27,
  74. RT_CID_819x_CLEVO = 28,
  75. };
  76. struct eeprom_priv {
  77. u8 bautoload_fail_flag;
  78. u8 bempty;
  79. u8 sys_config;
  80. u8 mac_addr[6];
  81. u8 config0;
  82. u16 channel_plan;
  83. u8 country_string[3];
  84. u8 tx_power_b[15];
  85. u8 tx_power_g[15];
  86. u8 tx_power_a[201];
  87. u8 efuse_eeprom_data[EEPROM_MAX_SIZE];
  88. enum RT_CUSTOMER_ID CustomerID;
  89. };
  90. void r8712_eeprom_write16(struct _adapter *padapter, u16 reg, u16 data);
  91. u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg);
  92. #endif /*__RTL871X_EEPROM_H__*/