fw.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 Realtek Corporation.
  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. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * wlanfae <wlanfae@realtek.com>
  23. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  24. * Hsinchu 300, Taiwan.
  25. * Larry Finger <Larry.Finger@lwfinger.net>
  26. *
  27. ****************************************************************************
  28. */
  29. #ifndef __RTL92C__FW__H__
  30. #define __RTL92C__FW__H__
  31. #define FW_8192C_START_ADDRESS 0x1000
  32. #define FW_8192C_END_ADDRESS 0x3FFF
  33. #define FW_8192C_PAGE_SIZE 4096
  34. #define FW_8192C_POLLING_DELAY 5
  35. #define FW_8192C_POLLING_TIMEOUT_COUNT 1000
  36. #define BEACON_PG 0
  37. #define PSPOLL_PG 2
  38. #define NULL_PG 3
  39. #define PROBERSP_PG 4 /* ->5 */
  40. #define TOTAL_RESERVED_PKT_LEN 768
  41. #define IS_FW_HEADER_EXIST(_pfwhdr) \
  42. ((_pfwhdr->signature&0xFF00) == 0x2300)
  43. struct rtl8723ae_firmware_header {
  44. u16 signature;
  45. u8 category;
  46. u8 function;
  47. u16 version;
  48. u8 subversion;
  49. u8 rsvd1;
  50. u8 month;
  51. u8 date;
  52. u8 hour;
  53. u8 minute;
  54. u16 ramcodeSize;
  55. u16 rsvd2;
  56. u32 svnindex;
  57. u32 rsvd3;
  58. u32 rsvd4;
  59. u32 rsvd5;
  60. };
  61. enum rtl8192c_h2c_cmd {
  62. H2C_AP_OFFLOAD = 0,
  63. H2C_SETPWRMODE = 1,
  64. H2C_JOINBSSRPT = 2,
  65. H2C_RSVDPAGE = 3,
  66. H2C_RSSI_REPORT = 5,
  67. H2C_RA_MASK = 6,
  68. MAX_H2CCMD
  69. };
  70. #define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \
  71. SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
  72. #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__ph2ccmd, __val) \
  73. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
  74. #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__ph2ccmd, __val) \
  75. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
  76. #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \
  77. SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
  78. #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \
  79. SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
  80. #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \
  81. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
  82. #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \
  83. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
  84. int rtl8723ae_download_fw(struct ieee80211_hw *hw);
  85. void rtl8723ae_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
  86. u32 cmd_len, u8 *p_cmdbuffer);
  87. void rtl8723ae_firmware_selfreset(struct ieee80211_hw *hw);
  88. void rtl8723ae_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
  89. void rtl8723ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
  90. void rtl8723ae_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
  91. #endif