Changeset c39e9fb in mainline


Ignore:
Timestamp:
2013-01-25T22:21:13Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
945d66c
Parents:
f6b2a76
Message:

usb, drivers: Use usb_device_* wrappers.

Location:
uspace/drv/bus/usb
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbflbk/main.c

    rf6b2a76 rc39e9fb  
    5050        usb_log_info("Pretending to control %s `%s' (handle %" PRIun ").\n",
    5151            dev->interface_no < 0 ? "device" : "interface",
    52             ddf_dev_get_name(dev->ddf_dev), ddf_dev_get_handle(dev->ddf_dev));
     52            usb_device_get_name(dev), ddf_dev_get_handle(dev->ddf_dev));
    5353        return EOK;
    5454}
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.c

    rf6b2a76 rc39e9fb  
    270270                0));
    271271
    272         rc = usbhid_req_set_report(&hid_dev->usb_dev->ctrl_pipe,
     272        rc = usbhid_req_set_report(
     273            usb_device_get_default_pipe(hid_dev->usb_dev),
    273274            hid_dev->usb_dev->interface_no, USB_HID_REPORT_TYPE_OUTPUT,
    274275            kbd_dev->output_buffer, kbd_dev->output_size);
     
    581582        usb_kbd_set_led(hid_dev, kbd_dev);
    582583
    583         usbhid_req_set_idle(&hid_dev->usb_dev->ctrl_pipe,
     584        usbhid_req_set_idle(usb_device_get_default_pipe(hid_dev->usb_dev),
    584585            hid_dev->usb_dev->interface_no, IDLE_RATE);
    585586
     
    786787        }
    787788
    788         rc = usbhid_req_set_protocol(&hid_dev->usb_dev->ctrl_pipe,
     789        rc = usbhid_req_set_protocol(
     790            usb_device_get_default_pipe(hid_dev->usb_dev),
    789791            hid_dev->usb_dev->interface_no, USB_HID_PROTOCOL_BOOT);
    790792
  • uspace/drv/bus/usb/usbhid/main.c

    rf6b2a76 rc39e9fb  
    105105        if (rc != EOK) {
    106106                usb_log_error("Failed to start polling fibril for `%s'.\n",
    107                     ddf_dev_get_name(dev->ddf_dev));
     107                    usb_device_get_name(dev));
    108108                usb_hid_deinit(hid_dev);
    109109                return rc;
     
    111111        hid_dev->running = true;
    112112
    113         usb_log_info("HID device `%s' ready to use.\n",
    114             ddf_dev_get_name(dev->ddf_dev));
     113        usb_log_info("HID device `%s' ready.\n", usb_device_get_name(dev));
    115114
    116115        return EOK;
     
    139138{
    140139        assert(dev);
    141         assert(dev->driver_data);
    142         usb_hid_dev_t *hid_dev = dev->driver_data;
     140        usb_hid_dev_t *hid_dev = usb_device_data_get(dev);
     141        assert(hid_dev);
    143142        unsigned tries = 100;
    144143        /* Wait for fail. */
     
    152151
    153152        usb_hid_deinit(hid_dev);
    154         usb_log_debug2("%s destruction complete.\n", ddf_dev_get_name(dev->ddf_dev));
     153        usb_log_debug2("%s destruction complete.\n", usb_device_get_name(dev));
    155154        return EOK;
    156155}
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.c

    rf6b2a76 rc39e9fb  
    315315
    316316        // TODO: how to know if the device supports the request???
    317         usbhid_req_set_idle(&hid_dev->usb_dev->ctrl_pipe,
     317        usbhid_req_set_idle(usb_device_get_default_pipe(hid_dev->usb_dev),
    318318            hid_dev->usb_dev->interface_no, IDLE_RATE);
    319319        return EOK;
     
    425425        }
    426426
    427         rc = usbhid_req_set_protocol(&hid_dev->usb_dev->ctrl_pipe,
     427        rc = usbhid_req_set_protocol(
     428            usb_device_get_default_pipe(hid_dev->usb_dev),
    428429            hid_dev->usb_dev->interface_no, USB_HID_PROTOCOL_BOOT);
    429430
  • uspace/drv/bus/usb/usbhub/port.c

    rf6b2a76 rc39e9fb  
    5757    usb_port_status_t status);
    5858static int get_port_status(usb_hub_port_t *port, usb_port_status_t *status);
    59 //static int enable_port_callback(void *arg);
    6059static int add_device_phase1_worker_fibril(void *arg);
    6160static int create_add_device_fibril(usb_hub_port_t *port, usb_hub_dev_t *hub,
  • uspace/drv/bus/usb/usbhub/usbhub.c

    rf6b2a76 rc39e9fb  
    162162        hub_dev->running = true;
    163163        usb_log_info("Controlling hub '%s' (%zu ports).\n",
    164             ddf_dev_get_name(hub_dev->usb_device->ddf_dev), hub_dev->port_count);
     164            usb_device_get_name(hub_dev->usb_device), hub_dev->port_count);
    165165
    166166        usb_pipe_end_long_transfer(control_pipe);
  • uspace/drv/bus/usb/usbmast/bo_trans.c

    rf6b2a76 rc39e9fb  
    117117                /* Clear stall condition and continue below to read CSW. */
    118118                if (ddir == USB_DIRECTION_IN) {
    119                         usb_pipe_clear_halt(&mfun->mdev->usb_dev->ctrl_pipe,
     119                        usb_pipe_clear_halt(
     120                            usb_device_get_default_pipe(mfun->mdev->usb_dev),
    120121                            &mfun->mdev->usb_dev->pipes[BULK_IN_EP].pipe);
    121122                } else {
    122                         usb_pipe_clear_halt(&mfun->mdev->usb_dev->ctrl_pipe,
     123                        usb_pipe_clear_halt(
     124                            usb_device_get_default_pipe(mfun->mdev->usb_dev),
    123125                            &mfun->mdev->usb_dev->pipes[BULK_OUT_EP].pipe);
    124126                }
     
    197199int usb_massstor_reset(usbmast_dev_t *mdev)
    198200{
    199         return usb_control_request_set(&mdev->usb_dev->ctrl_pipe,
     201        return usb_control_request_set(
     202            usb_device_get_default_pipe(mdev->usb_dev),
    200203            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE,
    201204            0xFF, 0, mdev->usb_dev->interface_no, NULL, 0);
     
    215218         */
    216219        usb_massstor_reset(mdev);
    217         usb_pipe_clear_halt(&mdev->usb_dev->ctrl_pipe,
     220        usb_pipe_clear_halt(usb_device_get_default_pipe(mdev->usb_dev),
    218221            &mdev->usb_dev->pipes[BULK_IN_EP].pipe);
    219         usb_pipe_clear_halt(&mdev->usb_dev->ctrl_pipe,
     222        usb_pipe_clear_halt(usb_device_get_default_pipe(mdev->usb_dev),
    220223            &mdev->usb_dev->pipes[BULK_OUT_EP].pipe);
    221224}
     
    236239        uint8_t max_lun;
    237240        size_t data_recv_len;
    238         int rc = usb_control_request_get(&mdev->usb_dev->ctrl_pipe,
     241        int rc = usb_control_request_get(
     242            usb_device_get_default_pipe(mdev->usb_dev),
    239243            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE,
    240244            0xFE, 0, mdev->usb_dev->interface_no, &max_lun, 1, &data_recv_len);
  • uspace/drv/bus/usb/usbmast/main.c

    rf6b2a76 rc39e9fb  
    110110static int usbmast_device_gone(usb_device_t *dev)
    111111{
    112         usbmast_dev_t *mdev = dev->driver_data;
     112        usbmast_dev_t *mdev = usb_device_data_get(dev);
    113113        assert(mdev);
    114114
  • uspace/drv/bus/usb/usbmid/explore.c

    rf6b2a76 rc39e9fb  
    159159
    160160        /* Select the first configuration */
    161         int rc = usb_request_set_configuration(&dev->ctrl_pipe,
     161        int rc = usb_request_set_configuration(usb_device_get_default_pipe(dev),
    162162            config_descriptor->configuration_number);
    163163        if (rc != EOK) {
  • uspace/drv/bus/usb/usbmid/main.c

    rf6b2a76 rc39e9fb  
    6464{
    6565        assert(dev);
    66         usb_mid_t *usb_mid = dev->driver_data;
     66        usb_mid_t *usb_mid = usb_device_data_get(dev);
    6767        assert(usb_mid);
    6868
     
    113113{
    114114        assert(dev);
    115         usb_mid_t *usb_mid = dev->driver_data;
     115        usb_mid_t *usb_mid = usb_device_data_get(dev);
    116116        assert(usb_mid);
    117117
Note: See TracChangeset for help on using the changeset viewer.