hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/drivers/net/wireless/intersil/hostap/hostap_hw.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Host AP (software wireless LAN access point) driver for
34 * Intersil Prism2/2.5/3.
....@@ -5,11 +6,6 @@
56 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
67 * <j@w1.fi>
78 * Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation. See README and COPYING for
12
- * more details.
139 *
1410 * FIX:
1511 * - there is currently no way of associating TX packets to correct wds device
....@@ -130,7 +126,7 @@
130126
131127 #ifdef PRISM2_DOWNLOAD_SUPPORT
132128 /* hostap_download.c */
133
-static const struct file_operations prism2_download_aux_dump_proc_fops;
129
+static const struct proc_ops prism2_download_aux_dump_proc_ops;
134130 static u8 * prism2_read_pda(struct net_device *dev);
135131 static int prism2_download(local_info_t *local,
136132 struct prism2_download_param *param);
....@@ -323,12 +319,6 @@
323319
324320 iface = netdev_priv(dev);
325321 local = iface->local;
326
-
327
- if (in_interrupt()) {
328
- printk(KERN_DEBUG "%s: hfa384x_cmd called from interrupt "
329
- "context\n", dev->name);
330
- return -1;
331
- }
332322
333323 if (local->cmd_queue_len >= HOSTAP_CMD_QUEUE_MAX_LEN) {
334324 printk(KERN_DEBUG "%s: hfa384x_cmd: cmd_queue full\n",
....@@ -1564,12 +1554,6 @@
15641554 iface = netdev_priv(dev);
15651555 local = iface->local;
15661556
1567
- if (in_interrupt()) {
1568
- printk(KERN_DEBUG "%s: driver bug - prism2_hw_reset() called "
1569
- "in interrupt context\n", dev->name);
1570
- return;
1571
- }
1572
-
15731557 if (local->hw_downloading)
15741558 return;
15751559
....@@ -1807,7 +1791,7 @@
18071791 struct hfa384x_tx_frame txdesc;
18081792 struct hostap_skb_tx_data *meta;
18091793 int hdr_len, data_len, idx, res, ret = -1;
1810
- u16 tx_control, fc;
1794
+ u16 tx_control;
18111795
18121796 iface = netdev_priv(dev);
18131797 local = iface->local;
....@@ -1830,7 +1814,6 @@
18301814 /* skb->data starts with txdesc->frame_control */
18311815 hdr_len = 24;
18321816 skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len);
1833
- fc = le16_to_cpu(txdesc.frame_control);
18341817 if (ieee80211_is_data(txdesc.frame_control) &&
18351818 ieee80211_has_a4(txdesc.frame_control) &&
18361819 skb->len >= 30) {
....@@ -2087,9 +2070,9 @@
20872070
20882071
20892072 /* Called only as a tasklet (software IRQ) */
2090
-static void hostap_rx_tasklet(unsigned long data)
2073
+static void hostap_rx_tasklet(struct tasklet_struct *t)
20912074 {
2092
- local_info_t *local = (local_info_t *) data;
2075
+ local_info_t *local = from_tasklet(local, t, rx_tasklet);
20932076 struct sk_buff *skb;
20942077
20952078 while ((skb = skb_dequeue(&local->rx_list)) != NULL)
....@@ -2292,9 +2275,9 @@
22922275
22932276
22942277 /* Called only as a tasklet (software IRQ) */
2295
-static void hostap_sta_tx_exc_tasklet(unsigned long data)
2278
+static void hostap_sta_tx_exc_tasklet(struct tasklet_struct *t)
22962279 {
2297
- local_info_t *local = (local_info_t *) data;
2280
+ local_info_t *local = from_tasklet(local, t, sta_tx_exc_tasklet);
22982281 struct sk_buff *skb;
22992282
23002283 while ((skb = skb_dequeue(&local->sta_tx_exc_list)) != NULL) {
....@@ -2394,9 +2377,9 @@
23942377
23952378
23962379 /* Called only as a tasklet (software IRQ) */
2397
-static void hostap_info_tasklet(unsigned long data)
2380
+static void hostap_info_tasklet(struct tasklet_struct *t)
23982381 {
2399
- local_info_t *local = (local_info_t *) data;
2382
+ local_info_t *local = from_tasklet(local, t, info_tasklet);
24002383 struct sk_buff *skb;
24012384
24022385 while ((skb = skb_dequeue(&local->info_list)) != NULL) {
....@@ -2473,9 +2456,9 @@
24732456
24742457
24752458 /* Called only as a tasklet (software IRQ) */
2476
-static void hostap_bap_tasklet(unsigned long data)
2459
+static void hostap_bap_tasklet(struct tasklet_struct *t)
24772460 {
2478
- local_info_t *local = (local_info_t *) data;
2461
+ local_info_t *local = from_tasklet(local, t, bap_tasklet);
24792462 struct net_device *dev = local->dev;
24802463 u16 ev;
24812464 int frames = 30;
....@@ -3122,7 +3105,7 @@
31223105 local->func->reset_port = prism2_reset_port;
31233106 local->func->schedule_reset = prism2_schedule_reset;
31243107 #ifdef PRISM2_DOWNLOAD_SUPPORT
3125
- local->func->read_aux_fops = &prism2_download_aux_dump_proc_fops;
3108
+ local->func->read_aux_proc_ops = &prism2_download_aux_dump_proc_ops;
31263109 local->func->download = prism2_download;
31273110 #endif /* PRISM2_DOWNLOAD_SUPPORT */
31283111 local->func->tx = prism2_tx_80211;
....@@ -3187,7 +3170,7 @@
31873170 /* Initialize tasklets for handling hardware IRQ related operations
31883171 * outside hw IRQ handler */
31893172 #define HOSTAP_TASKLET_INIT(q, f, d) \
3190
-do { memset((q), 0, sizeof(*(q))); (q)->func = (f); (q)->data = (d); } \
3173
+do { memset((q), 0, sizeof(*(q))); (q)->func = (void(*)(unsigned long))(f); } \
31913174 while (0)
31923175 HOSTAP_TASKLET_INIT(&local->bap_tasklet, hostap_bap_tasklet,
31933176 (unsigned long) local);
....@@ -3370,8 +3353,8 @@
33703353 }
33713354
33723355
3373
-#if (defined(PRISM2_PCI) && defined(CONFIG_PM)) || defined(PRISM2_PCCARD)
3374
-static void prism2_suspend(struct net_device *dev)
3356
+#if defined(PRISM2_PCI) || defined(PRISM2_PCCARD)
3357
+static void __maybe_unused prism2_suspend(struct net_device *dev)
33753358 {
33763359 struct hostap_interface *iface;
33773360 struct local_info *local;
....@@ -3389,7 +3372,7 @@
33893372 /* Disable hardware and firmware */
33903373 prism2_hw_shutdown(dev, 0);
33913374 }
3392
-#endif /* (PRISM2_PCI && CONFIG_PM) || PRISM2_PCCARD */
3375
+#endif /* PRISM2_PCI || PRISM2_PCCARD */
33933376
33943377
33953378 /* These might at some point be compiled separately and used as separate