| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | | - * Marvell Wireless LAN device driver: major functions |
|---|
| 2 | + * NXP Wireless LAN device driver: major functions |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2011-2014, Marvell International Ltd. |
|---|
| 4 | + * Copyright 2011-2020 NXP |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * This software file (the "File") is distributed by Marvell International |
|---|
| 7 | | - * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 6 | + * This software file (the "File") is distributed by NXP |
|---|
| 7 | + * under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 8 | 8 | * (the "License"). You may use, redistribute and/or modify this File in |
|---|
| 9 | 9 | * accordance with the terms and conditions of the License, a copy of which |
|---|
| 10 | 10 | * is available by writing to the Free Software Foundation, Inc., |
|---|
| .. | .. |
|---|
| 47 | 47 | bool aggr_ctrl; |
|---|
| 48 | 48 | module_param(aggr_ctrl, bool, 0000); |
|---|
| 49 | 49 | MODULE_PARM_DESC(aggr_ctrl, "usb tx aggregation enable:1, disable:0"); |
|---|
| 50 | + |
|---|
| 51 | +const u16 mwifiex_1d_to_wmm_queue[8] = { 1, 0, 0, 1, 2, 2, 3, 3 }; |
|---|
| 50 | 52 | |
|---|
| 51 | 53 | /* |
|---|
| 52 | 54 | * This function registers the device and performs all the necessary |
|---|
| .. | .. |
|---|
| 173 | 175 | |
|---|
| 174 | 176 | static void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter) |
|---|
| 175 | 177 | { |
|---|
| 176 | | - unsigned long flags; |
|---|
| 177 | | - |
|---|
| 178 | | - spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
|---|
| 178 | + spin_lock_bh(&adapter->rx_proc_lock); |
|---|
| 179 | 179 | if (adapter->rx_processing) { |
|---|
| 180 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 180 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 181 | 181 | } else { |
|---|
| 182 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 182 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 183 | 183 | queue_work(adapter->rx_workqueue, &adapter->rx_work); |
|---|
| 184 | 184 | } |
|---|
| 185 | 185 | } |
|---|
| 186 | 186 | |
|---|
| 187 | 187 | static int mwifiex_process_rx(struct mwifiex_adapter *adapter) |
|---|
| 188 | 188 | { |
|---|
| 189 | | - unsigned long flags; |
|---|
| 190 | 189 | struct sk_buff *skb; |
|---|
| 191 | 190 | struct mwifiex_rxinfo *rx_info; |
|---|
| 192 | 191 | |
|---|
| 193 | | - spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
|---|
| 192 | + spin_lock_bh(&adapter->rx_proc_lock); |
|---|
| 194 | 193 | if (adapter->rx_processing || adapter->rx_locked) { |
|---|
| 195 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 194 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 196 | 195 | goto exit_rx_proc; |
|---|
| 197 | 196 | } else { |
|---|
| 198 | 197 | adapter->rx_processing = true; |
|---|
| 199 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 198 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 200 | 199 | } |
|---|
| 201 | 200 | |
|---|
| 202 | 201 | /* Check for Rx data */ |
|---|
| .. | .. |
|---|
| 219 | 218 | mwifiex_handle_rx_packet(adapter, skb); |
|---|
| 220 | 219 | } |
|---|
| 221 | 220 | } |
|---|
| 222 | | - spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
|---|
| 221 | + spin_lock_bh(&adapter->rx_proc_lock); |
|---|
| 223 | 222 | adapter->rx_processing = false; |
|---|
| 224 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 223 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 225 | 224 | |
|---|
| 226 | 225 | exit_rx_proc: |
|---|
| 227 | 226 | return 0; |
|---|
| .. | .. |
|---|
| 634 | 633 | |
|---|
| 635 | 634 | mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1); |
|---|
| 636 | 635 | mwifiex_dbg(adapter, MSG, "driver_version = %s\n", fmt); |
|---|
| 636 | + adapter->is_up = true; |
|---|
| 637 | 637 | goto done; |
|---|
| 638 | 638 | |
|---|
| 639 | 639 | err_add_intf: |
|---|
| .. | .. |
|---|
| 825 | 825 | |
|---|
| 826 | 826 | skb = skb_clone(skb, GFP_ATOMIC); |
|---|
| 827 | 827 | if (skb) { |
|---|
| 828 | | - unsigned long flags; |
|---|
| 829 | 828 | int id; |
|---|
| 830 | 829 | |
|---|
| 831 | | - spin_lock_irqsave(&priv->ack_status_lock, flags); |
|---|
| 830 | + spin_lock_bh(&priv->ack_status_lock); |
|---|
| 832 | 831 | id = idr_alloc(&priv->ack_status_frames, orig_skb, |
|---|
| 833 | 832 | 1, 0x10, GFP_ATOMIC); |
|---|
| 834 | | - spin_unlock_irqrestore(&priv->ack_status_lock, flags); |
|---|
| 833 | + spin_unlock_bh(&priv->ack_status_lock); |
|---|
| 835 | 834 | |
|---|
| 836 | 835 | if (id >= 0) { |
|---|
| 837 | 836 | tx_info = MWIFIEX_SKB_TXCB(skb); |
|---|
| .. | .. |
|---|
| 956 | 955 | } else { |
|---|
| 957 | 956 | /* Internal mac address change */ |
|---|
| 958 | 957 | if (priv->bss_type == MWIFIEX_BSS_TYPE_ANY) |
|---|
| 959 | | - return -ENOTSUPP; |
|---|
| 958 | + return -EOPNOTSUPP; |
|---|
| 960 | 959 | |
|---|
| 961 | 960 | mac_addr = old_mac_addr; |
|---|
| 962 | 961 | |
|---|
| .. | .. |
|---|
| 1023 | 1022 | * CFG802.11 network device handler for transmission timeout. |
|---|
| 1024 | 1023 | */ |
|---|
| 1025 | 1024 | static void |
|---|
| 1026 | | -mwifiex_tx_timeout(struct net_device *dev) |
|---|
| 1025 | +mwifiex_tx_timeout(struct net_device *dev, unsigned int txqueue) |
|---|
| 1027 | 1026 | { |
|---|
| 1028 | 1027 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
|---|
| 1029 | 1028 | |
|---|
| .. | .. |
|---|
| 1282 | 1281 | |
|---|
| 1283 | 1282 | static u16 |
|---|
| 1284 | 1283 | mwifiex_netdev_select_wmm_queue(struct net_device *dev, struct sk_buff *skb, |
|---|
| 1285 | | - struct net_device *sb_dev, |
|---|
| 1286 | | - select_queue_fallback_t fallback) |
|---|
| 1284 | + struct net_device *sb_dev) |
|---|
| 1287 | 1285 | { |
|---|
| 1288 | 1286 | skb->priority = cfg80211_classify8021d(skb, NULL); |
|---|
| 1289 | 1287 | return mwifiex_1d_to_wmm_queue[skb->priority]; |
|---|
| .. | .. |
|---|
| 1355 | 1353 | */ |
|---|
| 1356 | 1354 | int is_command_pending(struct mwifiex_adapter *adapter) |
|---|
| 1357 | 1355 | { |
|---|
| 1358 | | - unsigned long flags; |
|---|
| 1359 | 1356 | int is_cmd_pend_q_empty; |
|---|
| 1360 | 1357 | |
|---|
| 1361 | | - spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); |
|---|
| 1358 | + spin_lock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 1362 | 1359 | is_cmd_pend_q_empty = list_empty(&adapter->cmd_pending_q); |
|---|
| 1363 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); |
|---|
| 1360 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 1364 | 1361 | |
|---|
| 1365 | 1362 | return !is_cmd_pend_q_empty; |
|---|
| 1366 | 1363 | } |
|---|
| .. | .. |
|---|
| 1477 | 1474 | mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN); |
|---|
| 1478 | 1475 | |
|---|
| 1479 | 1476 | mwifiex_uninit_sw(adapter); |
|---|
| 1477 | + adapter->is_up = false; |
|---|
| 1480 | 1478 | |
|---|
| 1481 | 1479 | if (adapter->if_ops.down_dev) |
|---|
| 1482 | 1480 | adapter->if_ops.down_dev(adapter); |
|---|
| .. | .. |
|---|
| 1738 | 1736 | if (!adapter) |
|---|
| 1739 | 1737 | return 0; |
|---|
| 1740 | 1738 | |
|---|
| 1741 | | - mwifiex_uninit_sw(adapter); |
|---|
| 1739 | + if (adapter->is_up) |
|---|
| 1740 | + mwifiex_uninit_sw(adapter); |
|---|
| 1742 | 1741 | |
|---|
| 1743 | 1742 | if (adapter->irq_wakeup >= 0) |
|---|
| 1744 | 1743 | device_init_wakeup(adapter->dev, false); |
|---|