wl_android.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Linux cfg80211 driver - Android related functions
  3. *
  4. * Copyright (C) 1999-2014, Broadcom Corporation
  5. *
  6. * Unless you and Broadcom execute a separate written software license
  7. * agreement governing use of this software, this software is licensed to you
  8. * under the terms of the GNU General Public License version 2 (the "GPL"),
  9. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  10. * following added to such license:
  11. *
  12. * As a special exception, the copyright holders of this software give you
  13. * permission to link this software with independent modules, and to copy and
  14. * distribute the resulting executable under terms of your choice, provided that
  15. * you also meet, for each linked independent module, the terms and conditions of
  16. * the license of that module. An independent module is a module which is not
  17. * derived from this software. The special exception does not apply to any
  18. * modifications of the software.
  19. *
  20. * Notwithstanding the above, under no circumstances may you combine this
  21. * software in any way with any other Broadcom software provided under a license
  22. * other than the GPL, without Broadcom's express prior written consent.
  23. *
  24. * $Id: wl_android.h 487871 2014-06-27 07:48:00Z $
  25. */
  26. #include <linux/module.h>
  27. #include <linux/netdevice.h>
  28. #include <wldev_common.h>
  29. /* If any feature uses the Generic Netlink Interface, put it here to enable WL_GENL
  30. * automatically
  31. */
  32. #ifdef WL_GENL
  33. #include <net/genetlink.h>
  34. #endif
  35. /**
  36. * Android platform dependent functions, feel free to add Android specific functions here
  37. * (save the macros in dhd). Please do NOT declare functions that are NOT exposed to dhd
  38. * or cfg, define them as static in wl_android.c
  39. */
  40. /**
  41. * wl_android_init will be called from module init function (dhd_module_init now), similarly
  42. * wl_android_exit will be called from module exit function (dhd_module_cleanup now)
  43. */
  44. int wl_android_init(void);
  45. int wl_android_exit(void);
  46. void wl_android_post_init(void);
  47. int wl_android_wifi_on(struct net_device *dev);
  48. int wl_android_wifi_off(struct net_device *dev);
  49. int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
  50. #ifdef WL_GENL
  51. typedef struct bcm_event_hdr {
  52. u16 event_type;
  53. u16 len;
  54. } bcm_event_hdr_t;
  55. /* attributes (variables): the index in this enum is used as a reference for the type,
  56. * userspace application has to indicate the corresponding type
  57. * the policy is used for security considerations
  58. */
  59. enum {
  60. BCM_GENL_ATTR_UNSPEC,
  61. BCM_GENL_ATTR_STRING,
  62. BCM_GENL_ATTR_MSG,
  63. __BCM_GENL_ATTR_MAX
  64. };
  65. #define BCM_GENL_ATTR_MAX (__BCM_GENL_ATTR_MAX - 1)
  66. /* commands: enumeration of all commands (functions),
  67. * used by userspace application to identify command to be ececuted
  68. */
  69. enum {
  70. BCM_GENL_CMD_UNSPEC,
  71. BCM_GENL_CMD_MSG,
  72. __BCM_GENL_CMD_MAX
  73. };
  74. #define BCM_GENL_CMD_MAX (__BCM_GENL_CMD_MAX - 1)
  75. /* Enum values used by the BCM supplicant to identify the events */
  76. enum {
  77. BCM_E_UNSPEC,
  78. BCM_E_SVC_FOUND,
  79. BCM_E_DEV_FOUND,
  80. BCM_E_DEV_LOST,
  81. BCM_E_MAX
  82. };
  83. s32 wl_genl_send_msg(struct net_device *ndev, u32 event_type,
  84. u8 *string, u16 len, u8 *hdr, u16 hdrlen);
  85. #endif /* WL_GENL */
  86. s32 wl_netlink_send_msg(int pid, int type, int seq, void *data, size_t size);
  87. /* hostap mac mode */
  88. #define MACLIST_MODE_DISABLED 0
  89. #define MACLIST_MODE_DENY 1
  90. #define MACLIST_MODE_ALLOW 2
  91. /* max number of assoc list */
  92. #define MAX_NUM_OF_ASSOCLIST 64
  93. /* max number of mac filter list
  94. * restrict max number to 10 as maximum cmd string size is 255
  95. */
  96. #define MAX_NUM_MAC_FILT 10
  97. int wl_android_set_ap_mac_list(struct net_device *dev, int macmode, struct maclist *maclist);