Ignore:
Timestamp:
2011-02-20T21:43:50Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
070f11e, ace12560
Parents:
423e8c81 (diff), 063ead6f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Add simple USB multi interface device driver

The MID driver serves as a mini bus driver for devices with several
interfaces or for devices with classes defined at interface level.

The keyboard driver is working with this driver with the same problems
as before introduction of USB MID driver.

The merge also includes addition of bulk transfers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    r423e8c81 r41e645c  
    4343#define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 4
    4444
    45 static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4645static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4746static void remote_usbhc_interrupt_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
     47static void remote_usbhc_bulk_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
     48static void remote_usbhc_bulk_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4849static void remote_usbhc_control_write(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4950static void remote_usbhc_control_read(device_t *, void *, ipc_callid_t, ipc_call_t *);
     
    5758/** Remote USB host controller interface operations. */
    5859static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = {
    59         remote_usbhc_get_address,
    60 
    6160        remote_usbhc_reserve_default_address,
    6261        remote_usbhc_release_default_address,
     
    6867        remote_usbhc_interrupt_out,
    6968        remote_usbhc_interrupt_in,
     69
     70        remote_usbhc_bulk_out,
     71        remote_usbhc_bulk_in,
    7072
    7173        remote_usbhc_control_write,
     
    121123}
    122124
    123 void remote_usbhc_get_address(device_t *device, void *iface,
    124     ipc_callid_t callid, ipc_call_t *call)
    125 {
    126         usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    127 
    128         if (!usb_iface->tell_address) {
    129                 async_answer_0(callid, ENOTSUP);
    130                 return;
    131         }
    132 
    133         devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
    134 
    135         usb_address_t address;
    136         int rc = usb_iface->tell_address(device, handle, &address);
    137         if (rc != EOK) {
    138                 async_answer_0(callid, rc);
    139         } else {
    140                 async_answer_1(callid, EOK, address);
    141         }
    142 }
    143 
    144125void remote_usbhc_reserve_default_address(device_t *device, void *iface,
    145126    ipc_callid_t callid, ipc_call_t *call)
     
    389370        return remote_usbhc_in_transfer(device, callid, call,
    390371            usb_iface->interrupt_in);
     372}
     373
     374void remote_usbhc_bulk_out(device_t *device, void *iface,
     375    ipc_callid_t callid, ipc_call_t *call)
     376{
     377        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     378        assert(usb_iface != NULL);
     379
     380        return remote_usbhc_out_transfer(device, callid, call,
     381            usb_iface->bulk_out);
     382}
     383
     384void remote_usbhc_bulk_in(device_t *device, void *iface,
     385    ipc_callid_t callid, ipc_call_t *call)
     386{
     387        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     388        assert(usb_iface != NULL);
     389
     390        return remote_usbhc_in_transfer(device, callid, call,
     391            usb_iface->bulk_in);
    391392}
    392393
Note: See TracChangeset for help on using the changeset viewer.