aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial/usb_debug.c
AgeCommit message (Collapse)AuthorFilesLines
2017-11-28USB: serial: usb_debug: add new USB device idLu Baolu1-0/+2
USB vendor id and product id for Linux USB Debug Target is added. Signed-off-by: Lu Baolu <[email protected]> Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2017-11-07USB: serial: Change DbC debug device binding IDLu Baolu1-2/+2
The product ID for "Linux USB GDB Target device" has been changed. Change the driver binding table accordingly. This patch should be back-ported to kernels as old as v4.12, that contain the commit 57fb47279a04 ("usb/serial: Add DBC debug device support to usb_debug"). Cc: <[email protected]> # v4.12+ Cc: Johan Hovold <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04USB: serial: fix module-license macrosJohan Hovold1-1/+1
Several GPL-2.0 drivers used "GPL" rather than "GPL v2" in their MODULE_LICENSE macros; fix the macros to match the licenses. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04USB: serial: Remove redundant license textGreg Kroah-Hartman1-4/+0
Now that the SPDX tag is in all USB files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04USB: add SPDX identifiers to all remaining files in drivers/usb/Greg 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 drivers/usb/ and include/linux/usb* 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 <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Philippe Ombredanne <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-05-04Merge tag 'usb-4.12-rc1' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB updates from Greg KH: "Here is the big USB patchset for 4.12-rc1. Lots of good stuff here, after many many many attempts, the kernel finally has a working typeC interface, many thanks to Heikki and Guenter and others who have taken the time to get this merged. It wasn't an easy path for them at all. There's also a staging driver that uses this new api, which is why it's coming in through this tree. Along with that, there's the usual huge number of changes for gadget drivers, xhci, and other stuff. Johan also finally refactored pretty much every driver that was looking at USB endpoints to do it in a common way, which will help prevent any "badly-formed" devices from causing problems in drivers. That too wasn't a simple task. All of these have been in linux-next for a while with no reported issues" * tag 'usb-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) staging: typec: Fairchild FUSB302 Type-c chip driver staging: typec: Type-C Port Controller Interface driver (tcpci) staging: typec: USB Type-C Port Manager (tcpm) usb: host: xhci: remove #ifdef around PM functions usb: musb: don't mark of_dev_auxdata as initdata usb: misc: legousbtower: Fix buffers on stack USB: Revert "cdc-wdm: fix "out-of-sync" due to missing notifications" usb: Make sure usb/phy/of gets built-in USB: storage: e-mail update in drivers/usb/storage/unusual_devs.h usb: host: xhci: print correct command ring address usb: host: xhci: delete sp_dma_buffers for scratchpad usb: host: xhci: using correct specification chapter reference for DCBAAP xhci: switch to pci_alloc_irq_vectors usb: host: xhci-plat: set resume_quirk() for R-Car controllers usb: host: xhci-plat: add resume_quirk() usb: host: xhci-plat: enable clk in resume timing usb: host: plat: Enable xHCI plat runtime PM USB: serial: ftdi_sio: add device ID for Microsemi/Arrow SF2PLUS Dev Kit USB: serial: constify static arrays usb: fix some references for /proc/bus/usb ...
2017-04-19USB: serial: constify static arraysJohan Hovold1-1/+1
Declare three immutable static driver arrays as const. Signed-off-by: Johan Hovold <[email protected]>
2017-03-21usb/serial: Add DBC debug device support to usb_debugLu Baolu1-3/+25
This patch adds DBC debug device support to the usb_debug driver. Signed-off-by: Lu Baolu <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Johan Hovold <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mathias Nyman <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2014-01-08usb: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-08USB: serial: rework usb_serial_register/deregister_drivers()Greg Kroah-Hartman1-6/+1
This reworks the usb_serial_register_drivers() and usb_serial_deregister_drivers() to not need a pointer to a struct usb_driver anymore. The usb_driver structure is now created dynamically and registered and unregistered as needed. This saves lines of code in each usb-serial driver. All in-kernel users of these functions were also fixed up at this time. The pl2303 driver was tested that everything worked properly. Thanks for the idea to do this from Alan Stern. Cc: Adhir Ramjiawan <[email protected]> Cc: Alan Stern <[email protected]> Cc: Al Borchers <[email protected]> Cc: Aleksey Babahin <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andrew Worsley <[email protected]> Cc: Bart Hartgers <[email protected]> Cc: Bill Pemberton <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Dan Williams <[email protected]> Cc: Donald Lee <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Gary Brubaker <[email protected]> Cc: Jesper Juhl <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Kautuk Consul <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Lonnie Mendez <[email protected]> Cc: Matthias Bruestle and Harald Welte <[email protected]> Cc: Matthias Urlichs <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Michal Sroczynski <[email protected]> Cc: "Michał Wróbel" <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Peter Berger <[email protected]> Cc: Preston Fick <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Rigbert Hamisch <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Simon Arlott <[email protected]> Cc: Support Department <[email protected]> Cc: Thomas Tuttle <[email protected]> Cc: Uwe Bonnes <[email protected]> Cc: Wang YanQing <[email protected]> Cc: William Greathouse <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-07USB: serial: remove usb_serial_disconnect call in all driversGreg Kroah-Hartman1-1/+0
This is now set by the usb-serial core, no need for the driver to individually set it. Thanks to Alan Stern for the idea to get rid of it. Cc: William Greathouse <[email protected]> Cc: Matthias Bruestle and Harald Welte <[email protected]> Cc: Lonnie Mendez <[email protected]> Cc: Peter Berger <[email protected]> Cc: Al Borchers <[email protected]> Cc: Gary Brubaker <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Matthias Urlichs <[email protected]> Cc: Support Department <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Alan Stern <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Kautuk Consul <[email protected]> Cc: Bill Pemberton <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Bart Hartgers <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Preston Fick <[email protected]> Cc: Uwe Bonnes <[email protected]> Cc: Simon Arlott <[email protected]> Cc: Andrew Worsley <[email protected]> Cc: "Michał Wróbel" <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Aleksey Babahin <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Donald Lee <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Michal Sroczynski <[email protected]> Cc: Wang YanQing <[email protected]> Cc: Dan Williams <[email protected]> Cc: Thomas Tuttle <[email protected]> Cc: Rigbert Hamisch <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Jesper Juhl <[email protected]> Cc: Adhir Ramjiawan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-07USB: serial: remove usb_serial_probe call in all driversGreg Kroah-Hartman1-1/+0
This is now set by the usb-serial core, no need for the driver to individually set it. Thanks to Alan Stern for the idea to get rid of it. Cc: William Greathouse <[email protected]> Cc: Matthias Bruestle and Harald Welte <[email protected]> Cc: Lonnie Mendez <[email protected]> Cc: Peter Berger <[email protected]> Cc: Al Borchers <[email protected]> Cc: Gary Brubaker <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Matthias Urlichs <[email protected]> Cc: Support Department <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Alan Stern <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Kautuk Consul <[email protected]> Cc: Bill Pemberton <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Bart Hartgers <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Preston Fick <[email protected]> Cc: Uwe Bonnes <[email protected]> Cc: Simon Arlott <[email protected]> Cc: Andrew Worsley <[email protected]> Cc: "Michał Wróbel" <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Aleksey Babahin <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Donald Lee <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Michal Sroczynski <[email protected]> Cc: Wang YanQing <[email protected]> Cc: Dan Williams <[email protected]> Cc: Thomas Tuttle <[email protected]> Cc: Rigbert Hamisch <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Jesper Juhl <[email protected]> Cc: Adhir Ramjiawan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-02-28USB: serial: usb_debug.c: use module_usb_serial_driverGreg Kroah-Hartman1-12/+1
This converts the usb_debug.c driver to use the module_usb_serial_driver() call instead of having to have a module_init/module_exit function, saving a lot of duplicated code. CC: Johan Hovold <[email protected]> CC: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-02-24usb-serial: use new registration API in [t-z]* driversAlan Stern1-13/+6
This patch (as1529) modifies the following usb-serial drivers to utilize the new usb_serial_{de}register_drivers() routines: ti_usb_3410_5052, usb_debug, visor, vivopay-serial, whiteheat, and zio. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-11-15USB: usb_debug: use process_read_urbJohan Hovold1-4/+3
Use process_read_urb rather than read_bulk_callback for break processing. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-11-15USB: usb_debug: fix indentationJohan Hovold1-3/+3
Use tabs for indentation. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-01-22USB serial: add missing .usb_driver field in serial driversAlan Stern1-0/+1
This patch (as1443) fixes a bug found in many of the USB serial drivers: They don't set the .usb_driver field in their usb_serial_driver structure. This field is needed for assigning dynamic IDs for device matching. In addition, starting with the 2.6.37 kernel, the .usb_driver field is needed for proper autosuspend operation. Without it, attempts to open the device file will fail. Signed-off-by: Alan Stern <[email protected]> Reported-by: Dan Williams <[email protected]> CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: usb_debug: set bulk out size at probeJohan Hovold1-7/+1
Use bulk_out_size in usb_serial_driver to set urb buffer size. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: usb_debug: use the generic kfifo-based write implementationJohan Hovold1-2/+0
Use the generic kfifo-based write implementation rather than allowing up to 4000 8 byte urbs in the host stack queues. Cc: Jason Wessel <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: serial: refactor read urb submission in generic driverJohan Hovold1-1/+1
Use the already exported function for submitting the read urb associated with a usb_serial_port. Make sure it returns the result of usb_submit_urb and rename to the more descriptive usb_serial_generic_submit_read_urb. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo1-0/+1
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <[email protected]> Guess-its-ok-by: Christoph Lameter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Lee Schermerhorn <[email protected]>
2010-03-02USB serial: make USB device id constantNémeth Márton1-1/+1
The id_table field of the struct usb_device_id is constant in <linux/usb.h> so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Németh Márton <[email protected]> Cc: Julia Lawall <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-09-19tty: USB does not need the filp argument in the driversAlan Cox1-3/+2
And indeed none of them use it. Clean this up as it will make moving to a standard open method rather easier. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-06-15USB: serial: usb_debug,usb_generic_serial: implement sysrq and serial breakJason Wessel1-0/+39
The usb_debug driver was modified to implement serial break handling by using a "magic" data packet comprised of the sequence: 0x00 0xff 0x01 0xfe 0x00 0xfe 0x01 0xff When the tty layer requests a serial break the usb_debug driver sends the magic packet. On the receiving side the magic packet is thrown away or a sysrq is activated depending on what kernel .config options have been set. The generic serial driver was modified as well as the usb serial headers to generically implement sysrq processing in the same way the non usb uart based drivers implement the sysrq handling. This will allow other usb serial devices to implement sysrq handling as desired. The new usb serial functions are named similarly and implemented similarly to the uart functions as follows: usb_serial_handle_break <-> uart_handle_break usb_serial_handle_sysrq_char <-> uart_handle_sysrq_char Signed-off-by: Jason Wessel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-06-15USB: usb_debug, usb_generic_serial: implement multi urb writeJason Wessel1-0/+2
The usb_debug driver, when used as the console, will always fail to insert the carriage return and new line sequence as well as randomly drop console output. This is a result of only having the single write_urb and that the tty layer will have a lock that prevents the processing of the back to back urb requests. The solution is to allow more than one urb to be outstanding and have a slightly deeper transmit queue. The idea and some code is borrowed from the ftdi_sio usb driver. The generic usb serial driver was modified so as to allow the classic method of 1 write urb, or a multi write urb scheme with N allowed outstanding urbs where N is controlled by max_in_flight_urbs. When max_in_flight_urbs in a "struct usb_serial_driver" is non zero the multi write urb scheme will be used. The size of 4000 was selected for the usb_debug driver so that the driver lowers possibility of losing the queued console messages during the kernel startup. Signed-off-by: Jason Wessel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-01-07USB: serial: usb_debug: Make staticRoel Kluin1-1/+1
Sparse asked whether these could be static. Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-07-22usb_serial: API all changeAlan Cox1-2/+3
USB serial likes to use port->tty back pointers for the real work it does and to do so without any actual locking. Unfortunately when you consider hangup events, hangup/parallel reopen or even worse hangup followed by parallel close events the tty->port and port->tty pointers are not guaranteed to be the same as port->tty is the active tty while tty->port is the port the tty may or may not still be attached to. So rework the entire API to pass the tty struct. For console cases we need to pass both for now. This shows up multiple drivers that immediately crash with USB console some of which have been fixed in the process. Longer term we need a proper tty as console abstraction Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-21USB: debug port converter does not accept more than 8 byte packetsAleksey Gorelov1-0/+9
USB debug port only supports 8 byte rx/tx packets. Although spec implies that "if a packet larger than eight bytes is received from the remote computer, the device must break the larger packet into eight-byte packets before sending the data to the Debug Port", the real PLX NET20DC device does not handle it right - data is corrupted on debug port end if serial interface sends >8 byte urbs. Patch below fixes the issue by limiting tx urb to 8 byte. Signed off by: Aleks Gorelov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: serial: remove unneeded number endpoints settingsGreg Kroah-Hartman1-3/+0
The usb-serial core no longer checks these fields so remove them from all of the individual drivers. They will be removed from the usb-serial core in a patch later in the series. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB: add driver for the USB debug devicesGreg Kroah-Hartman1-0/+65
It's a simple usb-serial driver that just creates a tty device to read and write from. Signed-off-by: Greg Kroah-Hartman <[email protected]>