| .. | .. |
|---|
| 1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 1 | /* |
|---|
| 3 | 2 | * Broadcom Dongle Host Driver (DHD), Linux monitor network interface |
|---|
| 4 | 3 | * |
|---|
| 5 | | - * Copyright (C) 1999-2019, Broadcom Corporation |
|---|
| 6 | | - * |
|---|
| 4 | + * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation |
|---|
| 5 | + * |
|---|
| 6 | + * Copyright (C) 1999-2017, Broadcom Corporation |
|---|
| 7 | + * |
|---|
| 7 | 8 | * Unless you and Broadcom execute a separate written software license |
|---|
| 8 | 9 | * agreement governing use of this software, this software is licensed to you |
|---|
| 9 | 10 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
|---|
| 10 | 11 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
|---|
| 11 | 12 | * following added to such license: |
|---|
| 12 | | - * |
|---|
| 13 | + * |
|---|
| 13 | 14 | * As a special exception, the copyright holders of this software give you |
|---|
| 14 | 15 | * permission to link this software with independent modules, and to copy and |
|---|
| 15 | 16 | * distribute the resulting executable under terms of your choice, provided that |
|---|
| .. | .. |
|---|
| 17 | 18 | * the license of that module. An independent module is a module which is not |
|---|
| 18 | 19 | * derived from this software. The special exception does not apply to any |
|---|
| 19 | 20 | * modifications of the software. |
|---|
| 20 | | - * |
|---|
| 21 | + * |
|---|
| 21 | 22 | * Notwithstanding the above, under no circumstances may you combine this |
|---|
| 22 | 23 | * software in any way with any other Broadcom software provided under a license |
|---|
| 23 | 24 | * other than the GPL, without Broadcom's express prior written consent. |
|---|
| .. | .. |
|---|
| 25 | 26 | * |
|---|
| 26 | 27 | * <<Broadcom-WL-IPTag/Open:>> |
|---|
| 27 | 28 | * |
|---|
| 28 | | - * $Id: wl_linux_mon.c 514727 2014-11-12 03:02:48Z $ |
|---|
| 29 | + * $Id: wl_linux_mon.c 576195 2015-08-01 18:21:54Z $ |
|---|
| 29 | 30 | */ |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | #include <osl.h> |
|---|
| .. | .. |
|---|
| 51 | 52 | MONITOR_STATE_INTERFACE_ADDED = 0x2, |
|---|
| 52 | 53 | MONITOR_STATE_INTERFACE_DELETED = 0x4 |
|---|
| 53 | 54 | } monitor_states_t; |
|---|
| 54 | | -int dhd_add_monitor(char *name, struct net_device **new_ndev); |
|---|
| 55 | +int dhd_add_monitor(const char *name, struct net_device **new_ndev); |
|---|
| 55 | 56 | extern int dhd_start_xmit(struct sk_buff *skb, struct net_device *net); |
|---|
| 56 | 57 | int dhd_del_monitor(struct net_device *ndev); |
|---|
| 57 | 58 | int dhd_monitor_init(void *dhd_pub); |
|---|
| .. | .. |
|---|
| 62 | 63 | */ |
|---|
| 63 | 64 | #ifndef DHD_MAX_IFS |
|---|
| 64 | 65 | #define DHD_MAX_IFS 16 |
|---|
| 65 | | -#endif |
|---|
| 66 | +#endif // endif |
|---|
| 66 | 67 | #define MON_PRINT(format, ...) printk("DHD-MON: %s " format, __func__, ##__VA_ARGS__) |
|---|
| 67 | 68 | #define MON_TRACE MON_PRINT |
|---|
| 68 | 69 | |
|---|
| .. | .. |
|---|
| 81 | 82 | |
|---|
| 82 | 83 | static dhd_linux_monitor_t g_monitor; |
|---|
| 83 | 84 | |
|---|
| 84 | | -static struct net_device* lookup_real_netdev(char *name); |
|---|
| 85 | +static struct net_device* lookup_real_netdev(const char *name); |
|---|
| 85 | 86 | static monitor_interface* ndev_to_monif(struct net_device *ndev); |
|---|
| 86 | 87 | static int dhd_mon_if_open(struct net_device *ndev); |
|---|
| 87 | 88 | static int dhd_mon_if_stop(struct net_device *ndev); |
|---|
| .. | .. |
|---|
| 97 | 98 | .ndo_set_rx_mode = dhd_mon_if_set_multicast_list, |
|---|
| 98 | 99 | #else |
|---|
| 99 | 100 | .ndo_set_multicast_list = dhd_mon_if_set_multicast_list, |
|---|
| 100 | | -#endif |
|---|
| 101 | +#endif // endif |
|---|
| 101 | 102 | .ndo_set_mac_address = dhd_mon_if_change_mac, |
|---|
| 102 | 103 | }; |
|---|
| 103 | 104 | |
|---|
| .. | .. |
|---|
| 108 | 109 | /* Look up dhd's net device table to find a match (e.g. interface "eth0" is a match for "mon.eth0" |
|---|
| 109 | 110 | * "p2p-eth0-0" is a match for "mon.p2p-eth0-0") |
|---|
| 110 | 111 | */ |
|---|
| 111 | | -static struct net_device* lookup_real_netdev(char *name) |
|---|
| 112 | +static struct net_device* lookup_real_netdev(const char *name) |
|---|
| 112 | 113 | { |
|---|
| 113 | 114 | struct net_device *ndev_found = NULL; |
|---|
| 114 | 115 | |
|---|
| .. | .. |
|---|
| 281 | 282 | * Global function definitions (declared in dhd_linux_mon.h) |
|---|
| 282 | 283 | */ |
|---|
| 283 | 284 | |
|---|
| 284 | | -int dhd_add_monitor(char *name, struct net_device **new_ndev) |
|---|
| 285 | +int dhd_add_monitor(const char *name, struct net_device **new_ndev) |
|---|
| 285 | 286 | { |
|---|
| 286 | 287 | int i; |
|---|
| 287 | 288 | int idx = -1; |
|---|