Changeset ec59693 in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-02-15T23:04:42Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0c00dac, 2e85b3c
Parents:
4e832d8
Message:

USB HC interface has max packet size

Currently, it is only a hack to extend the interface as the values
are hard coded inside the remote part of the interface.

Sending of real values will be added once the old drivers API is
completely removed (no sense in changing the same thing twice).

File:
1 edited

Legend:

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

    r4e832d8 rec59693  
    103103/*----------------------------------------------------------------------------*/
    104104static int interrupt_out(device_t *dev, usb_target_t target,
    105     void *data, size_t size,
    106     usbhc_iface_transfer_out_callback_t callback, void *arg)
    107 {
    108         size_t max_packet_size = 8;
     105    size_t max_packet_size,
     106    void *data, size_t size,
     107    usbhc_iface_transfer_out_callback_t callback, void *arg)
     108{
    109109        dev_speed_t speed = FULL_SPEED;
    110110
     
    118118/*----------------------------------------------------------------------------*/
    119119static int interrupt_in(device_t *dev, usb_target_t target,
    120     void *data, size_t size,
    121     usbhc_iface_transfer_in_callback_t callback, void *arg)
    122 {
    123         size_t max_packet_size = 4;
     120    size_t max_packet_size,
     121    void *data, size_t size,
     122    usbhc_iface_transfer_in_callback_t callback, void *arg)
     123{
    124124        dev_speed_t speed = FULL_SPEED;
    125125
     
    133133/*----------------------------------------------------------------------------*/
    134134static int control_write(device_t *dev, usb_target_t target,
     135    size_t max_packet_size,
    135136    void *setup_data, size_t setup_size, void *data, size_t size,
    136137    usbhc_iface_transfer_out_callback_t callback, void *arg)
    137138{
    138         size_t max_packet_size = 8;
    139139        dev_speed_t speed = FULL_SPEED;
    140140
     
    149149/*----------------------------------------------------------------------------*/
    150150static int control_read(device_t *dev, usb_target_t target,
     151    size_t max_packet_size,
    151152    void *setup_data, size_t setup_size, void *data, size_t size,
    152153    usbhc_iface_transfer_in_callback_t callback, void *arg)
    153154{
    154         size_t max_packet_size = 8;
    155155        dev_speed_t speed = FULL_SPEED;
    156156
     
    165165/*----------------------------------------------------------------------------*/
    166166static int control_write_setup(device_t *dev, usb_target_t target,
    167     void *data, size_t size,
    168     usbhc_iface_transfer_out_callback_t callback, void *arg)
     167    size_t max_packet_size,
     168    void *data, size_t size,
     169    usbhc_iface_transfer_out_callback_t callback, void *arg)
     170{
     171        dev_speed_t speed = FULL_SPEED;
     172
     173        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
     174        batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
     175            max_packet_size, speed, NULL, 0, data, size, NULL, callback, arg);
     176        if (!batch)
     177                return ENOMEM;
     178        batch_control_setup_old(batch);
     179        return EOK;
     180}
     181/*----------------------------------------------------------------------------*/
     182static int control_write_data(device_t *dev, usb_target_t target,
     183    size_t max_packet_size,
     184    void *data, size_t size,
     185    usbhc_iface_transfer_out_callback_t callback, void *arg)
     186{
     187        dev_speed_t speed = FULL_SPEED;
     188
     189        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
     190        batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
     191            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg);
     192        if (!batch)
     193                return ENOMEM;
     194        batch_control_write_data_old(batch);
     195        return EOK;
     196}
     197/*----------------------------------------------------------------------------*/
     198static int control_write_status(device_t *dev, usb_target_t target,
     199    usbhc_iface_transfer_in_callback_t callback, void *arg)
    169200{
    170201        size_t max_packet_size = 8;
     
    173204        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    174205        batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
     206            max_packet_size, speed, NULL, 0, NULL, 0, callback, NULL, arg);
     207        if (!batch)
     208                return ENOMEM;
     209        batch_control_write_status_old(batch);
     210        return EOK;
     211}
     212/*----------------------------------------------------------------------------*/
     213static int control_read_setup(device_t *dev, usb_target_t target,
     214    size_t max_packet_size,
     215    void *data, size_t size,
     216    usbhc_iface_transfer_out_callback_t callback, void *arg)
     217{
     218        dev_speed_t speed = FULL_SPEED;
     219
     220        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
     221        batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
    175222            max_packet_size, speed, NULL, 0, data, size, NULL, callback, arg);
    176223        if (!batch)
     
    180227}
    181228/*----------------------------------------------------------------------------*/
    182 static int control_write_data(device_t *dev, usb_target_t target,
    183     void *data, size_t size,
    184     usbhc_iface_transfer_out_callback_t callback, void *arg)
    185 {
    186         size_t max_packet_size = 8;
    187         dev_speed_t speed = FULL_SPEED;
    188 
    189         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    190         batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
    191             max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg);
    192         if (!batch)
    193                 return ENOMEM;
    194         batch_control_write_data_old(batch);
    195         return EOK;
    196 }
    197 /*----------------------------------------------------------------------------*/
    198 static int control_write_status(device_t *dev, usb_target_t target,
    199     usbhc_iface_transfer_in_callback_t callback, void *arg)
    200 {
    201         size_t max_packet_size = 8;
    202         dev_speed_t speed = FULL_SPEED;
    203 
    204         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    205         batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
    206             max_packet_size, speed, NULL, 0, NULL, 0, callback, NULL, arg);
    207         if (!batch)
    208                 return ENOMEM;
    209         batch_control_write_status_old(batch);
    210         return EOK;
    211 }
    212 /*----------------------------------------------------------------------------*/
    213 static int control_read_setup(device_t *dev, usb_target_t target,
    214     void *data, size_t size,
    215     usbhc_iface_transfer_out_callback_t callback, void *arg)
    216 {
    217         size_t max_packet_size = 8;
    218         dev_speed_t speed = FULL_SPEED;
    219 
    220         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    221         batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
    222             max_packet_size, speed, NULL, 0, data, size, NULL, callback, arg);
    223         if (!batch)
    224                 return ENOMEM;
    225         batch_control_setup_old(batch);
    226         return EOK;
    227 }
    228 /*----------------------------------------------------------------------------*/
    229229static int control_read_data(device_t *dev, usb_target_t target,
    230     void *data, size_t size,
    231     usbhc_iface_transfer_in_callback_t callback, void *arg)
    232 {
    233         size_t max_packet_size = 8;
     230    size_t max_packet_size,
     231    void *data, size_t size,
     232    usbhc_iface_transfer_in_callback_t callback, void *arg)
     233{
    234234        dev_speed_t speed = FULL_SPEED;
    235235
Note: See TracChangeset for help on using the changeset viewer.