Changeset 2f4438f5 in mainline


Ignore:
Timestamp:
2011-02-02T00:49:24Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ab65fa1, b00849e
Parents:
1b6e52f
Message:

Add endianness conversions to some requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/request.c

    r1b6e52f r2f4438f5  
    167167 *
    168168 * @param pipe Control endpoint pipe (session must be already started).
    169  * @param new_address New USB address to be set.
     169 * @param new_address New USB address to be set (in native endianness).
    170170 * @return Error code.
    171171 */
     
    176176                return EINVAL;
    177177        }
     178
     179        uint16_t addr = uint16_host2usb((uint16_t)new_address);
    178180
    179181        int rc = usb_control_request_set(pipe,
    180182            USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE,
    181183            USB_DEVREQ_SET_ADDRESS,
    182             new_address, 0,
     184            addr, 0,
    183185            NULL, 0);
    184186
     
    344346    uint8_t configuration_value)
    345347{
     348        uint16_t config_value
     349            = uint16_host2usb((uint16_t) configuration_value);
     350
    346351        return usb_control_request_set(pipe,
    347352            USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE,
    348             USB_DEVREQ_SET_CONFIGURATION, configuration_value, 0,
     353            USB_DEVREQ_SET_CONFIGURATION, config_value, 0,
    349354            NULL, 0);
    350355}
Note: See TracChangeset for help on using the changeset viewer.