rtl8192d_cmd.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 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 __RTL8192D_CMD_H_
  21. #define __RTL8192D_CMD_H_
  22. //--------------------------------------------
  23. //3 Host Message Box
  24. //--------------------------------------------
  25. // User Define Message [31:8]
  26. //_SETPWRMODE_PARM
  27. #define SET_H2CCMD_PWRMODE_PARM_MODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  28. #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
  29. #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  30. //JOINBSSRPT_PARM
  31. #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  32. //_RSVDPAGE_LOC
  33. #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value)
  34. #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value)
  35. #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value)
  36. #define SET_H2CCMD_P2P_PS_OFFLOAD_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
  37. #define SET_H2CCMD_P2P_PS_OFFLOAD_ROLE(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
  38. #define SET_H2CCMD_P2P_PS_OFFLOAD_CTW(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
  39. #define SET_H2CCMD_P2P_PS_OFFLOAD_NOA0(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
  40. #define SET_H2CCMD_P2P_PS_OFFLOAD_NOA1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 1, __Value)
  41. #define SET_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 5, 1, __Value)
  42. #define SET_H2CCMD_P2P_PS_OFFLOAD_DISCOVERY(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 6, 1, __Value)
  43. // Description: Determine the types of H2C commands that are the same in driver and Fw.
  44. // Fisrt constructed by tynli. 2009.10.09.
  45. typedef enum _RTL8192D_H2C_CMD
  46. {
  47. H2C_AP_OFFLOAD = 0, /*0*/
  48. H2C_SETPWRMODE = 1, /*1*/
  49. H2C_JOINBSSRPT = 2, /*2*/
  50. H2C_RSVDPAGE = 3,
  51. H2C_RSSI_REPORT = 5,
  52. H2C_RA_MASK = 6,
  53. H2C_P2P_PS_OFFLOAD = 8,
  54. H2C_MAC_MODE_SEL = 9,
  55. H2C_PWRM=15,
  56. H2C_P2P_PS_CTW_CMD = 24,
  57. H2C_PathDiv = 26, //PathDiv--NeilChen--2011.07.15
  58. H2C_92D_TSF_SYNC=36,
  59. H2C_92D_RESET_TSF = 43,
  60. H2C_CMD_MAX
  61. }RTL8192D_H2C_CMD;
  62. struct cmd_msg_parm {
  63. u8 eid; //element id
  64. u8 sz; // sz
  65. u8 buf[6];
  66. };
  67. void FillH2CCmd92D(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBuffer);
  68. // host message to firmware cmd
  69. void rtl8192d_set_FwPwrMode_cmd(_adapter*padapter, u8 Mode);
  70. void rtl8192d_set_FwJoinBssReport_cmd(_adapter* padapter, u8 mstatus);
  71. u8 rtl8192d_set_rssi_cmd(_adapter*padapter, u8 *param);
  72. void rtl8192d_set_raid_cmd(_adapter*padapter, u32 mask, u8* arg);
  73. void rtl8192d_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8* arg, u8 rssi_level);
  74. #ifdef CONFIG_P2P
  75. void rtl8192d_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state);
  76. #endif //CONFIG_P2P
  77. #ifdef CONFIG_TSF_RESET_OFFLOAD
  78. int reset_tsf(PADAPTER Adapter, u8 reset_port );
  79. #endif // CONFIG_TSF_RESET_OFFLOAD
  80. #endif