1 /* 2 * Copyright (c) 2018,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 * This file provides OS dependent network interface related APIs 22 */ 23 24 #include "qdf_net_if.h" 25 #include "qdf_types.h" 26 #include "qdf_module.h" 27 #include "qdf_util.h" 28 #include <linux/netdevice.h> 29 30 QDF_STATUS 31 qdf_net_if_create_dummy_if(struct qdf_net_if *nif) 32 { 33 int ret; 34 35 if (!nif) 36 return QDF_STATUS_E_INVAL; 37 38 ret = init_dummy_netdev((struct net_device *)nif); 39 40 return qdf_status_from_os_return(ret); 41 } 42 43 qdf_export_symbol(qdf_net_if_create_dummy_if); 44 45 /** 46 * qdf_net_if_get_devname() - Retrieve netdevice name 47 * @nif: Abstraction of netdevice 48 * 49 * Return: netdevice name 50 */ 51 char *qdf_net_if_get_devname(struct qdf_net_if *nif) 52 { 53 if (!nif) 54 return NULL; 55 56 return (((struct net_device *)nif)->name); 57 } 58 59 qdf_export_symbol(qdf_net_if_get_devname); 60