Changeset 357a302 in mainline for uspace/drv
- Timestamp:
- 2011-02-20T14:17:40Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b68b279
- Parents:
- 3ae93a8
- Location:
- uspace/drv
- Files:
-
- 7 edited
-
uhci-hcd/iface.c (modified) (2 diffs)
-
uhci-hcd/main.c (modified) (1 diff)
-
uhci-rhd/main.c (modified) (2 diffs)
-
usbhub/usbhub.c (modified) (2 diffs)
-
vhc/conn.h (modified) (2 diffs)
-
vhc/connhost.c (modified) (5 diffs)
-
vhc/hcd.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r3ae93a8 r357a302 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
r3ae93a8 r357a302 55 55 } 56 56 57 static int usb_iface_get_address(device_t *dev, devman_handle_t handle, 58 usb_address_t *address) 59 { 60 assert(dev); 61 uhci_t *hc = dev_to_uhci(dev); 62 assert(hc); 63 64 usb_address_t addr = usb_address_keeping_find(&hc->address_manager, 65 handle); 66 if (addr < 0) { 67 return addr; 68 } 69 70 if (address != NULL) { 71 *address = addr; 72 } 73 74 return EOK; 75 } 76 57 77 static usb_iface_t hc_usb_iface = { 58 .get_hc_handle = usb_iface_get_hc_handle 78 .get_hc_handle = usb_iface_get_hc_handle, 79 .get_address = usb_iface_get_address 59 80 }; 60 81 -
uspace/drv/uhci-rhd/main.c
r3ae93a8 r357a302 34 34 #include <driver.h> 35 35 #include <usb_iface.h> 36 #include <usb/ddfiface.h> 36 37 37 38 #include <errno.h> … … 56 57 57 58 static usb_iface_t uhci_rh_usb_iface = { 58 .get_hc_handle = usb_iface_get_hc_handle 59 .get_hc_handle = usb_iface_get_hc_handle, 60 .get_address = usb_iface_get_address_hub_impl 59 61 }; 60 62 -
uspace/drv/usbhub/usbhub.c
r3ae93a8 r357a302 39 39 40 40 #include <usb_iface.h> 41 #include <usb/ddfiface.h> 41 42 #include <usb/usbdrv.h> 42 43 #include <usb/descriptor.h> … … 50 51 #include "usb/usb.h" 51 52 52 static int iface_get_hc_handle(device_t *device, devman_handle_t *handle)53 {54 return usb_hc_find(device->handle, handle);55 }56 57 static usb_iface_t hub_usb_iface = {58 .get_hc_handle = iface_get_hc_handle59 };60 61 53 static device_ops_t hub_device_ops = { 62 .interfaces[USB_DEV_IFACE] = & hub_usb_iface54 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_impl 63 55 }; 64 56 -
uspace/drv/vhc/conn.h
r3ae93a8 r357a302 38 38 #include <usb/usb.h> 39 39 #include <usbhc_iface.h> 40 #include <usb_iface.h> 40 41 #include "vhcd.h" 41 42 #include "devices.h" … … 43 44 void connection_handler_host(sysarg_t); 44 45 45 usbhc_iface_t vhc_iface; 46 extern usbhc_iface_t vhc_iface; 47 extern usb_iface_t vhc_usb_iface; 46 48 47 49 void address_init(void); -
uspace/drv/vhc/connhost.c
r3ae93a8 r357a302 37 37 #include <usb/usb.h> 38 38 #include <usb/addrkeep.h> 39 #include <usb/ddfiface.h> 39 40 40 41 #include "vhcd.h" … … 313 314 static usb_address_keeping_t addresses; 314 315 316 static int tell_address(device_t *dev, devman_handle_t handle, 317 usb_address_t *address) 318 { 319 usb_address_t addr = usb_address_keeping_find(&addresses, handle); 320 if (addr < 0) { 321 return addr; 322 } 323 324 *address = addr; 325 return EOK; 326 } 315 327 316 328 static int reserve_default_address(device_t *dev, usb_speed_t ignored) … … 350 362 } 351 363 352 static int tell_address(device_t *dev, devman_handle_t handle,353 usb_address_t *address)354 {355 usb_address_t addr = usb_address_keeping_find(&addresses, handle);356 if (addr < 0) {357 return addr;358 }359 360 *address = addr;361 return EOK;362 }363 364 364 void address_init(void) 365 365 { … … 368 368 369 369 usbhc_iface_t vhc_iface = { 370 .tell_address = tell_address,371 372 370 .reserve_default_address = reserve_default_address, 373 371 .release_default_address = release_default_address, … … 383 381 }; 384 382 383 usb_iface_t vhc_usb_iface = { 384 .get_hc_handle = usb_iface_get_hc_handle_hc_impl, 385 .get_address = tell_address 386 }; 387 388 385 389 /** 386 390 * @} -
uspace/drv/vhc/hcd.c
r3ae93a8 r357a302 45 45 46 46 #include <usb/usb.h> 47 #include <usb/ddfiface.h> 47 48 #include <usb_iface.h> 48 49 #include "vhcd.h" … … 52 53 #include "conn.h" 53 54 54 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)55 {56 /* This shall be called only for VHC device. */57 assert(dev->parent == NULL);58 59 *handle = dev->handle;60 return EOK;61 }62 63 static usb_iface_t hc_usb_iface = {64 .get_hc_handle = usb_iface_get_hc_handle65 };66 67 55 static device_ops_t vhc_ops = { 68 56 .interfaces[USBHC_DEV_IFACE] = &vhc_iface, 69 .interfaces[USB_DEV_IFACE] = & hc_usb_iface,57 .interfaces[USB_DEV_IFACE] = &vhc_usb_iface, 70 58 .close = on_client_close, 71 59 .default_handler = default_connection_handler
Note:
See TracChangeset
for help on using the changeset viewer.
