fw.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #ifndef __RTL92C__FW__H__
  29. #define __RTL92C__FW__H__
  30. #define FW_8192C_SIZE 0x3000
  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 IS_FW_HEADER_EXIST(_pfwhdr) \
  36. ((_pfwhdr->signature&0xFFFF) == 0x2300 ||\
  37. (_pfwhdr->signature&0xFFFF) == 0x2301 ||\
  38. (_pfwhdr->signature&0xFFFF) == 0x2302)
  39. #define pagenum_128(_len) (u32)(((_len)>>7) + ((_len)&0x7F ? 1 : 0))
  40. #define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \
  41. SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
  42. #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__ph2ccmd, __val) \
  43. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
  44. #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__ph2ccmd, __val) \
  45. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
  46. #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \
  47. SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
  48. #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \
  49. SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
  50. #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \
  51. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
  52. #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \
  53. SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
  54. void rtl8723e_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
  55. u32 cmd_len, u8 *p_cmdbuffer);
  56. void rtl8723e_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
  57. void rtl8723e_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
  58. void rtl8723e_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
  59. void rtl8723e_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
  60. #endif