Age | Commit message (Collapse) | Author | Files | Lines |
|
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]>
|
|
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]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next
Johan writes:
USB-serial updates for v4.15-rc1
Here are the USB-serial updates for 4.15-rc1, including:
- three fixes for longstanding issues in garmin_gps and metro-usb which
could lead to NULL-pointer dereferences and memory leaks
- a workaround for broken f81534 firmware-handling of overruns
- f81534 break support, and
- conversion to timer_setup()
Included are also various clean ups and a new qcserial device id.
All have been in linux-next with no reported issues.
Signed-off-by: Johan Hovold <[email protected]>
|
|
Add device-id entry for (Honeywell) Metrologic MS7820 bar code scanner.
The device has two interfaces (in this mode?); a vendor-specific
interface with two interrupt endpoints and a second HID interface, which
we do not bind to.
Reported-by: Ladislav Dobrovsky <[email protected]>
Tested-by: Ladislav Dobrovsky <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
One class of "unidirectional" devices managed by this driver uses an
interrupt-out endpoint to send control messages at open and close. Due
to a missing endpoint sanity check, this could result in an interrupt
URB being submitted to endpoint 0 instead. This would be caught by
USB core (without a WARN dump), but let's verify that the expected
endpoints are present at probe rather than when a port is later opened.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
Let usb-serial core verify that the interrupt-in endpoint is present
when binding the interface instead of the driver verifying this at every
open.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
Make sure to kill the interrupt-in URB after a failed open request.
Apart from saving power (and avoiding stale input after a later
successful open), this also prevents a NULL-deref in the completion
handler if the port is manually unbound.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Fixes: 704577861d5e ("USB: serial: metro-usb: get data from device in Uni-Directional mode.")
Cc: stable <[email protected]> # 3.5
Signed-off-by: Johan Hovold <[email protected]>
|
|
No need to reinitialise the interrupt-in URB with values that have not
changed before (some) resubmissions.
This also allows the interrupt-in callback to have a single path for URB
resubmission.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
Drop some unnecessary debug printks.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
Drop redundant URB unlink as there's no need to unlink an URB which is
about to be killed synchronously.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
Drop the unused interrupt-out callback.
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
|
|
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]>
|
|
Declare device-id tables as const where possible.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Mark function metrousb_is_unidirectional_mode() in serial/metro-usb.c
because it is not used outside this file.
This eliminates the following warning in serial/metro-usb.c:
drivers/usb/serial/metro-usb.c:57:12: warning: no previous prototype for ‘metrousb_is_unidirectional_mode’ [-Wmissing-prototypes]
Signed-off-by: Rashika Kheria <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The usb_serial_port structure had the number field, which was the minor
number for the port, which almost no one really cared about. They
really wanted the number of the port within the device, which you had to
subtract from the minor of the parent usb_serial_device structure. To
clean this up, provide the real minor number of the port, and the number
of the port within the serial device separately, as these numbers might
not be related in the future.
Bonus is that this cleans up a lot of logic in the drivers, and saves
lines overall.
Tested-by: Tobias Winter <[email protected]>
Reviewed-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
--
drivers/staging/serqt_usb2/serqt_usb2.c | 21 +++--------
drivers/usb/serial/ark3116.c | 2 -
drivers/usb/serial/bus.c | 6 +--
drivers/usb/serial/console.c | 2 -
drivers/usb/serial/cp210x.c | 2 -
drivers/usb/serial/cypress_m8.c | 4 +-
drivers/usb/serial/digi_acceleport.c | 6 ---
drivers/usb/serial/f81232.c | 5 +-
drivers/usb/serial/garmin_gps.c | 6 +--
drivers/usb/serial/io_edgeport.c | 58 ++++++++++++--------------------
drivers/usb/serial/io_ti.c | 21 ++++-------
drivers/usb/serial/keyspan.c | 29 +++++++---------
drivers/usb/serial/metro-usb.c | 4 +-
drivers/usb/serial/mos7720.c | 37 +++++++++-----------
drivers/usb/serial/mos7840.c | 52 +++++++++-------------------
drivers/usb/serial/opticon.c | 2 -
drivers/usb/serial/pl2303.c | 2 -
drivers/usb/serial/quatech2.c | 7 +--
drivers/usb/serial/sierra.c | 2 -
drivers/usb/serial/ti_usb_3410_5052.c | 10 ++---
drivers/usb/serial/usb-serial.c | 7 ++-
drivers/usb/serial/usb_wwan.c | 2 -
drivers/usb/serial/whiteheat.c | 20 +++++------
include/linux/usb/serial.h | 6 ++-
24 files changed, 133 insertions(+), 180 deletions(-)
|
|
Always try to disable the uart on close.
Since the switch to tty ports, close will be called as part of shutdown
before disconnect returns. Hence there is no need to check the
disconnected flag, and we can put devices in disabled states also on
driver unbind.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.
Now, the one where most of tty_port_tty_get gets removed:
tty_flip_buffer_push.
IOW we also closed all the races in drivers not using tty_port_tty_get
at all yet.
Also we move tty_flip_buffer_push declaration from include/linux/tty.h
to include/linux/tty_flip.h to all others while we are changing it
anyway.
Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.
tty_insert_flip_string this time.
Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove all MODULE_VERSION macros and driver-version information (except
for garmin_gps which uses it in a status reply).
It is the kernel version that matters and not some private version
scheme which rarely even gets updated.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Make sure no control urb is submitted during close after a disconnect by
checking the disconnected flag.
Cc: <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Note that the call to metrousb_clean (close) in shutdown was redundant.
Compile-only tested.
Cc: <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Pull USB changes from Greg Kroah-Hartman:
"Here is the big USB pull request for 3.7-rc1
There are lots of gadget driver changes (including copying a bunch of
files into the drivers/staging/ccg/ directory so that the other gadget
drivers can be fixed up properly without breaking that driver), and we
remove the old obsolete ub.c driver from the tree.
There are also the usual XHCI set of updates, and other various driver
changes and updates. We also are trying hard to remove the old dbg()
macro, but the final bits of that removal will be coming in through
the networking tree before we can delete it for good.
All of these patches have been in the linux-next tree.
Signed-off-by: Greg Kroah-Hartman <[email protected]>"
Fix up several annoying - but fairly mindless - conflicts due to the
termios structure having moved into the tty device, and often clashing
with dbg -> dev_dbg conversion.
* tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (339 commits)
USB: ezusb: move ezusb.c from drivers/usb/serial to drivers/usb/misc
USB: uas: fix gcc warning
USB: uas: fix locking
USB: Fix race condition when removing host controllers
USB: uas: add locking
USB: uas: fix abort
USB: uas: remove aborted field, replace with status bit.
USB: uas: fix task management
USB: uas: keep track of command urbs
xhci: Intel Panther Point BEI quirk.
powerpc/usb: remove checking PHY_CLK_VALID for UTMI PHY
USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support
Revert "usb : Add sysfs files to control port power."
USB: serial: remove vizzini driver
usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems
Increase XHCI suspend timeout to 16ms
USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq
USB: sierra_ms: don't keep unused variable
fsl/usb: Add support for USB controller version 2.4
USB: qcaux: add Pantech vendor class match
...
|
|
Now that the dbg() macro is no longer being used in the driver,
the debug module parameter doesn't do anything at all. So remove
it so as to not confuse people.
CC: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fixes the leak of a tty kref that Jiri pointed out.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This is to sync up on Linus's branch to get the other tty and core changes.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Bits noticed doing the termios conversion
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Do not set low_latency flag at open as tty_flip_buffer_push must not be
called in IRQ context with low_latency set.
Cc: [email protected]
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Message in kernel log:
"metro-usb ttyUSB0: Metrologic USB to Serial converter now disconnected from ttyUSB0"
bit more likely than:
"metro-usb ttyUSB0: Metrologic USB to serial converter. converter now disconnected from ttyUSB0"
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
In this place result value is always zero. Use urb->status instead.
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We should send special control command to tell device start or stop
transmitting a data.
In Bi-Directional mode that cmd`s are not required.
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This function is never called now. Because we don`t send much data
to the device, only one byte via usb_interrupt_msg(). That doesn't require
callback function. But without declaration of write_int_callback inside
the struct usb_serial_driver, the usb_serial_probe doesn't initialize
endpoint address for the interrupt out pipe(interrupt_out_endpointAddress).
This endpoint is necessary for sending data via usb_interrupt_msg()
function.
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The right idProduct for Metrologic Bar Code Scanner
in Uni-Directional Serial Emulation mode is 0x0700.
Also rename idProduct for Bi-Directional mode to be a bit more informative.
Signed-off-by: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This properly ties the driver into the dynamic debug system and provides
the needed device identification when the messages are printed out.
It also removes a ton of checkpatch warnings as well, which is always a
nice validation that it's the correct thing to do.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We should use kzalloc() instead of kmalloc() and memset(), and remove an
unneeded void * cast as well.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
They aren't needed, make the checkpatch tool unhappy, and in some
places, aren't even correct. So just remove them, they get in the way
and are messy.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
By rearranging the functions a bit, we can remove all function
prototypes.
Note, this also deleted the _close function, as it wasn't needed, it was
doing the same thing the cleanup function did, so just call that
instead.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This fixes up all of the coding style errors, and removes the initial,
unneeded comments on how to load the module and the old changelog which
are no longer needed.
There are still a number of coding style warnings left, I'll get to them
later.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
A driver doesn't need a .h file just for simple things like vendor ids
and a private structure. So move it into the .c file instead, saving
some overall lines.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Now that we aren't doing anything special in the init function, move to
use the easier module_usb_serial_driver() call instead, saving a lot of
lines of unnecessary code.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
All new usb serial drivers should be using the dynamic id function, not
having module parameters for this type of thing. So remove them before
anyone gets used to them being there.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The usb serial core has changed how the driver is to be registered and
unregistered recently. Make these changes to the driver so that it will
properly build and work.
Cc: Aleksey Babahin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This driver is for the Metrologic barcode scanner.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|