ioctl_cfg80211.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 __IOCTL_CFG80211_H__
  21. #define __IOCTL_CFG80211_H__
  22. #if defined(RTW_USE_CFG80211_STA_EVENT)
  23. #undef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
  24. #endif
  25. struct rtw_wdev_invit_info {
  26. u8 token;
  27. u8 flags;
  28. u8 status;
  29. u8 req_op_ch;
  30. u8 rsp_op_ch;
  31. };
  32. #define rtw_wdev_invit_info_init(invit_info) \
  33. do { \
  34. (invit_info)->token = 0; \
  35. (invit_info)->flags = 0x00; \
  36. (invit_info)->status = 0xff; \
  37. (invit_info)->req_op_ch = 0; \
  38. (invit_info)->rsp_op_ch = 0; \
  39. } while (0)
  40. struct rtw_wdev_priv
  41. {
  42. struct wireless_dev *rtw_wdev;
  43. _adapter *padapter;
  44. struct cfg80211_scan_request *scan_request;
  45. _lock scan_req_lock;
  46. struct net_device *pmon_ndev;//for monitor interface
  47. char ifname_mon[IFNAMSIZ + 1]; //interface name for monitor interface
  48. u8 p2p_enabled;
  49. u8 provdisc_req_issued;
  50. struct rtw_wdev_invit_info invit_info;
  51. u8 bandroid_scan;
  52. bool block;
  53. bool power_mgmt;
  54. #ifdef CONFIG_CONCURRENT_MODE
  55. ATOMIC_T ro_ch_to;
  56. ATOMIC_T switch_ch_to;
  57. #endif
  58. };
  59. #define wdev_to_priv(w) ((struct rtw_wdev_priv *)(wdev_priv(w)))
  60. #define wiphy_to_adapter(x) (_adapter *)(((struct rtw_wdev_priv*)wiphy_priv(x))->padapter)
  61. #define wiphy_to_wdev(x) (struct wireless_dev *)(((struct rtw_wdev_priv*)wiphy_priv(x))->rtw_wdev)
  62. int rtw_wdev_alloc(_adapter *padapter, struct device *dev);
  63. void rtw_wdev_free(struct wireless_dev *wdev);
  64. void rtw_wdev_unregister(struct wireless_dev *wdev);
  65. void rtw_cfg80211_init_wiphy(_adapter *padapter);
  66. void rtw_cfg80211_surveydone_event_callback(_adapter *padapter);
  67. void rtw_cfg80211_indicate_connect(_adapter *padapter);
  68. void rtw_cfg80211_indicate_disconnect(_adapter *padapter);
  69. void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv, bool aborted);
  70. #ifdef CONFIG_AP_MODE
  71. void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint frame_len);
  72. void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, unsigned char *da, unsigned short reason);
  73. #endif //CONFIG_AP_MODE
  74. void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, size_t len);
  75. void rtw_cfg80211_rx_p2p_action_public(_adapter *padapter, u8 *pmgmt_frame, uint frame_len);
  76. void rtw_cfg80211_rx_action_p2p(_adapter *padapter, u8 *pmgmt_frame, uint frame_len);
  77. void rtw_cfg80211_rx_action(_adapter *adapter, u8 *frame, uint frame_len, const char*msg);
  78. int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, int type);
  79. bool rtw_cfg80211_pwr_mgmt(_adapter *adapter);
  80. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
  81. #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp)
  82. #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
  83. #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp)
  84. #else
  85. #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp)
  86. #endif
  87. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
  88. #define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, buf, len)
  89. #else
  90. #define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, bss, buf, len)
  91. #endif
  92. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
  93. #define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->pnetdev, cookie, buf, len, ack, gfp)
  94. #else
  95. #define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->rtw_wdev, cookie, buf, len, ack, gfp)
  96. #endif
  97. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
  98. #define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->pnetdev, cookie, chan, channel_type, duration, gfp)
  99. #define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->pnetdev, cookie, chan, chan_type, gfp)
  100. #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
  101. #define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, channel_type, duration, gfp)
  102. #define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, chan_type, gfp)
  103. #else
  104. #define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, duration, gfp)
  105. #define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, gfp)
  106. #endif
  107. #endif //__IOCTL_CFG80211_H__