Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/rt2x00/rt2x00pci.c

+460 -347
+4
drivers/net/wireless/ath/ath9k/main.c
··· 280 280 if (r) { 281 281 ath_err(common, 282 282 "Unable to reset channel, reset status %d\n", r); 283 + 284 + ath9k_hw_enable_interrupts(ah); 285 + ath9k_queue_reset(sc, RESET_TYPE_BB_HANG); 286 + 283 287 goto out; 284 288 } 285 289
+3 -3
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
··· 3303 3303 goto err; 3304 3304 } 3305 3305 3306 - /* External image takes precedence if specified */ 3307 3306 if (brcmf_sdbrcm_download_code_file(bus)) { 3308 3307 brcmf_err("dongle image file download failed\n"); 3309 3308 goto err; 3310 3309 } 3311 3310 3312 - /* External nvram takes precedence if specified */ 3313 - if (brcmf_sdbrcm_download_nvram(bus)) 3311 + if (brcmf_sdbrcm_download_nvram(bus)) { 3314 3312 brcmf_err("dongle nvram file download failed\n"); 3313 + goto err; 3314 + } 3315 3315 3316 3316 /* Take arm out of reset */ 3317 3317 if (brcmf_sdbrcm_download_state(bus, false)) {
+25 -21
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 1844 1844 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *ndev, 1845 1845 u8 key_idx, const u8 *mac_addr, struct key_params *params) 1846 1846 { 1847 + struct brcmf_if *ifp = netdev_priv(ndev); 1847 1848 struct brcmf_wsec_key key; 1848 1849 s32 err = 0; 1850 + u8 keybuf[8]; 1849 1851 1850 1852 memset(&key, 0, sizeof(key)); 1851 1853 key.index = (u32) key_idx; ··· 1871 1869 brcmf_dbg(CONN, "Setting the key index %d\n", key.index); 1872 1870 memcpy(key.data, params->key, key.len); 1873 1871 1874 - if (params->cipher == WLAN_CIPHER_SUITE_TKIP) { 1875 - u8 keybuf[8]; 1872 + if ((ifp->vif->mode != WL_MODE_AP) && 1873 + (params->cipher == WLAN_CIPHER_SUITE_TKIP)) { 1874 + brcmf_dbg(CONN, "Swapping RX/TX MIC key\n"); 1876 1875 memcpy(keybuf, &key.data[24], sizeof(keybuf)); 1877 1876 memcpy(&key.data[24], &key.data[16], sizeof(keybuf)); 1878 1877 memcpy(&key.data[16], keybuf, sizeof(keybuf)); ··· 1969 1966 break; 1970 1967 case WLAN_CIPHER_SUITE_TKIP: 1971 1968 if (ifp->vif->mode != WL_MODE_AP) { 1972 - brcmf_dbg(CONN, "Swapping key\n"); 1969 + brcmf_dbg(CONN, "Swapping RX/TX MIC key\n"); 1973 1970 memcpy(keybuf, &key.data[24], sizeof(keybuf)); 1974 1971 memcpy(&key.data[24], &key.data[16], sizeof(keybuf)); 1975 1972 memcpy(&key.data[16], keybuf, sizeof(keybuf)); ··· 2074 2071 err = -EAGAIN; 2075 2072 goto done; 2076 2073 } 2077 - switch (wsec & ~SES_OW_ENABLED) { 2078 - case WEP_ENABLED: 2074 + if (wsec & WEP_ENABLED) { 2079 2075 sec = &profile->sec; 2080 2076 if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) { 2081 2077 params.cipher = WLAN_CIPHER_SUITE_WEP40; ··· 2083 2081 params.cipher = WLAN_CIPHER_SUITE_WEP104; 2084 2082 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n"); 2085 2083 } 2086 - break; 2087 - case TKIP_ENABLED: 2084 + } else if (wsec & TKIP_ENABLED) { 2088 2085 params.cipher = WLAN_CIPHER_SUITE_TKIP; 2089 2086 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n"); 2090 - break; 2091 - case AES_ENABLED: 2087 + } else if (wsec & AES_ENABLED) { 2092 2088 params.cipher = WLAN_CIPHER_SUITE_AES_CMAC; 2093 2089 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n"); 2094 - break; 2095 - default: 2090 + } else { 2096 2091 brcmf_err("Invalid algo (0x%x)\n", wsec); 2097 2092 err = -EINVAL; 2098 2093 goto done; ··· 3773 3774 static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) 3774 3775 { 3775 3776 struct brcmf_if *ifp = netdev_priv(ndev); 3776 - s32 err = -EPERM; 3777 + s32 err; 3777 3778 struct brcmf_fil_bss_enable_le bss_enable; 3779 + struct brcmf_join_params join_params; 3778 3780 3779 3781 brcmf_dbg(TRACE, "Enter\n"); 3780 3782 ··· 3783 3783 /* Due to most likely deauths outstanding we sleep */ 3784 3784 /* first to make sure they get processed by fw. */ 3785 3785 msleep(400); 3786 - err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); 3787 - if (err < 0) { 3788 - brcmf_err("setting AP mode failed %d\n", err); 3789 - goto exit; 3790 - } 3786 + 3787 + memset(&join_params, 0, sizeof(join_params)); 3788 + err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, 3789 + &join_params, sizeof(join_params)); 3790 + if (err < 0) 3791 + brcmf_err("SET SSID error (%d)\n", err); 3791 3792 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0); 3792 - if (err < 0) { 3793 + if (err < 0) 3793 3794 brcmf_err("BRCMF_C_UP error %d\n", err); 3794 - goto exit; 3795 - } 3795 + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); 3796 + if (err < 0) 3797 + brcmf_err("setting AP mode failed %d\n", err); 3798 + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0); 3799 + if (err < 0) 3800 + brcmf_err("setting INFRA mode failed %d\n", err); 3796 3801 } else { 3797 3802 bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); 3798 3803 bss_enable.enable = cpu_to_le32(0); ··· 3810 3805 set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); 3811 3806 clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); 3812 3807 3813 - exit: 3814 3808 return err; 3815 3809 } 3816 3810
+8 -10
drivers/net/wireless/iwlwifi/dvm/rxon.c
··· 1419 1419 1420 1420 mutex_lock(&priv->mutex); 1421 1421 1422 + if (changes & BSS_CHANGED_IDLE && bss_conf->idle) { 1423 + /* 1424 + * If we go idle, then clearly no "passive-no-rx" 1425 + * workaround is needed any more, this is a reset. 1426 + */ 1427 + iwlagn_lift_passive_no_rx(priv); 1428 + } 1429 + 1422 1430 if (unlikely(!iwl_is_ready(priv))) { 1423 1431 IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); 1424 1432 mutex_unlock(&priv->mutex); ··· 1458 1450 priv->timestamp = bss_conf->sync_tsf; 1459 1451 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; 1460 1452 } else { 1461 - /* 1462 - * If we disassociate while there are pending 1463 - * frames, just wake up the queues and let the 1464 - * frames "escape" ... This shouldn't really 1465 - * be happening to start with, but we should 1466 - * not get stuck in this case either since it 1467 - * can happen if userspace gets confused. 1468 - */ 1469 - iwlagn_lift_passive_no_rx(priv); 1470 - 1471 1453 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 1472 1454 1473 1455 if (ctx->ctxid == IWL_RXON_CTX_BSS)
+1 -1
drivers/net/wireless/iwlwifi/dvm/tx.c
··· 1193 1193 memset(&info->status, 0, sizeof(info->status)); 1194 1194 1195 1195 if (status == TX_STATUS_FAIL_PASSIVE_NO_RX && 1196 - iwl_is_associated_ctx(ctx) && ctx->vif && 1196 + ctx->vif && 1197 1197 ctx->vif->type == NL80211_IFTYPE_STATION) { 1198 1198 /* block and stop all queues */ 1199 1199 priv->passive_no_rx = true;
+2 -1
drivers/net/wireless/mwifiex/cfg80211.c
··· 1904 1904 } 1905 1905 } 1906 1906 1907 - for (i = 0; i < request->n_channels; i++) { 1907 + for (i = 0; i < min_t(u32, request->n_channels, 1908 + MWIFIEX_USER_SCAN_CHAN_MAX); i++) { 1908 1909 chan = request->channels[i]; 1909 1910 priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value; 1910 1911 priv->user_scan_cfg->chan_list[i].radio_type = chan->band;
+9 -2
drivers/net/wireless/mwifiex/scan.c
··· 1393 1393 queue_work(adapter->workqueue, &adapter->main_work); 1394 1394 1395 1395 /* Perform internal scan synchronously */ 1396 - if (!priv->scan_request) 1396 + if (!priv->scan_request) { 1397 + dev_dbg(adapter->dev, "wait internal scan\n"); 1397 1398 mwifiex_wait_queue_complete(adapter, cmd_node); 1399 + } 1398 1400 } else { 1399 1401 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, 1400 1402 flags); ··· 1795 1793 /* Need to indicate IOCTL complete */ 1796 1794 if (adapter->curr_cmd->wait_q_enabled) { 1797 1795 adapter->cmd_wait_q.status = 0; 1798 - mwifiex_complete_cmd(adapter, adapter->curr_cmd); 1796 + if (!priv->scan_request) { 1797 + dev_dbg(adapter->dev, 1798 + "complete internal scan\n"); 1799 + mwifiex_complete_cmd(adapter, 1800 + adapter->curr_cmd); 1801 + } 1799 1802 } 1800 1803 if (priv->report_scan_result) 1801 1804 priv->report_scan_result = false;
+7
drivers/net/wireless/rt2x00/Kconfig
··· 20 20 config RT2400PCI 21 21 tristate "Ralink rt2400 (PCI/PCMCIA) support" 22 22 depends on PCI 23 + select RT2X00_LIB_MMIO 23 24 select RT2X00_LIB_PCI 24 25 select EEPROM_93CX6 25 26 ---help--- ··· 32 31 config RT2500PCI 33 32 tristate "Ralink rt2500 (PCI/PCMCIA) support" 34 33 depends on PCI 34 + select RT2X00_LIB_MMIO 35 35 select RT2X00_LIB_PCI 36 36 select EEPROM_93CX6 37 37 ---help--- ··· 45 43 tristate "Ralink rt2501/rt61 (PCI/PCMCIA) support" 46 44 depends on PCI 47 45 select RT2X00_LIB_PCI 46 + select RT2X00_LIB_MMIO 48 47 select RT2X00_LIB_FIRMWARE 49 48 select RT2X00_LIB_CRYPTO 50 49 select CRC_ITU_T ··· 60 57 tristate "Ralink rt27xx/rt28xx/rt30xx (PCI/PCIe/PCMCIA) support" 61 58 depends on PCI || SOC_RT288X || SOC_RT305X 62 59 select RT2800_LIB 60 + select RT2X00_LIB_MMIO 63 61 select RT2X00_LIB_PCI if PCI 64 62 select RT2X00_LIB_SOC if SOC_RT288X || SOC_RT305X 65 63 select RT2X00_LIB_FIRMWARE ··· 194 190 endif 195 191 196 192 config RT2800_LIB 193 + tristate 194 + 195 + config RT2X00_LIB_MMIO 197 196 tristate 198 197 199 198 config RT2X00_LIB_PCI
+1
drivers/net/wireless/rt2x00/Makefile
··· 9 9 rt2x00lib-$(CONFIG_RT2X00_LIB_LEDS) += rt2x00leds.o 10 10 11 11 obj-$(CONFIG_RT2X00_LIB) += rt2x00lib.o 12 + obj-$(CONFIG_RT2X00_LIB_MMIO) += rt2x00mmio.o 12 13 obj-$(CONFIG_RT2X00_LIB_PCI) += rt2x00pci.o 13 14 obj-$(CONFIG_RT2X00_LIB_SOC) += rt2x00soc.o 14 15 obj-$(CONFIG_RT2X00_LIB_USB) += rt2x00usb.o
+1
drivers/net/wireless/rt2x00/rt2400pci.c
··· 34 34 #include <linux/slab.h> 35 35 36 36 #include "rt2x00.h" 37 + #include "rt2x00mmio.h" 37 38 #include "rt2x00pci.h" 38 39 #include "rt2400pci.h" 39 40
+1
drivers/net/wireless/rt2x00/rt2500pci.c
··· 34 34 #include <linux/slab.h> 35 35 36 36 #include "rt2x00.h" 37 + #include "rt2x00mmio.h" 37 38 #include "rt2x00pci.h" 38 39 #include "rt2500pci.h" 39 40
+1
drivers/net/wireless/rt2x00/rt2800pci.c
··· 41 41 #include <linux/eeprom_93cx6.h> 42 42 43 43 #include "rt2x00.h" 44 + #include "rt2x00mmio.h" 44 45 #include "rt2x00pci.h" 45 46 #include "rt2x00soc.h" 46 47 #include "rt2800lib.h"
+216
drivers/net/wireless/rt2x00/rt2x00mmio.c
··· 1 + /* 2 + Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com> 3 + <http://rt2x00.serialmonkey.com> 4 + 5 + This program is free software; you can redistribute it and/or modify 6 + it under the terms of the GNU General Public License as published by 7 + the Free Software Foundation; either version 2 of the License, or 8 + (at your option) any later version. 9 + 10 + This program is distributed in the hope that it will be useful, 11 + but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + GNU General Public License for more details. 14 + 15 + You should have received a copy of the GNU General Public License 16 + along with this program; if not, write to the 17 + Free Software Foundation, Inc., 18 + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 + */ 20 + 21 + /* 22 + Module: rt2x00mmio 23 + Abstract: rt2x00 generic mmio device routines. 24 + */ 25 + 26 + #include <linux/dma-mapping.h> 27 + #include <linux/kernel.h> 28 + #include <linux/module.h> 29 + #include <linux/slab.h> 30 + 31 + #include "rt2x00.h" 32 + #include "rt2x00mmio.h" 33 + 34 + /* 35 + * Register access. 36 + */ 37 + int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, 38 + const unsigned int offset, 39 + const struct rt2x00_field32 field, 40 + u32 *reg) 41 + { 42 + unsigned int i; 43 + 44 + if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 45 + return 0; 46 + 47 + for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 48 + rt2x00pci_register_read(rt2x00dev, offset, reg); 49 + if (!rt2x00_get_field32(*reg, field)) 50 + return 1; 51 + udelay(REGISTER_BUSY_DELAY); 52 + } 53 + 54 + printk_once(KERN_ERR "%s() Indirect register access failed: " 55 + "offset=0x%.08x, value=0x%.08x\n", __func__, offset, *reg); 56 + *reg = ~0; 57 + 58 + return 0; 59 + } 60 + EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); 61 + 62 + bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) 63 + { 64 + struct data_queue *queue = rt2x00dev->rx; 65 + struct queue_entry *entry; 66 + struct queue_entry_priv_pci *entry_priv; 67 + struct skb_frame_desc *skbdesc; 68 + int max_rx = 16; 69 + 70 + while (--max_rx) { 71 + entry = rt2x00queue_get_entry(queue, Q_INDEX); 72 + entry_priv = entry->priv_data; 73 + 74 + if (rt2x00dev->ops->lib->get_entry_state(entry)) 75 + break; 76 + 77 + /* 78 + * Fill in desc fields of the skb descriptor 79 + */ 80 + skbdesc = get_skb_frame_desc(entry->skb); 81 + skbdesc->desc = entry_priv->desc; 82 + skbdesc->desc_len = entry->queue->desc_size; 83 + 84 + /* 85 + * DMA is already done, notify rt2x00lib that 86 + * it finished successfully. 87 + */ 88 + rt2x00lib_dmastart(entry); 89 + rt2x00lib_dmadone(entry); 90 + 91 + /* 92 + * Send the frame to rt2x00lib for further processing. 93 + */ 94 + rt2x00lib_rxdone(entry, GFP_ATOMIC); 95 + } 96 + 97 + return !max_rx; 98 + } 99 + EXPORT_SYMBOL_GPL(rt2x00pci_rxdone); 100 + 101 + void rt2x00pci_flush_queue(struct data_queue *queue, bool drop) 102 + { 103 + unsigned int i; 104 + 105 + for (i = 0; !rt2x00queue_empty(queue) && i < 10; i++) 106 + msleep(10); 107 + } 108 + EXPORT_SYMBOL_GPL(rt2x00pci_flush_queue); 109 + 110 + /* 111 + * Device initialization handlers. 112 + */ 113 + static int rt2x00pci_alloc_queue_dma(struct rt2x00_dev *rt2x00dev, 114 + struct data_queue *queue) 115 + { 116 + struct queue_entry_priv_pci *entry_priv; 117 + void *addr; 118 + dma_addr_t dma; 119 + unsigned int i; 120 + 121 + /* 122 + * Allocate DMA memory for descriptor and buffer. 123 + */ 124 + addr = dma_alloc_coherent(rt2x00dev->dev, 125 + queue->limit * queue->desc_size, 126 + &dma, GFP_KERNEL); 127 + if (!addr) 128 + return -ENOMEM; 129 + 130 + memset(addr, 0, queue->limit * queue->desc_size); 131 + 132 + /* 133 + * Initialize all queue entries to contain valid addresses. 134 + */ 135 + for (i = 0; i < queue->limit; i++) { 136 + entry_priv = queue->entries[i].priv_data; 137 + entry_priv->desc = addr + i * queue->desc_size; 138 + entry_priv->desc_dma = dma + i * queue->desc_size; 139 + } 140 + 141 + return 0; 142 + } 143 + 144 + static void rt2x00pci_free_queue_dma(struct rt2x00_dev *rt2x00dev, 145 + struct data_queue *queue) 146 + { 147 + struct queue_entry_priv_pci *entry_priv = 148 + queue->entries[0].priv_data; 149 + 150 + if (entry_priv->desc) 151 + dma_free_coherent(rt2x00dev->dev, 152 + queue->limit * queue->desc_size, 153 + entry_priv->desc, entry_priv->desc_dma); 154 + entry_priv->desc = NULL; 155 + } 156 + 157 + int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev) 158 + { 159 + struct data_queue *queue; 160 + int status; 161 + 162 + /* 163 + * Allocate DMA 164 + */ 165 + queue_for_each(rt2x00dev, queue) { 166 + status = rt2x00pci_alloc_queue_dma(rt2x00dev, queue); 167 + if (status) 168 + goto exit; 169 + } 170 + 171 + /* 172 + * Register interrupt handler. 173 + */ 174 + status = request_irq(rt2x00dev->irq, 175 + rt2x00dev->ops->lib->irq_handler, 176 + IRQF_SHARED, rt2x00dev->name, rt2x00dev); 177 + if (status) { 178 + ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n", 179 + rt2x00dev->irq, status); 180 + goto exit; 181 + } 182 + 183 + return 0; 184 + 185 + exit: 186 + queue_for_each(rt2x00dev, queue) 187 + rt2x00pci_free_queue_dma(rt2x00dev, queue); 188 + 189 + return status; 190 + } 191 + EXPORT_SYMBOL_GPL(rt2x00pci_initialize); 192 + 193 + void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev) 194 + { 195 + struct data_queue *queue; 196 + 197 + /* 198 + * Free irq line. 199 + */ 200 + free_irq(rt2x00dev->irq, rt2x00dev); 201 + 202 + /* 203 + * Free DMA 204 + */ 205 + queue_for_each(rt2x00dev, queue) 206 + rt2x00pci_free_queue_dma(rt2x00dev, queue); 207 + } 208 + EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize); 209 + 210 + /* 211 + * rt2x00mmio module information. 212 + */ 213 + MODULE_AUTHOR(DRV_PROJECT); 214 + MODULE_VERSION(DRV_VERSION); 215 + MODULE_DESCRIPTION("rt2x00 mmio library"); 216 + MODULE_LICENSE("GPL");
+119
drivers/net/wireless/rt2x00/rt2x00mmio.h
··· 1 + /* 2 + Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com> 3 + <http://rt2x00.serialmonkey.com> 4 + 5 + This program is free software; you can redistribute it and/or modify 6 + it under the terms of the GNU General Public License as published by 7 + the Free Software Foundation; either version 2 of the License, or 8 + (at your option) any later version. 9 + 10 + This program is distributed in the hope that it will be useful, 11 + but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + GNU General Public License for more details. 14 + 15 + You should have received a copy of the GNU General Public License 16 + along with this program; if not, write to the 17 + Free Software Foundation, Inc., 18 + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 + */ 20 + 21 + /* 22 + Module: rt2x00mmio 23 + Abstract: Data structures for the rt2x00mmio module. 24 + */ 25 + 26 + #ifndef RT2X00MMIO_H 27 + #define RT2X00MMIO_H 28 + 29 + #include <linux/io.h> 30 + 31 + /* 32 + * Register access. 33 + */ 34 + static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev, 35 + const unsigned int offset, 36 + u32 *value) 37 + { 38 + *value = readl(rt2x00dev->csr.base + offset); 39 + } 40 + 41 + static inline void rt2x00pci_register_multiread(struct rt2x00_dev *rt2x00dev, 42 + const unsigned int offset, 43 + void *value, const u32 length) 44 + { 45 + memcpy_fromio(value, rt2x00dev->csr.base + offset, length); 46 + } 47 + 48 + static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev, 49 + const unsigned int offset, 50 + u32 value) 51 + { 52 + writel(value, rt2x00dev->csr.base + offset); 53 + } 54 + 55 + static inline void rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, 56 + const unsigned int offset, 57 + const void *value, 58 + const u32 length) 59 + { 60 + __iowrite32_copy(rt2x00dev->csr.base + offset, value, length >> 2); 61 + } 62 + 63 + /** 64 + * rt2x00pci_regbusy_read - Read from register with busy check 65 + * @rt2x00dev: Device pointer, see &struct rt2x00_dev. 66 + * @offset: Register offset 67 + * @field: Field to check if register is busy 68 + * @reg: Pointer to where register contents should be stored 69 + * 70 + * This function will read the given register, and checks if the 71 + * register is busy. If it is, it will sleep for a couple of 72 + * microseconds before reading the register again. If the register 73 + * is not read after a certain timeout, this function will return 74 + * FALSE. 75 + */ 76 + int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, 77 + const unsigned int offset, 78 + const struct rt2x00_field32 field, 79 + u32 *reg); 80 + 81 + /** 82 + * struct queue_entry_priv_pci: Per entry PCI specific information 83 + * 84 + * @desc: Pointer to device descriptor 85 + * @desc_dma: DMA pointer to &desc. 86 + * @data: Pointer to device's entry memory. 87 + * @data_dma: DMA pointer to &data. 88 + */ 89 + struct queue_entry_priv_pci { 90 + __le32 *desc; 91 + dma_addr_t desc_dma; 92 + }; 93 + 94 + /** 95 + * rt2x00pci_rxdone - Handle RX done events 96 + * @rt2x00dev: Device pointer, see &struct rt2x00_dev. 97 + * 98 + * Returns true if there are still rx frames pending and false if all 99 + * pending rx frames were processed. 100 + */ 101 + bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev); 102 + 103 + /** 104 + * rt2x00pci_flush_queue - Flush data queue 105 + * @queue: Data queue to stop 106 + * @drop: True to drop all pending frames. 107 + * 108 + * This will wait for a maximum of 100ms, waiting for the queues 109 + * to become empty. 110 + */ 111 + void rt2x00pci_flush_queue(struct data_queue *queue, bool drop); 112 + 113 + /* 114 + * Device initialization handlers. 115 + */ 116 + int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev); 117 + void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev); 118 + 119 + #endif /* RT2X00MMIO_H */
-176
drivers/net/wireless/rt2x00/rt2x00pci.c
··· 33 33 #include "rt2x00pci.h" 34 34 35 35 /* 36 - * Register access. 37 - */ 38 - int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, 39 - const unsigned int offset, 40 - const struct rt2x00_field32 field, 41 - u32 *reg) 42 - { 43 - unsigned int i; 44 - 45 - if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 46 - return 0; 47 - 48 - for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 49 - rt2x00pci_register_read(rt2x00dev, offset, reg); 50 - if (!rt2x00_get_field32(*reg, field)) 51 - return 1; 52 - udelay(REGISTER_BUSY_DELAY); 53 - } 54 - 55 - printk_once(KERN_ERR "%s() Indirect register access failed: " 56 - "offset=0x%.08x, value=0x%.08x\n", __func__, offset, *reg); 57 - *reg = ~0; 58 - 59 - return 0; 60 - } 61 - EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); 62 - 63 - bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) 64 - { 65 - struct data_queue *queue = rt2x00dev->rx; 66 - struct queue_entry *entry; 67 - struct queue_entry_priv_pci *entry_priv; 68 - struct skb_frame_desc *skbdesc; 69 - int max_rx = 16; 70 - 71 - while (--max_rx) { 72 - entry = rt2x00queue_get_entry(queue, Q_INDEX); 73 - entry_priv = entry->priv_data; 74 - 75 - if (rt2x00dev->ops->lib->get_entry_state(entry)) 76 - break; 77 - 78 - /* 79 - * Fill in desc fields of the skb descriptor 80 - */ 81 - skbdesc = get_skb_frame_desc(entry->skb); 82 - skbdesc->desc = entry_priv->desc; 83 - skbdesc->desc_len = entry->queue->desc_size; 84 - 85 - /* 86 - * DMA is already done, notify rt2x00lib that 87 - * it finished successfully. 88 - */ 89 - rt2x00lib_dmastart(entry); 90 - rt2x00lib_dmadone(entry); 91 - 92 - /* 93 - * Send the frame to rt2x00lib for further processing. 94 - */ 95 - rt2x00lib_rxdone(entry, GFP_ATOMIC); 96 - } 97 - 98 - return !max_rx; 99 - } 100 - EXPORT_SYMBOL_GPL(rt2x00pci_rxdone); 101 - 102 - void rt2x00pci_flush_queue(struct data_queue *queue, bool drop) 103 - { 104 - unsigned int i; 105 - 106 - for (i = 0; !rt2x00queue_empty(queue) && i < 10; i++) 107 - msleep(10); 108 - } 109 - EXPORT_SYMBOL_GPL(rt2x00pci_flush_queue); 110 - 111 - /* 112 - * Device initialization handlers. 113 - */ 114 - static int rt2x00pci_alloc_queue_dma(struct rt2x00_dev *rt2x00dev, 115 - struct data_queue *queue) 116 - { 117 - struct queue_entry_priv_pci *entry_priv; 118 - void *addr; 119 - dma_addr_t dma; 120 - unsigned int i; 121 - 122 - /* 123 - * Allocate DMA memory for descriptor and buffer. 124 - */ 125 - addr = dma_alloc_coherent(rt2x00dev->dev, 126 - queue->limit * queue->desc_size, 127 - &dma, GFP_KERNEL); 128 - if (!addr) 129 - return -ENOMEM; 130 - 131 - memset(addr, 0, queue->limit * queue->desc_size); 132 - 133 - /* 134 - * Initialize all queue entries to contain valid addresses. 135 - */ 136 - for (i = 0; i < queue->limit; i++) { 137 - entry_priv = queue->entries[i].priv_data; 138 - entry_priv->desc = addr + i * queue->desc_size; 139 - entry_priv->desc_dma = dma + i * queue->desc_size; 140 - } 141 - 142 - return 0; 143 - } 144 - 145 - static void rt2x00pci_free_queue_dma(struct rt2x00_dev *rt2x00dev, 146 - struct data_queue *queue) 147 - { 148 - struct queue_entry_priv_pci *entry_priv = 149 - queue->entries[0].priv_data; 150 - 151 - if (entry_priv->desc) 152 - dma_free_coherent(rt2x00dev->dev, 153 - queue->limit * queue->desc_size, 154 - entry_priv->desc, entry_priv->desc_dma); 155 - entry_priv->desc = NULL; 156 - } 157 - 158 - int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev) 159 - { 160 - struct data_queue *queue; 161 - int status; 162 - 163 - /* 164 - * Allocate DMA 165 - */ 166 - queue_for_each(rt2x00dev, queue) { 167 - status = rt2x00pci_alloc_queue_dma(rt2x00dev, queue); 168 - if (status) 169 - goto exit; 170 - } 171 - 172 - /* 173 - * Register interrupt handler. 174 - */ 175 - status = request_irq(rt2x00dev->irq, 176 - rt2x00dev->ops->lib->irq_handler, 177 - IRQF_SHARED, rt2x00dev->name, rt2x00dev); 178 - if (status) { 179 - ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n", 180 - rt2x00dev->irq, status); 181 - goto exit; 182 - } 183 - 184 - return 0; 185 - 186 - exit: 187 - queue_for_each(rt2x00dev, queue) 188 - rt2x00pci_free_queue_dma(rt2x00dev, queue); 189 - 190 - return status; 191 - } 192 - EXPORT_SYMBOL_GPL(rt2x00pci_initialize); 193 - 194 - void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev) 195 - { 196 - struct data_queue *queue; 197 - 198 - /* 199 - * Free irq line. 200 - */ 201 - free_irq(rt2x00dev->irq, rt2x00dev); 202 - 203 - /* 204 - * Free DMA 205 - */ 206 - queue_for_each(rt2x00dev, queue) 207 - rt2x00pci_free_queue_dma(rt2x00dev, queue); 208 - } 209 - EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize); 210 - 211 - /* 212 36 * PCI driver handlers. 213 37 */ 214 38 static void rt2x00pci_free_reg(struct rt2x00_dev *rt2x00dev)
-88
drivers/net/wireless/rt2x00/rt2x00pci.h
··· 36 36 #define PCI_DEVICE_DATA(__ops) .driver_data = (kernel_ulong_t)(__ops) 37 37 38 38 /* 39 - * Register access. 40 - */ 41 - static inline void rt2x00pci_register_read(struct rt2x00_dev *rt2x00dev, 42 - const unsigned int offset, 43 - u32 *value) 44 - { 45 - *value = readl(rt2x00dev->csr.base + offset); 46 - } 47 - 48 - static inline void rt2x00pci_register_multiread(struct rt2x00_dev *rt2x00dev, 49 - const unsigned int offset, 50 - void *value, const u32 length) 51 - { 52 - memcpy_fromio(value, rt2x00dev->csr.base + offset, length); 53 - } 54 - 55 - static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev, 56 - const unsigned int offset, 57 - u32 value) 58 - { 59 - writel(value, rt2x00dev->csr.base + offset); 60 - } 61 - 62 - static inline void rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, 63 - const unsigned int offset, 64 - const void *value, 65 - const u32 length) 66 - { 67 - __iowrite32_copy(rt2x00dev->csr.base + offset, value, length >> 2); 68 - } 69 - 70 - /** 71 - * rt2x00pci_regbusy_read - Read from register with busy check 72 - * @rt2x00dev: Device pointer, see &struct rt2x00_dev. 73 - * @offset: Register offset 74 - * @field: Field to check if register is busy 75 - * @reg: Pointer to where register contents should be stored 76 - * 77 - * This function will read the given register, and checks if the 78 - * register is busy. If it is, it will sleep for a couple of 79 - * microseconds before reading the register again. If the register 80 - * is not read after a certain timeout, this function will return 81 - * FALSE. 82 - */ 83 - int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, 84 - const unsigned int offset, 85 - const struct rt2x00_field32 field, 86 - u32 *reg); 87 - 88 - /** 89 - * struct queue_entry_priv_pci: Per entry PCI specific information 90 - * 91 - * @desc: Pointer to device descriptor 92 - * @desc_dma: DMA pointer to &desc. 93 - * @data: Pointer to device's entry memory. 94 - * @data_dma: DMA pointer to &data. 95 - */ 96 - struct queue_entry_priv_pci { 97 - __le32 *desc; 98 - dma_addr_t desc_dma; 99 - }; 100 - 101 - /** 102 - * rt2x00pci_rxdone - Handle RX done events 103 - * @rt2x00dev: Device pointer, see &struct rt2x00_dev. 104 - * 105 - * Returns true if there are still rx frames pending and false if all 106 - * pending rx frames were processed. 107 - */ 108 - bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev); 109 - 110 - /** 111 - * rt2x00pci_flush_queue - Flush data queue 112 - * @queue: Data queue to stop 113 - * @drop: True to drop all pending frames. 114 - * 115 - * This will wait for a maximum of 100ms, waiting for the queues 116 - * to become empty. 117 - */ 118 - void rt2x00pci_flush_queue(struct data_queue *queue, bool drop); 119 - 120 - /* 121 - * Device initialization handlers. 122 - */ 123 - int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev); 124 - void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev); 125 - 126 - /* 127 39 * PCI driver handlers. 128 40 */ 129 41 int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops);
+1
drivers/net/wireless/rt2x00/rt61pci.c
··· 35 35 #include <linux/eeprom_93cx6.h> 36 36 37 37 #include "rt2x00.h" 38 + #include "rt2x00mmio.h" 38 39 #include "rt2x00pci.h" 39 40 #include "rt61pci.h" 40 41
+17 -21
drivers/nfc/microread/mei.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/interrupt.h> 24 24 #include <linux/gpio.h> 25 - #include <linux/mei_bus.h> 25 + #include <linux/mei_cl_bus.h> 26 26 27 27 #include <linux/nfc.h> 28 28 #include <net/nfc/hci.h> ··· 31 31 #include "microread.h" 32 32 33 33 #define MICROREAD_DRIVER_NAME "microread" 34 - 35 - #define MICROREAD_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, 0x94, \ 36 - 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c) 37 34 38 35 struct mei_nfc_hdr { 39 36 u8 cmd; ··· 45 48 #define MEI_NFC_MAX_READ (MEI_NFC_HEADER_SIZE + MEI_NFC_MAX_HCI_PAYLOAD) 46 49 47 50 struct microread_mei_phy { 48 - struct mei_device *mei_device; 51 + struct mei_cl_device *device; 49 52 struct nfc_hci_dev *hdev; 50 53 51 54 int powered; ··· 102 105 103 106 MEI_DUMP_SKB_OUT("mei frame sent", skb); 104 107 105 - r = mei_send(phy->device, skb->data, skb->len); 108 + r = mei_cl_send(phy->device, skb->data, skb->len); 106 109 if (r > 0) 107 110 r = 0; 108 111 109 112 return r; 110 113 } 111 114 112 - static void microread_event_cb(struct mei_device *device, u32 events, 115 + static void microread_event_cb(struct mei_cl_device *device, u32 events, 113 116 void *context) 114 117 { 115 118 struct microread_mei_phy *phy = context; ··· 117 120 if (phy->hard_fault != 0) 118 121 return; 119 122 120 - if (events & BIT(MEI_EVENT_RX)) { 123 + if (events & BIT(MEI_CL_EVENT_RX)) { 121 124 struct sk_buff *skb; 122 125 int reply_size; 123 126 ··· 125 128 if (!skb) 126 129 return; 127 130 128 - reply_size = mei_recv(device, skb->data, MEI_NFC_MAX_READ); 131 + reply_size = mei_cl_recv(device, skb->data, MEI_NFC_MAX_READ); 129 132 if (reply_size < MEI_NFC_HEADER_SIZE) { 130 133 kfree(skb); 131 134 return; ··· 146 149 .disable = microread_mei_disable, 147 150 }; 148 151 149 - static int microread_mei_probe(struct mei_device *device, 150 - const struct mei_id *id) 152 + static int microread_mei_probe(struct mei_cl_device *device, 153 + const struct mei_cl_device_id *id) 151 154 { 152 155 struct microread_mei_phy *phy; 153 156 int r; ··· 161 164 } 162 165 163 166 phy->device = device; 164 - mei_set_clientdata(device, phy); 167 + mei_cl_set_drvdata(device, phy); 165 168 166 - r = mei_register_event_cb(device, microread_event_cb, phy); 169 + r = mei_cl_register_event_cb(device, microread_event_cb, phy); 167 170 if (r) { 168 171 pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n"); 169 172 goto err_out; ··· 183 186 return r; 184 187 } 185 188 186 - static int microread_mei_remove(struct mei_device *device) 189 + static int microread_mei_remove(struct mei_cl_device *device) 187 190 { 188 - struct microread_mei_phy *phy = mei_get_clientdata(device); 191 + struct microread_mei_phy *phy = mei_cl_get_drvdata(device); 189 192 190 193 pr_info("Removing microread\n"); 191 194 ··· 199 202 return 0; 200 203 } 201 204 202 - static struct mei_id microread_mei_tbl[] = { 203 - { MICROREAD_DRIVER_NAME, MICROREAD_UUID }, 205 + static struct mei_cl_device_id microread_mei_tbl[] = { 206 + { MICROREAD_DRIVER_NAME }, 204 207 205 208 /* required last entry */ 206 209 { } 207 210 }; 208 - 209 211 MODULE_DEVICE_TABLE(mei, microread_mei_tbl); 210 212 211 - static struct mei_driver microread_driver = { 213 + static struct mei_cl_driver microread_driver = { 212 214 .id_table = microread_mei_tbl, 213 215 .name = MICROREAD_DRIVER_NAME, 214 216 ··· 221 225 222 226 pr_debug(DRIVER_DESC ": %s\n", __func__); 223 227 224 - r = mei_driver_register(&microread_driver); 228 + r = mei_cl_driver_register(&microread_driver); 225 229 if (r) { 226 230 pr_err(MICROREAD_DRIVER_NAME ": driver registration failed\n"); 227 231 return r; ··· 232 236 233 237 static void microread_mei_exit(void) 234 238 { 235 - mei_driver_unregister(&microread_driver); 239 + mei_cl_driver_unregister(&microread_driver); 236 240 } 237 241 238 242 module_init(microread_mei_init);
+4 -2
net/mac80211/cfg.c
··· 2641 2641 list_del(&dep->list); 2642 2642 mutex_unlock(&local->mtx); 2643 2643 2644 - ieee80211_roc_notify_destroy(dep); 2644 + ieee80211_roc_notify_destroy(dep, true); 2645 2645 return 0; 2646 2646 } 2647 2647 ··· 2681 2681 ieee80211_start_next_roc(local); 2682 2682 mutex_unlock(&local->mtx); 2683 2683 2684 - ieee80211_roc_notify_destroy(found); 2684 + ieee80211_roc_notify_destroy(found, true); 2685 2685 } else { 2686 2686 /* work may be pending so use it all the time */ 2687 2687 found->abort = true; ··· 2691 2691 2692 2692 /* work will clean up etc */ 2693 2693 flush_delayed_work(&found->work); 2694 + WARN_ON(!found->to_be_freed); 2695 + kfree(found); 2694 2696 } 2695 2697 2696 2698 return 0;
+14 -3
net/mac80211/chan.c
··· 63 63 enum ieee80211_chanctx_mode mode) 64 64 { 65 65 struct ieee80211_chanctx *ctx; 66 + u32 changed; 66 67 int err; 67 68 68 69 lockdep_assert_held(&local->chanctx_mtx); ··· 77 76 ctx->conf.rx_chains_dynamic = 1; 78 77 ctx->mode = mode; 79 78 79 + /* acquire mutex to prevent idle from changing */ 80 + mutex_lock(&local->mtx); 81 + /* turn idle off *before* setting channel -- some drivers need that */ 82 + changed = ieee80211_idle_off(local); 83 + if (changed) 84 + ieee80211_hw_config(local, changed); 85 + 80 86 if (!local->use_chanctx) { 81 87 local->_oper_channel_type = 82 88 cfg80211_get_chandef_type(chandef); ··· 93 85 err = drv_add_chanctx(local, ctx); 94 86 if (err) { 95 87 kfree(ctx); 96 - return ERR_PTR(err); 88 + ctx = ERR_PTR(err); 89 + 90 + ieee80211_recalc_idle(local); 91 + goto out; 97 92 } 98 93 } 99 94 95 + /* and keep the mutex held until the new chanctx is on the list */ 100 96 list_add_rcu(&ctx->list, &local->chanctx_list); 101 97 102 - mutex_lock(&local->mtx); 103 - ieee80211_recalc_idle(local); 98 + out: 104 99 mutex_unlock(&local->mtx); 105 100 106 101 return ctx;
+3 -1
net/mac80211/ieee80211_i.h
··· 309 309 struct ieee80211_channel *chan; 310 310 311 311 bool started, abort, hw_begun, notified; 312 + bool to_be_freed; 312 313 313 314 unsigned long hw_start_time; 314 315 ··· 1331 1330 void ieee80211_roc_setup(struct ieee80211_local *local); 1332 1331 void ieee80211_start_next_roc(struct ieee80211_local *local); 1333 1332 void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata); 1334 - void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc); 1333 + void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free); 1335 1334 void ieee80211_sw_roc_work(struct work_struct *work); 1336 1335 void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc); 1337 1336 ··· 1345 1344 enum nl80211_iftype type); 1346 1345 void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); 1347 1346 void ieee80211_remove_interfaces(struct ieee80211_local *local); 1347 + u32 ieee80211_idle_off(struct ieee80211_local *local); 1348 1348 void ieee80211_recalc_idle(struct ieee80211_local *local); 1349 1349 void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata, 1350 1350 const int offset);
+1 -1
net/mac80211/iface.c
··· 78 78 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER); 79 79 } 80 80 81 - static u32 ieee80211_idle_off(struct ieee80211_local *local) 81 + u32 ieee80211_idle_off(struct ieee80211_local *local) 82 82 { 83 83 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE)) 84 84 return 0;
+17 -6
net/mac80211/offchannel.c
··· 297 297 } 298 298 } 299 299 300 - void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) 300 + void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free) 301 301 { 302 302 struct ieee80211_roc_work *dep, *tmp; 303 + 304 + if (WARN_ON(roc->to_be_freed)) 305 + return; 303 306 304 307 /* was never transmitted */ 305 308 if (roc->frame) { ··· 319 316 GFP_KERNEL); 320 317 321 318 list_for_each_entry_safe(dep, tmp, &roc->dependents, list) 322 - ieee80211_roc_notify_destroy(dep); 319 + ieee80211_roc_notify_destroy(dep, true); 323 320 324 - kfree(roc); 321 + if (free) 322 + kfree(roc); 323 + else 324 + roc->to_be_freed = true; 325 325 } 326 326 327 327 void ieee80211_sw_roc_work(struct work_struct *work) ··· 336 330 bool started; 337 331 338 332 mutex_lock(&local->mtx); 333 + 334 + if (roc->to_be_freed) 335 + goto out_unlock; 339 336 340 337 if (roc->abort) 341 338 goto finish; ··· 379 370 finish: 380 371 list_del(&roc->list); 381 372 started = roc->started; 382 - ieee80211_roc_notify_destroy(roc); 373 + ieee80211_roc_notify_destroy(roc, !roc->abort); 383 374 384 375 if (started) { 385 376 ieee80211_flush_queues(local, NULL); ··· 419 410 420 411 list_del(&roc->list); 421 412 422 - ieee80211_roc_notify_destroy(roc); 413 + ieee80211_roc_notify_destroy(roc, true); 423 414 424 415 /* if there's another roc, start it now */ 425 416 ieee80211_start_next_roc(local); ··· 469 460 list_for_each_entry_safe(roc, tmp, &tmp_list, list) { 470 461 if (local->ops->remain_on_channel) { 471 462 list_del(&roc->list); 472 - ieee80211_roc_notify_destroy(roc); 463 + ieee80211_roc_notify_destroy(roc, true); 473 464 } else { 474 465 ieee80211_queue_delayed_work(&local->hw, &roc->work, 0); 475 466 476 467 /* work will clean up etc */ 477 468 flush_delayed_work(&roc->work); 469 + WARN_ON(!roc->to_be_freed); 470 + kfree(roc); 478 471 } 479 472 } 480 473
-8
net/nfc/llcp/llcp.c
··· 107 107 accept_sk->sk_state_change(sk); 108 108 109 109 bh_unlock_sock(accept_sk); 110 - 111 - sock_orphan(accept_sk); 112 110 } 113 111 114 112 if (listen == true) { ··· 131 133 sk->sk_state_change(sk); 132 134 133 135 bh_unlock_sock(sk); 134 - 135 - sock_orphan(sk); 136 136 137 137 sk_del_node_init(sk); 138 138 } ··· 159 163 sk->sk_state_change(sk); 160 164 161 165 bh_unlock_sock(sk); 162 - 163 - sock_orphan(sk); 164 166 165 167 sk_del_node_init(sk); 166 168 } ··· 863 869 skb_get(skb); 864 870 } else { 865 871 pr_err("Receive queue is full\n"); 866 - kfree_skb(skb); 867 872 } 868 873 869 874 nfc_llcp_sock_put(llcp_sock); ··· 1065 1072 skb_get(skb); 1066 1073 } else { 1067 1074 pr_err("Receive queue is full\n"); 1068 - kfree_skb(skb); 1069 1075 } 1070 1076 } 1071 1077
+3 -3
net/nfc/llcp/sock.c
··· 388 388 } 389 389 390 390 if (sk->sk_state == LLCP_CONNECTED || !newsock) { 391 - nfc_llcp_accept_unlink(sk); 391 + list_del_init(&lsk->accept_queue); 392 + sock_put(sk); 393 + 392 394 if (newsock) 393 395 sock_graft(sk, newsock); 394 396 ··· 584 582 nfc_llcp_accept_unlink(accept_sk); 585 583 586 584 release_sock(accept_sk); 587 - 588 - sock_orphan(accept_sk); 589 585 } 590 586 } 591 587
+2
net/wireless/sme.c
··· 228 228 rtnl_lock(); 229 229 cfg80211_lock_rdev(rdev); 230 230 mutex_lock(&rdev->devlist_mtx); 231 + mutex_lock(&rdev->sched_scan_mtx); 231 232 232 233 list_for_each_entry(wdev, &rdev->wdev_list, list) { 233 234 wdev_lock(wdev); ··· 253 252 wdev_unlock(wdev); 254 253 } 255 254 255 + mutex_unlock(&rdev->sched_scan_mtx); 256 256 mutex_unlock(&rdev->devlist_mtx); 257 257 cfg80211_unlock_rdev(rdev); 258 258 rtnl_unlock();