Changeset 6a44ee4 in mainline for uspace/drv/bus/usb
- Timestamp:
- 2011-07-20T15:26:21Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efcebe1
- Parents:
- 25bef0ff (diff), a701812 (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/bus/usb
- Files:
-
- 134 added
- 3 moved
-
ehci/Makefile (added)
-
ehci/ehci.h (moved) (moved from uspace/lib/c/include/ipc/mouse.h ) (2 diffs)
-
ehci/ehci.ma (added)
-
ehci/hc_iface.c (added)
-
ehci/main.c (added)
-
ehci/pci.c (added)
-
ehci/pci.h (added)
-
ohci/Makefile (added)
-
ohci/batch.c (added)
-
ohci/batch.h (added)
-
ohci/endpoint_list.c (added)
-
ohci/endpoint_list.h (added)
-
ohci/hc.c (added)
-
ohci/hc.h (added)
-
ohci/hcd_endpoint.c (added)
-
ohci/hcd_endpoint.h (added)
-
ohci/hw_struct/completion_codes.h (added)
-
ohci/hw_struct/endpoint_descriptor.c (added)
-
ohci/hw_struct/endpoint_descriptor.h (added)
-
ohci/hw_struct/hcca.h (added)
-
ohci/hw_struct/iso_transfer_descriptor.h (added)
-
ohci/hw_struct/transfer_descriptor.c (added)
-
ohci/hw_struct/transfer_descriptor.h (added)
-
ohci/iface.c (added)
-
ohci/iface.h (added)
-
ohci/main.c (added)
-
ohci/ohci.c (added)
-
ohci/ohci.h (added)
-
ohci/ohci.ma (added)
-
ohci/ohci_regs.h (added)
-
ohci/pci.c (added)
-
ohci/pci.h (added)
-
ohci/root_hub.c (added)
-
ohci/root_hub.h (added)
-
ohci/utils/malloc32.h (added)
-
uhci/Makefile (added)
-
uhci/batch.c (added)
-
uhci/batch.h (added)
-
uhci/hc.c (added)
-
uhci/hc.h (added)
-
uhci/hw_struct/link_pointer.h (added)
-
uhci/hw_struct/queue_head.h (added)
-
uhci/hw_struct/transfer_descriptor.c (added)
-
uhci/hw_struct/transfer_descriptor.h (added)
-
uhci/iface.c (added)
-
uhci/iface.h (added)
-
uhci/main.c (added)
-
uhci/pci.c (added)
-
uhci/pci.h (added)
-
uhci/root_hub.c (added)
-
uhci/root_hub.h (added)
-
uhci/transfer_list.c (added)
-
uhci/transfer_list.h (added)
-
uhci/uhci.c (added)
-
uhci/uhci.h (moved) (moved from uspace/srv/hid/char_mouse/include/char_mouse.h ) (2 diffs)
-
uhci/uhci.ma (added)
-
uhci/utils/malloc32.h (added)
-
uhcirh/Makefile (added)
-
uhcirh/main.c (added)
-
uhcirh/port.c (added)
-
uhcirh/port.h (added)
-
uhcirh/root_hub.c (added)
-
uhcirh/root_hub.h (added)
-
uhcirh/uhcirh.ma (added)
-
usbflbk/Makefile (added)
-
usbflbk/main.c (added)
-
usbflbk/usbflbk.ma (added)
-
usbhid/Makefile (added)
-
usbhid/generic/hiddev.c (added)
-
usbhid/generic/hiddev.h (added)
-
usbhid/kbd/conv.c (added)
-
usbhid/kbd/conv.h (added)
-
usbhid/kbd/kbddev.c (added)
-
usbhid/kbd/kbddev.h (added)
-
usbhid/kbd/kbdrepeat.c (added)
-
usbhid/kbd/kbdrepeat.h (added)
-
usbhid/main.c (added)
-
usbhid/mouse/mousedev.c (added)
-
usbhid/mouse/mousedev.h (added)
-
usbhid/multimedia/keymap.c (added)
-
usbhid/multimedia/keymap.h (added)
-
usbhid/multimedia/multimedia.c (added)
-
usbhid/multimedia/multimedia.h (added)
-
usbhid/subdrivers.c (added)
-
usbhid/subdrivers.h (added)
-
usbhid/usbhid.c (added)
-
usbhid/usbhid.h (added)
-
usbhid/usbhid.ma (added)
-
usbhub/Makefile (added)
-
usbhub/main.c (moved) (moved from uspace/srv/hid/adb_mouse/adb_dev.c ) (3 diffs)
-
usbhub/port_status.h (added)
-
usbhub/ports.c (added)
-
usbhub/ports.h (added)
-
usbhub/usbhub.c (added)
-
usbhub/usbhub.h (added)
-
usbhub/usbhub.ma (added)
-
usbhub/usbhub_private.h (added)
-
usbhub/utils.c (added)
-
usbmast/Makefile (added)
-
usbmast/bo_trans.c (added)
-
usbmast/bo_trans.h (added)
-
usbmast/cmdw.c (added)
-
usbmast/cmdw.h (added)
-
usbmast/main.c (added)
-
usbmast/scsi_ms.c (added)
-
usbmast/scsi_ms.h (added)
-
usbmast/usbmast.h (added)
-
usbmast/usbmast.ma (added)
-
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)
-
usbmouse/Makefile (added)
-
usbmouse/init.c (added)
-
usbmouse/main.c (added)
-
usbmouse/mouse.c (added)
-
usbmouse/mouse.h (added)
-
usbmouse/usbmouse.ma (added)
-
vhc/Makefile (added)
-
vhc/conn.h (added)
-
vhc/conndev.c (added)
-
vhc/connhost.c (added)
-
vhc/devconn.c (added)
-
vhc/hub.c (added)
-
vhc/hub.h (added)
-
vhc/hub/hub.c (added)
-
vhc/hub/hub.h (added)
-
vhc/hub/virthub.c (added)
-
vhc/hub/virthub.h (added)
-
vhc/hub/virthubops.c (added)
-
vhc/main.c (added)
-
vhc/transfer.c (added)
-
vhc/vhc.ma (added)
-
vhc/vhcd.h (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci.h
r25bef0ff r6a44ee4 1 1 /* 2 * Copyright (c) 20 09 Jiri Svoboda2 * Copyright (c) 2011 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup mouse 30 * @brief 29 /** @addtogroup drvusbehci 31 30 * @{ 32 31 */ 33 32 /** @file 33 * Common EHCI definitions. 34 34 */ 35 #ifndef DRV_EHCI_EHCI_H 36 #define DRV_EHCI_EHCI_H 35 37 36 #ifndef LIBC_IPC_MOUSE_H_ 37 #define LIBC_IPC_MOUSE_H_ 38 #include <usbhc_iface.h> 38 39 39 # include <ipc/common.h>40 #define NAME "ehci" 40 41 41 typedef enum { 42 MEVENT_BUTTON = IPC_FIRST_USER_METHOD, 43 MEVENT_MOVE 44 } mouse_notif_t; 42 extern usbhc_iface_t ehci_hc_iface; 45 43 46 44 #endif 47 48 45 /** 49 46 * @} 50 47 */ 48 -
uspace/drv/bus/usb/uhci/uhci.h
r25bef0ff r6a44ee4 1 1 /* 2 * Copyright (c) 20 09 Jiri Svoboda2 * Copyright (c) 2011 Jan Vesely 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup mouse 30 * @brief 29 /** @addtogroup drvusbuhci 31 30 * @{ 32 31 */ 33 32 /** @file 33 * @brief UHCI driver main structure for both host controller and root-hub. 34 34 */ 35 #ifndef DRV_UHCI_UHCI_H 36 #define DRV_UHCI_UHCI_H 37 #include <ddf/driver.h> 35 38 36 #ifndef CHAR_MOUSE_H_ 37 #define CHAR_MOUSE_H_ 38 39 extern void mouse_handle_byte(int); 40 extern void mouse_ev_btn(int button, int press); 41 extern void mouse_ev_move(int dx, int dy); 42 39 int device_setup_uhci(ddf_dev_t *device); 43 40 #endif 44 45 41 /** 46 42 * @} -
uspace/drv/bus/usb/usbhub/main.c
r25bef0ff r6a44ee4 1 1 /* 2 * Copyright (c) 2010 Jiri Svoboda2 * Copyright (c) 2010 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup mouse29 /** @addtogroup drvusbhub 30 30 * @{ 31 */32 /** @file33 * @brief34 31 */ 35 32 36 #include <ipc/adb.h> 33 #include <ddf/driver.h> 34 #include <errno.h> 37 35 #include <async.h> 38 #include <vfs/vfs.h> 39 #include <fcntl.h> 40 #include <errno.h> 36 #include <stdio.h> 41 37 42 #include "adb_mouse.h"43 #include "adb_dev.h"38 #include <usb/dev/driver.h> 39 #include <usb/classes/classes.h> 44 40 45 static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall); 41 #include "usbhub.h" 42 #include "usbhub_private.h" 46 43 47 static int dev_phone; 44 /** Hub status-change endpoint description. 45 * 46 * For more information see section 11.15.1 of USB 1.1 specification. 47 */ 48 static usb_endpoint_description_t hub_status_change_endpoint_description = { 49 .transfer_type = USB_TRANSFER_INTERRUPT, 50 .direction = USB_DIRECTION_IN, 51 .interface_class = USB_CLASS_HUB, 52 .interface_subclass = 0, 53 .interface_protocol = 0, 54 .flags = 0 55 }; 48 56 49 int adb_dev_init(void) 57 /** 58 * usb hub driver operations 59 * 60 * The most important one is add_device, which is set to usb_hub_add_device. 61 */ 62 static usb_driver_ops_t usb_hub_driver_ops = { 63 .add_device = usb_hub_add_device 64 }; 65 66 /** 67 * hub endpoints, excluding control endpoint 68 */ 69 static usb_endpoint_description_t *usb_hub_endpoints[] = { 70 &hub_status_change_endpoint_description, 71 NULL 72 }; 73 74 /** 75 * static usb hub driver information 76 */ 77 static usb_driver_t usb_hub_driver = { 78 .name = NAME, 79 .ops = &usb_hub_driver_ops, 80 .endpoints = usb_hub_endpoints 81 }; 82 83 84 int main(int argc, char *argv[]) 50 85 { 51 const char *input = "/dev/adb/mouse"; 52 int input_fd; 86 printf(NAME ": HelenOS USB hub driver.\n"); 53 87 54 printf(NAME ": open %s\n", input);88 usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME); 55 89 56 input_fd = open(input, O_RDONLY); 57 if (input_fd < 0) { 58 printf(NAME ": Failed opening %s (%d)\n", input, input_fd); 59 return false; 60 } 61 62 dev_phone = fd_phone(input_fd); 63 if (dev_phone < 0) { 64 printf(NAME ": Failed to connect to device\n"); 65 return false; 66 } 67 68 /* NB: The callback connection is slotted for removal */ 69 if (async_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events) != 0) { 70 printf(NAME ": Failed to create callback from device\n"); 71 return false; 72 } 73 74 return 0; 75 } 76 77 static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall) 78 { 79 /* Ignore parameters, the connection is already opened */ 80 while (true) { 81 82 ipc_call_t call; 83 ipc_callid_t callid = async_get_call(&call); 84 85 int retval; 86 87 switch (IPC_GET_IMETHOD(call)) { 88 case IPC_M_PHONE_HUNGUP: 89 /* TODO: Handle hangup */ 90 return; 91 case IPC_FIRST_USER_METHOD: 92 mouse_handle_data(IPC_GET_ARG1(call)); 93 break; 94 default: 95 retval = ENOENT; 96 } 97 async_answer_0(callid, retval); 98 } 90 return usb_driver_main(&usb_hub_driver); 99 91 } 100 92 … … 102 94 * @} 103 95 */ 96
Note:
See TracChangeset
for help on using the changeset viewer.
