Age | Commit message (Collapse) | Author | Files | Lines |
|
While there are a mix of things here, most of the stuff
were written from Kernel developer's PoV. So, add them to
the driver-api book.
A follow up for this patch would be to move documents from
there that are specific to sysadmins, adding them to the
admin-guide.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: Johan Hovold <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Now that the endpoint-port mapping has been properly set up during
probe, we can switch to using the more efficient generic write
implementation.
Note that this currently means that chars_in_buffer now overcounts
slightly as we always write a full endpoint-sized packet.
Also add a copyright entry.
Signed-off-by: Johan Hovold <[email protected]>
|
|
These devices use the second bulk-out endpoint for writing. Instead of
using the resources of the second port structure setup by core, use the
new endpoint-remap functionality to simply ignore the first bulk-out
endpoint. This specifically avoids allocating resources for the unused
endpoint.
Note that the disconnect callback was always redundant as all URBs would
have been killed by USB core on disconnect.
Signed-off-by: Johan Hovold <[email protected]>
|
|
Simplify the endpoint sanity check by letting core verify that the
required endpoints are present.
Note that the driver uses the second bulk-out endpoint for writing.
Signed-off-by: Johan Hovold <[email protected]>
|
|
Remove the now redundant open callback and let core call the generic
handler for us instead.
Signed-off-by: Johan Hovold <[email protected]>
|
|
This driver needlessly took another reference to the tty on open, a
reference which was then never released on close. This lead to not just
a leak of the tty, but also a driver reference leak that prevented the
driver from being unloaded after a port had once been opened.
Fixes: 4a90f09b20f4 ("tty: usb-serial krefs")
Cc: stable <[email protected]> # 2.6.28
Signed-off-by: Johan Hovold <[email protected]>
|
|
Fix NULL-pointer dereferences at open() and disconnect() should the
device lack the expected bulk-out endpoints:
Unable to handle kernel NULL pointer dereference at virtual address 000000b4
...
[c0170ff0>] (__lock_acquire) from [<c0172f00>] (lock_acquire+0x108/0x264)
[<c0172f00>] (lock_acquire) from [<c06a5090>] (_raw_spin_lock_irqsave+0x58/0x6c)
[<c06a5090>] (_raw_spin_lock_irqsave) from [<c0470684>] (tty_port_tty_set+0x28/0xa4)
[<c0470684>] (tty_port_tty_set) from [<bf08d384>] (omninet_open+0x30/0x40 [omninet])
[<bf08d384>] (omninet_open [omninet]) from [<bf07c118>] (serial_port_activate+0x68/0x98 [usbserial])
Unable to handle kernel NULL pointer dereference at virtual address 00000234
...
[<bf01f418>] (omninet_disconnect [omninet]) from [<bf0016c0>] (usb_serial_disconnect+0xe4/0x100 [usbserial])
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <[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]>
|
|
Switch to the more efficient generic read implementation.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Refactor read-urb processing, and add sanity checks on header and data
lengths.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove redundant data-offset define, which was really just the header
length.
Add payload-size define and use the bulk-out size define for the actual
bulk-out size.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Clean up and fix typos in protocol comment.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Make sure the port private data, which contains the write sequence
number, is cleared at allocation.
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]>
|
|
Fix port-data memory leak by replacing attach and release with
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.
Compile-only tested.
Cc: <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
I forgot to remove an unused variable.
Reported-by: Fengguang Wu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Now that all usb-serial modules are only using dev_dbg()
the debug module parameter does not do anything at all, so
remove it to reduce any confusion if someone were to try to
use it.
CC: Johan Hovold <[email protected]>
CC: Rusty Russell <[email protected]>
CC: Alan Stern <[email protected]>
CC: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We should use dev_dbg() for usb_serial_debug_data() like all of the rest
of the usb-serial drivers use, so remove the debug parameter as it's not
needed.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Add check for return value of tty_port_tty_get,
since it can return NULL after port hangup that may happen anytime.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
dbg() was a very old USB-serial-specific macro.
This patch removes it from being used in the
driver and uses dev_dbg() instead.
CC: Johan Hovold <[email protected]>
CC: Rusty Russell <[email protected]>
CC: Alan Stern <[email protected]>
CC: Mauro Carvalho Chehab <[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]>
|
|
dbg() was used a lot a long time ago to trace code flow. Now that we have
ftrace, this isn't needed at all, so remove these calls.
CC: Johan Hovold <[email protected]>
CC: Rusty Russell <[email protected]>
CC: Alan Stern <[email protected]>
CC: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This converts the omninet.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: Rusty Russell <[email protected]>
CC: Alan Stern <[email protected]>
CC: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This patch (as1527) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
navman, omninet, opticon, option, oti6858, and pl2303.
Signed-off-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use dev_err_console in write paths for devices which can be used as a
console but do not use the generic write implementation.
Compile-only tested.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.
It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.
Acked-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
|
|
Remove unnecessary re-fills of bulk urbs whose fields have not changed
since port probe.
Compile-only tested.
Cc: Matthias Bruestle and Harald Welte <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove unnecessary reinitialisations of urb->dev before each submission,
which were based on the (no longer valid) assumption that serial->dev
will be set to NULL on close.
Compile-only tested.
Cc: Matthias Bruestle and Harald Welte <[email protected]>
Cc: Lonnie Mendez <[email protected]>
Cc: Peter Berger <[email protected]>
Cc: Al Borchers <[email protected]>
Cc: Support Department <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use port write_urbs_free mask rather than write_urb_busy field in struct
serial_port.
Compile-only tested.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fix regression introduced by commit 507ca9bc047666 ([PATCH] USB: add
ability for usb-serial drivers to determine if their write urb is
currently being used.) which inverted the logic in write_room so that it
returns zero when the write urb is actually free.
Signed-off-by: Johan Hovold <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove remaining changelogs from file headers (can still be retrieved
through git).
Remove even older changelog entries stored in Changelog.history.
Remove outdated todo entries from belkin_sa.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Greg prefers this to go through the trivial tree.
http://lkml.org/lkml/2010/6/24/1
There are about 2500 void functions in drivers/usb
Only a few used return; at end of function.
Standardize them a bit.
Moved a statement down a line in drivers/usb/host/u132-hcd.c
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
|
|
Reduces string space a bit
Neaten a macro redefine of dbg
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
#define dbg adds the newline, messages shouldn't.
Converted dbg("%s", "some string") to dbg("some string")
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
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]>
|
|
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]>
|
|
This patch (as1254) splits up the shutdown method of usb_serial_driver
into a disconnect and a release method.
The problem is that the usb-serial core was calling shutdown during
disconnect handling, but drivers didn't expect it to be called until
after all the open file references had been closed. The result was an
oops when the close method tried to use memory that had been
deallocated by shutdown.
Signed-off-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This allows us to clean stuff up, but is probably also going to cause
some app breakage with buggy apps as we now implement proper POSIX behaviour
for USB ports matching all the other ports. This does also mean other apps
that break on USB will now work properly.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
err() is going away, so switch to dev_err() or printk() if it's really
needed.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use kref in the USB serial drivers so that we don't free tty structures
from under the URB receive handlers as has historically been the case if
you were unlucky. This also gives us a framework for general tty drivers to
use tty_port objects and refcount.
Contains two err->dev_err changes merged together to fix clashes in the
-next tree.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|