wlan_intf.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /******************************************************************************
  2. * Copyright (c) 2013-2016 Realtek Semiconductor Corp.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. ******************************************************************************/
  16. #ifndef __WLAN_INTF_H__
  17. #define __WLAN_INTF_H__
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #include <autoconf.h>
  22. #include <wireless.h>
  23. #include "wifi_constants.h"
  24. #ifndef WLAN0_IDX
  25. #define WLAN0_IDX 0
  26. #endif
  27. #ifndef WLAN1_IDX
  28. #define WLAN1_IDX 1
  29. #endif
  30. #ifndef WLAN_UNDEF
  31. #define WLAN_UNDEF -1
  32. #endif
  33. /***********************************************************/
  34. /*
  35. struct sk_buff {
  36. // These two members must be first.
  37. struct sk_buff *next; // Next buffer in list
  38. struct sk_buff *prev; // Previous buffer in list
  39. struct sk_buff_head *list; // List we are on
  40. unsigned char *head; // Head of buffer
  41. unsigned char *data; // Data head pointer
  42. unsigned char *tail; // Tail pointer
  43. unsigned char *end; //End pointer
  44. struct net_device *dev; //Device we arrived on/are leaving by
  45. unsigned int len; // Length of actual data
  46. };
  47. */
  48. /************************************************************/
  49. //----- ------------------------------------------------------------------
  50. // Wlan Interface opened for upper layer
  51. //----- ------------------------------------------------------------------
  52. int rltk_wlan_init(int idx_wlan, rtw_mode_t mode); //return 0: success. -1:fail
  53. void rltk_wlan_deinit(void);
  54. void rltk_wlan_deinit_fastly(void);
  55. int rltk_wlan_start(int idx_wlan);
  56. void rltk_wlan_statistic(unsigned char idx);
  57. unsigned char rltk_wlan_running(unsigned char idx); // interface is up. 0: interface is down
  58. int rltk_wlan_control(unsigned long cmd, void *data);
  59. int rltk_wlan_handshake_done(void);
  60. int rltk_wlan_rf_on(void);
  61. int rltk_wlan_rf_off(void);
  62. int rltk_wlan_check_bus(void);
  63. int rltk_wlan_wireless_mode(unsigned char mode);
  64. int rltk_wlan_get_wireless_mode(unsigned char *pmode);
  65. int rltk_wlan_set_wps_phase(unsigned char is_trigger_wps);
  66. int rtw_ps_enable(int enable);
  67. int rltk_wlan_is_connected_to_ap(void);
  68. #if CONFIG_IEEE80211W
  69. void rltk_wlan_tx_sa_query(unsigned char key_type);
  70. void rltk_wlan_tx_deauth(unsigned char b_broadcast, unsigned char key_type);
  71. void rltk_wlan_tx_auth(void);
  72. #endif
  73. #if CONFIG_SET_PRIORITY
  74. int rltk_wlan_set_priority(int priority);
  75. #endif
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif //#ifndef __WLAN_INTF_H__