aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wlan-ng/hfa384x_usb.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-01staging/wlan-ng: get the correct struct hfa384x in work callbackDavidlohr Bueso1-1/+1
hfa384x_usbctlx_completion_task() is bogusly using the reaper BH when in fact this is the completion_bh. This was reflected when trying to acquire the hw->ctlxq.lock and getting a failed lockdep class initialized to it. Fixes: 9442e81d7e7c ("staging/wlan-ng, prism2usb: replace completion_bh tasklet with work") Reported-by: syzbot+ce3408364c4a234dd90c@syzkaller.appspotmail.com Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Link: https://lore.kernel.org/r/20220629165225.3436822-1-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-12staging/wlan-ng, prism2usb: replace completion_bh tasklet with workDavidlohr Bueso1-11/+11
Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. The completion_bh tasklet will now run in process context and have further concurrency (tasklets being serialized among themselves), but this is done holding the ctlxq.lock, so it should be fine. Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Link: https://lore.kernel.org/r/20220411151620.129178-4-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-12staging/wlan-ng, prism2usb: replace reaper_bh tasklet with workDavidlohr Bueso1-7/+7
Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. The reaper_bh tasklet will now run in process context and have further concurrency (tasklets being serialized among themselves), but this is done holding the ctlxq.lock, so it should be fine. Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Link: https://lore.kernel.org/r/20220411151620.129178-3-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-15staging: wlan-ng: Avoid bitwise vs logical OR warning in hfa384x_usb_throttlefn()Nathan Chancellor1-11/+11
A new warning in clang points out a place in this file where a bitwise OR is being used with boolean expressions: In file included from drivers/staging/wlan-ng/prism2usb.c:2: drivers/staging/wlan-ng/hfa384x_usb.c:3787:7: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] ((test_and_clear_bit(THROTTLE_RX, &hw->usb_flags) && ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/wlan-ng/hfa384x_usb.c:3787:7: note: cast one or both operands to int to silence this warning 1 warning generated. The comment explains that short circuiting here is undesirable, as the calls to test_and_{clear,set}_bit() need to happen for both sides of the expression. Clang's suggestion would work to silence the warning but the readability of the expression would suffer even more. To clean up the warning and make the block more readable, use a variable for each side of the bitwise expression. Link: https://github.com/ClangBuiltLinux/linux/issues/1478 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20211014215703.3705371-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-13staging: wlan-ng: Remove filenames from filesAldas Taraškevičius1-1/+1
Fix checkpatch warnings about having filenames in the files. Signed-off-by: Aldas Taraškevičius <aldas60@gmail.com> Link: https://lore.kernel.org/r/20210828195324.68-1-aldas60@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26staging: wlan-ng: Avoid duplicate header in tx/rx framesKees Cook1-6/+5
Instead of open-coding the same header details in the tx/rx frames, directly include the actual struct. Rename associated variables to the more verbose of the two versions. This also has the benefit of being able to replace a field-spanning memcpy() with a direct assignment, helping clear the way for coming FORTIFY_SOURCE improvements. "diffoscope" reports no object code differences after this change, excepting the selection of different registers when switching from memcpy() to direct assignment: --- drivers/staging/wlan-ng/prism2usb.o.before +++ drivers/staging/wlan-ng/prism2usb.o.after ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {} │ @@ -4887,24 +4887,24 @@ │ sub %rdi,%rcx │ add $0x3c,%ecx │ shr $0x3,%ecx │ rep stos %rax,%es:(%rdi) │ mov $0x8,%eax │ movl $0x123,0x23e(%rbx) │ mov %ax,0x244(%rbx) │ - mov (%rdx),%rcx │ - mov %rcx,0x246(%rbx) │ - mov 0x8(%rdx),%rcx │ - mov %rcx,0x24e(%rbx) │ - mov 0x10(%rdx),%rcx │ - mov %rcx,0x256(%rbx) │ - mov 0x18(%rdx),%ecx │ - mov %ecx,0x25e(%rbx) │ - movzwl 0x1c(%rdx),%edx │ - mov %dx,0x262(%rbx) │ + mov (%rdx),%rax │ + mov %rax,0x246(%rbx) │ + mov 0x8(%rdx),%rax │ + mov %rax,0x24e(%rbx) │ + mov 0x10(%rdx),%rax │ + mov %rax,0x256(%rbx) │ + mov 0x18(%rdx),%eax │ + mov %eax,0x25e(%rbx) │ + movzwl 0x1c(%rdx),%eax │ + mov %ax,0x262(%rbx) │ cmpq $0x0,0x0(%rbp) │ movzwl 0x70(%rsi),%eax │ je 477a <hfa384x_drvr_txframe+0xba> │ add $0x8,%eax │ mov $0x44,%r12d │ mov %ax,0x264(%rbx) │ mov 0x70(%r13),%edx Cc: Romain Perier <romain.perier@gmail.com> Cc: Allen Pais <apais@linux.microsoft.com> Cc: Ivan Safonov <insafonov@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210819174537.3499227-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26staging: wlan-ng: Remove pointless a3/a4 unionKees Cook1-2/+2
There is no need for the a3/a4 union. The two structs are identical except for the addition of a4. Excepting one place, the structs are only ever used in the union, and the union is always allocated at full size. The one instance of the a3-specific struct can be replaced with the full version, as no sizing information is used. Replace the union with the a4 version of the struct. "diffoscope" reports there are no object code differences after this change. Cc: Allen Pais <apais@linux.microsoft.com> Cc: Romain Perier <romain.perier@gmail.com> Cc: Chen Lin <chen.lin5@zte.com.cn> Cc: Ivan Safonov <insafonov@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210819174537.3499227-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-16staging: wlan-ng: convert tasklets to use new tasklet_setup() APIAllen Pais1-10/+8
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Allen Pais <apais@linux.microsoft.com> Link: https://lore.kernel.org/r/20200916061519.57602-1-allen.lkml@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18staging: wlan-ng: fix out of bounds read in prism2sta_probe_usb()Rustam Kovhaev1-5/+0
let's use usb_find_common_endpoints() to discover endpoints, it does all necessary checks for type and xfer direction remove memset() in hfa384x_create(), because we now assign endpoints in prism2sta_probe_usb() and because create_wlan() uses kzalloc() to allocate hfa384x struct before calling hfa384x_create() Fixes: faaff9765664 ("staging: wlan-ng: properly check endpoint types") Reported-and-tested-by: syzbot+22794221ab96b0bab53a@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=22794221ab96b0bab53a Signed-off-by: Rustam Kovhaev <rkovhaev@gmail.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200804145614.104320-1-rkovhaev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callbackQiujun Huang1-0/+2
We can't handle the case length > WLAN_DATA_MAXLEN. Because the size of rxfrm->data is WLAN_DATA_MAXLEN(2312), and we can't read more than that. Thanks-to: Hillf Danton <hdanton@sina.com> Reported-and-tested-by: syzbot+7d42d68643a35f71ac8a@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang <hqjagain@gmail.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200326131850.17711-1-hqjagain@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-23staging: wlan-ng: Fix third argument going over 80 charactersJohn B. Wyatt IV1-2/+5
Create a new 'status' variable to store the value of a long argument that goes over 80 characters. The status variable is also used for an if check. Replacing that long statement in both places makes the code much easier to read. Note: the status variable is assigned after a needed byte order conversion for usbin->rxfrm.desc.status, which uses a reference. Issue reported by checkpatch. Suggested-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com> Reviewed-by: Stefano Brivio <sbrivio@redhat.com> Link: https://lore.kernel.org/r/20200321225808.2494564-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17staging: wlan-ng: Fix line going over 80 charactersJohn B. Wyatt IV1-1/+2
Add a newline before the second argument for style, readability, and consistency. Please note: checkpatch reports the third argument as being over 80 characters, but not the second argument. Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com> Link: https://lore.kernel.org/r/20200316221544.1251350-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: wlan-ng: fix compilation for USB debuggingTim Collier1-2/+0
Fix compilation errors (remove references to 2 undefined fields in the URB struct) when DEBUG_USB is defined for the wlan-ng driver. Signed-off-by: Tim Collier <osdevtc@gmail.com> Link: https://lore.kernel.org/r/20191025084126.9181-5-osdevtc@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Replace function hfa384x_dowmem()Nishka Dasgupta1-34/+17
Remove parameters mode, cmdcb, usercb, and usercb_data from hfa384x_dowmem as these parameters are only assigned the same constant values (DOWAIT, NULL, NULL, NULL respectively). Modify hfa384x_dowmem to use these constants directly. Remove check for value of mode (as it will always be DOWAIT). Remove function hfa384x_dowmem_wait as it does nothing except call hfa384x_dowmem with these extra arguments. Modify call sites of hfa384x_dowmem_wait to call hfa384x_dowmem instead. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-10-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Replace function hfa384x_dormem()Nishka Dasgupta1-27/+10
Remove parameters mode, cmdcb, usercb, and usercb_data from hfa384x_dormem as these parameters are only assigned the same constant values (DOWAIT, NULL, NULL, NULL respectively). Modify hfa384x_dormem to use these constants directly. Remove check for value of mode (as it will always be DOWAIT). Remove function hfa384x_dormem_wait as it does nothing except call hfa384x_dormem with these extra arguments. Modify call sites of hfa384x_dormem_wait to call hfa384x_dormem instead. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-9-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove function hfa384x_docmd_wait()Nishka Dasgupta1-29/+14
As hfa384x_docmd is only called by hfa384x_docmd_wait, and hfa384x_docmd_wait always passes 4 constant arguments (DOWAIT, NULL, NULL, NULL) to hfa384x_docmd, these constant parameters may be removed from hfa384x_docmd and their values used directly instead. Remove check for one of these constant parameters of hfa384x_docmd as it is no longer necessary. Remove hfa384x_docmd_wait as it does nothing except call hfa384x_docmd. Modify call sites of hfa384x_docmd_wait to call hfa384x_docmd instead. Change type of hfa384x_docmd to inline to match type of former hfa384x_docmd_wait. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-8-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove unused function hfa384x_docmd_async()Nishka Dasgupta1-8/+0
Remove unused function hfa384x_docmd_async. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-7-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove function hfa384x_dowmem_async()Nishka Dasgupta1-14/+0
Remove unused function hfa384x_dowmem_async. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-6-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove unused function hfa384x_dormem_async()Nishka Dasgupta1-11/+0
Remove unused function hfa384x_dormem_async. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-5-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove unused function hfa384x_dorrid_async()Nishka Dasgupta1-11/+0
Remove unused function hfa384x_dorrid_async. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-4-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove function hfa384x_dowrid_async()Nishka Dasgupta1-13/+2
Remove function hfa384x_dowrid_async as it does nothing except call hfa384x_dowrid, and itself is called only once. Move the contents of hfa384x_dowrid_async (i.e the call to hfa384x_dowrid) to its call site. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-3-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove function hfa384x_dowrid_wait()Nishka Dasgupta1-9/+1
Remove inline function hfa384x_dowrid_wait as it is only called once (in hfa384x_drvr_setconfig) and its contents are only a single line (a call to hfa384x_dowrid). Replace the call to hfa384x_dowrid_wait with its contents i.e the call to hfa384x_dowrid. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-2-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22staging: wlan-ng: Remove function hfa384x_dorrid_wait()Nishka Dasgupta1-9/+1
Remove function hfa384x_dorrid_wait as it is only called once and it does nothing except call hfa384x_dorrid. Move contents of hfa384x_dorrid_wait to its only call site to maintain functionality. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190712062807.9361-1-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20staging: wlan-ng: fix adapter initialization failureTim Collier1-1/+2
Commit e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.") moved the retrieval of the transfer buffer from the URB from the top of function hfa384x_usbin_callback to a point after reposting of the URB via a call to submit_rx_urb. The reposting of the URB allocates a new transfer buffer so the new buffer is retrieved instead of the buffer containing the response passed into the callback. This results in failure to initialize the adapter with an error reported in the system log (something like "CTLX[1] error: state(Request failed)"). This change moves the retrieval to just before the point where the URB is reposted so that the correct transfer buffer is retrieved and initialization of the device succeeds. Signed-off-by: Tim Collier <osdevtc@gmail.com> Fixes: e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-02staging: wlan-ng: Fix improper SPDX comment styleHimadri Pandya1-1/+1
The SPDX license identifier should have the form // SPDX-License-Identifier: <SPDX License Expression> for a .c source file. File hfa384x_usb.c has instead the form /* SPDX-License-Identifier: <SPDX License Expression> */ which is the form for C header files. Hence this patch corrects it. Issue identified by checkpatch. Signed-off-by: Himadri Pandya <himadri18.07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: wlan-ng: Correct typo in comment messageBranden Bonaby1-1/+1
Add space between two words for better readability in the comments. Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: wlan-ng: malformed SPDX-License-IdentifierBranden Bonaby1-1/+1
Correct malformed SPDX-License-Identifier so that it matches Linux kernel comment coding style. Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-28staging: wlan-ng: rejoin split lines shortened by case changesTim Collier1-4/+2
The reformatting of case blocks has shortened some lines such that previously split lines can be rejoined without exceeding 80 characters. Rejoined those lines. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-28staging: wlan-ng: make switch case block format consistentTim Collier1-25/+23
For switch statements with case blocks make the format consistent by applying K&R formatting, a space before the opening brace, single indentation of contained code, break inside the block and closing brace aligned with case. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-29staging: wlan-ng: correction to comment in hfa384x_usbTim Collier1-1/+1
The comment for hfa384x_docmd incorrectly states that usercb_data should be NULL for DOASYNC calls; in fact, it should be NULL for DOWAIT calls (this is consistent with the other similar functions and the rest of the comment text). Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: wlan-ng: convert P80211SKB_RXMETA to inline function in p80211convTim Collier1-1/+1
To avoid possible issues with repeated reference to the macro argument as reported by checkpatch, macro P80211SKB_RXMETA is replaced with an equivalent inline function. The function is named p80211skb_rxmeta to follow the coding style guidelines; references to the macro are updated to reference the new function. This change depends on the similar change for P80211SKB_FRMMETA having been applied. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: wlan-ng: fix line-break style issueTim Collier1-2/+1
Fix checkpatch warning due to line break after '(', leaving an over 80 character warning due to long macro name. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: wlan-ng: add missing parameter name to prototypeTim Collier1-1/+1
Fix checkpatch warning for missing parameter name for function prototype. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08Staging: wlan-ng: hfa384x_usb: fixed two line limit coding style issuesAndy Pusch1-2/+4
Fixed two coding style issues. Signed-off-by: Andy Pusch <drag@black-pixel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: wlan-ng: add SPDX identifiers to all wlan-ng driver filesGreg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the wlan-ng driver files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-13Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds1-2/+2
Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: usbfs: compute urb->actual_length for isochronous usb: core: message: remember to reset 'ret' to 0 when necessary USB: typec: Remove remaining redundant license text USB: typec: add SPDX identifiers to some files USB: renesas_usbhs: rcar?.h: add SPDX tags USB: chipidea: ci_hdrc_tegra.c: add SPDX line USB: host: xhci-debugfs: add SPDX lines USB: add SPDX identifiers to all remaining Makefiles usb: host: isp1362-hcd: remove a couple of redundant assignments USB: adutux: remove redundant variable minor usb: core: add a new usb_get_ptm_status() helper usb: core: add a 'type' parameter to usb_get_status() usb: core: introduce a new usb_get_std_status() helper usb: core: rename usb_get_status() 'type' argument to 'recip' usb: core: add Status Type definitions USB: gadget: Remove redundant license text USB: gadget: function: Remove redundant license text USB: gadget: udc: Remove redundant license text USB: gadget: legacy: Remove redundant license text ...
2017-11-07usb: core: introduce a new usb_get_std_status() helperFelipe Balbi1-2/+2
This new helper is a simple wrapper around usb_get_status(). This patch is in preparation to adding support for fetching PTM_STATUS types. No functional changes. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-20staging: wlan-ng: Convert timers to use timer_setup()Kees Cook1-16/+13
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com> Cc: Adrien Descamps <adrien.descamps@gmail.com> Cc: Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-20staging: wlan-ng: hfa384x_usb: Fix multiple line dereferenceAlex Briskin1-9/+7
Refactor code to be more readable and eliminate the checkpatch warning Signed-off-by: Alex Briskin <br.shurik@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds1-4/+2
Pull networking updates from David Miller: "Reasonably busy this cycle, but perhaps not as busy as in the 4.12 merge window: 1) Several optimizations for UDP processing under high load from Paolo Abeni. 2) Support pacing internally in TCP when using the sch_fq packet scheduler for this is not practical. From Eric Dumazet. 3) Support mutliple filter chains per qdisc, from Jiri Pirko. 4) Move to 1ms TCP timestamp clock, from Eric Dumazet. 5) Add batch dequeueing to vhost_net, from Jason Wang. 6) Flesh out more completely SCTP checksum offload support, from Davide Caratti. 7) More plumbing of extended netlink ACKs, from David Ahern, Pablo Neira Ayuso, and Matthias Schiffer. 8) Add devlink support to nfp driver, from Simon Horman. 9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa Prabhu. 10) Add stack depth tracking to BPF verifier and use this information in the various eBPF JITs. From Alexei Starovoitov. 11) Support XDP on qed device VFs, from Yuval Mintz. 12) Introduce BPF PROG ID for better introspection of installed BPF programs. From Martin KaFai Lau. 13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann. 14) For loads, allow narrower accesses in bpf verifier checking, from Yonghong Song. 15) Support MIPS in the BPF selftests and samples infrastructure, the MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David Daney. 16) Support kernel based TLS, from Dave Watson and others. 17) Remove completely DST garbage collection, from Wei Wang. 18) Allow installing TCP MD5 rules using prefixes, from Ivan Delalande. 19) Add XDP support to Intel i40e driver, from Björn Töpel 20) Add support for TC flower offload in nfp driver, from Simon Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub Kicinski, and Bert van Leeuwen. 21) IPSEC offloading support in mlx5, from Ilan Tayari. 22) Add HW PTP support to macb driver, from Rafal Ozieblo. 23) Networking refcount_t conversions, From Elena Reshetova. 24) Add sock_ops support to BPF, from Lawrence Brako. This is useful for tuning the TCP sockopt settings of a group of applications, currently via CGROUPs" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits) net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap cxgb4: Support for get_ts_info ethtool method cxgb4: Add PTP Hardware Clock (PHC) support cxgb4: time stamping interface for PTP nfp: default to chained metadata prepend format nfp: remove legacy MAC address lookup nfp: improve order of interfaces in breakout mode net: macb: remove extraneous return when MACB_EXT_DESC is defined bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case bpf: fix return in load_bpf_file mpls: fix rtm policy in mpls_getroute net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t net, ax25: convert ax25_route.refcount from atomic_t to refcount_t net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t ...
2017-06-20net: manual clean code which call skb_put_[data:zero]yuan linyu1-1/+1
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg1-4/+2
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 <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-29staging: wlan-ng: hfa384x: fix several type issues.Nikola Jelic1-10/+8
There were several in-place conversions of 16 and 32-bit data, which caused sparse to detect them. Changed them to the in situ versions, such as: le16_to_cpu -> le16_to_cpus Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12Staging: wlan-ng: Fix endian errorAdrien Descamps1-1/+1
sparse report fixed: drivers/staging//wlan-ng//hfa384x_usb.c:3517:35: warning: restricted __be64 degrades to integer drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: warning: incorrect type in assignment (different base types) drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: expected restricted __be64 [usertype] mactime drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: got unsigned long long Computation on the value should be done when in machine format, not in big endian format. Signed-off-by: Adrien Descamps <adrien.descamps@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12Staging: wlan-ng: Fix sparse warnings by using appropriate endian typesAdrien Descamps1-1/+1
Fix some sparse warning by using correct endian types in structs and local variables. This patch only fix sparse warnings and do not change the logic. Signed-off-by: Adrien Descamps <adrien.descamps@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-18net: Remove usage of net_device last_rx memberTobias Klauser1-1/+0
The network stack no longer uses the last_rx member of struct net_device since the bonding driver switched to use its own private last_rx in commit 9f242738376d ("bonding: use last_arp_rx in slave_last_rx()"). However, some drivers still (ab)use the field for their own purposes and some driver just update it without actually using it. Previously, there was an accompanying comment for the last_rx member added in commit 4dc89133f49b ("net: add a comment on netdev->last_rx") which asked drivers not to update is, unless really needed. However, this commend was removed in commit f8ff080dacec ("bonding: remove useless updating of slave->dev->last_rx"), so some drivers added later on still did update last_rx. Remove all usage of last_rx and switch three drivers (sky2, atp and smc91c92_cs) which actually read and write it to use their own private copy in netdev_priv. Compile-tested with allyesconfig and allmodconfig on x86 and arm. Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Jay Vosburgh <j.vosburgh@gmail.com> Cc: Veaceslav Falico <vfalico@gmail.com> Cc: Andy Gospodarek <andy@greyhouse.net> Cc: Mirko Lindner <mlindner@marvell.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-06Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.Yan Laijun1-1/+2
Fixed checkpatch warning "line over 80 characters" in wlan-ng/hfa384x_usb.c file. Signed-off-by: Yan Laijun <yan.laijun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.cSergio Paracuellos1-9/+9
This patch fix open parenthesis alignment in hfa384x_usb.c file to comply with the standard kernel coding style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callbackSergio Paracuellos1-1/+4
This patch avoids using BUG_ON() from driver, and return from hfa384x_usbin_callback with WARN_ON() if skb was NULL or data in skb is different from expected one. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.cSergio Paracuellos1-12/+12
This patch removes unnecessary parentheses in different statements of hfa384x_usb.c file in order to to comply with the standard kernel coding style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>