rtl8712_hal.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. * Modifications for inclusion into the Linux staging tree are
  19. * Copyright(c) 2010 Larry Finger. All rights reserved.
  20. *
  21. * Contact information:
  22. * WLAN FAE <wlanfae@realtek.com>
  23. * Larry Finger <Larry.Finger@lwfinger.net>
  24. *
  25. ******************************************************************************/
  26. #ifndef __RTL8712_HAL_H__
  27. #define __RTL8712_HAL_H__
  28. enum _HW_VERSION {
  29. RTL8712_FPGA,
  30. RTL8712_1stCUT, /*A Cut (RTL8712_ASIC)*/
  31. RTL8712_2ndCUT, /*B Cut*/
  32. RTL8712_3rdCUT, /*C Cut*/
  33. };
  34. enum _LOOPBACK_TYPE {
  35. RTL8712_AIR_TRX = 0,
  36. RTL8712_MAC_LBK,
  37. RTL8712_BB_LBK,
  38. RTL8712_MAC_FW_LBK = 4,
  39. RTL8712_BB_FW_LBK = 8,
  40. };
  41. enum RTL871X_HCI_TYPE {
  42. RTL8712_SDIO,
  43. RTL8712_USB,
  44. };
  45. enum RTL8712_RF_CONFIG {
  46. RTL8712_RF_1T1R,
  47. RTL8712_RF_1T2R,
  48. RTL8712_RF_2T2R
  49. };
  50. enum _RTL8712_HCI_TYPE_ {
  51. RTL8712_HCI_TYPE_PCIE = 0x01,
  52. RTL8712_HCI_TYPE_AP_PCIE = 0x81,
  53. RTL8712_HCI_TYPE_USB = 0x02,
  54. RTL8712_HCI_TYPE_92USB = 0x02,
  55. RTL8712_HCI_TYPE_AP_USB = 0x82,
  56. RTL8712_HCI_TYPE_72USB = 0x12,
  57. RTL8712_HCI_TYPE_SDIO = 0x04,
  58. RTL8712_HCI_TYPE_72SDIO = 0x14
  59. };
  60. struct fw_priv { /*8-bytes alignment required*/
  61. /*--- long word 0 ----*/
  62. unsigned char signature_0; /*0x12: CE product, 0x92: IT product*/
  63. unsigned char signature_1; /*0x87: CE product, 0x81: IT product*/
  64. unsigned char hci_sel; /*0x81: PCI-AP, 01:PCIe, 02: 92S-U, 0x82: USB-AP,
  65. * 0x12: 72S-U, 03:SDIO
  66. */
  67. unsigned char chip_version; /*the same value as register value*/
  68. unsigned char customer_ID_0; /*customer ID low byte*/
  69. unsigned char customer_ID_1; /*customer ID high byte*/
  70. unsigned char rf_config; /*0x11: 1T1R, 0x12: 1T2R, 0x92: 1T2R turbo,
  71. * 0x22: 2T2R
  72. */
  73. unsigned char usb_ep_num; /* 4: 4EP, 6: 6EP, 11: 11EP*/
  74. /*--- long word 1 ----*/
  75. unsigned char regulatory_class_0; /*regulatory class bit map 0*/
  76. unsigned char regulatory_class_1; /*regulatory class bit map 1*/
  77. unsigned char regulatory_class_2; /*regulatory class bit map 2*/
  78. unsigned char regulatory_class_3; /*regulatory class bit map 3*/
  79. unsigned char rfintfs; /* 0:SWSI, 1:HWSI, 2:HWPI*/
  80. unsigned char def_nettype;
  81. unsigned char turboMode;
  82. unsigned char lowPowerMode;/* 0: normal mode, 1: low power mode*/
  83. /*--- long word 2 ----*/
  84. unsigned char lbk_mode; /*0x00: normal, 0x03: MACLBK, 0x01: PHYLBK*/
  85. unsigned char mp_mode; /* 1: for MP use, 0: for normal driver */
  86. unsigned char vcsType; /* 0:off 1:on 2:auto */
  87. unsigned char vcsMode; /* 1:RTS/CTS 2:CTS to self */
  88. unsigned char rsvd022;
  89. unsigned char rsvd023;
  90. unsigned char rsvd024;
  91. unsigned char rsvd025;
  92. /*--- long word 3 ----*/
  93. unsigned char qos_en; /*1: QoS enable*/
  94. unsigned char bw_40MHz_en; /*1: 40MHz BW enable*/
  95. unsigned char AMSDU2AMPDU_en; /*1: 4181 convert AMSDU to AMPDU,
  96. * 0: disable
  97. */
  98. unsigned char AMPDU_en; /*1: 11n AMPDU enable*/
  99. unsigned char rate_control_offload; /*1: FW offloads,0: driver handles*/
  100. unsigned char aggregation_offload; /*1: FW offloads,0: driver handles*/
  101. unsigned char rsvd030;
  102. unsigned char rsvd031;
  103. /*--- long word 4 ----*/
  104. unsigned char beacon_offload; /* 1. FW offloads, 0: driver handles*/
  105. unsigned char MLME_offload; /* 2. FW offloads, 0: driver handles*/
  106. unsigned char hwpc_offload; /* 3. FW offloads, 0: driver handles*/
  107. unsigned char tcp_checksum_offload; /*4. FW offloads,0: driver handles*/
  108. unsigned char tcp_offload; /* 5. FW offloads, 0: driver handles*/
  109. unsigned char ps_control_offload; /* 6. FW offloads, 0: driver handles*/
  110. unsigned char WWLAN_offload; /* 7. FW offloads, 0: driver handles*/
  111. unsigned char rsvd040;
  112. /*--- long word 5 ----*/
  113. unsigned char tcp_tx_frame_len_L; /*tcp tx packet length low byte*/
  114. unsigned char tcp_tx_frame_len_H; /*tcp tx packet length high byte*/
  115. unsigned char tcp_rx_frame_len_L; /*tcp rx packet length low byte*/
  116. unsigned char tcp_rx_frame_len_H; /*tcp rx packet length high byte*/
  117. unsigned char rsvd050;
  118. unsigned char rsvd051;
  119. unsigned char rsvd052;
  120. unsigned char rsvd053;
  121. };
  122. struct fw_hdr {/*8-byte alignment required*/
  123. unsigned short signature;
  124. unsigned short version; /* 0x8000 ~ 0x8FFF for FPGA version,
  125. * 0x0000 ~ 0x7FFF for ASIC version,
  126. */
  127. unsigned int dmem_size; /*define the size of boot loader*/
  128. unsigned int img_IMEM_size; /*define the size of FW in IMEM*/
  129. unsigned int img_SRAM_size; /*define the size of FW in SRAM*/
  130. unsigned int fw_priv_sz; /*define the size of DMEM variable*/
  131. unsigned short efuse_addr;
  132. unsigned short h2ccnd_resp_addr;
  133. unsigned int SVNRevision;
  134. unsigned int release_time; /*Mon:Day:Hr:Min*/
  135. struct fw_priv fwpriv;
  136. };
  137. struct hal_priv {
  138. /*Endpoint handles*/
  139. struct net_device *pipehdls_r8712[10];
  140. u8 (*hal_bus_init)(struct _adapter *adapter);
  141. };
  142. uint rtl8712_hal_init(struct _adapter *padapter);
  143. int rtl871x_load_fw(struct _adapter *padapter);
  144. #endif