summaryrefslogtreecommitdiffstats
path: root/drivers/staging/gdm72xx/gdm_usb.c
Commit message (Collapse)AuthorAgeFilesLines
* Staging: gdm72xx: Remove gdm72xx driverShraddha Barke2016-03-111-788/+0
| | | | | | | | | | | Remove support for gdm72xx driver from the kernel since Wimax is dead. [1] http://www.networkworld.com/article/2220370/4g/wimax-is-dead.html [2] http://www.androidcentral.com/sprint-confirms-wimax-shutdown-november-6-2015 Chrome OS can distribute this driver alongside their library. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: gdm72xx: make "len" unsignedDan Carpenter2016-03-051-3/+3
| | | | | | | | We had an underflow bug here and I think I fixed it but we may as well be proactive and make "len" unsigned to be double sure. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: gdm72xx: Add space around that "+", "&" and "/"Shraddha Barke2016-02-201-1/+1
| | | | | | | | Add missing spaces around "+", "&" and "/" to follow kernel coding style. Warning detected by checkpatch. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: gdm72xx: Remove multiple blank linesShraddha Barke2016-02-071-1/+0
| | | | | | | | Remove extra blank line which is not necessary. Warning detected using checkpatch. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: NULL comparison styleSudip Mukherjee2015-09-121-8/+8
| | | | | | | checkpatch complains if NULL comparison is done as if (var == NULL) Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: replace print_hex_dump_debug() with dev_dbg()Michalis Pappas2014-07-171-4/+6
| | | | | Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: reorder functions and remove forward declarationsMichalis Pappas2014-07-091-45/+42
| | | | | Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: clean up endianness conversionsBen Chan2014-07-091-8/+4
| | | | | | | | | | | | This patch cleans up the endianness conversions in the gdm72xx driver: - Directly use the generic byte-reordering macros for endianness conversion instead of some custom-defined macros. - Convert values on the constant side instead of the variable side when appropriate. - Add endianness annotations. Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: return -EINVAL instead of BUG_ON for invalid data lengthBen Chan2014-06-291-1/+2
| | | | | | | | | | This patch changes gdm_usb_send() and gdm_sdio_send() to return -EINVAL instead of calling BUG_ON if an invalid data length is passed to the functions. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: remove blank lines after an open braceBen Chan2014-06-261-3/+0
| | | | | | | | | This patch fixes the following checkpatch warning: CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: fix block comment styleBen Chan2014-06-261-4/+2
| | | | | | | | | | | | This patch fixes the following checkpatch warnings, which are issued when the gdm72xx driver is moved out of staging into drivers/net/wimax: WARNING: networking block comments don't use an empty /* line, use /* Comment... WARNING: networking block comments start with * on subsequent lines WARNING: networking block comments put the trailing */ on a separate line Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: code cleanupDavide Gianforte2014-05-241-6/+10
| | | | | | | | | Checkpatch.pl cleanup Thanks again to Greg KH and Dan Carpenter for the patience :) Signed-off-by: Davide Gianforte <davide@gengisdave.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Indentation and other whitespace fixesMichalis Pappas2014-05-161-8/+9
| | | | | Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Whitespace fixes to conform to coding standardsMichalis Pappas2014-05-161-28/+15
| | | | | | | | | | | | | Fixes the following checkpatch.pl issues: WARNING: unnecessary whitespace before a quoted newline CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast Also some additional, whitespace related, readability issues. Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Move logical continuation to previous line to conform to ↵Michalis Pappas2014-05-161-2/+2
| | | | | | | | | | | coding style Fixes the following checkpatch.pl issue: CHECK: Logical continuations should be on the previous line Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Replace comparisons on jiffies values with wrap-safe functionsMichalis Pappas2014-05-161-1/+1
| | | | | | | | | | Fixes the following checkpatch.pl issue: WARNING: Comparing jiffies is almost always wrong; prefer time_after, time_before and friends Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: replace printk() and debug macros with dynamic debuggingKristina Martšenko2014-03-161-11/+2
| | | | | | | | | | | Replace printk(KERN_DEBUG ...) with netdev_dbg and dev_dbg. Remove debug macros which become unnecessary. This removes the following types of checkpatch warnings from the driver: drivers/staging/gdm72xx/gdm_sdio.c:461: WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
* staging: gdm72xx: use print_hex_dump_debug and remove debug macrosKristina Martšenko2014-03-161-20/+4
| | | | | | | | | Since the kernel already has a function for hex dumps, use that instead of the driver's own versions. The function supports dynamic debugging, so also remove some unnecessary debug macros. Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
* staging: gdm72xx: fix leaks at failure path in gdm_usb_probe()Alexey Khoroshilov2014-02-071-0/+3
| | | | | | | | | | Error handling code in gdm_usb_probe() misses to deallocate tx_ and rx_structs and to do usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: fix interruptible_sleep_on raceArnd Bergmann2014-01-091-2/+3
| | | | | | | | | | | interruptible_sleep_on is racy and going away. This replaces the use in the gdm72xx driver with the appropriate wait_event_interruptible_lock_irq. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: devel@driverdev.osuosl.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge branch 'for-linus' of ↵Linus Torvalds2012-12-121-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal Pull big execve/kernel_thread/fork unification series from Al Viro: "All architectures are converted to new model. Quite a bit of that stuff is actually shared with architecture trees; in such cases it's literally shared branch pulled by both, not a cherry-pick. A lot of ugliness and black magic is gone (-3KLoC total in this one): - kernel_thread()/kernel_execve()/sys_execve() redesign. We don't do syscalls from kernel anymore for either kernel_thread() or kernel_execve(): kernel_thread() is essentially clone(2) with callback run before we return to userland, the callbacks either never return or do successful do_execve() before returning. kernel_execve() is a wrapper for do_execve() - it doesn't need to do transition to user mode anymore. As a result kernel_thread() and kernel_execve() are arch-independent now - they live in kernel/fork.c and fs/exec.c resp. sys_execve() is also in fs/exec.c and it's completely architecture-independent. - daemonize() is gone, along with its parts in fs/*.c - struct pt_regs * is no longer passed to do_fork/copy_process/ copy_thread/do_execve/search_binary_handler/->load_binary/do_coredump. - sys_fork()/sys_vfork()/sys_clone() unified; some architectures still need wrappers (ones with callee-saved registers not saved in pt_regs on syscall entry), but the main part of those suckers is in kernel/fork.c now." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (113 commits) do_coredump(): get rid of pt_regs argument print_fatal_signal(): get rid of pt_regs argument ptrace_signal(): get rid of unused arguments get rid of ptrace_signal_deliver() arguments new helper: signal_pt_regs() unify default ptrace_signal_deliver flagday: kill pt_regs argument of do_fork() death to idle_regs() don't pass regs to copy_process() flagday: don't pass regs to copy_thread() bfin: switch to generic vfork, get rid of pointless wrappers xtensa: switch to generic clone() openrisc: switch to use of generic fork and clone unicore32: switch to generic clone(2) score: switch to generic fork/vfork/clone c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone() take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h mn10300: switch to generic fork/vfork/clone h8300: switch to generic fork/vfork/clone tile: switch to generic clone() ... Conflicts: arch/microblaze/include/asm/Kbuild
| * kill daemonize()Al Viro2012-11-281-3/+1
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | staging: gdm72xx: unlock on error in init_usb()Dan Carpenter2012-11-291-0/+1
| | | | | | | | | | | | | | | | We recently added locking here and there was an error path which is missing an unlock. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: gdm72xx: fix unused variable warning in gdm_usb_sendBen Chan2012-11-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | This patch fixes an unused variable warning in gdm_usb_send (when CONFIG_WIMAX_GDM72XX_K_MODE=n), which was introduced in commit 1a276b80466bbd195cf94ec7178f68f2ab351467 (staging: gdm72xx: protect access of rx / tx structs). Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: gdm72xx: protect access of rx / tx structsBen Chan2012-11-261-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch applies spinlock to protect access to rx / tx structs in certain call sites, which fixes the following crash in gdm_suspend. It also fixes usb_set_intfdata() in gdm_usb_probe to avoid setting an already freed phy_dev. <5>[ 4996.815018] [<7f0074b0>] (gdm_suspend+0x1c/0x2b4 [gdmwm]) from [<803020a4>] (usb_suspend_both+0x80/0x1a0) <5>[ 4996.815055] [<803020a4>] (usb_suspend_both+0x80/0x1a0) from [<80302c84>] (usb_runtime_suspend+0x38/0x64) <5>[ 4996.815089] [<80302c84>] (usb_runtime_suspend+0x38/0x64) from [<802becc0>] (__rpm_callback+0x48/0x78) <5>[ 4996.815118] [<802becc0>] (__rpm_callback+0x48/0x78) from [<802bf8dc>] (rpm_suspend+0x394/0x5ec) <5>[ 4996.815145] [<802bf8dc>] (rpm_suspend+0x394/0x5ec) from [<802c0550>] (pm_runtime_work+0x8c/0xa4) <5>[ 4996.815177] [<802c0550>] (pm_runtime_work+0x8c/0xa4) from [<800456cc>] (process_one_work+0x264/0x438) <5>[ 4996.815209] [<800456cc>] (process_one_work+0x264/0x438) from [<80045acc>] (worker_thread+0x22c/0x3b8) <5>[ 4996.815239] [<80045acc>] (worker_thread+0x22c/0x3b8) from [<8004a43c>] (kthread+0x9c/0xa8) <5>[ 4996.815270] [<8004a43c>] (kthread+0x9c/0xa8) from [<8000f160>] (kernel_thread_exit+0x0/0x8) <0>[ 4996.815295] Code: e92d4000 e8bd4000 e2800020 eb4ab9a1 (e5905000) Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Sameer Nanda <snanda@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging/gdm72xx: Use dev_ printks in gdm_usb.cYAMANE Toshiaki2012-10-301-5/+5
|/ | | | | | | | | fixed below checkpatch warnings. - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... - WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: simplify alloc_tx_struct and alloc_rx_structBen Chan2012-09-131-27/+17
| | | | | | | | | This patch simplifies alloc_tx_struct and alloc_rx_struct in gdm_sdio.c and gdm_usb.c by replacing kmalloc+memset with kzalloc and reorganizing the code. Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/gdm72xx: gdm_usb coding style clean upMacpaul Lin2012-09-121-5/+5
| | | | | | | | | | gdm_usb.* coding style clean up. Signed-off-by: Macpaul Lin <macpaul@gmail.com> Cc: Paul Stewart <pstew@chromium.org> Cc: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: use list_move instead of list_del/list_addWei Yongjun2012-09-061-2/+1
| | | | | | | | | | Using list_move() instead of list_del() + list_add(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: use list_move_tail instead of list_del/list_add_tailWei Yongjun2012-09-051-2/+1
| | | | | | | | | | Using list_move_tail() instead of list_del() + list_add_tail(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: use kzalloc to allocate usb_tx structureDevendra Naga2012-09-041-3/+1
| | | | | | | | | | the code under alloc_tx_struct does the allocation of usb_tx structure using kmalloc, and memsets the allocated pointer, instead we can directly use kzalloc so that the allocated memory is set with zeros Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/gdm72xx: use kzalloc for phydev and udevDevendra Naga2012-07-161-5/+2
| | | | | | | we are doing kmalloc and memset, can be done using kzalloc itself. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Simplify spinlock fix for gdm_usb_send_completeBen Chan2012-06-121-16/+10
| | | | | | | | | | This patch simplifies the previous patch (commit dd13c86b0dae86efdde98119ffd7348e80719ade) for fixing the spinlock recursion issue on several call sites of gdm_usb_send_complete. Signed-off-by: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Fix spinlock recursion on gdm_usb_send_completeBen Chan2012-06-121-6/+18
| | | | | | | | | | This patch fixes a spinlock recursion bug on several call sites of gdm_usb_send_complete by not calling spin_lock_irqsave on urb->context->tx_cxt->lock when the lock has already been acquired. Signed-off-by: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/gdm72xx: Remove version.h includesDevendra Naga2012-06-121-1/+0
| | | | | Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: gdm72xx: gdm_usb: fix deprecated function kernel_threadAdnan Ali2012-06-121-1/+2
| | | | | | | | This commit fixes deprecated function kernel_thread by replacing it with kthread_run. Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Set up parent link in sysfs for gdm72xx devicesPaul Stewart2012-05-171-1/+1
| | | | | | | | | | This patch uses SET_NETDEV_DEV to set up a 'device' parent link in sysfs (e.g. /sys/class/net/wm0/device) for a gdm72xx device. Signed-off-by: Paul Stewart <pstew@chromium.org> Signed-off-by: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: WIMAX_GDM72XX_USB_PM should depend on USB_SUSPENDGeert Uytterhoeven2012-05-161-6/+0
| | | | | | | | | | Use Kconfig logic instead of a rude #error in the driver source, which breaks m68k-allmodconfig. Also remove the "default n", as that's the default. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: gdm72xx: Add GCT GDM72xx WiMAX driver.Sage Ahn2012-05-151-0/+804
This patch provides the kernel driver for the GDM72xx WiMAX chips developed by GCT Semiconductor, Inc., which enables mobile WiMAX connection on the Linux host. Signed-off-by: Sage Ahn <syahn@gctsemi.com> Cc: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>