{
u8 recipient;
u16 selector;
+ u16 wIndex;
u32 test_mode;
struct usb_ctrlrequest *p_ctrl;
struct nbu2ss_udc *udc;
/*-------------------------------------------------*/
/* SET_FEATURE */
recipient = (u8)(p_ctrl->bRequestType & USB_RECIP_MASK);
- selector = p_ctrl->wValue;
+ selector = le16_to_cpu(p_ctrl->wValue);
if ((recipient == USB_RECIP_DEVICE) &&
(selector == USB_DEVICE_TEST_MODE)) {
- test_mode = (u32)(p_ctrl->wIndex >> 8);
+ wIndex = le16_to_cpu(p_ctrl->wIndex);
+ test_mode = (u32)(wIndex >> 8);
_nbu2ss_set_test_mode(udc, test_mode);
}
}
{
u8 recipient = (u8)(udc->ctrl.bRequestType & USB_RECIP_MASK);
u8 direction = (u8)(udc->ctrl.bRequestType & USB_DIR_IN);
- u16 selector = udc->ctrl.wValue;
- u16 wIndex = udc->ctrl.wIndex;
+ u16 selector = le16_to_cpu(udc->ctrl.wValue);
+ u16 wIndex = le16_to_cpu(udc->ctrl.wIndex);
u8 ep_adrs;
int result = -EOPNOTSUPP;
if ((udc->ctrl.wValue != 0x0000) || (direction != USB_DIR_IN))
return result;
- length = min_t(u16, udc->ctrl.wLength, sizeof(status_data));
-
+ length =
+ min_t(u16, le16_to_cpu(udc->ctrl.wLength), sizeof(status_data));
switch (recipient) {
case USB_RECIP_DEVICE:
if (udc->ctrl.wIndex == 0x0000) {
break;
case USB_RECIP_ENDPOINT:
- if (0x0000 == (udc->ctrl.wIndex & 0xFF70)) {
- ep_adrs = (u8)(udc->ctrl.wIndex & 0xFF);
+ if (0x0000 == (le16_to_cpu(udc->ctrl.wIndex) & 0xFF70)) {
+ ep_adrs = (u8)(le16_to_cpu(udc->ctrl.wIndex) & 0xFF);
result = _nbu2ss_get_ep_stall(udc, ep_adrs);
if (result > 0)
static int std_req_set_address(struct nbu2ss_udc *udc)
{
int result = 0;
- u32 wValue = udc->ctrl.wValue;
+ u32 wValue = le16_to_cpu(udc->ctrl.wValue);
if ((udc->ctrl.bRequestType != 0x00) ||
(udc->ctrl.wIndex != 0x0000) ||
/*-------------------------------------------------------------------------*/
static int std_req_set_configuration(struct nbu2ss_udc *udc)
{
- u32 config_value = (u32)(udc->ctrl.wValue & 0x00ff);
+ u32 config_value = (u32)(le16_to_cpu(udc->ctrl.wValue) & 0x00ff);
if ((udc->ctrl.wIndex != 0x0000) ||
(udc->ctrl.wLength != 0x0000) ||