Changeset 9e80904 in mainline


Ignore:
Timestamp:
2011-02-07T13:28:25Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c8dd5b1
Parents:
e2172cf8
Message:

Adds the use of trackers for control transfers(old API)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/iface.c

    re2172cf8 r9e80904  
    128128    usbhc_iface_transfer_out_callback_t callback, void *arg)
    129129{
    130         assert(dev);
    131         uhci_t *hc = dev_to_uhci(dev);
    132         assert(hc);
    133         return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_SETUP,
    134                 false, data, size, callback, NULL, arg);
     130        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
     131            8, FULL_SPEED, data, size, NULL, callback, arg);
     132        if (!tracker)
     133                return ENOMEM;
     134        tracker_control_setup_old(tracker);
     135        return EOK;
    135136}
    136137/*----------------------------------------------------------------------------*/
     
    139140    usbhc_iface_transfer_out_callback_t callback, void *arg)
    140141{
    141         assert(dev);
    142         uhci_t *hc = dev_to_uhci(dev);
    143         assert(hc);
    144         return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 1, USB_PID_OUT,
    145                 false, data, size, callback, NULL, arg);
     142        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
     143            size, FULL_SPEED, data, size, NULL, callback, arg);
     144        if (!tracker)
     145                return ENOMEM;
     146        tracker_control_write_data_old(tracker);
     147        return EOK;
    146148}
    147149/*----------------------------------------------------------------------------*/
     
    149151    usbhc_iface_transfer_in_callback_t callback, void *arg)
    150152{
    151         assert(dev);
    152         uhci_t *hc = dev_to_uhci(dev);
    153         assert(hc);
    154         return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_IN,
    155                 false, NULL, 0, NULL, callback, arg);
     153        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
     154            0, FULL_SPEED, NULL, 0, callback, NULL, arg);
     155        if (!tracker)
     156                return ENOMEM;
     157        tracker_control_write_status_old(tracker);
     158        return EOK;
    156159}
    157160/*----------------------------------------------------------------------------*/
     
    160163    usbhc_iface_transfer_out_callback_t callback, void *arg)
    161164{
    162         assert(dev);
    163         uhci_t *hc = dev_to_uhci(dev);
    164         assert(hc);
    165         return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_SETUP,
    166                 false, data, size, callback, NULL, arg);
     165        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
     166            8, FULL_SPEED, data, size, NULL, callback, arg);
     167        if (!tracker)
     168                return ENOMEM;
     169        tracker_control_setup_old(tracker);
     170        return EOK;
    167171}
    168172/*----------------------------------------------------------------------------*/
     
    171175    usbhc_iface_transfer_in_callback_t callback, void *arg)
    172176{
    173         assert(dev);
    174         uhci_t *hc = dev_to_uhci(dev);
    175         assert(hc);
    176         return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 1, USB_PID_IN,
    177                 false, data, size, NULL, callback, arg);
     177        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
     178            size, FULL_SPEED, data, size, callback, NULL, arg);
     179        if (!tracker)
     180                return ENOMEM;
     181        tracker_control_read_data_old(tracker);
     182        return EOK;
    178183}
    179184/*----------------------------------------------------------------------------*/
     
    181186    usbhc_iface_transfer_out_callback_t callback, void *arg)
    182187{
    183         assert(dev);
    184         uhci_t *hc = dev_to_uhci(dev);
    185         assert(hc);
    186         return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_OUT,
    187                 false, NULL, 0, callback, NULL, arg);
    188 }
    189 
    190 
     188        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
     189            0, FULL_SPEED, NULL, 0, NULL, callback, arg);
     190        if (!tracker)
     191                return ENOMEM;
     192        tracker_control_read_status_old(tracker);
     193        return EOK;
     194}
     195/*----------------------------------------------------------------------------*/
    191196usbhc_iface_t uhci_iface = {
    192197        .tell_address = get_address,
Note: See TracChangeset for help on using the changeset viewer.