Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/usbdrv.c

    r6c8ada21 r0a5a950  
    5555/** Connect to host controller the device is physically attached to.
    5656 *
    57  * @param handle Device handle.
     57 * @param dev Device asking for connection.
    5858 * @param flags Connection flags (blocking connection).
    5959 * @return Phone to corresponding HC or error code.
     
    7171        devman_handle_t handle;
    7272
    73         rc = devman_device_get_handle("/vhc", &handle, 0);
     73        rc = devman_device_get_handle("/virt/usbhc", &handle, 0);
    7474        if (rc != EOK) {
    7575                return rc;
     
    9898
    9999        return (usb_address_t) address;
     100}
     101
     102/** Tell HC to reserve default address.
     103 *
     104 * @param phone Open phone to host controller driver.
     105 * @return Error code.
     106 */
     107int usb_drv_reserve_default_address(int phone)
     108{
     109        return async_req_0_0(phone, IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS);
     110}
     111
     112/** Tell HC to release default address.
     113 *
     114 * @param phone Open phone to host controller driver.
     115 * @return Error code.
     116 */
     117int usb_drv_release_default_address(int phone)
     118{
     119        return async_req_0_0(phone, IPC_M_USBHC_RELEASE_DEFAULT_ADDRESS);
     120}
     121
     122/** Ask HC for free address assignment.
     123 *
     124 * @param phone Open phone to host controller driver.
     125 * @return Assigned USB address or negative error code.
     126 */
     127usb_address_t usb_drv_request_address(int phone)
     128{
     129        ipcarg_t address;
     130        int rc = async_req_0_1(phone, IPC_M_USBHC_REQUEST_ADDRESS, &address);
     131        if (rc != EOK) {
     132                return rc;
     133        } else {
     134                return (usb_address_t) address;
     135        }
     136}
     137
     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
     154/** Inform HC about address release.
     155 *
     156 * @param phone Open phone to host controller driver.
     157 * @param address Address to be released.
     158 * @return Error code.
     159 */
     160int usb_drv_release_address(int phone, usb_address_t address)
     161{
     162        return async_req_1_0(phone, IPC_M_USBHC_RELEASE_ADDRESS, address);
    100163}
    101164
Note: See TracChangeset for help on using the changeset viewer.