Changeset 095bddfc in mainline


Ignore:
Timestamp:
2011-11-25T18:05:26Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
272f46f8
Parents:
02fc5c4
Message:

libusbdev, usbmid: Minor changes.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmid/explore.c

    r02fc5c4 r095bddfc  
    5454 * @return Interface @p interface_no is already present in the list.
    5555 */
    56 static bool interface_in_list(list_t *list, int interface_no)
     56static bool interface_in_list(const list_t *list, int interface_no)
    5757{
    5858        list_foreach(*list, l) {
  • uspace/lib/usbdev/include/usb/dev/request.h

    r02fc5c4 r095bddfc  
    8282         */
    8383        uint8_t request_type;
     84#define SETUP_REQUEST_TYPE_DEVICE_TO_HOST (1 << 7)
     85
    8486        /** Request identification. */
    8587        uint8_t request;
  • uspace/lib/usbdev/src/request.c

    r02fc5c4 r095bddfc  
    143143         */
    144144
    145         usb_device_request_setup_packet_t setup_packet;
    146         setup_packet.request_type = 128 | (request_type << 5) | recipient;
    147         setup_packet.request = request;
    148         setup_packet.value = value;
    149         setup_packet.index = index;
    150         setup_packet.length = (uint16_t) data_size;
    151 
    152         int rc = usb_pipe_control_read(pipe,
    153             &setup_packet, sizeof(setup_packet),
     145        const usb_device_request_setup_packet_t setup_packet = {
     146                .request_type = SETUP_REQUEST_TYPE_DEVICE_TO_HOST
     147                    | (request_type << 5) | recipient,
     148                .request = request,
     149                .value = value,
     150                .index = index,
     151                .length = (uint16_t) data_size,
     152        };
     153
     154        return usb_pipe_control_read(pipe, &setup_packet, sizeof(setup_packet),
    154155            data, data_size, actual_data_size);
    155 
    156         return rc;
    157156}
    158157
     
    276275        }
    277276
    278         uint16_t wValue = descriptor_index | (descriptor_type << 8);
     277        const uint16_t wValue = descriptor_index | (descriptor_type << 8);
    279278
    280279        return usb_control_request_get(pipe,
Note: See TracChangeset for help on using the changeset viewer.