aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r--drivers/usb/atm/ueagle-atm.c1
-rw-r--r--drivers/usb/atm/usbatm.c15
-rw-r--r--drivers/usb/atm/usbatm.h10
-rw-r--r--drivers/usb/atm/xusbatm.c2
4 files changed, 16 insertions, 12 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index cb01b5106efd..b6483dd98acc 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -64,7 +64,6 @@
64#include <linux/ctype.h> 64#include <linux/ctype.h>
65#include <linux/sched.h> 65#include <linux/sched.h>
66#include <linux/kthread.h> 66#include <linux/kthread.h>
67#include <linux/version.h>
68#include <linux/mutex.h> 67#include <linux/mutex.h>
69#include <linux/freezer.h> 68#include <linux/freezer.h>
70 69
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 07228721cafe..06dd114910d4 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -344,7 +344,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
344 __func__, sarb->len, vcc); 344 __func__, sarb->len, vcc);
345 /* discard cells already received */ 345 /* discard cells already received */
346 skb_trim(sarb, 0); 346 skb_trim(sarb, 0);
347 UDSL_ASSERT(sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); 347 UDSL_ASSERT(instance, sarb->tail + ATM_CELL_PAYLOAD <= sarb->end);
348 } 348 }
349 349
350 memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); 350 memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD);
@@ -432,7 +432,7 @@ static void usbatm_extract_cells(struct usbatm_data *instance,
432 unsigned char *cell_buf = instance->cell_buf; 432 unsigned char *cell_buf = instance->cell_buf;
433 unsigned int space_left = stride - buf_usage; 433 unsigned int space_left = stride - buf_usage;
434 434
435 UDSL_ASSERT(buf_usage <= stride); 435 UDSL_ASSERT(instance, buf_usage <= stride);
436 436
437 if (avail_data >= space_left) { 437 if (avail_data >= space_left) {
438 /* add new data and process cell */ 438 /* add new data and process cell */
@@ -475,7 +475,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance,
475 unsigned int stride = instance->tx_channel.stride; 475 unsigned int stride = instance->tx_channel.stride;
476 476
477 vdbg("%s: skb->len=%d, avail_space=%u", __func__, skb->len, avail_space); 477 vdbg("%s: skb->len=%d, avail_space=%u", __func__, skb->len, avail_space);
478 UDSL_ASSERT(!(avail_space % stride)); 478 UDSL_ASSERT(instance, !(avail_space % stride));
479 479
480 for (bytes_written = 0; bytes_written < avail_space && ctrl->len; 480 for (bytes_written = 0; bytes_written < avail_space && ctrl->len;
481 bytes_written += stride, target += stride) { 481 bytes_written += stride, target += stride) {
@@ -547,7 +547,7 @@ static void usbatm_rx_process(unsigned long data)
547 if (!urb->iso_frame_desc[i].status) { 547 if (!urb->iso_frame_desc[i].status) {
548 unsigned int actual_length = urb->iso_frame_desc[i].actual_length; 548 unsigned int actual_length = urb->iso_frame_desc[i].actual_length;
549 549
550 UDSL_ASSERT(actual_length <= packet_size); 550 UDSL_ASSERT(instance, actual_length <= packet_size);
551 551
552 if (!merge_length) 552 if (!merge_length)
553 merge_start = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; 553 merge_start = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset;
@@ -640,14 +640,13 @@ static void usbatm_cancel_send(struct usbatm_data *instance,
640 640
641 atm_dbg(instance, "%s entered\n", __func__); 641 atm_dbg(instance, "%s entered\n", __func__);
642 spin_lock_irq(&instance->sndqueue.lock); 642 spin_lock_irq(&instance->sndqueue.lock);
643 for (skb = instance->sndqueue.next, n = skb->next; 643 skb_queue_walk_safe(&instance->sndqueue, skb, n) {
644 skb != (struct sk_buff *)&instance->sndqueue;
645 skb = n, n = skb->next)
646 if (UDSL_SKB(skb)->atm.vcc == vcc) { 644 if (UDSL_SKB(skb)->atm.vcc == vcc) {
647 atm_dbg(instance, "%s: popping skb 0x%p\n", __func__, skb); 645 atm_dbg(instance, "%s: popping skb 0x%p\n", __func__, skb);
648 __skb_unlink(skb, &instance->sndqueue); 646 __skb_unlink(skb, &instance->sndqueue);
649 usbatm_pop(vcc, skb); 647 usbatm_pop(vcc, skb);
650 } 648 }
649 }
651 spin_unlock_irq(&instance->sndqueue.lock); 650 spin_unlock_irq(&instance->sndqueue.lock);
652 651
653 tasklet_disable(&instance->tx_channel.tasklet); 652 tasklet_disable(&instance->tx_channel.tasklet);
@@ -1189,7 +1188,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
1189 struct urb *urb; 1188 struct urb *urb;
1190 unsigned int iso_packets = usb_pipeisoc(channel->endpoint) ? channel->buf_size / channel->packet_size : 0; 1189 unsigned int iso_packets = usb_pipeisoc(channel->endpoint) ? channel->buf_size / channel->packet_size : 0;
1191 1190
1192 UDSL_ASSERT(!usb_pipeisoc(channel->endpoint) || usb_pipein(channel->endpoint)); 1191 UDSL_ASSERT(instance, !usb_pipeisoc(channel->endpoint) || usb_pipein(channel->endpoint));
1193 1192
1194 urb = usb_alloc_urb(iso_packets, GFP_KERNEL); 1193 urb = usb_alloc_urb(iso_packets, GFP_KERNEL);
1195 if (!urb) { 1194 if (!urb) {
diff --git a/drivers/usb/atm/usbatm.h b/drivers/usb/atm/usbatm.h
index e6887c6cf3cf..f6f4508a9d42 100644
--- a/drivers/usb/atm/usbatm.h
+++ b/drivers/usb/atm/usbatm.h
@@ -40,9 +40,15 @@
40*/ 40*/
41 41
42#ifdef DEBUG 42#ifdef DEBUG
43#define UDSL_ASSERT(x) BUG_ON(!(x)) 43#define UDSL_ASSERT(instance, x) BUG_ON(!(x))
44#else 44#else
45#define UDSL_ASSERT(x) do { if (!(x)) warn("failed assertion '%s' at line %d", __stringify(x), __LINE__); } while(0) 45#define UDSL_ASSERT(instance, x) \
46 do { \
47 if (!(x)) \
48 dev_warn(&(instance)->usb_intf->dev, \
49 "failed assertion '%s' at line %d", \
50 __stringify(x), __LINE__); \
51 } while(0)
46#endif 52#endif
47 53
48#define usb_err(instance, format, arg...) \ 54#define usb_err(instance, format, arg...) \
diff --git a/drivers/usb/atm/xusbatm.c b/drivers/usb/atm/xusbatm.c
index 8472543eee81..17d167bbd2dc 100644
--- a/drivers/usb/atm/xusbatm.c
+++ b/drivers/usb/atm/xusbatm.c
@@ -193,7 +193,7 @@ static int __init xusbatm_init(void)
193 num_vendor != num_product || 193 num_vendor != num_product ||
194 num_vendor != num_rx_endpoint || 194 num_vendor != num_rx_endpoint ||
195 num_vendor != num_tx_endpoint) { 195 num_vendor != num_tx_endpoint) {
196 warn("malformed module parameters"); 196 printk(KERN_WARNING "xusbatm: malformed module parameters\n");
197 return -EINVAL; 197 return -EINVAL;
198 } 198 }
199 199