.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Host AP (software wireless LAN access point) driver for |
---|
3 | 4 | * Intersil Prism2/2.5/3. |
---|
.. | .. |
---|
5 | 6 | * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen |
---|
6 | 7 | * <j@w1.fi> |
---|
7 | 8 | * 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. |
---|
13 | 9 | * |
---|
14 | 10 | * FIX: |
---|
15 | 11 | * - there is currently no way of associating TX packets to correct wds device |
---|
.. | .. |
---|
130 | 126 | |
---|
131 | 127 | #ifdef PRISM2_DOWNLOAD_SUPPORT |
---|
132 | 128 | /* 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; |
---|
134 | 130 | static u8 * prism2_read_pda(struct net_device *dev); |
---|
135 | 131 | static int prism2_download(local_info_t *local, |
---|
136 | 132 | struct prism2_download_param *param); |
---|
.. | .. |
---|
323 | 319 | |
---|
324 | 320 | iface = netdev_priv(dev); |
---|
325 | 321 | 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 | | - } |
---|
332 | 322 | |
---|
333 | 323 | if (local->cmd_queue_len >= HOSTAP_CMD_QUEUE_MAX_LEN) { |
---|
334 | 324 | printk(KERN_DEBUG "%s: hfa384x_cmd: cmd_queue full\n", |
---|
.. | .. |
---|
1564 | 1554 | iface = netdev_priv(dev); |
---|
1565 | 1555 | local = iface->local; |
---|
1566 | 1556 | |
---|
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 | | - |
---|
1573 | 1557 | if (local->hw_downloading) |
---|
1574 | 1558 | return; |
---|
1575 | 1559 | |
---|
.. | .. |
---|
1807 | 1791 | struct hfa384x_tx_frame txdesc; |
---|
1808 | 1792 | struct hostap_skb_tx_data *meta; |
---|
1809 | 1793 | int hdr_len, data_len, idx, res, ret = -1; |
---|
1810 | | - u16 tx_control, fc; |
---|
| 1794 | + u16 tx_control; |
---|
1811 | 1795 | |
---|
1812 | 1796 | iface = netdev_priv(dev); |
---|
1813 | 1797 | local = iface->local; |
---|
.. | .. |
---|
1830 | 1814 | /* skb->data starts with txdesc->frame_control */ |
---|
1831 | 1815 | hdr_len = 24; |
---|
1832 | 1816 | skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len); |
---|
1833 | | - fc = le16_to_cpu(txdesc.frame_control); |
---|
1834 | 1817 | if (ieee80211_is_data(txdesc.frame_control) && |
---|
1835 | 1818 | ieee80211_has_a4(txdesc.frame_control) && |
---|
1836 | 1819 | skb->len >= 30) { |
---|
.. | .. |
---|
2087 | 2070 | |
---|
2088 | 2071 | |
---|
2089 | 2072 | /* 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) |
---|
2091 | 2074 | { |
---|
2092 | | - local_info_t *local = (local_info_t *) data; |
---|
| 2075 | + local_info_t *local = from_tasklet(local, t, rx_tasklet); |
---|
2093 | 2076 | struct sk_buff *skb; |
---|
2094 | 2077 | |
---|
2095 | 2078 | while ((skb = skb_dequeue(&local->rx_list)) != NULL) |
---|
.. | .. |
---|
2292 | 2275 | |
---|
2293 | 2276 | |
---|
2294 | 2277 | /* 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) |
---|
2296 | 2279 | { |
---|
2297 | | - local_info_t *local = (local_info_t *) data; |
---|
| 2280 | + local_info_t *local = from_tasklet(local, t, sta_tx_exc_tasklet); |
---|
2298 | 2281 | struct sk_buff *skb; |
---|
2299 | 2282 | |
---|
2300 | 2283 | while ((skb = skb_dequeue(&local->sta_tx_exc_list)) != NULL) { |
---|
.. | .. |
---|
2394 | 2377 | |
---|
2395 | 2378 | |
---|
2396 | 2379 | /* 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) |
---|
2398 | 2381 | { |
---|
2399 | | - local_info_t *local = (local_info_t *) data; |
---|
| 2382 | + local_info_t *local = from_tasklet(local, t, info_tasklet); |
---|
2400 | 2383 | struct sk_buff *skb; |
---|
2401 | 2384 | |
---|
2402 | 2385 | while ((skb = skb_dequeue(&local->info_list)) != NULL) { |
---|
.. | .. |
---|
2473 | 2456 | |
---|
2474 | 2457 | |
---|
2475 | 2458 | /* 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) |
---|
2477 | 2460 | { |
---|
2478 | | - local_info_t *local = (local_info_t *) data; |
---|
| 2461 | + local_info_t *local = from_tasklet(local, t, bap_tasklet); |
---|
2479 | 2462 | struct net_device *dev = local->dev; |
---|
2480 | 2463 | u16 ev; |
---|
2481 | 2464 | int frames = 30; |
---|
.. | .. |
---|
3122 | 3105 | local->func->reset_port = prism2_reset_port; |
---|
3123 | 3106 | local->func->schedule_reset = prism2_schedule_reset; |
---|
3124 | 3107 | #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; |
---|
3126 | 3109 | local->func->download = prism2_download; |
---|
3127 | 3110 | #endif /* PRISM2_DOWNLOAD_SUPPORT */ |
---|
3128 | 3111 | local->func->tx = prism2_tx_80211; |
---|
.. | .. |
---|
3187 | 3170 | /* Initialize tasklets for handling hardware IRQ related operations |
---|
3188 | 3171 | * outside hw IRQ handler */ |
---|
3189 | 3172 | #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); } \ |
---|
3191 | 3174 | while (0) |
---|
3192 | 3175 | HOSTAP_TASKLET_INIT(&local->bap_tasklet, hostap_bap_tasklet, |
---|
3193 | 3176 | (unsigned long) local); |
---|
.. | .. |
---|
3370 | 3353 | } |
---|
3371 | 3354 | |
---|
3372 | 3355 | |
---|
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) |
---|
3375 | 3358 | { |
---|
3376 | 3359 | struct hostap_interface *iface; |
---|
3377 | 3360 | struct local_info *local; |
---|
.. | .. |
---|
3389 | 3372 | /* Disable hardware and firmware */ |
---|
3390 | 3373 | prism2_hw_shutdown(dev, 0); |
---|
3391 | 3374 | } |
---|
3392 | | -#endif /* (PRISM2_PCI && CONFIG_PM) || PRISM2_PCCARD */ |
---|
| 3375 | +#endif /* PRISM2_PCI || PRISM2_PCCARD */ |
---|
3393 | 3376 | |
---|
3394 | 3377 | |
---|
3395 | 3378 | /* These might at some point be compiled separately and used as separate |
---|