You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
USB: replace uses of __constant_{endian}
The base versions handle constant folding now. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a78b42824d
commit
551509d267
@@ -901,7 +901,7 @@ static int register_root_hub(struct usb_hcd *hcd)
|
||||
|
||||
mutex_lock(&usb_bus_list_lock);
|
||||
|
||||
usb_dev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64);
|
||||
usb_dev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
|
||||
retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE);
|
||||
if (retval != sizeof usb_dev->descriptor) {
|
||||
mutex_unlock(&usb_bus_list_lock);
|
||||
|
||||
@@ -2471,20 +2471,20 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
|
||||
*/
|
||||
switch (udev->speed) {
|
||||
case USB_SPEED_VARIABLE: /* fixed at 512 */
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(512);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(512);
|
||||
break;
|
||||
case USB_SPEED_HIGH: /* fixed at 64 */
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
|
||||
break;
|
||||
case USB_SPEED_FULL: /* 8, 16, 32, or 64 */
|
||||
/* to determine the ep0 maxpacket size, try to read
|
||||
* the device descriptor to get bMaxPacketSize0 and
|
||||
* then correct our initial guess.
|
||||
*/
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
|
||||
break;
|
||||
case USB_SPEED_LOW: /* fixed at 8 */
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(8);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(8);
|
||||
break;
|
||||
default:
|
||||
goto fail;
|
||||
|
||||
@@ -551,7 +551,7 @@ udc_alloc_request(struct usb_ep *usbep, gfp_t gfp)
|
||||
dma_desc->status = AMD_ADDBITS(dma_desc->status,
|
||||
UDC_DMA_STP_STS_BS_HOST_BUSY,
|
||||
UDC_DMA_STP_STS_BS);
|
||||
dma_desc->bufptr = __constant_cpu_to_le32(DMA_DONT_USE);
|
||||
dma_desc->bufptr = cpu_to_le32(DMA_DONT_USE);
|
||||
req->td_data = dma_desc;
|
||||
req->td_data_last = NULL;
|
||||
req->chain_len = 1;
|
||||
|
||||
@@ -1017,7 +1017,7 @@ static struct usb_endpoint_descriptor usba_ep0_desc = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bEndpointAddress = 0,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_CONTROL,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(64),
|
||||
.wMaxPacketSize = cpu_to_le16(64),
|
||||
/* FIXME: I have no idea what to put here */
|
||||
.bInterval = 1,
|
||||
};
|
||||
@@ -1207,21 +1207,21 @@ static int do_test_mode(struct usba_udc *udc)
|
||||
/* Avoid overly long expressions */
|
||||
static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq)
|
||||
{
|
||||
if (crq->wValue == __constant_cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP))
|
||||
if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq)
|
||||
{
|
||||
if (crq->wValue == __constant_cpu_to_le16(USB_DEVICE_TEST_MODE))
|
||||
if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq)
|
||||
{
|
||||
if (crq->wValue == __constant_cpu_to_le16(USB_ENDPOINT_HALT))
|
||||
if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
status = cpu_to_le16(udc->devstatus);
|
||||
} else if (crq->bRequestType
|
||||
== (USB_DIR_IN | USB_RECIP_INTERFACE)) {
|
||||
status = __constant_cpu_to_le16(0);
|
||||
status = cpu_to_le16(0);
|
||||
} else if (crq->bRequestType
|
||||
== (USB_DIR_IN | USB_RECIP_ENDPOINT)) {
|
||||
struct usba_ep *target;
|
||||
@@ -1250,12 +1250,12 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
|
||||
status = 0;
|
||||
if (is_stalled(udc, target))
|
||||
status |= __constant_cpu_to_le16(1);
|
||||
status |= cpu_to_le16(1);
|
||||
} else
|
||||
goto delegate;
|
||||
|
||||
/* Write directly to the FIFO. No queueing is done. */
|
||||
if (crq->wLength != __constant_cpu_to_le16(sizeof(status)))
|
||||
if (crq->wLength != cpu_to_le16(sizeof(status)))
|
||||
goto stall;
|
||||
ep->state = DATA_STAGE_IN;
|
||||
__raw_writew(status, ep->fifo);
|
||||
@@ -1274,7 +1274,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
} else if (crq->bRequestType == USB_RECIP_ENDPOINT) {
|
||||
struct usba_ep *target;
|
||||
|
||||
if (crq->wLength != __constant_cpu_to_le16(0)
|
||||
if (crq->wLength != cpu_to_le16(0)
|
||||
|| !feature_is_ep_halt(crq))
|
||||
goto stall;
|
||||
target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex));
|
||||
@@ -1308,7 +1308,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
} else if (crq->bRequestType == USB_RECIP_ENDPOINT) {
|
||||
struct usba_ep *target;
|
||||
|
||||
if (crq->wLength != __constant_cpu_to_le16(0)
|
||||
if (crq->wLength != cpu_to_le16(0)
|
||||
|| !feature_is_ep_halt(crq))
|
||||
goto stall;
|
||||
|
||||
@@ -1514,7 +1514,7 @@ restart:
|
||||
*/
|
||||
ep->state = DATA_STAGE_IN;
|
||||
} else {
|
||||
if (crq.crq.wLength != __constant_cpu_to_le16(0))
|
||||
if (crq.crq.wLength != cpu_to_le16(0))
|
||||
ep->state = DATA_STAGE_OUT;
|
||||
else
|
||||
ep->state = STATUS_STAGE_IN;
|
||||
|
||||
@@ -66,7 +66,7 @@ static struct usb_device_descriptor device_desc = {
|
||||
.bLength = sizeof device_desc,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
|
||||
.bcdUSB = __constant_cpu_to_le16(0x0200),
|
||||
.bcdUSB = cpu_to_le16(0x0200),
|
||||
|
||||
.bDeviceClass = USB_CLASS_COMM,
|
||||
.bDeviceSubClass = 0,
|
||||
@@ -74,8 +74,8 @@ static struct usb_device_descriptor device_desc = {
|
||||
/* .bMaxPacketSize0 = f(hardware) */
|
||||
|
||||
/* Vendor and product id can be overridden by module parameters. */
|
||||
.idVendor = __constant_cpu_to_le16(CDC_VENDOR_NUM),
|
||||
.idProduct = __constant_cpu_to_le16(CDC_PRODUCT_NUM),
|
||||
.idVendor = cpu_to_le16(CDC_VENDOR_NUM),
|
||||
.idProduct = cpu_to_le16(CDC_PRODUCT_NUM),
|
||||
/* .bcdDevice = f(hardware) */
|
||||
/* .iManufacturer = DYNAMIC */
|
||||
/* .iProduct = DYNAMIC */
|
||||
@@ -193,7 +193,7 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
|
||||
gadget->name,
|
||||
cdc_config_driver.label);
|
||||
device_desc.bcdDevice =
|
||||
__constant_cpu_to_le16(0x0300 | 0x0099);
|
||||
cpu_to_le16(0x0300 | 0x0099);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1626,7 +1626,7 @@ static int dummy_hub_control (
|
||||
hub_descriptor ((struct usb_hub_descriptor *) buf);
|
||||
break;
|
||||
case GetHubStatus:
|
||||
*(__le32 *) buf = __constant_cpu_to_le32 (0);
|
||||
*(__le32 *) buf = cpu_to_le32 (0);
|
||||
break;
|
||||
case GetPortStatus:
|
||||
if (wIndex != 1)
|
||||
|
||||
@@ -148,7 +148,7 @@ ep_matches (
|
||||
return 0;
|
||||
|
||||
/* BOTH: "high bandwidth" works only at high speed */
|
||||
if ((desc->wMaxPacketSize & __constant_cpu_to_le16(3<<11))) {
|
||||
if ((desc->wMaxPacketSize & cpu_to_le16(3<<11))) {
|
||||
if (!gadget->is_dualspeed)
|
||||
return 0;
|
||||
/* configure your hardware with enough buffering!! */
|
||||
|
||||
@@ -156,7 +156,7 @@ static struct usb_device_descriptor device_desc = {
|
||||
.bLength = sizeof device_desc,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
|
||||
.bcdUSB = __constant_cpu_to_le16 (0x0200),
|
||||
.bcdUSB = cpu_to_le16 (0x0200),
|
||||
|
||||
.bDeviceClass = USB_CLASS_COMM,
|
||||
.bDeviceSubClass = 0,
|
||||
@@ -167,8 +167,8 @@ static struct usb_device_descriptor device_desc = {
|
||||
* we support. (As does bNumConfigurations.) These values can
|
||||
* also be overridden by module parameters.
|
||||
*/
|
||||
.idVendor = __constant_cpu_to_le16 (CDC_VENDOR_NUM),
|
||||
.idProduct = __constant_cpu_to_le16 (CDC_PRODUCT_NUM),
|
||||
.idVendor = cpu_to_le16 (CDC_VENDOR_NUM),
|
||||
.idProduct = cpu_to_le16 (CDC_PRODUCT_NUM),
|
||||
/* .bcdDevice = f(hardware) */
|
||||
/* .iManufacturer = DYNAMIC */
|
||||
/* .iProduct = DYNAMIC */
|
||||
@@ -318,7 +318,7 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
|
||||
gadget->name,
|
||||
eth_config_driver.label);
|
||||
device_desc.bcdDevice =
|
||||
__constant_cpu_to_le16(0x0300 | 0x0099);
|
||||
cpu_to_le16(0x0300 | 0x0099);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ static struct usb_cdc_header_desc acm_header_desc __initdata = {
|
||||
.bLength = sizeof(acm_header_desc),
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
|
||||
.bcdCDC = __constant_cpu_to_le16(0x0110),
|
||||
.bcdCDC = cpu_to_le16(0x0110),
|
||||
};
|
||||
|
||||
static struct usb_cdc_call_mgmt_descriptor
|
||||
@@ -159,7 +159,7 @@ static struct usb_endpoint_descriptor acm_fs_notify_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(GS_NOTIFY_MAXPACKET),
|
||||
.wMaxPacketSize = cpu_to_le16(GS_NOTIFY_MAXPACKET),
|
||||
.bInterval = 1 << GS_LOG2_NOTIFY_INTERVAL,
|
||||
};
|
||||
|
||||
@@ -197,7 +197,7 @@ static struct usb_endpoint_descriptor acm_hs_notify_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(GS_NOTIFY_MAXPACKET),
|
||||
.wMaxPacketSize = cpu_to_le16(GS_NOTIFY_MAXPACKET),
|
||||
.bInterval = GS_LOG2_NOTIFY_INTERVAL+4,
|
||||
};
|
||||
|
||||
@@ -205,14 +205,14 @@ static struct usb_endpoint_descriptor acm_hs_in_desc __initdata = {
|
||||
.bLength = USB_DT_ENDPOINT_SIZE,
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor acm_hs_out_desc __initdata = {
|
||||
.bLength = USB_DT_ENDPOINT_SIZE,
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *acm_hs_function[] __initdata = {
|
||||
|
||||
@@ -130,7 +130,7 @@ static struct usb_cdc_header_desc ecm_header_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
|
||||
|
||||
.bcdCDC = __constant_cpu_to_le16(0x0110),
|
||||
.bcdCDC = cpu_to_le16(0x0110),
|
||||
};
|
||||
|
||||
static struct usb_cdc_union_desc ecm_union_desc __initdata = {
|
||||
@@ -148,9 +148,9 @@ static struct usb_cdc_ether_desc ecm_desc __initdata = {
|
||||
|
||||
/* this descriptor actually adds value, surprise! */
|
||||
/* .iMACAddress = DYNAMIC */
|
||||
.bmEthernetStatistics = __constant_cpu_to_le32(0), /* no statistics */
|
||||
.wMaxSegmentSize = __constant_cpu_to_le16(ETH_FRAME_LEN),
|
||||
.wNumberMCFilters = __constant_cpu_to_le16(0),
|
||||
.bmEthernetStatistics = cpu_to_le32(0), /* no statistics */
|
||||
.wMaxSegmentSize = cpu_to_le16(ETH_FRAME_LEN),
|
||||
.wNumberMCFilters = cpu_to_le16(0),
|
||||
.bNumberPowerFilters = 0,
|
||||
};
|
||||
|
||||
@@ -192,7 +192,7 @@ static struct usb_endpoint_descriptor fs_ecm_notify_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(ECM_STATUS_BYTECOUNT),
|
||||
.wMaxPacketSize = cpu_to_le16(ECM_STATUS_BYTECOUNT),
|
||||
.bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC,
|
||||
};
|
||||
|
||||
@@ -236,7 +236,7 @@ static struct usb_endpoint_descriptor hs_ecm_notify_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(ECM_STATUS_BYTECOUNT),
|
||||
.wMaxPacketSize = cpu_to_le16(ECM_STATUS_BYTECOUNT),
|
||||
.bInterval = LOG2_STATUS_INTERVAL_MSEC + 4,
|
||||
};
|
||||
static struct usb_endpoint_descriptor hs_ecm_in_desc __initdata = {
|
||||
@@ -245,7 +245,7 @@ static struct usb_endpoint_descriptor hs_ecm_in_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor hs_ecm_out_desc __initdata = {
|
||||
@@ -254,7 +254,7 @@ static struct usb_endpoint_descriptor hs_ecm_out_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_OUT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *ecm_hs_function[] __initdata = {
|
||||
|
||||
@@ -100,7 +100,7 @@ static struct usb_endpoint_descriptor hs_loop_source_desc = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor hs_loop_sink_desc = {
|
||||
@@ -108,7 +108,7 @@ static struct usb_endpoint_descriptor hs_loop_sink_desc = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *hs_loopback_descs[] = {
|
||||
|
||||
@@ -123,7 +123,7 @@ static struct usb_cdc_header_desc obex_cdc_header_desc __initdata = {
|
||||
.bLength = sizeof(obex_cdc_header_desc),
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
|
||||
.bcdCDC = __constant_cpu_to_le16(0x0120),
|
||||
.bcdCDC = cpu_to_le16(0x0120),
|
||||
};
|
||||
|
||||
static struct usb_cdc_union_desc obex_cdc_union_desc __initdata = {
|
||||
@@ -138,7 +138,7 @@ static struct usb_cdc_obex_desc obex_desc __initdata = {
|
||||
.bLength = sizeof(obex_desc),
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_OBEX_TYPE,
|
||||
.bcdVersion = __constant_cpu_to_le16(0x0100),
|
||||
.bcdVersion = cpu_to_le16(0x0100),
|
||||
};
|
||||
|
||||
/* High-Speed Support */
|
||||
@@ -149,7 +149,7 @@ static struct usb_endpoint_descriptor obex_hs_ep_out_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_OUT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor obex_hs_ep_in_desc __initdata = {
|
||||
@@ -158,7 +158,7 @@ static struct usb_endpoint_descriptor obex_hs_ep_in_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *hs_function[] __initdata = {
|
||||
|
||||
@@ -79,7 +79,7 @@ pn_header_desc = {
|
||||
.bLength = sizeof pn_header_desc,
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
|
||||
.bcdCDC = __constant_cpu_to_le16(0x0110),
|
||||
.bcdCDC = cpu_to_le16(0x0110),
|
||||
};
|
||||
|
||||
static const struct usb_cdc_header_desc
|
||||
@@ -87,7 +87,7 @@ pn_phonet_desc = {
|
||||
.bLength = sizeof pn_phonet_desc,
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_PHONET_TYPE,
|
||||
.bcdCDC = __constant_cpu_to_le16(0x1505), /* ??? */
|
||||
.bcdCDC = cpu_to_le16(0x1505), /* ??? */
|
||||
};
|
||||
|
||||
static struct usb_cdc_union_desc
|
||||
@@ -138,7 +138,7 @@ pn_hs_sink_desc = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_OUT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor
|
||||
@@ -157,7 +157,7 @@ pn_hs_source_desc = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *fs_pn_function[] = {
|
||||
|
||||
@@ -137,7 +137,7 @@ static struct usb_cdc_header_desc header_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
|
||||
|
||||
.bcdCDC = __constant_cpu_to_le16(0x0110),
|
||||
.bcdCDC = cpu_to_le16(0x0110),
|
||||
};
|
||||
|
||||
static struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor __initdata = {
|
||||
@@ -187,7 +187,7 @@ static struct usb_endpoint_descriptor fs_notify_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(STATUS_BYTECOUNT),
|
||||
.wMaxPacketSize = cpu_to_le16(STATUS_BYTECOUNT),
|
||||
.bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC,
|
||||
};
|
||||
|
||||
@@ -230,7 +230,7 @@ static struct usb_endpoint_descriptor hs_notify_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(STATUS_BYTECOUNT),
|
||||
.wMaxPacketSize = cpu_to_le16(STATUS_BYTECOUNT),
|
||||
.bInterval = LOG2_STATUS_INTERVAL_MSEC + 4,
|
||||
};
|
||||
static struct usb_endpoint_descriptor hs_in_desc __initdata = {
|
||||
@@ -239,7 +239,7 @@ static struct usb_endpoint_descriptor hs_in_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor hs_out_desc __initdata = {
|
||||
@@ -248,7 +248,7 @@ static struct usb_endpoint_descriptor hs_out_desc __initdata = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_OUT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *eth_hs_function[] __initdata = {
|
||||
|
||||
@@ -89,14 +89,14 @@ static struct usb_endpoint_descriptor gser_hs_in_desc __initdata = {
|
||||
.bLength = USB_DT_ENDPOINT_SIZE,
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor gser_hs_out_desc __initdata = {
|
||||
.bLength = USB_DT_ENDPOINT_SIZE,
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *gser_hs_function[] __initdata = {
|
||||
|
||||
@@ -118,7 +118,7 @@ static struct usb_endpoint_descriptor hs_source_desc = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor hs_sink_desc = {
|
||||
@@ -126,7 +126,7 @@ static struct usb_endpoint_descriptor hs_sink_desc = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *hs_source_sink_descs[] = {
|
||||
|
||||
@@ -108,7 +108,7 @@ static struct usb_cdc_header_desc mdlm_header_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
|
||||
|
||||
.bcdCDC = __constant_cpu_to_le16(0x0110),
|
||||
.bcdCDC = cpu_to_le16(0x0110),
|
||||
};
|
||||
|
||||
static struct usb_cdc_mdlm_desc mdlm_desc __initdata = {
|
||||
@@ -116,7 +116,7 @@ static struct usb_cdc_mdlm_desc mdlm_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubType = USB_CDC_MDLM_TYPE,
|
||||
|
||||
.bcdVersion = __constant_cpu_to_le16(0x0100),
|
||||
.bcdVersion = cpu_to_le16(0x0100),
|
||||
.bGUID = {
|
||||
0x5d, 0x34, 0xcf, 0x66, 0x11, 0x18, 0x11, 0xd6,
|
||||
0xa2, 0x1a, 0x00, 0x01, 0x02, 0xca, 0x9a, 0x7f,
|
||||
@@ -144,9 +144,9 @@ static struct usb_cdc_ether_desc ether_desc __initdata = {
|
||||
|
||||
/* this descriptor actually adds value, surprise! */
|
||||
/* .iMACAddress = DYNAMIC */
|
||||
.bmEthernetStatistics = __constant_cpu_to_le32(0), /* no statistics */
|
||||
.wMaxSegmentSize = __constant_cpu_to_le16(ETH_FRAME_LEN),
|
||||
.wNumberMCFilters = __constant_cpu_to_le16(0),
|
||||
.bmEthernetStatistics = cpu_to_le32(0), /* no statistics */
|
||||
.wMaxSegmentSize = cpu_to_le16(ETH_FRAME_LEN),
|
||||
.wNumberMCFilters = cpu_to_le16(0),
|
||||
.bNumberPowerFilters = 0,
|
||||
};
|
||||
|
||||
@@ -186,7 +186,7 @@ static struct usb_endpoint_descriptor hs_subset_in_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor hs_subset_out_desc __initdata = {
|
||||
@@ -194,7 +194,7 @@ static struct usb_endpoint_descriptor hs_subset_out_desc __initdata = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_descriptor_header *hs_eth_function[] __initdata = {
|
||||
|
||||
@@ -847,13 +847,13 @@ device_desc = {
|
||||
.bLength = sizeof device_desc,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
|
||||
.bcdUSB = __constant_cpu_to_le16(0x0200),
|
||||
.bcdUSB = cpu_to_le16(0x0200),
|
||||
.bDeviceClass = USB_CLASS_PER_INTERFACE,
|
||||
|
||||
/* The next three values can be overridden by module parameters */
|
||||
.idVendor = __constant_cpu_to_le16(DRIVER_VENDOR_ID),
|
||||
.idProduct = __constant_cpu_to_le16(DRIVER_PRODUCT_ID),
|
||||
.bcdDevice = __constant_cpu_to_le16(0xffff),
|
||||
.idVendor = cpu_to_le16(DRIVER_VENDOR_ID),
|
||||
.idProduct = cpu_to_le16(DRIVER_PRODUCT_ID),
|
||||
.bcdDevice = cpu_to_le16(0xffff),
|
||||
|
||||
.iManufacturer = STRING_MANUFACTURER,
|
||||
.iProduct = STRING_PRODUCT,
|
||||
@@ -926,7 +926,7 @@ fs_intr_in_desc = {
|
||||
|
||||
.bEndpointAddress = USB_DIR_IN,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(2),
|
||||
.wMaxPacketSize = cpu_to_le16(2),
|
||||
.bInterval = 32, // frames -> 32 ms
|
||||
};
|
||||
|
||||
@@ -954,7 +954,7 @@ dev_qualifier = {
|
||||
.bLength = sizeof dev_qualifier,
|
||||
.bDescriptorType = USB_DT_DEVICE_QUALIFIER,
|
||||
|
||||
.bcdUSB = __constant_cpu_to_le16(0x0200),
|
||||
.bcdUSB = cpu_to_le16(0x0200),
|
||||
.bDeviceClass = USB_CLASS_PER_INTERFACE,
|
||||
|
||||
.bNumConfigurations = 1,
|
||||
@@ -967,7 +967,7 @@ hs_bulk_in_desc = {
|
||||
|
||||
/* bEndpointAddress copied from fs_bulk_in_desc during fsg_bind() */
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
};
|
||||
|
||||
static struct usb_endpoint_descriptor
|
||||
@@ -977,7 +977,7 @@ hs_bulk_out_desc = {
|
||||
|
||||
/* bEndpointAddress copied from fs_bulk_out_desc during fsg_bind() */
|
||||
.bmAttributes = USB_ENDPOINT_XFER_BULK,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(512),
|
||||
.wMaxPacketSize = cpu_to_le16(512),
|
||||
.bInterval = 1, // NAK every 1 uframe
|
||||
};
|
||||
|
||||
@@ -988,7 +988,7 @@ hs_intr_in_desc = {
|
||||
|
||||
/* bEndpointAddress copied from fs_intr_in_desc during fsg_bind() */
|
||||
.bmAttributes = USB_ENDPOINT_XFER_INT,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(2),
|
||||
.wMaxPacketSize = cpu_to_le16(2),
|
||||
.bInterval = 9, // 2**(9-1) = 256 uframes -> 32 ms
|
||||
};
|
||||
|
||||
@@ -2646,7 +2646,7 @@ static int send_status(struct fsg_dev *fsg)
|
||||
struct bulk_cs_wrap *csw = bh->buf;
|
||||
|
||||
/* Store and send the Bulk-only CSW */
|
||||
csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
|
||||
csw->Signature = cpu_to_le32(USB_BULK_CS_SIG);
|
||||
csw->Tag = fsg->tag;
|
||||
csw->Residue = cpu_to_le32(fsg->residue);
|
||||
csw->Status = status;
|
||||
@@ -3089,7 +3089,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
|
||||
|
||||
/* Is the CBW valid? */
|
||||
if (req->actual != USB_BULK_CB_WRAP_LEN ||
|
||||
cbw->Signature != __constant_cpu_to_le32(
|
||||
cbw->Signature != cpu_to_le32(
|
||||
USB_BULK_CB_SIG)) {
|
||||
DBG(fsg, "invalid CBW: len %u sig 0x%x\n",
|
||||
req->actual,
|
||||
|
||||
@@ -199,10 +199,10 @@ DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(1);
|
||||
static struct usb_device_descriptor device_desc = {
|
||||
.bLength = USB_DT_DEVICE_SIZE,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
.bcdUSB = __constant_cpu_to_le16(0x0200),
|
||||
.bcdUSB = cpu_to_le16(0x0200),
|
||||
.bDeviceClass = USB_CLASS_PER_INTERFACE,
|
||||
.idVendor = __constant_cpu_to_le16(DRIVER_VENDOR_NUM),
|
||||
.idProduct = __constant_cpu_to_le16(DRIVER_PRODUCT_NUM),
|
||||
.idVendor = cpu_to_le16(DRIVER_VENDOR_NUM),
|
||||
.idProduct = cpu_to_le16(DRIVER_PRODUCT_NUM),
|
||||
.iManufacturer = STRING_MANUFACTURER,
|
||||
.iProduct = STRING_PRODUCT,
|
||||
.bNumConfigurations = 1,
|
||||
@@ -241,8 +241,8 @@ static const struct usb_ac_header_descriptor_1 ac_header_desc = {
|
||||
.bLength = USB_DT_AC_HEADER_SIZE(1),
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubtype = USB_MS_HEADER,
|
||||
.bcdADC = __constant_cpu_to_le16(0x0100),
|
||||
.wTotalLength = __constant_cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)),
|
||||
.bcdADC = cpu_to_le16(0x0100),
|
||||
.wTotalLength = cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)),
|
||||
.bInCollection = 1,
|
||||
.baInterfaceNr = {
|
||||
[0] = GMIDI_MS_INTERFACE,
|
||||
@@ -265,8 +265,8 @@ static const struct usb_ms_header_descriptor ms_header_desc = {
|
||||
.bLength = USB_DT_MS_HEADER_SIZE,
|
||||
.bDescriptorType = USB_DT_CS_INTERFACE,
|
||||
.bDescriptorSubtype = USB_MS_HEADER,
|
||||
.bcdMSC = __constant_cpu_to_le16(0x0100),
|
||||
.wTotalLength = __constant_cpu_to_le16(USB_DT_MS_HEADER_SIZE
|
||||
.bcdMSC = cpu_to_le16(0x0100),
|
||||
.wTotalLength = cpu_to_le16(USB_DT_MS_HEADER_SIZE
|
||||
+ 2*USB_DT_MIDI_IN_SIZE
|
||||
+ 2*USB_DT_MIDI_OUT_SIZE(1)),
|
||||
};
|
||||
@@ -1227,7 +1227,7 @@ autoconf_fail:
|
||||
*/
|
||||
pr_warning("%s: controller '%s' not recognized\n",
|
||||
shortname, gadget->name);
|
||||
device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
|
||||
device_desc.bcdDevice = cpu_to_le16(0x9999);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1472,7 +1472,7 @@ static void ep0_setup(struct goku_udc *dev)
|
||||
/* active endpoint */
|
||||
if (tmp > 3 || (!dev->ep[tmp].desc && tmp != 0))
|
||||
goto stall;
|
||||
if (ctrl.wIndex & __constant_cpu_to_le16(
|
||||
if (ctrl.wIndex & cpu_to_le16(
|
||||
USB_DIR_IN)) {
|
||||
if (!dev->ep[tmp].is_in)
|
||||
goto stall;
|
||||
@@ -1480,7 +1480,7 @@ static void ep0_setup(struct goku_udc *dev)
|
||||
if (dev->ep[tmp].is_in)
|
||||
goto stall;
|
||||
}
|
||||
if (ctrl.wValue != __constant_cpu_to_le16(
|
||||
if (ctrl.wValue != cpu_to_le16(
|
||||
USB_ENDPOINT_HALT))
|
||||
goto stall;
|
||||
if (tmp)
|
||||
@@ -1493,7 +1493,7 @@ succeed:
|
||||
return;
|
||||
case USB_RECIP_DEVICE:
|
||||
/* device remote wakeup: always clear */
|
||||
if (ctrl.wValue != __constant_cpu_to_le16(1))
|
||||
if (ctrl.wValue != cpu_to_le16(1))
|
||||
goto stall;
|
||||
VDBG(dev, "clear dev remote wakeup\n");
|
||||
goto succeed;
|
||||
@@ -1519,7 +1519,7 @@ succeed:
|
||||
dev->req_config = (ctrl.bRequest == USB_REQ_SET_CONFIGURATION
|
||||
&& ctrl.bRequestType == USB_RECIP_DEVICE);
|
||||
if (unlikely(dev->req_config))
|
||||
dev->configured = (ctrl.wValue != __constant_cpu_to_le16(0));
|
||||
dev->configured = (ctrl.wValue != cpu_to_le16(0));
|
||||
|
||||
/* delegate everything to the gadget driver.
|
||||
* it may respond after this irq handler returns.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user