aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless
AgeCommit message (Collapse)AuthorFilesLines
2017-06-23iwlwifi: use bitfield.h for some registersJohannes Berg4-24/+23
Letting the preprocessor/compiler generate the shift/mask by itself is a win for readability, so use bitfield.h for some registers. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: use scnprintf() instead of snprintf()Johannes Berg1-10/+12
It's safer to use scnprintf() here because the buffer might be too short for the full format strings. In most cases this isn't true because of external limits on the values. In one case, this fixes a stack data leak. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: avoid variable shadowingJohannes Berg2-3/+3
Avoid one kind of symbol shadowing another in iwl_mvm_flush_sta() by renaming the function parameter. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: pcie: fix TVQM queue ID range checkJohannes Berg1-1/+1
The queue ID should never be 512 either, so correct the check to be >= instead of just >. Fixes: 310181ec34e2 ("iwlwifi: move to TVQM mode") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: remove pointless num_stored conditionJohannes Berg1-1/+1
Since we exit if buf->num_stored is 0, there's no need to check it again later. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: avoid unnecessary cache trashing in Tx pathEmmanuel Grumbach1-1/+4
When sending a Tx Command with a Tx packet, we allocate the Tx command separately from the payload of the packet. The WiFi MAC header is then copied into the buffer that was allocated for the Tx Command. This means that this buffer needs to be big enough to contain both. This is why it is allocated with iwl_trans_alloc_tx_cmd which returns a pointer to a newly allocated not zeroed struct iwl_device_cmd. The Tx command has a few bit fields and hence it needs to be zeroed, but all the rest of the buffer doesn't need to be zeroed since it will either be memcopy'ed with the MAC header, or not even sent to the device. This means that we don't need to zero all the iwl_device_cmd structure, but rather only the size of the iwl_tx_cmd structure. Since sizeof(iwl_tx_cmd) - sizeof(iwl_tx_cmd) is about 260 bytes, this can avoid touching 4 cache lines for each packet. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: Enable security on new TX APIDavid Spinadel2-40/+80
Install GTKs on AP side for new TX API. Don't add IV space, it's added by the HW. While at that fix GCMP abnd GCMP-256 GTK installation which work similarly to the new TX API. Signed-off-by: David Spinadel <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: disable dbg data collect when fw isn't aliveLiad Kaufman1-0/+4
If FW isn't alive, trying to collect debug data will result in errors both in driver and in the collected data, so just warn and leave the collecting function in this case. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: remove resp_pkt NULL checksJohannes Berg5-24/+3
Contrary to what some of the comments say, if rfkill was asserted the transport will return -ERFKILL instead of success, if CMD_WANT_SKB was set, so it's not necessary to check cmd.resp_pkt for being NULL if the return code was success. Validate that this is true in iwl_trans_send_cmd(). Most of the other code modifications were done with the following spatch: @@ struct iwl_host_cmd cmd; identifier pkt; @@ <... ( pkt = cmd.resp_pkt; ... -if (!pkt) { ... } | pkt = cmd.resp_pkt; ... -if (WARN_ON(!pkt)) { ... } | -if (!cmd.resp_pkt) { ... } ) ...> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: mvm: remove txq EMPTYING_DELBA state for DQALiad Kaufman1-2/+7
In DQA mode, there is no need to wait for the TXQ to clear out after getting a DELBA, since traffic can continue running on the queue. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-22Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.gitKalle Valo27-535/+1718
ath.git patches for 4.13. Major changes: wil6210 * add low level RF sector interface via nl80211 vendor commands * add module parameter ftm_mode to load separate firmware for factory testing * support devices with different PCIe bar size * add support for PCIe D3hot in system suspend * remove ioctl interface which should not be in a wireless driver ath10k * go back to using dma_alloc_coherent() for firmware scratch memory * add per chain RSSI reporting
2017-06-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller6-36/+49
Two entries being added at the same time to the IFLA policy table, whilst parallel bug fixes to decnet routing dst handling overlapping with the dst gc removal in net-next. Signed-off-by: David S. Miller <[email protected]>
2017-06-21brcmfmac: initialize oob irq data before request_irq()Michał Mirosław1-5/+3
This fixes spin-forever in irq handler when IRQ is already asserted at request_irq() time. Signed-off-by: Michał Mirosław <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: btcoexist control to enter/leave LPSPing-Ke Shih8-26/+203
To yield better user experience, have btcoex control LPS's parameters. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: add btc_is_bt_lps_on() for btcoexistPing-Ke Shih3-0/+8
If LPS is controlled by btcoex, this function tell driver LPS is on or off. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: Add rx ampdu cfg for btcoexist.Ping-Ke Shih6-2/+58
If RX ampdu is too long, BT will have less time. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: Add btcoex record_pwr_modePing-Ke Shih9-6/+43
Add btcoex record pwr mode to control LPS's parameters and share time with BT. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: Revise special packet notification to be readable format.Ping-Ke Shih1-4/+9
We extend types of special packets to a enumeration from boolean value. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: Add TX report and disable key to force wait until report acked.Ping-Ke Shih16-25/+194
When using EAPOL to do a PTK rekey, there is a possible race condition. When msg 3/4 is received, the supplicant will send msg 4/4 and install the new key immediately; however, the driver must make sure that msg 4/4 is sent before installing the new key. We use TX report to ensure it is sent. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: extend debug_comp to u64Ping-Ke Shih2-4/+4
The number of debugging conditions now exceeds the capabilities of a 32-bit word. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: Correct power save capability while init mac80211Ping-Ke Shih2-1/+6
Since the driver itself will enter power saving mode dynamically according to the traffic, we set hw capability SUPPORTS_PS and SUPPORTS_DYNAMIC_PS in case of fwctrl_lps. The process IEEE80211_CONF_CHANGE_PS in op_config is used by SW-LPS only, so we add constraints to avoid errors. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: vincent_fann <[email protected]> Signed-off-by: shaofu <[email protected]> Signed-off-by: Larry Finger <[email protected]> Signed-off-by: Yan-Hsuan Chuang <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: btcoex: rtl8723be: fix ant_sel not workPing-Ke Shih2-0/+4
To make ant_sel work, we should call power_on_setting to set antenna correctly. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: btcoex: set correct interface type and parameter.Ping-Ke Shih3-7/+15
This commit fixies two problems. The first one is interface types (e.g. PCI) that are used to switch antenna, and the second is to add wifi_only parameter to give correct state. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: btcoex: call bind to setup btcoexPing-Ke Shih2-0/+2
New btcoex add a function 'bind' to connect adapter, so we should call it during initializing. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: Yan-Hsuan Chuang <[email protected]> Cc: Birming Chiu <[email protected]> Cc: Shaofu <[email protected]> Cc: Steven Ting <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: add tx frame for common device configurationPrameela Rani Garnepudi5-14/+178
After successful loading of firmware, a CARD READY indication is received by host. Common device configuration parameters are sent to the device after this. It includes information like device operating mode (Wi-Fi alone or BT coex), power save related parameters, GPIO information etc. As device supports BT coex, this frame is send in COEX queue initially. Based on the operating mode, CARD READY indication is received from each protocol module in firmware i.e. WLAN, BT. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: configure new boot parameters to devicePrameela Rani Garnepudi2-13/+22
Boot parameters are changed in new firmware. Also three new sdio sleep parameters are added for ultra low power save. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: receive path enhancement for RS9113Prameela Rani Garnepudi2-1/+9
RS9113 chipset supports Coex feature. Initial frame exchanges during device initialization happens on coex queue. This patch adds the handling for coex queue. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: Register interrupt handler before firmware loadPrameela Rani Garnepudi3-10/+13
Before firmware load, sometimes false interrupts are received. System hang is observed if interrupt handler is not registered to receive these interrupts. Hence interrupt handler registration is moved before firmware load. We will drop these false interrupts as these are not from the device. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: use enum for FSM statesAmitkumar Karwar1-7/+9
Currently macros are used for FSM states. We will replace it with enum so that new state can be added easily without worrying about macro value. Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rsi: add usb RS9113 chipset supportPrameela Rani Garnepudi1-0/+1
usb device id and vendor id for RS9113 chipset are included. So it can be used through usb interface. Signed-off-by: Prameela Rani Garnepudi <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21mwifiex: debugfs: remove redunant check of mwifiex_dfs_dirShawn Lin1-2/+1
debugfs_remove already check mwifiex_dfs_dir, so remove it. Signed-off-by: Shawn Lin <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21mwifiex: fixes the unexpected be printed log by defaultCaesar Wang1-1/+1
This patch uses WARN level is not printed by default. In some cases, some boards have always met the unused log be printed as follows. ... [23193.523182] mwifiex_pcie 0000:01:00.0: mwifiex_get_cfp: cannot find cfp by band 2 & channel=13 freq=0 [23378.633684] mwifiex_pcie 0000:01:00.0: mwifiex_get_cfp: cannot find cfp by band 2 & channel=13 freq=0 Due to we used the wifi default area was US and didn't support 12~14 channels. As Frequencies: * 2412 MHz [1] (30.0 dBm) * 2417 MHz [2] (30.0 dBm) * 2422 MHz [3] (30.0 dBm) * 2427 MHz [4] (30.0 dBm) * 2432 MHz [5] (30.0 dBm) * 2437 MHz [6] (30.0 dBm) * 2442 MHz [7] (30.0 dBm) * 2447 MHz [8] (30.0 dBm) * 2452 MHz [9] (30.0 dBm) * 2457 MHz [10] (30.0 dBm) * 2462 MHz [11] (30.0 dBm) * 2467 MHz [12] (disabled) * 2472 MHz [13] (disabled) * 2484 MHz [14] (disabled) Also, as the commit 1b499cb72f26b ("mwifiex: disable channel filtering feature in firmware"), it proved to be a feature to get better scan result from overlapping channel. Even there could be AP from overlapping channel (might be 12/13/14 in this case), it will be filtered depend on reg domain rules. e.g: ... if (ch->flags & IEEE80211_CHAN_DISABLED) continue; So it should not been an ERROR, use the WARN level to instead it for now. Signed-off-by: Caesar Wang <[email protected]> Acked-by: Xinming Hu <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21rtlwifi: fix REG_USTIME_TSF register definitionKevin Lo6-6/+6
The REG_USTIME_TSF (US Time Tuning for TSF) definition of Realtek chips should be 0x55C. Signed-off-by: Kevin Lo <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21brcmfmac: Use separate firmware for revision 0 of the brcm43430 chipHans de Goede1-2/+5
The brcm43430 chip needs different firmware files for chip revision 0 and 1. The file currently in linux-firmware is for revision 1 only. This commit makes brcmfmac request brcmfmac43430a0-sdio.bin instead of brcmfmac43430-sdio.bin for revision 0 chips. Note that the behavior for revision 1 chips is not changed, ideally those would load brcmfmac43430a1-sdio.bin, but that will break existing setups. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21wil6210: remove ioctl interfaceMaya Erez4-190/+0
Wireless drivers should not be using ioctl interface, hence remove this interface for wil6210 driver. Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21wil6210: add support for PCIe D3hot in system suspendMaya Erez11-49/+603
In order to preserve the connection in suspend/resume flow, wil6210 host allows going to PCIe D3hot state in suspend, instead of performing a full wil6210 device reset. This requires the platform ability to initiate wakeup in case of RX data. To check that, a new platform API is added. In addition, add cfg80211 suspend/resume callbacks implementation. Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21wil6210: prevent platform callbacks after uninitDedy Lansky1-4/+9
After calling platform_ops.uninit() it is still possible to invoke platform callbacks. To prevent this, zero platform_ops right after invoking uninit. Signed-off-by: Dedy Lansky <[email protected]> Signed-off-by: Maya Erez <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-21ath10k: set rxnss_override for QCA9888Sven Eckelmann1-2/+6
QCA9888 supports VHT80 with 2x2. But it only support 1x1 with VHT160 or VHT80+80. Inform userspace and the the QCA firmware about that limitation whenever VHT80+80 or VHT160 is configured. Signed-off-by: Sven Eckelmann <[email protected]> [[email protected]: use hw_params] Signed-off-by: Kalle Valo <[email protected]>
2017-06-21ath10k: configure rxnss_override for QCA9984Ben Greear5-1/+69
QCA9984 hardware can do 4x4 at 80Mhz, but only 2x2 at 160Mhz. First, report this to user-space by setting the max-tx-speed and max-rx-speed vht capabilities. Second, if the peer rx-speed is configured, and if we are in 160 or 80+80 mode, and the peer rx-speed matches the max speed for 2x2 or 1x1 at 160Mhz (long guard interval), then use that info to set the peer_bw_rxnss_override appropriately. Without this, a 9984 firmware will not use 2x2 ratesets when transmitting to peer (it will be stuck at 1x1), because the firmware would not have configured the rxnss_override. Signed-off-by: Ben Greear <[email protected]> [[email protected]: rebase, cleanup, drop 160Mhz workaround cleanup] Signed-off-by: Sven Eckelmann <[email protected]> [[email protected]: use hw_params, rename the title] Signed-off-by: Kalle Valo <[email protected]>
2017-06-21ath10k: use complete VHT chan width for 160MHz workaroundBen Greear1-1/+1
The ath10k firmware doesn't announce its VHT channel width capabilities in the vht_cap information from the "service ready event" arguments. The driver must therefore check whether the 160MHz short GI bit is set and whether the driver still doesn't set the bits for the 160/80+80 MHz capabilities. The two bits for the channel width are a two bit integer and not two separate bits which cannot be parsed without the knowledge of the other bit. Using IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (b10..) as a mask for this task doesn't make any sense. The correct mask for the VHT channel width should be used instead to make this check more readable. Signed-off-by: Ben Greear <[email protected]> [[email protected]: separate 160Mhz workaround cleanup, add commit message] Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-20Merge tag 'wireless-drivers-for-davem-2017-06-20' of ↵David S. Miller6-36/+49
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers Kalle Valo says: ==================== wireless-drivers fixes for 4.12 Two important fixes for brcmfmac. The rest of the brcmfmac patches are either code preparation and fixing a new build warning. brcmfmac * fix a NULL pointer dereference during resume * fix a NULL pointer dereference with USB devices, a regression from v4.12-rc1 ==================== Signed-off-by: David S. Miller <[email protected]>
2017-06-20net: manual clean code which call skb_put_[data:zero]yuan linyu6-18/+8
Signed-off-by: yuan linyu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-20net: replace more place to skb_put_[data:zero]yuan linyu6-14/+7
spatch file, @@ expression skb, len, data; type t; @@ -memcpy((t *)skb_put(skb, len), data, len); +skb_put_data(skb, data, len); @@ identifier p; expression skb, len, data; type t; @@ -p = (t *)memset(skb_put(skb, len), data, len); +p = skb_put_zero(skb, len); @@ expression skb, len, data; type t; @@ -memcpy((t *)__skb_put(skb, len), data, len); +__skb_put_data(skb, data, len); @@ identifier p; expression skb, len, data; type t; @@ -p = (t *)memset(__skb_put(skb, len), data, len); +p = __skb_put_zero(skb, len); Signed-off-by: yuan linyu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-20sched/wait: Rename wait_queue_t => wait_queue_entry_tIngo Molnar3-3/+3
Rename: wait_queue_t => wait_queue_entry_t 'wait_queue_t' was always a slight misnomer: its name implies that it's a "queue", but in reality it's a queue *entry*. The 'real' queue is the wait queue head, which had to carry the name. Start sorting this out by renaming it to 'wait_queue_entry_t'. This also allows the real structure name 'struct __wait_queue' to lose its double underscore and become 'struct wait_queue_entry', which is the more canonical nomenclature for such data types. Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
2017-06-16networking: make skb_push & __skb_push return void pointersJohannes Berg24-45/+32
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) @@ expression SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - fn(SKB, LEN)[0] + *(u8 *)fn(SKB, LEN) Note that the last part there converts from push(...)[0] to the more idiomatic *(u8 *)push(...). Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-16networking: make skb_put & friends return void pointersJohannes Berg15-73/+63
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions (skb_put, __skb_put and pskb_put) return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_put, __skb_put }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_put, __skb_put }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) which actually doesn't cover pskb_put since there are only three users overall. A handful of stragglers were converted manually, notably a macro in drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many instances in net/bluetooth/hci_sock.c. In the former file, I also had to fix one whitespace problem spatch introduced. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg48-119/+94
A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-16networking: convert many more places to skb_put_zero()Johannes Berg10-32/+15
There were many places that my previous spatch didn't find, as pointed out by yuan linyu in various patches. The following spatch found many more and also removes the now unnecessary casts: @@ identifier p, p2; expression len; expression skb; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_zero(skb, len); | -p = (t)skb_put(skb, len); +p = skb_put_zero(skb, len); ) ... when != p ( p2 = (t2)p; -memset(p2, 0, len); | -memset(p, 0, len); ) @@ type t, t2; identifier p, p2; expression skb; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_zero(skb, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_zero(skb, sizeof(t)); ) ... when != p ( p2 = (t2)p; -memset(p2, 0, sizeof(*p)); | -memset(p, 0, sizeof(*p)); ) @@ expression skb, len; @@ -memset(skb_put(skb, len), 0, len); +skb_put_zero(skb, len); Apply it to the tree (with one manual fixup to keep the comment in vxlan.c, which spatch removed.) Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-16brcmfmac: fix uninitialized warning in brcmf_usb_probe_phase2()Arend Van Spriel1-2/+1
This fixes the following warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c: In function 'brcmf_usb_probe_phase2': drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c:1198:2: warning: 'devinfo' may be used uninitialized in this function [-Wmaybe-uninitialized] mutex_unlock(&devinfo->dev_init_lock); Fixes: 6d0507a777fb ("brcmfmac: add parameter to pass error code in firmware callback") Cc: Stephen Rothwell <[email protected]> Reported-by: Kalle Valo <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2017-06-16ath6kl: fix spelling mistake: "Indicat" -> "Indicate"Colin Ian King1-1/+1
Trivial fix to spelling mistake in ath6kl_dbg debug message Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Steve deRosier <[email protected]> Signed-off-by: Kalle Valo <[email protected]>