Changeset 747ef72 in mainline for uspace/lib/drv/generic/remote_usb.c


Ignore:
Timestamp:
2011-11-10T11:29:10Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
54464f6a, c2245a3, c6f189f7
Parents:
2e1b9dc (diff), 2d1ba51 (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:

Merge USB changes.

Interface changes:

  • GET_ADDRESS has been renamed to GET_MY_ADDRESS and the handle parameter was dropped. Tis call no longer cascades up to the root hub, but it is answered in the first place the information is available (nearest hub)
  • Reintroduced address reservation for USB_DEFAULT_ADDRESS. The interface now enables device drivers to request specific address on initialization and either insists on that address or accept any other if the address is not available. Note that it is not possible to get the default address if the driver does not insist.
  • Any endpoint registered is removed when address is released and a warning is produced if there were any such endpoints.
  • It is no longer necessary or possible to pass device speed information when registering endpoints.

Driver fixes: memory leaks and crashes (not only) in error paths.
Fixes or removes flaky device_remove implementation in device drivers.

File:
1 edited

Legend:

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

    r2e1b9dc r747ef72  
    4040
    4141
    42 static void remote_usb_get_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     42static void remote_usb_get_my_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    4343static void remote_usb_get_interface(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    4444static void remote_usb_get_hc_handle(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     
    4747/** Remote USB interface operations. */
    4848static remote_iface_func_ptr_t remote_usb_iface_ops [] = {
    49         remote_usb_get_address,
    50         remote_usb_get_interface,
    51         remote_usb_get_hc_handle
     49        [IPC_M_USB_GET_MY_ADDRESS] = remote_usb_get_my_address,
     50        [IPC_M_USB_GET_INTERFACE] = remote_usb_get_interface,
     51        [IPC_M_USB_GET_HOST_CONTROLLER_HANDLE] = remote_usb_get_hc_handle,
    5252};
    5353
     
    6161
    6262
    63 void remote_usb_get_address(ddf_fun_t *fun, void *iface,
     63void remote_usb_get_my_address(ddf_fun_t *fun, void *iface,
    6464    ipc_callid_t callid, ipc_call_t *call)
    6565{
    6666        usb_iface_t *usb_iface = (usb_iface_t *) iface;
    6767
    68         if (usb_iface->get_address == NULL) {
     68        if (usb_iface->get_my_address == NULL) {
    6969                async_answer_0(callid, ENOTSUP);
    7070                return;
    7171        }
    7272
    73         devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
    74 
    7573        usb_address_t address;
    76         int rc = usb_iface->get_address(fun, handle, &address);
     74        int rc = usb_iface->get_my_address(fun, &address);
    7775        if (rc != EOK) {
    7876                async_answer_0(callid, rc);
Note: See TracChangeset for help on using the changeset viewer.