History log of /linux-master/drivers/usb/atm/usbatm.c
Revision Date Author Comments
# b7fa76e0 15-Sep-2023 Gustavo A. R. Silva <gustavoars@kernel.org>

usb: atm: Use size_add() in call to struct_size()

If, for any reason, the open-coded arithmetic causes a wraparound,
the protection that `struct_size()` adds against potential integer
overflows is defeated. Fix this by hardening call to `struct_size()`
with `size_add()`.

Fixes: b626871a7cda ("usb: atm: Use struct_size() helper")
Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/ZQSuboEIhvATAdxN@work
Signed-off-by: Kees Cook <keescook@chromium.org>


# b7db5733 18-Aug-2022 Wolfram Sang <wsa+renesas@sang-engineering.com>

usb: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Reviewed-by: Richard Leitner <richard.leitner@skidata.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210116.7517-1-wsa+renesas@sang-engineering.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dcd2e49b 16-Mar-2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>

usb: remove third argument of usb_maxpacket()

The third argument of usb_maxpacket(): in_out has been deprecated
because it could be derived from the second argument (e.g. using
usb_pipeout(pipe)).

N.B. function usb_maxpacket() was made variadic to accommodate the
transition from the old prototype with three arguments to the new one
with only two arguments (so that no renaming is needed). The variadic
argument is to be removed once all users of usb_maxpacket() get
migrated.

CC: Duncan Sands <duncan.sands@free.fr>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Olav Kongas <ok@artecdesign.ee>
CC: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20220317035514.6378-7-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cead1855 22-Nov-2021 Eric W. Biederman <ebiederm@xmission.com>

exit: Rename complete_and_exit to kthread_complete_and_exit

Update complete_and_exit to call kthread_exit instead of do_exit.

Change the name to reflect this change in functionality. All of the
users of complete_and_exit are causing the current kthread to exit so
this change makes it clear what is happening.

Move the implementation of kthread_complete_and_exit from
kernel/exit.c to to kernel/kthread.c. As this function is kthread
specific it makes most sense to live with the kthread functions.

There are no functional change.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>


# b626871a 28-Sep-2021 Gustavo A. R. Silva <gustavoars@kernel.org>

usb: atm: Use struct_size() helper

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worse scenario, could lead to heap overflows.

Link: https://github.com/KSPP/linux/issues/160
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210928233935.GA299525@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ba7052f5 08-Dec-2020 Enrico Weigelt, metux IT consult <info@metux.net>

drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk()

Since we have the nice helpers pr_err() and pr_warn(), use them instead
of raw printk().

Acked-by: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Link: https://lore.kernel.org/r/20201208093206.24780-3-info@metux.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 726c8277 18-Oct-2020 Thomas Gleixner <tglx@linutronix.de>

usb: atm: Replace in_interrupt() usage in comment

in_interrupt() is a pretty vague context description as it means: hard
interrupt, soft interrupt or bottom half disabled regions.

Replace the vague comment with a proper reasoning why spin_lock_irqsave()
needs to be used.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Duncan Sands <duncan.sands@free.fr>
Cc: linux-usb@vger.kernel.org

Link: https://lore.kernel.org/r/20201019101110.944939915@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c05c932a 17-Aug-2020 Allen Pais <allen.lkml@gmail.com>

usb: atm: convert tasklets to use new tasklet_setup() API

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 <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200817090209.26351-2-allen.cryptic@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c593642c 09-Dec-2019 Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>

treewide: Use sizeof_field() macro

Replace all the occurrences of FIELD_SIZEOF() with sizeof_field() except
at places where these are defined. Later patches will remove the unused
definition of FIELD_SIZEOF().

This patch is generated using following script:

EXCLUDE_FILES="include/linux/stddef.h|include/linux/kernel.h"

git grep -l -e "\bFIELD_SIZEOF\b" | while read file;
do

if [[ "$file" =~ $EXCLUDE_FILES ]]; then
continue
fi
sed -i -e 's/\bFIELD_SIZEOF\b/sizeof_field/g' $file;
done

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Link: https://lore.kernel.org/r/20190924105839.110713-3-pankaj.laxminarayan.bharadiya@intel.com
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: David Miller <davem@davemloft.net> # for net


# 72a9f9a4 21-Oct-2017 Kees Cook <keescook@chromium.org>

usb: usbatm: Convert timers to use timer_setup()

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. Additionally corrects and on-stack
timer usage.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: accessrunner-general@lists.sourceforge.net
Cc: linux-usb@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Allen Pais <allen.lkml@gmail.com>


# 4a8635ae 02-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: atm: Remove redundant license text

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.

Cc: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

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 <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0f773547 09-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

USB: atm: make atmdev_ops const

Make these const as they are only passed to the function
atm_dev_register and the corresponding argument is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9acd6b2a 19-Jul-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: atm: remove unneeded MODULE_VERSION() usage

MODULE_VERSION is useless for in-kernel drivers, so just remove all
usage of it in the USB ATM drivers. Along with this, some
DRIVER_VERSION macros were removed as they are also pointless.

Cc: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f07c014 08-Feb-2017 Ingo Molnar <mingo@kernel.org>

sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h>

We are going to split <linux/sched/signal.h> out of <linux/sched.h>, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder <linux/sched/signal.h> file that just
maps to <linux/sched.h> to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>


# 7c0f6ba6 24-Dec-2016 Linus Torvalds <torvalds@linux-foundation.org>

Replace <asm/uaccess.h> with <linux/uaccess.h> globally

This was entirely automated, using the script by Al:

PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>'
sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)

to do the replacement at the end of the merge window.

Requested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 52879bb1 25-Aug-2016 Wolfram Sang <wsa-dev@sang-engineering.com>

usb: atm: usbatm: don't print on ENOMEM

All kmalloc-based functions print enough information on failures.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4675e961 11-Aug-2016 Wolfram Sang <wsa-dev@sang-engineering.com>

usb: atm: usbatm: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f354c845 30-Apr-2015 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: usbatm.c: move assignment out of if () block

We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Felipe Balbi <balbi@ti.com>


# 9058bdc3 05-Dec-2013 Seth Archer Brown <learc83@gmail.com>

Usb: atm: usbatm: fixed a pointer variable format issue

Fixed a pointer variable format issue.

Signed-off-by: Seth Archer Brown <learc83@gmail.com>
Acked-by: Duncan Sands <duncan.sands@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2c21c985 28-Jun-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: usbatm: remove CONFIG_USB_DEBUG dependancy

Now that no USB atm driver is relying on the CONFIG_USB_DEBUG option
(well, really the DEBUG option, thanks to some Makefile fun), remove it
from the Makefile.

Also remove two last vestiges of DEBUG in the usbatm.c driver, moving
one to VERBOSE_DEBUG, which no one ever really cares about, and the
other to use the dynamic debug subsystem.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0fef59d3 28-Jun-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: usbatm: remove unneeded trace printk calls

We have an in-kernel trace subsystem, so use that instead of printk for
trying to figure out what functions are being called.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f55876de 28-Jun-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: usbatm: remove unused UDSL_ASSERT macro

If this code isn't triggering this assert by now, it never will, so just
remove it, it's pointless.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f170168b 03-Jul-2013 Kees Cook <keescook@chromium.org>

drivers: avoid parsing names as kthread_run() format strings

Calling kthread_run with a single name parameter causes it to be handled
as a format string. Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# c33c888b 18-Apr-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn>

usbatm: fix potential NULL pointer dereference

The dereference to 'instance' in the debug code should be moved
below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 34ad569f 13-Sep-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: atm: usbatm: fix up debug printing code

If VERBOSE_DEBUG was enabled, lots of build errors happend (obviously no
one uses this mode.) So fix that up, and get rid of the dbg() call, and
use dev_dbg() like the rest of the driver does.

Cc: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4c2a47a2 01-May-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: usbatm.c: remove dbg() usage

dbg() was a very old USB-specific macro that should no longer
be used. This patch removes it from being used in the driver
and uses dev_dbg() instead.

CC: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bf929b3b 16-Jun-2011 Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>

drivers/usb/atm: use printk_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# d9ca676b 08-Dec-2010 Dan Williams <dcbw@redhat.com>

atm: correct sysfs 'device' link creation and parent relationships

The ATM subsystem was incorrectly creating the 'device' link for ATM
nodes in sysfs. This led to incorrect device/parent relationships
exposed by sysfs and udev. Instead of rolling the 'device' link by hand
in the generic ATM code, pass each ATM driver's bus device down to the
sysfs code and let sysfs do this stuff correctly.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 9196cc7b 09-Jun-2010 Nicolas Kaiser <nikai@nikai.net>

USB: speedtouch: fixed more brace and spacing coding style issues

Fixed spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 6c4b7f70 09-Jun-2010 Nicolas Kaiser <nikai@nikai.net>

USB: speedtouch: fixed brace and spacing coding style issues

Fixed brace coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 08add0c7 11-Jan-2010 Thiago Farina <tfransosi@gmail.com>

USB: atm: Use FIELD_SIZEOF, trivial cleanup.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 9fc950d3 21-Nov-2009 Simon Arlott <simon@octiron.net>

USB: cxacru: check device isn't being removed during sysfs calls

It is possible for usb_get_intfdata() to return NULL if
sysfs is accessed while the module is being unloaded or
the device is being removed.

Move the access code to an inline function in usbatm.h,
and return -ENODEV if any of the pointers are NULL.

It should not be possible for the instance data or atm
device to be invalid until after unbind() completes and
the sysfs attributes have been removed.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 7c510e4b 27-Oct-2008 Johannes Berg <johannes@sipsolutions.net>

net: convert more to %pM

A number of places still use %02x:...:%02x because it's
in debug statements or for no real reason. Make a few
of them use %pM.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3b6004f3 14-Aug-2008 Greg Kroah-Hartman <gregkh@suse.de>

USB: remove warn() macro from usb drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible. In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# b5f61ab9 23-Sep-2008 David S. Miller <davem@davemloft.net>

usbatm: Use skb_queue_walk_safe() instead of by-hand implementation.

Signed-off-by: David S. Miller <davem@davemloft.net>


# c4504a7e 11-Feb-2008 Pavel Emelyanov <xemul@openvz.org>

USB: usbatm: convert heavy init dances to kthread API

This is an attempt to kill two birds with one stone.

First, we kill one more user of kernel_thread, which is scheduled
for removal. Second - we kill one of the last users of kill_proc -
the function which is also to be removed, because it uses a pid_t
which is not safe now.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 33fea2b2 18-Jul-2007 Greg Kroah-Hartman <gregkh@suse.de>

USB: atm: usbatm: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# b8a124da 09-May-2007 Oleg Nesterov <oleg@tv-sign.ru>

usbatm_heavy_init: don't use CLONE_SIGHAND

usbatm_do_heavy_init() calls allow_signal() which plays with parent process's
->sighand.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Duncan Sands <duncan.sands@free.fr>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# e63340ae 08-May-2007 Randy Dunlap <randy.dunlap@oracle.com>

header cleaning: don't include smp_lock.h when not used

Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 7d5e1dd4 26-Apr-2007 Simon Arlott <simon@octiron.net>

usbatm: Detect usb device shutdown and ignore failed urbs

Detect usb device shutdown and ignore failed urbs. This happens when the
driver is unloaded or the device is unplugged.

I'm not sure what other urb statuses should be ignored, and the warning
message doesn't need to be shown when the module is unloaded or the device
is removed.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@math.u-psud.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e9b8daf3 06-Mar-2007 Simon Arlott <simon@arlott.org>

usbatm: create sysfs link "device" from atm class device to usb interface

There is currently no path from the ATM device in /sys to the USB device's
interface that the driver is using; this patch creates a "device" symlink. It
is then possible to get to the cxacru ADSL statistics
(http://lkml.org/lkml/2007/2/23/328):

/sys/class/atm/cxacru0/device $ ls *_rate *_margin *_attenuation
downstream_attenuation downstream_snr_margin upstream_rate
downstream_rate upstream_attenuation upstream_snr_margin

If this link is not appropriate I'd have to create device files in
/sys/class/atm/cxacru0 instead - which seems less appropriate since the ADSL
statistics are for the USB device not ATM (which is running over the ADSL).

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@math.u-psud.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 27d7ff46 31-Mar-2007 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

[SK_BUFF]: Introduce skb_copy_to_linear_data{_offset}

To clearly state the intent of copying to linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>


# d626f62b 27-Mar-2007 Arnaldo Carvalho de Melo <acme@redhat.com>

[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}

To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 4305b541 19-Apr-2007 Arnaldo Carvalho de Melo <acme@redhat.com>

[SK_BUFF]: Convert skb->end to sk_buff_data_t

Now to convert the last one, skb->data, that will allow many simplifications
and removal of some of the offset helpers.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 27a884dc 19-Apr-2007 Arnaldo Carvalho de Melo <acme@redhat.com>

[SK_BUFF]: Convert skb->tail to sk_buff_data_t

So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes
on 64bit architectures, allowing us to combine the 4 bytes hole left by the
layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4
64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN...
:-)

Many calculations that previously required that skb->{transport,network,
mac}_header be first converted to a pointer now can be done directly, being
meaningful as offsets or pointers.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 521b600b 10-Oct-2006 Andrew Morton <akpm@osdl.org>

USB: fix usbatm tiny race

ia64:

drivers/usb/atm/usbatm.c: In function `usbatm_do_heavy_init':
drivers/usb/atm/usbatm.c:1004: warning: implicit declaration of function `get_current'
drivers/usb/atm/usbatm.c:1004: error: invalid type argument of `->'

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# ccf40d62 05-Oct-2006 Duncan Sands <baldrick@free.fr>

usbatm: fix tiny race

If usbatm_do_heavy_init finishes before usbatm_heavy_init
writes the pid, the disconnect method could shoot down the
wrong process if the pid has been recycled.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 7d12e780 05-Oct-2006 David Howells <dhowells@redhat.com>

IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)


# fcf4830a 28-Apr-2006 Duncan Sands <duncan.sands@math.u-psud.fr>

[PATCH] USBATM: remove pointless inline

Remove pointless inline.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 6275cdfa 28-Apr-2006 Duncan Sands <duncan.sands@math.u-psud.fr>

[PATCH] USBATM: fix modinfo output

Because of the way stringify works, using an expression
like 64 * 1024 for UDSL_MAX_BUF_SIZE results in 64 * 1024
turning up in the modinfo output instead of 65536. So use
65536 directly (this was the only way I found of fixing this).

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# ab3c81ff 13-Jan-2006 Arjan van de Ven <arjan@infradead.org>

[PATCH] USBATM: semaphore to mutex conversion

This is the usbatm part of the Arjan, Jes and Ingo
mass semaphore to mutex conversion, reworked to apply on top
of the patches I just sent to you. This time, with correct
attribution and signed-off lines.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# a3673d3c 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: -EILSEQ workaround

Don't throttle on -EILSEQ urb status if requested by a minidriver.
It seems the ueagle modems are buggy, giving -EILSEQ when they
have no data to send. The ueagle change will be sent separately
by the ueagle guys. Patch by Matthieu Castet.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 9b0e54ad 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: bump version numbers

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e3fb2f64 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: handle urbs containing partial cells

The receive logic has always assumed that urbs contain an integral
number of ATM cells, which is a bit naughty, though it never caused
any problems with bulk transfers. Isochronous urbs spank us soundly
for this. Fixed thanks to this patch, mostly by Stanislaw Gruszka.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 80aae7a1 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: allow isochronous transfer

While the usbatm core has had some support for using isoc urbs
for some time, there was no way for users to turn it on. While
use of isoc transfer should still be considered experimental, it
now works well enough to let users turn it on. Minidrivers signal
to the core that they want to use isoc transfer by setting the new
UDSL_USE_ISOC flag. The speedtch minidriver gets a new module
parameter enable_isoc (defaults to false), plus some logic that
checks for the existence of an isoc receive endpoint (not all
speedtouch modems have one).

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 6f749475 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: measure buffer size in bytes; force valid sizes

Change the module parameters rcv_buf_size and snd_buf_size to
specify buffer sizes in bytes rather than ATM cells. Since
there is some danger that users may not notice this change,
the parameters are renamed to rcv_buf_bytes etc. The transmit
buffer needs to be a multiple of the ATM cell size in length,
while the receive buffer should be a multiple of the endpoint
maxpacket size (this wasn't enforced before, which causes trouble
with isochronous transfers), so enforce these restrictions. Now
that the usbatm probe method inspects the endpoint maxpacket size,
minidriver bind routines need to set the correct alternate setting
for the interface in their bind routine. This is the reason for
the speedtch changes.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 227d7761 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: use dev_kfree_skb_any rather than dev_kfree_skb

In one spot (usbatm_cancel_send) we were calling dev_kfree_skb with irqs
disabled. This mistake is just too easy to make, so systematically use
dev_kfree_skb_any rather than dev_kfree_skb.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 72ef8ab4 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: return correct error code when out of memory

We weren't always returning -ENOMEM.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 0e42a627 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: shutdown open connections when disconnected

This patch causes vcc_release_async to be applied to any open
vcc's when the modem is disconnected. This signals a socket
shutdown, letting the socket user know that the game is up.
I wrote this patch because of reports that pppd would keep
connections open forever when the modem is disconnected.
This patch does not fix that problem, but it's a step in the
right direction. It doesn't help because the pppoatm module
doesn't yet monitor state changes on the ATM socket, so simply
never realises that the ATM connection has gone down (meaning
it doesn't tell the ppp layer). But at least there is a socket
state change now. Unfortunately this patch may create problems
for those rare users like me who use routed IP or some other
non-ppp connection method that goes via the ATM ARP daemon: the
daemon is buggy, and with this patch will crash when the modem
is disconnected. Users with a buggy atmarpd can simply restart
it after disconnecting the modem.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 9a734efe 13-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: kzalloc conversion

Convert kmalloc + memset to kzalloc.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 35644b0c 17-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: add flags field

Have minidrivers and the core signal special requirements
using a flags field in struct usbatm_data. For the moment
this is only used to replace the need_heavy_init bind
parameter, but there'll be new flags in later patches.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 0ec3c7e8 17-Jan-2006 Duncan Sands <baldrick@free.fr>

[PATCH] USBATM: trivial modifications

Formatting, changes to variable names, comments, log level changes,
printk rate limiting.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 858119e1 14-Jan-2006 Arjan van de Ven <arjan@infradead.org>

[PATCH] Unlinline a bunch of other functions

Remove the "inline" keyword from a bunch of big functions in the kernel with
the goal of shrinking it by 30kb to 40kb

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 3d48586c 20-Nov-2005 Adrian Bunk <bunk@stusta.de>

[PATCH] USB: small cleanups

This patch contains the following cleanups:
- make needlessly global functions static
- every file should #include the headers containing the prototypes for
it's global functions

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 64bf69dd 29-Nov-2005 Stanislaw Gruszka <stf_xl@wp.pl>

[ATM]: deregistration removes device from atm_devs list immediately

atm_dev_deregister() removes device from atm_dev list immediately to
prevent operations on a phantom device. Decision to free device based
only on ->refcnt now. Remove shutdown_atm_dev() use atm_dev_deregister()
instead. atm_dev_deregister() also asynchronously releases all vccs
related to device.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 7b842b6e 06-Sep-2005 Pekka Enberg <penberg@cs.helsinki.fi>

[PATCH] USB: convert kcalloc to kzalloc

This patch converts kcalloc(1, ...) calls to use the new kzalloc() function.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# f0706930 28-May-2005 Duncan Sands <duncan.sands@math.u-psud.fr>

[PATCH] USB: usbatm kcalloc cleanup

you seem to have applied the original, not the new improved one with
whiter teeth that uses kcalloc instead of kmalloc + memset. Here's a
patch that goes on top of the one you applied.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 65412e48 27-May-2005 Duncan Sands <duncan.sands@math.u-psud.fr>

[PATCH] USB ATM: avoid oops on bind failure; plug memory leak

Zero the entire instance, not just the struct usbatm_data head.
Make sure the just allocated urb is freed if we fail to allocate
a buffer. Based on a patch by Stanislaw W. Gruszka.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e20d6645 26-May-2005 Duncan Sands <duncan.sands@math.u-psud.fr>

[PATCH] USB ATM: reduce log spamming

Reduce the number of "unknown vpi/vci" debug messages to (usually) at most
one per-urb, rather than one per-cell. This is only an issue when (a) many
packets come in but no connection is open; and (b) CONFIG_USB_DEBUG is set.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# c59bba75 11-May-2005 Duncan Sands <duncan.sands@math.u-psud.fr>

[PATCH] USB ATM: new usbatm core

Rework the core usbatm code: minidrivers (i.e. drivers for particular
modems) now register themselves with the usbatm core, supplying methods
for binding/unbinding etc. The design was inspired by usb-serial and
usbnet. At the same time, more common code from the speedtch and
cxacru (patch 3/5) drivers was generalized and moved into the core. The
transmission and reception parts have been unified and simplified. Since
this is a major change and I don't like underscores in file names,
usb_atm.[ch] has been renamed usbatm.[ch].

Many thanks to Roman Kagan, who did a lot of the coding.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>