Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4689d40 in mainline


Ignore:
Timestamp:
2010-12-04T17:51:07Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
ce687bbe
Parents:
ad104e0
Message:

Add binding of USB address and devman handle to usbhc iface

Location:
uspace/lib
Files:
4 edited

Legend:

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

    rad104e0 r4689d40  
    5555static void remote_usbhc_release_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    5656static void remote_usbhc_request_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
     57static void remote_usbhc_bind_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    5758static void remote_usbhc_release_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    5859//static void remote_usbhc(device_t *, void *, ipc_callid_t, ipc_call_t *);
     
    6869
    6970        remote_usbhc_request_address,
     71        remote_usbhc_bind_address,
    7072        remote_usbhc_release_address,
    7173
     
    197199                ipc_answer_1(callid, EOK, (ipcarg_t) address);
    198200        }
     201}
     202
     203void remote_usbhc_bind_address(device_t *device, void *iface,
     204    ipc_callid_t callid, ipc_call_t *call)
     205{
     206        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     207
     208        if (!usb_iface->bind_address) {
     209                ipc_answer_0(callid, ENOTSUP);
     210                return;
     211        }
     212
     213        usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call);
     214        devman_handle_t handle = (devman_handle_t) IPC_GET_ARG2(*call);
     215
     216        int rc = usb_iface->bind_address(device, address, handle);
     217
     218        ipc_answer_0(callid, rc);
    199219}
    200220
  • uspace/lib/drv/include/usbhc_iface.h

    rad104e0 r4689d40  
    137137        IPC_M_USBHC_REQUEST_ADDRESS,
    138138
     139        /** Bind USB address with devman handle.
     140         * Parameters:
     141         * - USB address
     142         * - devman handle
     143         * Answer:
     144         * - EOK - address binded
     145         * - ENOENT - address is not in use
     146         */
     147        IPC_M_USBHC_BIND_ADDRESS,
     148
    139149        /** Release address in use.
    140150         * Arguments:
     
    223233        int (*release_default_address)(device_t *);
    224234        int (*request_address)(device_t *, usb_address_t *);
     235        int (*bind_address)(device_t *, usb_address_t, devman_handle_t);
    225236        int (*release_address)(device_t *, usb_address_t);
    226237
  • uspace/lib/usb/include/usb/usbdrv.h

    rad104e0 r4689d40  
    4444int usb_drv_release_default_address(int);
    4545usb_address_t usb_drv_request_address(int);
     46int usb_drv_bind_address(int, usb_address_t, devman_handle_t);
    4647int usb_drv_release_address(int, usb_address_t);
    4748
  • uspace/lib/usb/src/usbdrv.c

    rad104e0 r4689d40  
    136136}
    137137
     138/** Inform HC about binding address with devman handle.
     139 *
     140 * @param phone Open phone to host controller driver.
     141 * @param address Address to be binded.
     142 * @param handle Devman handle of the device.
     143 * @return Error code.
     144 */
     145int usb_drv_bind_address(int phone, usb_address_t address,
     146    devman_handle_t handle)
     147{
     148        int rc = async_req_2_0(phone, IPC_M_USBHC_BIND_ADDRESS,
     149            address, handle);
     150
     151        return rc;
     152}
     153
    138154/** Inform HC about address release.
    139155 *
Note: See TracChangeset for help on using the changeset viewer.