Commit edb5352e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Linus Torvalds

[PATCH] USB: drivers/usb/atm/usb_atm.c: fix nonzero snd_padding case

This is the patch to fix the case when snd_padding is not zero, updated
according to Duncan's comments.  Also it changes the driver name to reflect
its generic nature.
Signed-off-by: default avatarRoman Kagan <rkagan@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 938bc254
...@@ -111,7 +111,7 @@ static int udsl_print_packet(const unsigned char *data, int len); ...@@ -111,7 +111,7 @@ static int udsl_print_packet(const unsigned char *data, int len);
#define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@free.fr>" #define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@free.fr>"
#define DRIVER_VERSION "1.8" #define DRIVER_VERSION "1.8"
#define DRIVER_DESC "Alcatel SpeedTouch USB driver version " DRIVER_VERSION #define DRIVER_DESC "Generic USB ATM/DSL I/O, version " DRIVER_VERSION
static unsigned int num_rcv_urbs = UDSL_DEFAULT_RCV_URBS; static unsigned int num_rcv_urbs = UDSL_DEFAULT_RCV_URBS;
static unsigned int num_snd_urbs = UDSL_DEFAULT_SND_URBS; static unsigned int num_snd_urbs = UDSL_DEFAULT_SND_URBS;
...@@ -386,10 +386,6 @@ static unsigned int udsl_write_cells(struct udsl_instance_data *instance, ...@@ -386,10 +386,6 @@ static unsigned int udsl_write_cells(struct udsl_instance_data *instance,
if (!(ctrl->num_cells -= ne) || !(howmany -= ne)) if (!(ctrl->num_cells -= ne) || !(howmany -= ne))
goto out; goto out;
if (instance->snd_padding) {
memset(target, 0, instance->snd_padding);
target += instance->snd_padding;
}
udsl_fill_cell_header(target, ctrl->atm_data.vcc); udsl_fill_cell_header(target, ctrl->atm_data.vcc);
target += ATM_CELL_HEADER; target += ATM_CELL_HEADER;
memcpy(target, skb->data, skb->len); memcpy(target, skb->data, skb->len);
...@@ -404,6 +400,10 @@ static unsigned int udsl_write_cells(struct udsl_instance_data *instance, ...@@ -404,6 +400,10 @@ static unsigned int udsl_write_cells(struct udsl_instance_data *instance,
goto out; goto out;
} }
if (instance->snd_padding) {
memset(target, 0, instance->snd_padding);
target += instance->snd_padding;
}
udsl_fill_cell_header(target, ctrl->atm_data.vcc); udsl_fill_cell_header(target, ctrl->atm_data.vcc);
target += ATM_CELL_HEADER; target += ATM_CELL_HEADER;
memset(target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER); memset(target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment