mac.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 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. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #ifndef __RTL92C_MAC_H__
  26. #define __RTL92C_MAC_H__
  27. #define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER 255
  28. #define DRIVER_EARLY_INT_TIME 0x05
  29. #define BCN_DMA_ATIME_INT_TIME 0x02
  30. void rtl92c_read_chip_version(struct ieee80211_hw *hw);
  31. bool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data);
  32. bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary);
  33. void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
  34. u8 *p_macaddr, bool is_group, u8 enc_algo,
  35. bool is_wepkey, bool clear_all);
  36. void rtl92c_enable_interrupt(struct ieee80211_hw *hw);
  37. void rtl92c_disable_interrupt(struct ieee80211_hw *hw);
  38. void rtl92c_set_qos(struct ieee80211_hw *hw, int aci);
  39. /*---------------------------------------------------------------
  40. * Hardware init functions
  41. *---------------------------------------------------------------*/
  42. void rtl92c_init_interrupt(struct ieee80211_hw *hw);
  43. void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size);
  44. int rtl92c_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type);
  45. void rtl92c_init_network_type(struct ieee80211_hw *hw);
  46. void rtl92c_init_adaptive_ctrl(struct ieee80211_hw *hw);
  47. void rtl92c_init_rate_fallback(struct ieee80211_hw *hw);
  48. void rtl92c_init_edca_param(struct ieee80211_hw *hw,
  49. u16 queue,
  50. u16 txop,
  51. u8 ecwmax,
  52. u8 ecwmin,
  53. u8 aifs);
  54. void rtl92c_init_edca(struct ieee80211_hw *hw);
  55. void rtl92c_init_ampdu_aggregation(struct ieee80211_hw *hw);
  56. void rtl92c_init_beacon_max_error(struct ieee80211_hw *hw);
  57. void rtl92c_init_rdg_setting(struct ieee80211_hw *hw);
  58. void rtl92c_init_retry_function(struct ieee80211_hw *hw);
  59. void rtl92c_disable_fast_edca(struct ieee80211_hw *hw);
  60. void rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T);
  61. u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
  62. struct rx_fwinfo_92c {
  63. u8 gain_trsw[4];
  64. u8 pwdb_all;
  65. u8 cfosho[4];
  66. u8 cfotail[4];
  67. s8 rxevm[2];
  68. s8 rxsnr[4];
  69. u8 pdsnr[2];
  70. u8 csi_current[2];
  71. u8 csi_target[2];
  72. u8 sigevm;
  73. u8 max_ex_pwr;
  74. u8 ex_intf_flag:1;
  75. u8 sgi_en:1;
  76. u8 rxsc:2;
  77. u8 reserve:4;
  78. } __packed;
  79. struct rx_desc_92c {
  80. u32 length:14;
  81. u32 crc32:1;
  82. u32 icverror:1;
  83. u32 drv_infosize:4;
  84. u32 security:3;
  85. u32 qos:1;
  86. u32 shift:2;
  87. u32 phystatus:1;
  88. u32 swdec:1;
  89. u32 lastseg:1;
  90. u32 firstseg:1;
  91. u32 eor:1;
  92. u32 own:1;
  93. u32 macid:5; /* word 1 */
  94. u32 tid:4;
  95. u32 hwrsvd:5;
  96. u32 paggr:1;
  97. u32 faggr:1;
  98. u32 a1_fit:4;
  99. u32 a2_fit:4;
  100. u32 pam:1;
  101. u32 pwr:1;
  102. u32 moredata:1;
  103. u32 morefrag:1;
  104. u32 type:2;
  105. u32 mc:1;
  106. u32 bc:1;
  107. u32 seq:12; /* word 2 */
  108. u32 frag:4;
  109. u32 nextpktlen:14;
  110. u32 nextind:1;
  111. u32 rsvd:1;
  112. u32 rxmcs:6; /* word 3 */
  113. u32 rxht:1;
  114. u32 amsdu:1;
  115. u32 splcp:1;
  116. u32 bandwidth:1;
  117. u32 htc:1;
  118. u32 tcpchk_rpt:1;
  119. u32 ipcchk_rpt:1;
  120. u32 tcpchk_valid:1;
  121. u32 hwpcerr:1;
  122. u32 hwpcind:1;
  123. u32 iv0:16;
  124. u32 iv1; /* word 4 */
  125. u32 tsfl; /* word 5 */
  126. u32 bufferaddress; /* word 6 */
  127. u32 bufferaddress64; /* word 7 */
  128. } __packed;
  129. enum rtl_desc_qsel rtl92c_map_hwqueue_to_fwqueue(u16 fc,
  130. unsigned int
  131. skb_queue);
  132. void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw,
  133. struct sk_buff *skb,
  134. struct rtl_stats *pstats,
  135. struct rx_desc_92c *pdesc,
  136. struct rx_fwinfo_92c *p_drvinfo);
  137. /*---------------------------------------------------------------
  138. * Card disable functions
  139. *---------------------------------------------------------------*/
  140. #endif