qdf_net_if.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (c) 2014-2020 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. * DOC: qdf_net_if
  20. * QCA driver framework (QDF) network interface management APIs
  21. */
  22. #if !defined(__QDF_NET_IF_H)
  23. #define __QDF_NET_IF_H
  24. /* Include Files */
  25. #include <qdf_types.h>
  26. #include <i_qdf_net_if.h>
  27. struct qdf_net_if;
  28. #ifdef ENHANCED_OS_ABSTRACTION
  29. /**
  30. * qdf_net_if_create_dummy_if() - create dummy interface
  31. * @nif: interface handle
  32. *
  33. * This function will create a dummy network interface
  34. *
  35. * Return: QDF_STATUS_SUCCESS on success
  36. */
  37. QDF_STATUS
  38. qdf_net_if_create_dummy_if(struct qdf_net_if *nif);
  39. /**
  40. * qdf_net_if_get_dev_by_name() - Find a network device by its name
  41. * @nif_name: network device name
  42. *
  43. * This function retrieves the network device by its name
  44. *
  45. * Return: qdf network device
  46. */
  47. struct qdf_net_if *
  48. qdf_net_if_get_dev_by_name(char *nif_name);
  49. /**
  50. * qdf_net_if_release_dev() - Release reference to network device
  51. * @nif: network device
  52. *
  53. * This function releases reference to the network device
  54. *
  55. * Return: QDF_STATUS_SUCCESS on success
  56. */
  57. QDF_STATUS
  58. qdf_net_if_release_dev(struct qdf_net_if *nif);
  59. #else
  60. static inline QDF_STATUS
  61. qdf_net_if_create_dummy_if(struct qdf_net_if *nif)
  62. {
  63. return __qdf_net_if_create_dummy_if(nif);
  64. }
  65. static inline struct qdf_net_if *
  66. qdf_net_if_get_dev_by_name(char *nif_name)
  67. {
  68. return __qdf_net_if_get_dev_by_name(nif_name);
  69. }
  70. static inline QDF_STATUS
  71. qdf_net_if_release_dev(struct qdf_net_if *nif)
  72. {
  73. return __qdf_net_if_release_dev(nif);
  74. }
  75. #endif
  76. /**
  77. * qdf_net_if_get_devname() - Retrieve netdevice name
  78. * @nif: Abstraction of netdevice
  79. *
  80. * Return: netdevice name
  81. */
  82. char *qdf_net_if_get_devname(struct qdf_net_if *nif);
  83. #endif /* __QDF_NET_IF_H */