Changeset 563fb40 in mainline


Ignore:
Timestamp:
2011-02-15T21:30:53Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
72363a1
Parents:
fa2f79d
Message:

Less usage of old drivers API

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-rhd/root_hub.c

    rfa2f79d r563fb40  
    4747        assert(rh);
    4848        int ret;
    49         ret = usb_drv_find_hc(rh, &instance->hc_handle);
     49        ret = usb_hc_find(rh->handle, &instance->hc_handle);
    5050        usb_log_info("rh found(%d) hc handle: %d.\n", ret, instance->hc_handle);
    5151        if (ret != EOK) {
  • uspace/drv/usbhub/usbhub.c

    rfa2f79d r563fb40  
    5050#include "usb/usb.h"
    5151
     52static int iface_get_hc_handle(device_t *device, devman_handle_t *handle)
     53{
     54        return usb_hc_find(device->handle, handle);
     55}
     56
    5257static usb_iface_t hub_usb_iface = {
    53         .get_hc_handle = usb_drv_find_hc
     58        .get_hc_handle = iface_get_hc_handle
    5459};
    5560
  • uspace/lib/usb/src/pipes.c

    rfa2f79d r563fb40  
    3535#include <usb/usb.h>
    3636#include <usb/pipes.h>
     37#include <usbhc_iface.h>
    3738#include <errno.h>
    3839#include <assert.h>
    39 #include <usb/usbdrv.h>
     40
     41/** Tell USB address assigned to given device.
     42 *
     43 * @param phone Phone to my HC.
     44 * @param dev Device in question.
     45 * @return USB address or error code.
     46 */
     47static usb_address_t get_my_address(int phone, device_t *dev)
     48{
     49        sysarg_t address;
     50        int rc = async_req_2_1(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
     51            IPC_M_USBHC_GET_ADDRESS,
     52            dev->handle, &address);
     53
     54        if (rc != EOK) {
     55                return rc;
     56        }
     57
     58        return (usb_address_t) address;
     59}
    4060
    4161/** Initialize connection to USB device.
     
    5575        usb_address_t my_address;
    5676
    57         rc = usb_drv_find_hc(device, &hc_handle);
     77        rc = usb_hc_find(device->handle, &hc_handle);
    5878        if (rc != EOK) {
    5979                return rc;
     
    6585        }
    6686
    67         my_address = usb_drv_get_my_address(hc_phone, device);
     87        my_address = get_my_address(hc_phone, device);
    6888        if (my_address < 0) {
    6989                rc = my_address;
Note: See TracChangeset for help on using the changeset viewer.