Changeset deece2f in mainline for uspace/drv/uhci-hcd
- Timestamp:
- 2011-02-21T22:25:58Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 233e68d
- Parents:
- fb78ae72 (diff), dbe25f1 (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. - Location:
- uspace/drv/uhci-hcd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
rfb78ae72 rdeece2f 42 42 #include "uhci.h" 43 43 44 static int get_address(device_t *dev, devman_handle_t handle,45 usb_address_t *address)46 {47 assert(dev);48 uhci_t *hc = dev_to_uhci(dev);49 assert(hc);50 *address = usb_address_keeping_find(&hc->address_manager, handle);51 if (*address <= 0)52 return *address;53 return EOK;54 }55 44 /*----------------------------------------------------------------------------*/ 56 45 static int reserve_default_address(device_t *dev, usb_speed_t speed) … … 168 157 /*----------------------------------------------------------------------------*/ 169 158 usbhc_iface_t uhci_iface = { 170 .tell_address = get_address,171 172 159 .reserve_default_address = reserve_default_address, 173 160 .release_default_address = release_default_address, -
uspace/drv/uhci-hcd/main.c
rfb78ae72 rdeece2f 34 34 #include <driver.h> 35 35 #include <usb_iface.h> 36 #include <usb/ddfiface.h> 36 37 #include <device/hw_res.h> 37 38 … … 48 49 49 50 static int uhci_add_device(device_t *device); 50 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle); 51 /*----------------------------------------------------------------------------*/ 52 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)51 52 static int usb_iface_get_address(device_t *dev, devman_handle_t handle, 53 usb_address_t *address) 53 54 { 54 /* This shall be called only for the UHCI itself. */ 55 assert(dev->parent == NULL); 55 assert(dev); 56 uhci_t *hc = dev_to_uhci(dev); 57 assert(hc); 56 58 57 *handle = dev->handle; 59 usb_address_t addr = usb_address_keeping_find(&hc->address_manager, 60 handle); 61 if (addr < 0) { 62 return addr; 63 } 64 65 if (address != NULL) { 66 *address = addr; 67 } 68 58 69 return EOK; 59 70 } 60 /*----------------------------------------------------------------------------*/ 71 72 61 73 static usb_iface_t hc_usb_iface = { 62 .get_hc_handle = usb_iface_get_hc_handle 74 .get_hc_handle = usb_iface_get_hc_handle_hc_impl, 75 .get_address = usb_iface_get_address 63 76 }; 64 77 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.
