Changeset ace12560 in mainline for uspace/drv
- Timestamp:
- 2011-02-20T21:52:43Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b317b0b, d37b235
- Parents:
- 62066b4 (diff), 41e645c (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
- Files:
-
- 7 added
- 8 edited
-
uhci-hcd/iface.c (modified) (2 diffs)
-
uhci-hcd/main.c (modified) (2 diffs)
-
uhci-rhd/main.c (modified) (2 diffs)
-
usbhid/main.c (modified) (2 diffs)
-
usbhub/usbhub.c (modified) (2 diffs)
-
usbmid/Makefile (added)
-
usbmid/dump.c (added)
-
usbmid/explore.c (added)
-
usbmid/main.c (added)
-
usbmid/usbmid.c (added)
-
usbmid/usbmid.h (added)
-
usbmid/usbmid.ma (added)
-
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
r62066b4 race12560 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
r62066b4 race12560 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 /*----------------------------------------------------------------------------*/ -
uspace/drv/uhci-rhd/main.c
r62066b4 race12560 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/usbhid/main.c
r62066b4 race12560 265 265 for (i = 0; i < count; ++i) { 266 266 printf("%d ", key_codes[i]); 267 } 268 printf("\n"); 269 270 for (i = 0; i < count; ++i) { 267 271 // TODO: Key press / release 268 272 269 273 // TODO: NOT WORKING 270 274 unsigned int key = usbkbd_parse_scancode(key_codes[i]); 275 276 if (key == 0) { 277 continue; 278 } 271 279 kbd_push_ev(KEY_PRESS, key); 272 280 } … … 348 356 { 349 357 .pipe = &kbd_dev->poll_pipe, 350 .description = &poll_endpoint_description 358 .description = &poll_endpoint_description, 359 .interface_no = 360 usb_device_get_assigned_interface(kbd_dev->device) 351 361 } 352 362 }; -
uspace/drv/usbhub/usbhub.c
r62066b4 race12560 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> … … 52 53 #include "usb/pipes.h" 53 54 54 static int iface_get_hc_handle(device_t *device, devman_handle_t *handle)55 {56 return usb_hc_find(device->handle, handle);57 }58 59 static usb_iface_t hub_usb_iface = {60 .get_hc_handle = iface_get_hc_handle61 };62 63 55 static device_ops_t hub_device_ops = { 64 .interfaces[USB_DEV_IFACE] = & hub_usb_iface56 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_impl 65 57 }; 66 58 -
uspace/drv/vhc/conn.h
r62066b4 race12560 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
r62066b4 race12560 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
r62066b4 race12560 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.
