Changeset 56e9fb0 in mainline


Ignore:
Timestamp:
2011-09-14T18:52:40Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
365e29e2
Parents:
8e3d17f
Message:

usb: add support for packing target_t type into uint32_t

Location:
uspace
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    r8e3d17f r56e9fb0  
    229229            uhci_batch->usb_batch->ep->speed == USB_SPEED_LOW;
    230230        const size_t mps = uhci_batch->usb_batch->ep->max_packet_size;
    231         const usb_target_t target = {
     231        const usb_target_t target = {{
    232232            uhci_batch->usb_batch->ep->address,
    233             uhci_batch->usb_batch->ep->endpoint };
     233            uhci_batch->usb_batch->ep->endpoint }};
    234234
    235235        int toggle = endpoint_toggle_get(uhci_batch->usb_batch->ep);
     
    289289            uhci_batch->usb_batch->ep->speed == USB_SPEED_LOW;
    290290        const size_t mps = uhci_batch->usb_batch->ep->max_packet_size;
    291         const usb_target_t target = {
     291        const usb_target_t target = {{
    292292            uhci_batch->usb_batch->ep->address,
    293             uhci_batch->usb_batch->ep->endpoint };
     293            uhci_batch->usb_batch->ep->endpoint }};
    294294
    295295        /* setup stage */
  • uspace/lib/drv/generic/remote_usbhc.c

    r8e3d17f r56e9fb0  
    239239
    240240        usb_target_t target = {
    241                 .address = DEV_IPC_GET_ARG1(*call),
    242                 .endpoint = DEV_IPC_GET_ARG2(*call)
     241                {.address = DEV_IPC_GET_ARG1(*call),
     242                .endpoint = DEV_IPC_GET_ARG2(*call) }
    243243        };
    244244        size_t data_buffer_len = DEV_IPC_GET_ARG3(*call);
     
    302302        }
    303303
    304         usb_target_t target = {
     304        usb_target_t target = {{
    305305                .address = DEV_IPC_GET_ARG1(*call),
    306306                .endpoint = DEV_IPC_GET_ARG2(*call)
    307         };
     307        }};
    308308
    309309        int rc;
     
    436436        }
    437437
    438         const usb_target_t target = {
     438        const usb_target_t target = {{
    439439                .address = DEV_IPC_GET_ARG1(*call),
    440440                .endpoint = DEV_IPC_GET_ARG2(*call)
    441         };
     441        }};
    442442
    443443
     
    484484        }
    485485
    486         const usb_target_t target = {
     486        const usb_target_t target = {{
    487487                .address = DEV_IPC_GET_ARG1(*call),
    488488                .endpoint = DEV_IPC_GET_ARG2(*call)
    489         };
     489        }};
    490490
    491491
  • uspace/lib/usb/include/usb/hc.h

    r8e3d17f r56e9fb0  
    6262    devman_handle_t *);
    6363
    64 int usb_hc_get_address_by_handle(devman_handle_t);
     64usb_address_t usb_hc_get_address_by_handle(devman_handle_t);
    6565
    6666int usb_hc_find(devman_handle_t, devman_handle_t *);
  • uspace/lib/usb/include/usb/usb.h

    r8e3d17f r56e9fb0  
    106106 * Negative values could be used to indicate error.
    107107 */
    108 typedef int usb_address_t;
     108typedef int16_t usb_address_t;
    109109
    110110/** Default USB address. */
     
    116116 * Negative values could be used to indicate error.
    117117 */
    118 typedef int usb_endpoint_t;
     118typedef int16_t usb_endpoint_t;
    119119
    120120/** Maximum endpoint number in USB 1.1.
     
    126126 * Pair address + endpoint is identification of transaction recipient.
    127127 */
    128 typedef struct {
    129         usb_address_t address;
    130         usb_endpoint_t endpoint;
     128typedef union {
     129        struct {
     130                usb_address_t address;
     131                usb_endpoint_t endpoint;
     132        } __attribute__((packed));
     133        uint32_t packed;
    131134} usb_target_t;
    132135
  • uspace/lib/usbhost/src/batch.c

    r8e3d17f r56e9fb0  
    136136        if (instance->ep->transfer_type == USB_TRANSFER_CONTROL
    137137            && instance->error == EOK) {
    138                 usb_target_t target =
    139                     {instance->ep->address, instance->ep->endpoint};
     138                const usb_target_t target =
     139                    {{ instance->ep->address, instance->ep->endpoint }};
    140140                reset_ep_if_need(
    141141                    fun_to_hcd(instance->fun), target, instance->setup_buffer);
Note: See TracChangeset for help on using the changeset viewer.