diff options
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/Makefile | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/coreconfigurator.c | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/coreconfigurator.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 46 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.h | 6 | ||||
-rw-r--r-- | drivers/staging/wilc1000/linux_mon.c | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.c | 2 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan_cfg.c | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan_cfg.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan_if.h | 1 |
14 files changed, 46 insertions, 26 deletions
diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index d22628314305..ee7e26b886a5 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_WILC1000) += wilc1000.o ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 622994795222..8cf886d32afb 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "coreconfigurator.h" #include "wilc_wlan_if.h" #include "wilc_wlan.h" diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 5256f40524bf..3f5da8c58815 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /*! * @file coreconfigurator.h diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7b620658ec38..d69248a8c7b5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include <linux/slab.h> #include <linux/time.h> #include <linux/kthread.h> @@ -238,6 +239,7 @@ static struct completion hif_driver_comp; static struct completion hif_wait_response; static struct mutex hif_deinit_lock; static struct timer_list periodic_rssi; +static struct wilc_vif *periodic_rssi_vif; u8 wilc_multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN]; @@ -2272,7 +2274,7 @@ static int Handle_RemainOnChan(struct wilc_vif *vif, ERRORHANDLER: { P2P_LISTEN_STATE = 1; - hif_drv->remain_on_ch_timer.data = (unsigned long)vif; + hif_drv->remain_on_ch_timer_vif = vif; mod_timer(&hif_drv->remain_on_ch_timer, jiffies + msecs_to_jiffies(pstrHostIfRemainOnChan->duration)); @@ -2360,11 +2362,13 @@ _done_: return result; } -static void ListenTimerCB(unsigned long arg) +static void ListenTimerCB(struct timer_list *t) { + struct host_if_drv *hif_drv = from_timer(hif_drv, t, + remain_on_ch_timer); + struct wilc_vif *vif = hif_drv->remain_on_ch_timer_vif; s32 result = 0; struct host_if_msg msg; - struct wilc_vif *vif = (struct wilc_vif *)arg; del_timer(&vif->hif_drv->remain_on_ch_timer); @@ -2417,9 +2421,9 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif, pu8CurrByte = wid.val; *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF); - *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF); - *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF); - *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF); + *pu8CurrByte++ = 0; + *pu8CurrByte++ = 0; + *pu8CurrByte++ = 0; *pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF); *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF); @@ -2643,9 +2647,10 @@ free_msg: complete(&hif_thread_comp); } -static void TimerCB_Scan(unsigned long arg) +static void TimerCB_Scan(struct timer_list *t) { - struct wilc_vif *vif = (struct wilc_vif *)arg; + struct host_if_drv *hif_drv = from_timer(hif_drv, t, scan_timer); + struct wilc_vif *vif = hif_drv->scan_timer_vif; struct host_if_msg msg; memset(&msg, 0, sizeof(struct host_if_msg)); @@ -2655,9 +2660,11 @@ static void TimerCB_Scan(unsigned long arg) wilc_enqueue_cmd(&msg); } -static void TimerCB_Connect(unsigned long arg) +static void TimerCB_Connect(struct timer_list *t) { - struct wilc_vif *vif = (struct wilc_vif *)arg; + struct host_if_drv *hif_drv = from_timer(hif_drv, t, + connect_timer); + struct wilc_vif *vif = hif_drv->connect_timer_vif; struct host_if_msg msg; memset(&msg, 0, sizeof(struct host_if_msg)); @@ -3040,7 +3047,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, return -EFAULT; } - hif_drv->connect_timer.data = (unsigned long)vif; + hif_drv->connect_timer_vif = vif; mod_timer(&hif_drv->connect_timer, jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT)); @@ -3283,7 +3290,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, return -EINVAL; } - hif_drv->scan_timer.data = (unsigned long)vif; + hif_drv->scan_timer_vif = vif; mod_timer(&hif_drv->scan_timer, jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT)); @@ -3309,9 +3316,9 @@ int wilc_hif_set_cfg(struct wilc_vif *vif, return wilc_enqueue_cmd(&msg); } -static void GetPeriodicRSSI(unsigned long arg) +static void GetPeriodicRSSI(struct timer_list *unused) { - struct wilc_vif *vif = (struct wilc_vif *)arg; + struct wilc_vif *vif = periodic_rssi_vif; if (!vif->hif_drv) { netdev_err(vif->ndev, "Driver handler is NULL\n"); @@ -3321,7 +3328,6 @@ static void GetPeriodicRSSI(unsigned long arg) if (vif->hif_drv->hif_state == HOST_IF_CONNECTED) wilc_get_statistics(vif, &vif->wilc->dummy_statistics); - periodic_rssi.data = (unsigned long)vif; mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000)); } @@ -3374,14 +3380,14 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) goto _fail_; } - setup_timer(&periodic_rssi, GetPeriodicRSSI, - (unsigned long)vif); + periodic_rssi_vif = vif; + timer_setup(&periodic_rssi, GetPeriodicRSSI, 0); mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000)); } - setup_timer(&hif_drv->scan_timer, TimerCB_Scan, 0); - setup_timer(&hif_drv->connect_timer, TimerCB_Connect, 0); - setup_timer(&hif_drv->remain_on_ch_timer, ListenTimerCB, 0); + timer_setup(&hif_drv->scan_timer, TimerCB_Scan, 0); + timer_setup(&hif_drv->connect_timer, TimerCB_Connect, 0); + timer_setup(&hif_drv->remain_on_ch_timer, ListenTimerCB, 0); mutex_init(&hif_drv->cfg_values_lock); mutex_lock(&hif_drv->cfg_values_lock); diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 1ce5ead318c7..aa914d69ab0d 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef HOST_INT_H #define HOST_INT_H #include <linux/ieee80211.h> @@ -279,8 +280,13 @@ struct host_if_drv { struct completion comp_inactive_time; struct timer_list scan_timer; + struct wilc_vif *scan_timer_vif; + struct timer_list connect_timer; + struct wilc_vif *connect_timer_vif; + struct timer_list remain_on_ch_timer; + struct wilc_vif *remain_on_ch_timer_vif; bool IFC_UP; int driver_handler_id; diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 01efa80b4f88..91d49c4738dc 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /*! * @file linux_mon.c * @brief File Operations OS wrapper functionality diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index ac5aaafa461c..8a275996d4e6 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "wilc_wfi_cfgoperations.h" #include "host_interface.h" #include <linux/errno.h> @@ -266,7 +267,7 @@ static void update_scan_time(void) last_scanned_shadow[i].time_scan = jiffies; } -static void remove_network_from_shadow(unsigned long arg) +static void remove_network_from_shadow(unsigned long unused) { unsigned long now = jiffies; int i, j; @@ -287,7 +288,6 @@ static void remove_network_from_shadow(unsigned long arg) } if (last_scanned_cnt != 0) { - hAgingTimer.data = arg; mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME)); } } @@ -304,7 +304,6 @@ static int is_network_in_shadow(struct network_info *pstrNetworkInfo, int i; if (last_scanned_cnt == 0) { - hAgingTimer.data = (unsigned long)user_void; mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME)); state = -1; } else { @@ -1111,7 +1110,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, g_key_gtk_params.key = NULL; kfree(g_key_gtk_params.seq); g_key_gtk_params.seq = NULL; - } if (key_index >= 0 && key_index <= 3) { @@ -1617,7 +1615,7 @@ static int mgmt_tx(struct wiphy *wiphy, *cookie = (unsigned long)buf; priv->u64tx_cookie = *cookie; - mgmt = (const struct ieee80211_mgmt *) buf; + mgmt = (const struct ieee80211_mgmt *)buf; if (ieee80211_is_mgmt(mgmt->frame_control)) { mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h index 85a3810d7bb5..dfb7ec272935 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /*! * @file wilc_wfi_cfgoperations.h * @brief Definitions for the network module diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 7a36561a599e..e6f4d84971c3 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /*! * @file wilc_wfi_netdevice.h * @brief Definitions for the network module diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 9addef1f1e12..f49dfa82f1b8 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -714,7 +714,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid; buffer_offset = ETH_ETHERNET_HDR_OFFSET; - memcpy(&txb[offset + 4], bssid, 6); + memcpy(&txb[offset + 8], bssid, 6); } else { buffer_offset = HOST_HDR_OFFSET; } diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 7a5eba9b5f47..da7173105497 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef WILC_WLAN_H #define WILC_WLAN_H diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c index d3e5b1b302f4..19e4f85fdd27 100644 --- a/drivers/staging/wilc1000/wilc_wlan_cfg.c +++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* ////////////////////////////////////////////////////////////////////////// */ /* */ /* Copyright (c) Atmel Corporation. All rights reserved. */ diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.h b/drivers/staging/wilc1000/wilc_wlan_cfg.h index b8641a273547..08092a551840 100644 --- a/drivers/staging/wilc1000/wilc_wlan_cfg.h +++ b/drivers/staging/wilc1000/wilc_wlan_cfg.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* ////////////////////////////////////////////////////////////////////////// */ /* */ /* Copyright (c) Atmel Corporation. All rights reserved. */ diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index f4d60057a06e..c1693cfc076d 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* ///////////////////////////////////////////////////////////////////////// */ /* */ /* Copyright (c) Atmel Corporation. All rights reserved. */ |