wlan_nlink_srv.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /******************************************************************************
  19. * wlan_nlink_srv.h
  20. *
  21. * wlan_nlink_srv is used to RX/TX Netlink messages from user space to kernel
  22. * modules and vice versa. Kernel modules must register a message handler for a
  23. * message type so that the wlan_nlink_srv can invoke the corresponding msg handler
  24. * whenever a Netlink message of a particular type has been received from an
  25. * application. In the opposite direction, wlan_nlink_srv provides a mechanism
  26. * which kernel modules can use to send Netlink messages to applications.
  27. *
  28. ******************************************************************************/
  29. #ifndef WLAN_NLINK_SRV_H
  30. #define WLAN_NLINK_SRV_H
  31. #include <linux/skbuff.h>
  32. #include <net/netlink.h>
  33. #include <wlan_nlink_common.h>
  34. #define INVALID_PID -1
  35. #define NLINK_MAX_CALLBACKS (WLAN_NL_MSG_MAX - WLAN_NL_MSG_BASE)
  36. typedef int (*nl_srv_msg_callback)(struct sk_buff *skb);
  37. int nl_srv_init(void *wiphy, int proto);
  38. void nl_srv_exit(void);
  39. int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler);
  40. int nl_srv_unregister(tWlanNlModTypes msg_type,
  41. nl_srv_msg_callback msg_handler);
  42. #ifdef CNSS_GENL
  43. int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag,
  44. int app_id, int mcgroup_id);
  45. int nl_srv_bcast(struct sk_buff *skb, int mcgroup_id, int app_id);
  46. #else
  47. int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag);
  48. int nl_srv_bcast(struct sk_buff *skb);
  49. #endif
  50. int nl_srv_is_initialized(void);
  51. void nl_srv_ucast_oem(struct sk_buff *skb, int dst_pid, int flag);
  52. #endif