@@ -1615,13 +1615,13 @@ static void xudc_getstatus(struct xusb_udc *udc)
16151615 case USB_RECIP_INTERFACE :
16161616 break ;
16171617 case USB_RECIP_ENDPOINT :
1618- epnum = udc -> setup .wIndex & USB_ENDPOINT_NUMBER_MASK ;
1618+ epnum = le16_to_cpu ( udc -> setup .wIndex ) & USB_ENDPOINT_NUMBER_MASK ;
16191619 if (epnum >= XUSB_MAX_ENDPOINTS )
16201620 goto stall ;
16211621 target_ep = & udc -> ep [epnum ];
16221622 epcfgreg = udc -> read_fn (udc -> addr + target_ep -> offset );
16231623 halt = epcfgreg & XUSB_EP_CFG_STALL_MASK ;
1624- if (udc -> setup .wIndex & USB_DIR_IN ) {
1624+ if (le16_to_cpu ( udc -> setup .wIndex ) & USB_DIR_IN ) {
16251625 if (!target_ep -> is_in )
16261626 goto stall ;
16271627 } else {
@@ -1664,7 +1664,7 @@ static void xudc_set_clear_feature(struct xusb_udc *udc)
16641664
16651665 switch (udc -> setup .bRequestType ) {
16661666 case USB_RECIP_DEVICE :
1667- switch (udc -> setup .wValue ) {
1667+ switch (le16_to_cpu ( udc -> setup .wValue ) ) {
16681668 case USB_DEVICE_TEST_MODE :
16691669 /*
16701670 * The Test Mode will be executed
@@ -1684,13 +1684,15 @@ static void xudc_set_clear_feature(struct xusb_udc *udc)
16841684 break ;
16851685 case USB_RECIP_ENDPOINT :
16861686 if (!udc -> setup .wValue ) {
1687- endpoint = udc -> setup .wIndex & USB_ENDPOINT_NUMBER_MASK ;
1687+ endpoint = le16_to_cpu (udc -> setup .wIndex ) &
1688+ USB_ENDPOINT_NUMBER_MASK ;
16881689 if (endpoint >= XUSB_MAX_ENDPOINTS ) {
16891690 xudc_ep0_stall (udc );
16901691 return ;
16911692 }
16921693 target_ep = & udc -> ep [endpoint ];
1693- outinbit = udc -> setup .wIndex & USB_ENDPOINT_DIR_MASK ;
1694+ outinbit = le16_to_cpu (udc -> setup .wIndex ) &
1695+ USB_ENDPOINT_DIR_MASK ;
16941696 outinbit = outinbit >> 7 ;
16951697
16961698 /* Make sure direction matches.*/
@@ -1867,7 +1869,7 @@ static void xudc_ep0_in(struct xusb_udc *udc)
18671869 u16 count = 0 ;
18681870 u16 length ;
18691871 u8 * ep0rambase ;
1870- u8 test_mode = udc -> setup .wIndex >> 8 ;
1872+ u8 test_mode = le16_to_cpu ( udc -> setup .wIndex ) >> 8 ;
18711873
18721874 req = list_first_entry (& ep0 -> queue , struct xusb_req , queue );
18731875 bytes_to_tx = req -> usb_req .length - req -> usb_req .actual ;
@@ -1878,12 +1880,12 @@ static void xudc_ep0_in(struct xusb_udc *udc)
18781880 case USB_REQ_SET_ADDRESS :
18791881 /* Set the address of the device.*/
18801882 udc -> write_fn (udc -> addr , XUSB_ADDRESS_OFFSET ,
1881- udc -> setup .wValue );
1883+ le16_to_cpu ( udc -> setup .wValue ) );
18821884 break ;
18831885 case USB_REQ_SET_FEATURE :
18841886 if (udc -> setup .bRequestType ==
18851887 USB_RECIP_DEVICE ) {
1886- if (udc -> setup .wValue ==
1888+ if (le16_to_cpu ( udc -> setup .wValue ) ==
18871889 USB_DEVICE_TEST_MODE )
18881890 udc -> write_fn (udc -> addr ,
18891891 XUSB_TESTMODE_OFFSET ,
0 commit comments