~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to drivers/usb/gadget/goku_udc.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
                return -EINVAL;
111
111
        if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)
112
112
                return -ESHUTDOWN;
113
 
        if (ep->num != (desc->bEndpointAddress & 0x0f))
 
113
        if (ep->num != usb_endpoint_num(desc))
114
114
                return -EINVAL;
115
115
 
116
 
        switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
 
116
        switch (usb_endpoint_type(desc)) {
117
117
        case USB_ENDPOINT_XFER_BULK:
118
118
        case USB_ENDPOINT_XFER_INT:
119
119
                break;
142
142
        /* ep1/ep2 dma direction is chosen early; it works in the other
143
143
         * direction, with pio.  be cautious with out-dma.
144
144
         */
145
 
        ep->is_in = (USB_DIR_IN & desc->bEndpointAddress) != 0;
 
145
        ep->is_in = usb_endpoint_dir_in(desc);
146
146
        if (ep->is_in) {
147
147
                mode |= 1;
148
148
                ep->dma = (use_dma != 0) && (ep->num == UDC_MSTRD_ENDPOINT);
1472
1472
                                /* active endpoint */
1473
1473
                                if (tmp > 3 || (!dev->ep[tmp].desc && tmp != 0))
1474
1474
                                        goto stall;
1475
 
                                if (ctrl.wIndex & __constant_cpu_to_le16(
 
1475
                                if (ctrl.wIndex & cpu_to_le16(
1476
1476
                                                USB_DIR_IN)) {
1477
1477
                                        if (!dev->ep[tmp].is_in)
1478
1478
                                                goto stall;
1480
1480
                                        if (dev->ep[tmp].is_in)
1481
1481
                                                goto stall;
1482
1482
                                }
1483
 
                                if (ctrl.wValue != __constant_cpu_to_le16(
 
1483
                                if (ctrl.wValue != cpu_to_le16(
1484
1484
                                                USB_ENDPOINT_HALT))
1485
1485
                                        goto stall;
1486
1486
                                if (tmp)
1493
1493
                                return;
1494
1494
                        case USB_RECIP_DEVICE:
1495
1495
                                /* device remote wakeup: always clear */
1496
 
                                if (ctrl.wValue != __constant_cpu_to_le16(1))
 
1496
                                if (ctrl.wValue != cpu_to_le16(1))
1497
1497
                                        goto stall;
1498
1498
                                VDBG(dev, "clear dev remote wakeup\n");
1499
1499
                                goto succeed;
1519
1519
        dev->req_config = (ctrl.bRequest == USB_REQ_SET_CONFIGURATION
1520
1520
                                && ctrl.bRequestType == USB_RECIP_DEVICE);
1521
1521
        if (unlikely(dev->req_config))
1522
 
                dev->configured = (ctrl.wValue != __constant_cpu_to_le16(0));
 
1522
                dev->configured = (ctrl.wValue != cpu_to_le16(0));
1523
1523
 
1524
1524
        /* delegate everything to the gadget driver.
1525
1525
         * it may respond after this irq handler returns.