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