]> git.hungrycats.org Git - linux/commitdiff
usb_submit_urb() changes for the drivers/usb/*.c drivers.
authorGreg Kroah-Hartman <greg@soap.kroah.net>
Wed, 6 Feb 2002 07:49:08 +0000 (23:49 -0800)
committerGreg Kroah-Hartman <greg@soap.kroah.net>
Wed, 6 Feb 2002 07:49:08 +0000 (23:49 -0800)
Some driver changes were done by Oliver Neukum and David Brownell.

28 files changed:
drivers/usb/CDCEther.c
drivers/usb/acm.c
drivers/usb/audio.c
drivers/usb/auerswald.c
drivers/usb/bluetooth.c
drivers/usb/catc.c
drivers/usb/dabusb.c
drivers/usb/devio.c
drivers/usb/hid-core.c
drivers/usb/hpusbscsi.c
drivers/usb/hub.c
drivers/usb/kaweth.c
drivers/usb/mdc800.c
drivers/usb/microtek.c
drivers/usb/ov511.c
drivers/usb/pegasus.c
drivers/usb/printer.c
drivers/usb/pwc-if.c
drivers/usb/scanner.c
drivers/usb/se401.c
drivers/usb/stv680.c
drivers/usb/usb-skeleton.c
drivers/usb/usbkbd.c
drivers/usb/usbmouse.c
drivers/usb/usbnet.c
drivers/usb/usbvideo.c
drivers/usb/vicam.c
drivers/usb/wacom.c

index defae1cd4a724c67d85814bd6d73f689284a6280..fc360a9c5337f0f17a59a7a29ee0790e38ee8917 100644 (file)
@@ -132,7 +132,7 @@ goon:
                        
        // Give this to the USB subsystem so it can tell us 
        // when more data arrives.
-       if ( (res = usb_submit_urb(ether_dev->rx_urb)) ) {
+       if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) {
                warn( __FUNCTION__ " failed submint rx_urb %d", res);
        }
        
@@ -302,7 +302,7 @@ static int CDCEther_start_xmit( struct sk_buff *skb, struct net_device *net )
        ether_dev->tx_urb->transfer_buffer_length = count;
        
        // Send the URB on its merry way.
-       if ((res = usb_submit_urb(ether_dev->tx_urb)))  {
+       if ((res = usb_submit_urb(ether_dev->tx_urb, GFP_KERNEL)))  {
                // Hmm...  It didn't go. Tell someone...
                warn("failed tx_urb %d", res);
                // update some stats...
@@ -350,7 +350,7 @@ static int CDCEther_open(struct net_device *net)
                        read_bulk_callback, ether_dev );
 
        // Put it out there so the device can send us stuff
-       if ( (res = usb_submit_urb(ether_dev->rx_urb)) )
+       if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) )
        {
                // Hmm...  Okay...
                warn( __FUNCTION__ " failed rx_urb %d", res );
index e8834c190a48b07aab7634f0b5537226cc4f4272..77c42d87f551b73b8c9eb33b6ea1f96c27e2f2e1 100644 (file)
@@ -261,7 +261,7 @@ static void acm_read_bulk(struct urb *urb)
        urb->actual_length = 0;
        urb->dev = acm->dev;
 
-       if (usb_submit_urb(urb))
+       if (usb_submit_urb(urb, GFP_KERNEL))
                dbg("failed resubmitting read urb");
 }
 
@@ -316,11 +316,11 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
         unlock_kernel();
 
        acm->ctrlurb.dev = acm->dev;
-       if (usb_submit_urb(&acm->ctrlurb))
+       if (usb_submit_urb(&acm->ctrlurb, GFP_KERNEL))
                dbg("usb_submit_urb(ctrl irq) failed");
 
        acm->readurb.dev = acm->dev;
-       if (usb_submit_urb(&acm->readurb))
+       if (usb_submit_urb(&acm->readurb, GFP_KERNEL))
                dbg("usb_submit_urb(read bulk) failed");
 
        acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS);
@@ -371,7 +371,7 @@ static int acm_tty_write(struct tty_struct *tty, int from_user, const unsigned c
        acm->writeurb.transfer_buffer_length = count;
        acm->writeurb.dev = acm->dev;
 
-       if (usb_submit_urb(&acm->writeurb))
+       if (usb_submit_urb(&acm->writeurb, GFP_KERNEL))
                dbg("usb_submit_urb(write bulk) failed");
 
        return count;
index a1d11494233ec3edd79c23796c01163c58f31a8d..bad6151b0913170a2e724c3e21640cbc05943408 100644 (file)
@@ -917,7 +917,7 @@ static void usbin_completed(struct urb *urb)
        if (!usbin_retire_desc(u, urb) &&
            u->flags & FLG_RUNNING &&
            !usbin_prepare_desc(u, urb) && 
-           (suret = usb_submit_urb(urb)) == 0) {
+           (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) {
                u->flags |= mask;
        } else {
                u->flags &= ~(mask | FLG_RUNNING);
@@ -982,7 +982,7 @@ static void usbin_sync_completed(struct urb *urb)
        if (!usbin_sync_retire_desc(u, urb) &&
            u->flags & FLG_RUNNING &&
            !usbin_sync_prepare_desc(u, urb) && 
-           (suret = usb_submit_urb(urb)) == 0) {
+           (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) {
                u->flags |= mask;
        } else {
                u->flags &= ~(mask | FLG_RUNNING);
@@ -1055,7 +1055,7 @@ static int usbin_start(struct usb_audiodev *as)
                urb->number_of_packets = DESCFRAMES;
                urb->context = as;
                urb->complete = usbin_completed;
-               if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb))
+               if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                        u->flags |= FLG_URB0RUNNING;
                else
                        u->flags &= ~FLG_RUNNING;
@@ -1068,7 +1068,7 @@ static int usbin_start(struct usb_audiodev *as)
                urb->number_of_packets = DESCFRAMES;
                urb->context = as;
                urb->complete = usbin_completed;
-               if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb))
+               if (!usbin_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                        u->flags |= FLG_URB1RUNNING;
                else
                        u->flags &= ~FLG_RUNNING;
@@ -1083,7 +1083,7 @@ static int usbin_start(struct usb_audiodev *as)
                        urb->context = as;
                        urb->complete = usbin_sync_completed;
                        /* stride: u->syncinterval */
-                       if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb))
+                       if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                                u->flags |= FLG_SYNC0RUNNING;
                        else
                                u->flags &= ~FLG_RUNNING;
@@ -1097,7 +1097,7 @@ static int usbin_start(struct usb_audiodev *as)
                        urb->context = as;
                        urb->complete = usbin_sync_completed;
                        /* stride: u->syncinterval */
-                       if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb))
+                       if (!usbin_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                                u->flags |= FLG_SYNC1RUNNING;
                        else
                                u->flags &= ~FLG_RUNNING;
@@ -1275,7 +1275,7 @@ static void usbout_completed(struct urb *urb)
        if (!usbout_retire_desc(u, urb) &&
            u->flags & FLG_RUNNING &&
            !usbout_prepare_desc(u, urb) && 
-           (suret = usb_submit_urb(urb)) == 0) {
+           (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) {
                u->flags |= mask;
        } else {
                u->flags &= ~(mask | FLG_RUNNING);
@@ -1347,7 +1347,7 @@ static void usbout_sync_completed(struct urb *urb)
        if (!usbout_sync_retire_desc(u, urb) &&
            u->flags & FLG_RUNNING &&
            !usbout_sync_prepare_desc(u, urb) && 
-           (suret = usb_submit_urb(urb)) == 0) {
+           (suret = usb_submit_urb(urb, GFP_KERNEL)) == 0) {
                u->flags |= mask;
        } else {
                u->flags &= ~(mask | FLG_RUNNING);
@@ -1420,7 +1420,7 @@ static int usbout_start(struct usb_audiodev *as)
                urb->number_of_packets = DESCFRAMES;
                urb->context = as;
                urb->complete = usbout_completed;
-               if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb))
+               if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                        u->flags |= FLG_URB0RUNNING;
                else
                        u->flags &= ~FLG_RUNNING;
@@ -1433,7 +1433,7 @@ static int usbout_start(struct usb_audiodev *as)
                urb->number_of_packets = DESCFRAMES;
                urb->context = as;
                urb->complete = usbout_completed;
-               if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb))
+               if (!usbout_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                        u->flags |= FLG_URB1RUNNING;
                else
                        u->flags &= ~FLG_RUNNING;
@@ -1448,7 +1448,7 @@ static int usbout_start(struct usb_audiodev *as)
                        urb->context = as;
                        urb->complete = usbout_sync_completed;
                        /* stride: u->syncinterval */
-                       if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb))
+                       if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                                u->flags |= FLG_SYNC0RUNNING;
                        else
                                u->flags &= ~FLG_RUNNING;
@@ -1462,7 +1462,7 @@ static int usbout_start(struct usb_audiodev *as)
                        urb->context = as;
                        urb->complete = usbout_sync_completed;
                        /* stride: u->syncinterval */
-                       if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb))
+                       if (!usbout_sync_prepare_desc(u, urb) && !usb_submit_urb(urb, GFP_KERNEL))
                                u->flags |= FLG_SYNC1RUNNING;
                        else
                                u->flags &= ~FLG_RUNNING;
index 24490c47d4089a08ef2316efbb80531c97f2790c..a2f02f2adfb439ef08fcdbc4d8f3ddb53d8fc88f 100644 (file)
@@ -330,7 +330,7 @@ static void auerchain_complete (struct urb * urb)
                 urb    = acep->urbp;
                 dbg ("auerchain_complete: submitting next urb from chain");
                urb->status = 0;        /* needed! */
-               result = usb_submit_urb( urb);
+               result = usb_submit_urb(urb, GFP_KERNEL);
 
                 /* check for submit errors */
                 if (result) {
@@ -408,7 +408,7 @@ static int auerchain_submit_urb_list (pauerchain_t acp, struct urb * urb, int ea
         if (acep) {
                 dbg("submitting urb immediate");
                urb->status = 0;        /* needed! */
-                result = usb_submit_urb( urb);
+                result = usb_submit_urb(urb, GFP_KERNEL);
                 /* check for submit errors */
                 if (result) {
                         urb->status = result;
@@ -1128,7 +1128,7 @@ static int auerswald_int_open (pauerswald_t cp)
         FILL_INT_URB (cp->inturbp, cp->usbdev, usb_rcvintpipe (cp->usbdev,AU_IRQENDP), cp->intbufp, irqsize, auerswald_int_complete, cp, ep->bInterval);
         /* start the urb */
        cp->inturbp->status = 0;        /* needed! */
-       ret = usb_submit_urb (cp->inturbp);
+       ret = usb_submit_urb (cp->inturbp, GFP_KERNEL);
 
 intoend:
         if (ret < 0) {
index 9429d75b9300c08199516cdcfb4d2d9e0f699c6d..56268a5e4560c50745404e1e481e707d40c49a41 100644 (file)
@@ -335,7 +335,7 @@ static int bluetooth_ctrl_msg (struct usb_bluetooth *bluetooth, int request, int
                          (unsigned char*)dr, urb->transfer_buffer, len, bluetooth_ctrl_callback, bluetooth);
 
        /* send it down the pipe */
-       status = usb_submit_urb(urb);
+       status = usb_submit_urb(urb, GFP_KERNEL);
        if (status)
                dbg(__FUNCTION__ " - usb_submit_urb(control) failed with status = %d", status);
        
@@ -390,7 +390,7 @@ static int bluetooth_open (struct tty_struct *tty, struct file * filp)
                               bluetooth->bulk_in_buffer,
                               bluetooth->bulk_in_buffer_size,
                               bluetooth_read_bulk_callback, bluetooth);
-               result = usb_submit_urb(bluetooth->read_urb);
+               result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL);
                if (result)
                        dbg(__FUNCTION__ " - usb_submit_urb(read bulk) failed with status %d", result);
 #endif
@@ -400,7 +400,7 @@ static int bluetooth_open (struct tty_struct *tty, struct file * filp)
                              bluetooth->interrupt_in_buffer_size,
                              bluetooth_int_callback, bluetooth,
                              bluetooth->interrupt_in_interval);
-               result = usb_submit_urb(bluetooth->interrupt_in_urb);
+               result = usb_submit_urb(bluetooth->interrupt_in_urb, GFP_KERNEL);
                if (result)
                        dbg(__FUNCTION__ " - usb_submit_urb(interrupt in) failed with status %d", result);
        }
@@ -540,7 +540,7 @@ static int bluetooth_write (struct tty_struct * tty, int from_user, const unsign
                                urb->transfer_flags |= USB_QUEUE_BULK;
 
                                /* send it down the pipe */
-                               retval = usb_submit_urb(urb);
+                               retval = usb_submit_urb(urb, GFP_KERNEL);
                                if (retval) {
                                        dbg(__FUNCTION__ " - usb_submit_urb(write bulk) failed with error = %d", retval);
                                        goto exit;
@@ -730,7 +730,7 @@ void btusb_enable_bulk_read(struct tty_struct *tty){
                              usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress),
                              bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, 
                              bluetooth_read_bulk_callback, bluetooth);
-               result = usb_submit_urb(bluetooth->read_urb);
+               result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL);
                if (result)
                        err (__FUNCTION__ " - failed submitting read urb, error %d", result);
        }
@@ -921,7 +921,7 @@ static void bluetooth_read_bulk_callback (struct urb *urb)
                              usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress),
                              bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, 
                              bluetooth_read_bulk_callback, bluetooth);
-               result = usb_submit_urb(bluetooth->read_urb);
+               result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL);
                if (result)
                        err (__FUNCTION__ " - failed resubmitting read urb, error %d", result);
 
@@ -982,7 +982,7 @@ exit:
                      usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress),
                      bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, 
                      bluetooth_read_bulk_callback, bluetooth);
-       result = usb_submit_urb(bluetooth->read_urb);
+       result = usb_submit_urb(bluetooth->read_urb, GFP_KERNEL);
        if (result)
                err (__FUNCTION__ " - failed resubmitting read urb, error %d", result);
 
index 0667997ff89a08fe28ec1036ce757ae0e519f40b..fdfad40b85f677e9361376d36925e27e594bb140 100644 (file)
@@ -257,7 +257,7 @@ static void catc_irq_done(struct urb *urb)
 
        if ((data[1] & 0x80) && !test_and_set_bit(RX_RUNNING, &catc->flags)) {
                catc->rx_urb->dev = catc->usbdev;
-               if ((status = usb_submit_urb(catc->rx_urb)) < 0) {
+               if ((status = usb_submit_urb(catc->rx_urb, GFP_KERNEL)) < 0) {
                        err("submit(rx_urb) status %d", status);
                        return;
                } 
@@ -286,7 +286,7 @@ static void catc_tx_run(struct catc *catc)
        catc->tx_urb->transfer_buffer = catc->tx_buf[catc->tx_idx];
        catc->tx_urb->dev = catc->usbdev;
 
-       if ((status = usb_submit_urb(catc->tx_urb)) < 0)
+       if ((status = usb_submit_urb(catc->tx_urb, GFP_KERNEL)) < 0)
                err("submit(tx_urb), status %d", status);
 
        catc->tx_idx = !catc->tx_idx;
@@ -402,7 +402,7 @@ static void catc_ctrl_run(struct catc *catc)
        if (!q->dir && q->buf && q->len)
                memcpy(catc->ctrl_buf, q->buf, q->len);
 
-       if ((status = usb_submit_urb(catc->ctrl_urb)))
+       if ((status = usb_submit_urb(catc->ctrl_urb, GFP_KERNEL)))
                err("submit(ctrl_urb) status %d", status);
 }
 
@@ -625,7 +625,7 @@ static int catc_open(struct net_device *netdev)
        int status;
 
        catc->irq_urb->dev = catc->usbdev;
-       if ((status = usb_submit_urb(catc->irq_urb)) < 0) {
+       if ((status = usb_submit_urb(catc->irq_urb, GFP_KERNEL)) < 0) {
                err("submit(irq_urb) status %d", status);
                return -1;
        }
index 40ba92fedcfa7a73948ba91b2331743ab751b6e2..02833f56f92b56442b8e19416d1ecbd09b6a8f7e 100644 (file)
@@ -458,7 +458,7 @@ static int dabusb_startrek (pdabusb_t s)
 
                        end = list_entry (s->rec_buff_list.prev, buff_t, buff_list);
 
-                       ret = usb_submit_urb (end->purb);
+                       ret = usb_submit_urb (end->purb, GFP_KERNEL);
                        if (ret) {
                                err("usb_submit_urb returned:%d", ret);
                                if (dabusb_add_buf_tail (s, &s->free_buff_list, &s->rec_buff_list))
index c7883b37613969a6cbf32d8db78fa904646f87f1..94f7a120104acfef24ed246a394c3ec1c682ba2f 100644 (file)
@@ -364,7 +364,7 @@ static int checkintf(struct dev_state *ps, unsigned int intf)
        if (test_bit(intf, &ps->ifclaimed))
                return 0;
        /* if not yet claimed, claim it for the driver */
-       printk(KERN_WARNING "usbdevfs: process %d (%s) did not claim interface %u before use\n",
+       printk(KERN_WARNING "usbfs: process %d (%s) did not claim interface %u before use\n",
               current->pid, current->comm, intf);
        return claimintf(ps, intf);
 }
@@ -563,7 +563,7 @@ static int proc_control(struct dev_state *ps, void *arg)
        }
        free_page((unsigned long)tbuf);
        if (i<0) {
-               printk(KERN_DEBUG "usbdevfs: USBDEVFS_CONTROL failed dev %d rqt %u rq %u len %u ret %d\n", 
+               printk(KERN_DEBUG "usbfs: USBDEVFS_CONTROL failed dev %d rqt %u rq %u len %u ret %d\n", 
                       dev->devnum, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i);
        }
        return i;
@@ -619,7 +619,7 @@ static int proc_bulk(struct dev_state *ps, void *arg)
        }
        free_page((unsigned long)tbuf);
        if (i < 0) {
-               printk(KERN_WARNING "usbdevfs: USBDEVFS_BULK failed dev %d ep 0x%x len %u ret %d\n", 
+               printk(KERN_WARNING "usbfs: USBDEVFS_BULK failed dev %d ep 0x%x len %u ret %d\n", 
                       dev->devnum, bulk.ep, bulk.len, i);
                return i;
        }
@@ -906,8 +906,8 @@ static int proc_submiturb(struct dev_state *ps, void *arg)
                }
        }
         async_newpending(as);
-        if ((ret = usb_submit_urb(as->urb))) {
-               printk(KERN_DEBUG "usbdevfs: usb_submit_urb returned %d\n", ret);
+        if ((ret = usb_submit_urb(as->urb, GFP_KERNEL))) {
+               printk(KERN_DEBUG "usbfs: usb_submit_urb returned %d\n", ret);
                 async_removepending(as);
                 free_async(as);
                 return ret;
index 1129deb66a2a3e4c7114c92562eb239e63162f2b..f9ebfa1f86875cc6078de132a49f081556ff75a7 100644 (file)
@@ -992,7 +992,7 @@ static int hid_submit_out(struct hid_device *hid)
        hid->urbout.setup_packet = (void *) &(hid->out[hid->outtail].dr);
        hid->urbout.dev = hid->dev;
 
-       if (usb_submit_urb(&hid->urbout)) {
+       if (usb_submit_urb(&hid->urbout, GFP_KERNEL)) {
                err("usb_submit_urb(out) failed");
                return -1;
        }
@@ -1036,7 +1036,7 @@ int hid_open(struct hid_device *hid)
 
        hid->urb.dev = hid->dev;
 
-       if (usb_submit_urb(&hid->urb))
+       if (usb_submit_urb(&hid->urb, GFP_KERNEL))
                return -EIO;
 
        return 0;
index 37cae7f9ce4251b5430a0f58bbdacbabfd4b8613..25007ece348ad507fabbec58fb1d6c1b2624f79c 100644 (file)
@@ -245,7 +245,7 @@ hpusbscsi_scsi_detect (struct SHT *sht)
                        desc->interrupt_interval
        );
 
-       if ( 0  >  usb_submit_urb(desc->controlurb)) {
+       if ( 0  >  usb_submit_urb(desc->controlurb, GFP_KERNEL)) {
                kfree(sht->proc_name);
                return 0;
        }
@@ -321,7 +321,7 @@ static int hpusbscsi_scsi_queuecommand (Scsi_Cmnd *srb, scsi_callback callback)
        hpusbscsi->scallback = callback;
        hpusbscsi->srb = srb;
 
-       res = usb_submit_urb(hpusbscsi->dataurb);
+       res = usb_submit_urb(hpusbscsi->dataurb, GFP_ATOMIC);
        if (unlikely(res)) {
                hpusbscsi->state = HP_STATE_FREE;
                TRACE_STATE;
@@ -460,7 +460,7 @@ static void scatter_gather_callback(struct urb *u)
                 hpusbscsi
         );
 
-        res = usb_submit_urb(u);
+        res = usb_submit_urb(u, GFP_ATOMIC);
         if (unlikely(res))
                 hpusbscsi->state = HP_STATE_ERROR;
        TRACE_STATE;
@@ -509,7 +509,7 @@ static void simple_payload_callback (struct urb *u)
                hpusbscsi
        );
 
-       res = usb_submit_urb(u);
+       res = usb_submit_urb(u, GFP_ATOMIC);
        if (unlikely(res)) {
                 handle_usb_error(hpusbscsi);
                return;
index f741f808a244a7e612d43a0b3485051d88673f52..23eb747a727e6adf493481a17baa704cc7bd6190 100644 (file)
@@ -312,7 +312,7 @@ static int usb_hub_configure(struct usb_hub *hub,
 
        FILL_INT_URB(hub->urb, dev, pipe, hub->buffer, maxp, hub_irq,
                hub, endpoint->bInterval);
-       ret = usb_submit_urb(hub->urb);
+       ret = usb_submit_urb(hub->urb, GFP_KERNEL);
        if (ret) {
                err("usb_submit_urb failed (%d)", ret);
                kfree(hub->descriptor);
@@ -498,7 +498,7 @@ static int usb_hub_reset(struct usb_hub *hub)
                return -1;
 
        hub->urb->dev = dev;                                                    
-       if (usb_submit_urb(hub->urb))
+       if (usb_submit_urb(hub->urb, GFP_KERNEL))
                return -1;
 
        usb_hub_power_on(hub);
index 8d89ba87cf30562ef3a7788a086a131d285a2c5b..65cb2b123841f3026099c07541b70d10b3edcb2d 100644 (file)
@@ -447,7 +447,8 @@ static void kaweth_usb_receive(struct urb *);
 /****************************************************************
  *     kaweth_resubmit_rx_urb
  ****************************************************************/
-static inline void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth)
+static inline void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth,
+                                               int mem_flags)
 {
        int result;
 
@@ -461,7 +462,7 @@ static inline void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth)
                      kaweth_usb_receive,
                      kaweth);
 
-       if((result = usb_submit_urb(kaweth->rx_urb))) {
+       if((result = usb_submit_urb(kaweth->rx_urb, mem_flags))) {
                kaweth_err("resubmitting rx_urb %d failed", result);
        }
 }
@@ -493,7 +494,7 @@ static void kaweth_usb_receive(struct urb *urb)
                           urb->status,
                           count, 
                           (int)pkt_len);
-               kaweth_resubmit_rx_urb(kaweth);
+               kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
                 return;
        }
 
@@ -502,12 +503,12 @@ static void kaweth_usb_receive(struct urb *urb)
                        kaweth_err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count);
                        kaweth_err("Packet len & 2047: %x", pkt_len & 2047);
                        kaweth_err("Count 2: %x", count2);
-                       kaweth_resubmit_rx_urb(kaweth);
+                       kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
                         return;
                 }
                
                if(!(skb = dev_alloc_skb(pkt_len+2))) {
-                       kaweth_resubmit_rx_urb(kaweth);
+                       kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
                         return;
                }
 
@@ -525,7 +526,7 @@ static void kaweth_usb_receive(struct urb *urb)
                kaweth->stats.rx_bytes += pkt_len;
        }
 
-       kaweth_resubmit_rx_urb(kaweth);
+       kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
 }
 
 /****************************************************************
@@ -539,11 +540,11 @@ static int kaweth_open(struct net_device *net)
 
        kaweth_dbg("Opening network device.");
 
-       kaweth_resubmit_rx_urb(kaweth);
+       MOD_INC_USE_COUNT;
 
-       netif_start_queue(net);
+       kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL);
 
-       MOD_INC_USE_COUNT;
+       netif_start_queue(net);
 
        kaweth_async_set_rx_mode(kaweth);
        return 0;
@@ -621,7 +622,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
                      kaweth_usb_transmit_complete,
                      kaweth);
 
-       if((res = usb_submit_urb(kaweth->tx_urb)))
+       if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC)))
        {
                kaweth_warn("kaweth failed tx_urb %d", res);
                kaweth->stats.tx_errors++;
@@ -975,7 +976,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
         set_current_state(TASK_INTERRUPTIBLE);
         add_wait_queue(&awd.wqh, &wait);
         urb->context = &awd;
-        status = usb_submit_urb(urb);
+        status = usb_submit_urb(urb, GFP_KERNEL);
         if (status) {
                 // something went wrong
                 usb_free_urb(urb);
index a6b2e0c549e8bc915dc3c6501122e04b6c49b81a..eb3d1df911cb18d17205597001b12b4612ba9bd3 100644 (file)
@@ -605,7 +605,7 @@ static int mdc800_device_open (struct inode* inode, struct file *file)
 
        retval=0;
        mdc800->irq_urb->dev = mdc800->dev;
-       if (usb_submit_urb (mdc800->irq_urb))
+       if (usb_submit_urb (mdc800->irq_urb, GFP_KERNEL))
        {
                err ("request USB irq fails (submit_retval=%i urb_status=%i).",retval, mdc800->irq_urb->status);
                errn = -EIO;
@@ -694,7 +694,7 @@ static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, lof
 
                                /* Download -> Request new bytes */
                                mdc800->download_urb->dev = mdc800->dev;
-                               if (usb_submit_urb (mdc800->download_urb))
+                               if (usb_submit_urb (mdc800->download_urb, GFP_KERNEL))
                                {
                                        err ("Can't submit download urb (status=%i)",mdc800->download_urb->status);
                                        up (&mdc800->io_lock);
@@ -808,7 +808,7 @@ static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t l
                        mdc800->state=WORKING;
                        memcpy (mdc800->write_urb->transfer_buffer, mdc800->in,8);
                        mdc800->write_urb->dev = mdc800->dev;
-                       if (usb_submit_urb (mdc800->write_urb))
+                       if (usb_submit_urb (mdc800->write_urb, GFP_KERNEL))
                        {
                                err ("submitting write urb fails (status=%i)", mdc800->write_urb->status);
                                up (&mdc800->io_lock);
index 83d325608f57f55908619e9c1ddc1949d5cb7e05..a9f5b704e8fedd0b56b89513c98c80ac1c9b27e5 100644 (file)
@@ -499,7 +499,7 @@ void mts_int_submit_urb (struct urb* transfer,
 
        transfer->status = 0;
 
-       res = usb_submit_urb( transfer );
+       res = usb_submit_urb( transfer, GFP_ATOMIC );
        if ( unlikely(res) ) {
                MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res );
                context->srb->result = DID_ERROR << 16;
@@ -719,7 +719,8 @@ int mts_scsi_queuecommand( Scsi_Cmnd *srb, mts_scsi_cmnd_callback callback )
        mts_build_transfer_context( srb, desc );
        desc->context.final_callback = callback;
        
-       res=usb_submit_urb(desc->urb);
+       /* here we need ATOMIC as we are called with the iolock */
+       res=usb_submit_urb(desc->urb, GFP_ATOMIC);
 
        if(unlikely(res)){
                MTS_ERROR("error %d submitting URB\n",(int)res);
index c84a6691aec80dcbfd691412d98d5bd7c94967a0..3acc6bb62d8e689c12365be97dc0fe1cd840c694 100644 (file)
@@ -4457,7 +4457,7 @@ ov511_init_isoc(struct usb_ov511 *ov511)
 
        for (n = 0; n < OV511_NUMSBUF; n++) {
                ov511->sbuf[n].urb->dev = ov511->dev;
-               err = usb_submit_urb(ov511->sbuf[n].urb);
+               err = usb_submit_urb(ov511->sbuf[n].urb, GFP_KERNEL);
                if (err)
                        err("init isoc: usb_submit_urb(%d) ret %d", n, err);
        }
index 96e28260c8b8cb2c001dea4f17d73a097fba8c4c..02e1a8e84f277609f81c4bec398da1e74bbee428 100644 (file)
@@ -157,7 +157,8 @@ static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data)
        add_wait_queue( &pegasus->ctrl_wait, &wait );
        set_current_state( TASK_UNINTERRUPTIBLE );
 
-       if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) {
+       /* using ATOMIC, we'd never wake up if we slept */
+       if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) {
                err("%s: BAD CTRLs %d", __FUNCTION__, ret);
                goto out;
        }
@@ -207,7 +208,7 @@ static int set_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data)
        add_wait_queue( &pegasus->ctrl_wait, &wait );
        set_current_state( TASK_UNINTERRUPTIBLE );
 
-       if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) {
+       if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) {
                err("%s: BAD CTRL %d", __FUNCTION__, ret);
                goto out;
        }
@@ -257,7 +258,7 @@ static int set_register( pegasus_t *pegasus, __u16 indx, __u8 data )
        add_wait_queue( &pegasus->ctrl_wait, &wait );
        set_current_state( TASK_UNINTERRUPTIBLE );
 
-       if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) {
+       if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) ) {
                err("%s: BAD CTRL %d", __FUNCTION__, ret);
                goto out;
        }
@@ -287,7 +288,7 @@ static int update_eth_regs_async( pegasus_t *pegasus )
                          (char *)&pegasus->dr,
                          pegasus->eth_regs, 3, ctrl_callback, pegasus );
 
-       if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) )
+       if ( (ret = usb_submit_urb( pegasus->ctrl_urb, GFP_ATOMIC )) )
                err("%s: BAD CTRL %d, flgs %x",__FUNCTION__,ret,pegasus->flags);
 
        return  ret;
@@ -573,7 +574,7 @@ goon:
                        usb_rcvbulkpipe(pegasus->usb, 1),
                        pegasus->rx_buff, PEGASUS_MAX_MTU, 
                        read_bulk_callback, pegasus );
-       if ( (res = usb_submit_urb(pegasus->rx_urb)) )
+       if ( (res = usb_submit_urb(pegasus->rx_urb, GFP_ATOMIC)) )
                warn("%s: failed submint rx_urb %d", __FUNCTION__, res);
        pegasus->flags &= ~PEGASUS_RX_BUSY;
 }
@@ -661,7 +662,7 @@ static int pegasus_start_xmit( struct sk_buff *skb, struct net_device *net )
                        pegasus->tx_buff, PEGASUS_MAX_MTU, 
                        write_bulk_callback, pegasus );
        pegasus->tx_urb->transfer_buffer_length = count;
-       if ((res = usb_submit_urb(pegasus->tx_urb))) {
+       if ((res = usb_submit_urb(pegasus->tx_urb, GFP_ATOMIC))) {
                warn("failed tx_urb %d", res);
                pegasus->stats.tx_errors++;
                netif_start_queue( net );
@@ -721,14 +722,14 @@ static int pegasus_open(struct net_device *net)
                        usb_rcvbulkpipe(pegasus->usb, 1),
                        pegasus->rx_buff, PEGASUS_MAX_MTU, 
                        read_bulk_callback, pegasus );
-       if ( (res = usb_submit_urb(pegasus->rx_urb)) )
+       if ( (res = usb_submit_urb(pegasus->rx_urb, GFP_KERNEL)) )
                warn("%s: failed rx_urb %d", __FUNCTION__, res);
 #ifdef PEGASUS_USE_INTR
        FILL_INT_URB( pegasus->intr_urb, pegasus->usb,
                        usb_rcvintpipe(pegasus->usb, 3),
                        pegasus->intr_buff, sizeof(pegasus->intr_buff),
                        intr_callback, pegasus, pegasus->intr_interval );
-       if ( (res = usb_submit_urb(pegasus->intr_urb)) )
+       if ( (res = usb_submit_urb(pegasus->intr_urb, GFP_KERNEL)) )
                warn("%s: failed intr_urb %d", __FUNCTION__, res);
 #endif
        netif_start_queue( net );
index a77f41a109b6f05cc7e59bf956bcf453abaa1fbf..b67fe4805ce3710b9be5e20b0ec506c97e4dcd2e 100644 (file)
@@ -261,7 +261,7 @@ static int usblp_open(struct inode *inode, struct file *file)
        if (usblp->bidir) {
                usblp->readcount = 0;
                usblp->readurb.dev = usblp->dev;
-               if (usb_submit_urb(&usblp->readurb) < 0) {
+               if (usb_submit_urb(&usblp->readurb, GFP_KERNEL) < 0) {
                        retval = -EIO;
                        usblp->used = 0;
                        file->private_data = NULL;
@@ -456,7 +456,7 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count,
 
                usblp->writeurb.dev = usblp->dev;
                usblp->wcomplete = 0;
-               if (usb_submit_urb(&usblp->writeurb)) {
+               if (usb_submit_urb(&usblp->writeurb, GFP_KERNEL)) {
                        count = -EIO;
                        up (&usblp->sem);
                        break;
@@ -521,7 +521,7 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t
                        usblp->minor, usblp->readurb.status);
                usblp->readurb.dev = usblp->dev;
                usblp->readcount = 0;
-               usb_submit_urb(&usblp->readurb);
+               usb_submit_urb(&usblp->readurb, GFP_KERNEL);
                count = -EIO;
                goto done;
        }
@@ -538,7 +538,7 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t
                usblp->readcount = 0;
                usblp->readurb.dev = usblp->dev;
                usblp->rcomplete = 0;
-               if (usb_submit_urb(&usblp->readurb)) {
+               if (usb_submit_urb(&usblp->readurb, GFP_KERNEL)) {
                        count = -EIO;
                        goto done;
                }
index bac4b10b4aa5618da0e731d863587d29546e335b..ba5f74019952187a016a35e9b3e26676198902aa 100644 (file)
@@ -869,7 +869,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
 
        /* link */
        for (i = 0; i < MAX_ISO_BUFS; i++) {
-               ret = usb_submit_urb(pdev->sbuf[i].urb);
+               ret = usb_submit_urb(pdev->sbuf[i].urb, GFP_KERNEL);
                if (ret)
                        Err("isoc_init() submit_urb %d failed with error %d\n", i, ret);
                else
index 8dac42ff26c5551f3ef32b08484eb030417e7e5e..8b262b83c275f09784eb5bba3e488ba592c19097 100644 (file)
@@ -992,7 +992,7 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum,
                             // endpoint[(int)have_intr].bInterval);
                             250);
 
-               if (usb_submit_urb(scn->scn_irq)) {
+               if (usb_submit_urb(scn->scn_irq, GFP_KERNEL)) {
                        err("probe_scanner(%d): Unable to allocate INT URB.", scn_minor);
                        kfree(scn);
                        up(&scn_mutex);
index 7029693e2d73c912da318786af073fb3ffdda71b..8cdd85e0901188a8895c28f1c771760f3c9a3057 100644 (file)
@@ -556,7 +556,7 @@ static void se401_video_irq(struct urb *urb)
        /* Resubmit urb for new data */
        urb->status=0;
        urb->dev=se401->dev;
-       if(usb_submit_urb(urb))
+       if(usb_submit_urb(urb, GFP_KERNEL))
                info("urb burned down");
        return;
 }
@@ -657,7 +657,7 @@ static int se401_start_stream(struct usb_se401 *se401)
 
                se401->urb[i]=urb;
 
-               err=usb_submit_urb(se401->urb[i]);
+               err=usb_submit_urb(se401->urb[i], GFP_KERNEL);
                if(err)
                        err("urb burned down");
        }
@@ -1477,7 +1477,7 @@ static int se401_init(struct usb_se401 *se401)
            se401,
            HZ/10
        );
-       if (usb_submit_urb(se401->inturb)) {
+       if (usb_submit_urb(se401->inturb, GFP_KERNEL)) {
                info("int urb burned down");
                return 1;
        }
index e5f89a3de975a710bacaeee6fa408d65934a5856..442f311397870efe34fbd3a38ce43c463e80ec5d 100644 (file)
@@ -765,7 +765,7 @@ static void stv680_video_irq (struct urb *urb)
        /* Resubmit urb for new data */
        urb->status = 0;
        urb->dev = stv680->udev;
-       if (usb_submit_urb (urb))
+       if (usb_submit_urb (urb, GFP_KERNEL))
                PDEBUG (0, "STV(e): urb burned down in video irq");
        return;
 }                              /*  _video_irq  */
@@ -816,7 +816,7 @@ static int stv680_start_stream (struct usb_stv *stv680)
                urb->timeout = PENCAM_TIMEOUT * 2;
                urb->transfer_flags |= USB_QUEUE_BULK;
                stv680->urb[i] = urb;
-               err = usb_submit_urb (stv680->urb[i]);
+               err = usb_submit_urb (stv680->urb[i], GFP_KERNEL);
                if (err)
                        PDEBUG (0, "STV(e): urb burned down in start stream");
        }                       /* i STV680_NUMSBUF */
index 4abfb6559aa7eaeee40c252a382a1b443fe2042c..247cfc7aa6227ed35cfe4babec764edfc19086c3 100644 (file)
@@ -431,7 +431,9 @@ static ssize_t skel_write (struct file *file, const char *buffer, size_t count,
                      skel_write_bulk_callback, dev);
 
        /* send the data out the bulk port */
-       retval = usb_submit_urb(dev->write_urb);
+       /* a character device write uses GFP_KERNEL,
+        unless a spinlock is held */
+       retval = usb_submit_urb(dev->write_urb, GFP_KERNEL);
        if (retval) {
                err(__FUNCTION__ " - failed submitting write urb, error %d",
                    retval);
index 9d57df368e357c25a1029ea3e06b4ab01e3587e0..156c7878efd0fbfa37c64bcb6328161744be541e 100644 (file)
@@ -129,7 +129,7 @@ int usb_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, i
 
        kbd->leds = kbd->newleds;
        kbd->led->dev = kbd->usbdev;
-       if (usb_submit_urb(kbd->led))
+       if (usb_submit_urb(kbd->led, GFP_KERNEL))
                err("usb_submit_urb(leds) failed");
 
        return 0;
@@ -147,7 +147,7 @@ static void usb_kbd_led(struct urb *urb)
 
        kbd->leds = kbd->newleds;
        kbd->led->dev = kbd->usbdev;
-       if (usb_submit_urb(kbd->led))
+       if (usb_submit_urb(kbd->led, GFP_KERNEL))
                err("usb_submit_urb(leds) failed");
 }
 
@@ -159,7 +159,7 @@ static int usb_kbd_open(struct input_dev *dev)
                return 0;
 
        kbd->irq->dev = kbd->usbdev;
-       if (usb_submit_urb(kbd->irq))
+       if (usb_submit_urb(kbd->irq, GFP_KERNEL))
                return -EIO;
 
        return 0;
index db2e61f8290b4ee972dcdd9a30d0aea604f23b43..9a1994b79197b992c2a4e4fb2544e2a9db19813c 100644 (file)
@@ -85,7 +85,7 @@ static int usb_mouse_open(struct input_dev *dev)
                return 0;
 
        mouse->irq->dev = mouse->usbdev;
-       if (usb_submit_urb(mouse->irq))
+       if (usb_submit_urb(mouse->irq, GFP_KERNEL))
                return -EIO;
 
        return 0;
index 70bcf013f00cefbf28f75fbdee31d6ad98d71c14..772ca2f56df3be2a485b1096588640e31598c198 100644 (file)
@@ -373,7 +373,7 @@ static int gl_interrupt_read (struct usbnet *dev)
        // issue usb interrupt read
        if (priv && priv->irq_urb) {
                // submit urb
-               if ((retval = usb_submit_urb (priv->irq_urb)) != 0)
+               if ((retval = usb_submit_urb (priv->irq_urb, GFP_KERNEL)) != 0)
                        dbg ("gl_interrupt_read: submit fail - %X...", retval);
                else
                        dbg ("gl_interrupt_read: submit success...");
@@ -1281,7 +1281,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, int flags)
        spin_lock_irqsave (&dev->rxq.lock, lockflags);
 
        if (netif_running (&dev->net)) {
-               if ((retval = usb_submit_urb (urb)) != 0) {
+               if ((retval = usb_submit_urb (urb, GFP_ATOMIC)) != 0) {
                        dbg ("%s rx submit, %d", dev->net.name, retval);
                        tasklet_schedule (&dev->bh);
                } else {
@@ -1642,7 +1642,7 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
 #endif /* CONFIG_USB_NET1080 */
 
        netif_stop_queue (net);
-       if ((retval = usb_submit_urb (urb)) != 0) {
+       if ((retval = usb_submit_urb (urb, GFP_ATOMIC)) != 0) {
                netif_start_queue (net);
                dbg ("%s tx: submit urb err %d", net->name, retval);
        } else {
index c5c30d3d1e8d5d335a0bf60579639b3bb39a219b..a7a5fc1052af33e35c6c7069ac1aea0630b12b44 100644 (file)
@@ -1916,7 +1916,7 @@ int usbvideo_StartDataPump(uvd_t *uvd)
 
        /* Submit all URBs */
        for (i=0; i < USBVIDEO_NUMSBUF; i++) {
-               errFlag = usb_submit_urb(uvd->sbuf[i].urb);
+               errFlag = usb_submit_urb(uvd->sbuf[i].urb, GFP_KERNEL);
                if (errFlag)
                        err("%s: usb_submit_isoc(%d) ret %d", proc, i, errFlag);
        }
index d7dc679d5461656727de82be8fd8cadf0bfa21bb..ef02499ae99d8282d135b4774c32c71fdc4b1d42 100644 (file)
@@ -350,7 +350,7 @@ static void params_changed(struct usb_vicam *vicam)
        synchronize(vicam);
        mdelay(10);
        vicam_parameters(vicam);
-       printk("Submiting urb: %d\n", usb_submit_urb(vicam->readurb));
+       printk(KERN_DEBUG "Submiting urb: %d\n", usb_submit_urb(vicam->readurb, GFP_KERNEL));
 #endif
 }
 
@@ -765,7 +765,7 @@ static void vicam_bulk(struct urb *urb)
                memcpy(vicam->fbuf, buf+64, 0x1e480);
 
        if (!change_pending) {
-               if (usb_submit_urb(urb))
+               if (usb_submit_urb(urb, GFP_ATOMIC))
                        dbg("failed resubmitting read urb");
        } else {
                change_pending = 0;
@@ -849,7 +849,7 @@ static int vicam_init(struct usb_vicam *vicam)
 
        FILL_BULK_URB(vicam->readurb, vicam->udev, usb_rcvbulkpipe(vicam->udev, 0x81),
                      buf, 0x1e480, vicam_bulk, vicam);
-       printk("Submiting urb: %d\n", usb_submit_urb(vicam->readurb));
+       printk(KERN_DEBUG "Submiting urb: %d\n", usb_submit_urb(vicam->readurb, GFP_KERNEL));
 
        return 0;
 error:
index 9f3433a8aa64045c734fcdf5db984a7139ca84b8..638804196ff5ecc3433f20a86b531eeb6f4a6e8b 100644 (file)
@@ -336,7 +336,7 @@ static int wacom_open(struct input_dev *dev)
                return 0;
 
        wacom->irq->dev = wacom->usbdev;
-       if (usb_submit_urb(wacom->irq))
+       if (usb_submit_urb(wacom->irq, GFP_KERNEL))
                return -EIO;
 
        return 0;