Changeset 400575c5 in mainline
- Timestamp:
- 2011-02-04T17:19:20Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e29e09cf, e778543
- Parents:
- 458e40c (diff), 89acf204 (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. - Files:
-
- 25 added
- 8 edited
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r458e40c r400575c5 84 84 ./uspace/drv/test1/test1 85 85 ./uspace/drv/test2/test2 86 ./uspace/drv/uhci/uhci 86 ./uspace/drv/uhci-hcd/uhci-hcd 87 ./uspace/drv/uhci-rhd/uhci-rhd 87 88 ./uspace/drv/usbhub/usbhub 88 89 ./uspace/drv/usbhid/usbhid -
boot/arch/amd64/Makefile.inc
r458e40c r400575c5 43 43 isa \ 44 44 ns8250 \ 45 uhci \ 45 uhci-hcd \ 46 uhci-rhd \ 46 47 usbhub \ 47 48 usbhid \ -
uspace/Makefile
r458e40c r400575c5 117 117 srv/hw/irc/apic \ 118 118 srv/hw/irc/i8259 \ 119 drv/uhci \ 119 drv/uhci-hcd \ 120 drv/uhci-rhd \ 120 121 drv/usbhid \ 121 122 drv/usbhub \ … … 131 132 srv/hw/irc/apic \ 132 133 srv/hw/irc/i8259 \ 133 drv/uhci \ 134 drv/uhci-hcd \ 135 drv/uhci-rhd \ 134 136 drv/usbhid \ 135 137 drv/usbhub \ -
uspace/app/bdsh/cmds/modules/cat/cat.c
r458e40c r400575c5 144 144 return CMD_SUCCESS; 145 145 case 'H': 146 printf( cat_oops);146 printf("%s", cat_oops); 147 147 return CMD_FAILURE; 148 148 case 't': 149 printf( cat_oops);149 printf("%s", cat_oops); 150 150 return CMD_FAILURE; 151 151 case 'b': 152 printf( cat_oops);152 printf("%s", cat_oops); 153 153 break; 154 154 case 'm': 155 printf( cat_oops);155 printf("%s", cat_oops); 156 156 return CMD_FAILURE; 157 157 } -
uspace/app/bdsh/cmds/modules/rm/rm.c
r458e40c r400575c5 227 227 } 228 228 memset(buff, 0, sizeof(buff)); 229 snprintf(buff, len, argv[i]);229 snprintf(buff, len, "%s", argv[i]); 230 230 231 231 scope = rm_scope(buff); -
uspace/drv/rootvirt/devices.def
r458e40c r400575c5 23 23 #endif 24 24 /* Virtual USB host controller. */ 25 /* 25 26 { 26 27 .name = "usbhc", 27 28 .match_id = "usb&hc=vhc" 28 29 }, 30 */ -
uspace/drv/uhci-hcd/main.c
r458e40c r400575c5 1 1 /* 2 * Copyright (c) 201 0 Vojtech Horky2 * Copyright (c) 2011 Vojtech Horky, Jan Vesely 3 3 * All rights reserved. 4 4 * … … 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 #include <usb/hcdhubd.h> 28 /** @addtogroup usb 29 * @{ 30 */ 31 /** @file 32 * @brief UHCI driver 33 */ 34 #include <driver.h> 29 35 #include <usb_iface.h> 36 37 #include <errno.h> 38 30 39 #include <usb/debug.h> 31 #include <errno.h> 32 #include <str_error.h> 33 #include <driver.h> 40 41 #include "iface.h" 42 #include "pci.h" 43 #include "root_hub.h" 34 44 #include "uhci.h" 45 46 #define NAME "uhci-hcd" 35 47 36 48 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle) … … 54 66 static int uhci_add_device(device_t *device) 55 67 { 56 usb_dprintf(NAME, 1, "uhci_add_device() called\n"); 68 assert(device); 69 70 usb_log_info("uhci_add_device() called\n"); 57 71 device->ops = &uhci_ops; 58 72 … … 65 79 66 80 if (rc != EOK) { 67 fprintf(stderr, 68 NAME ": failed to get I/O registers addresses: %s.\n", 69 str_error(rc)); 81 usb_log_error("Failed(%d) to get I/O registers addresses for device:.\n", 82 rc, device->handle); 70 83 return rc; 71 84 } 72 85 73 usb_ dprintf(NAME, 2,"I/O regs at 0x%X (size %zu), IRQ %d.\n",86 usb_log_info("I/O regs at 0x%X (size %zu), IRQ %d.\n", 74 87 io_reg_base, io_reg_size, irq); 75 88 76 /* 77 * We need to announce the presence of our root hub. 78 */ 79 usb_dprintf(NAME, 2, "adding root hub\n"); 80 usb_hcd_add_root_hub(device); 89 uhci_t *uhci_hc = malloc(sizeof(uhci_t)); 90 if (!uhci_hc) { 91 usb_log_error("Failed to allocaete memory for uhci hcd driver.\n"); 92 return ENOMEM; 93 } 94 95 int ret = uhci_init(uhci_hc, (void*)io_reg_base, io_reg_size); 96 if (ret != EOK) { 97 usb_log_error("Failed to init uhci-hcd.\n"); 98 return ret; 99 } 100 device_t *rh; 101 ret = setup_root_hub(&rh, device); 102 103 if (ret != EOK) { 104 usb_log_error("Failed to setup uhci root hub.\n"); 105 /* TODO: destroy uhci here */ 106 return ret; 107 } 108 109 ret = child_device_register(rh, device); 110 if (ret != EOK) { 111 usb_log_error("Failed to register root hub.\n"); 112 /* TODO: destroy uhci here */ 113 return ret; 114 } 115 116 device->driver_data = uhci_hc; 81 117 82 118 return EOK; … … 98 134 */ 99 135 sleep(5); 100 usb_ dprintf_enable(NAME, 5);136 usb_log_enable(USB_LOG_LEVEL_INFO, NAME); 101 137 102 138 return driver_main(&uhci_driver); 103 139 } 140 /** 141 * @} 142 */ -
uspace/drv/uhci-hcd/pci.c
r458e40c r400575c5 34 34 * PCI related functions needed by the UHCI driver. 35 35 */ 36 #include "uhci.h"37 36 #include <errno.h> 38 37 #include <assert.h> 39 38 #include <devman.h> 40 39 #include <device/hw_res.h> 40 41 #include "pci.h" 41 42 42 43 /** Get address of registers and IRQ for given device. … … 125 126 */ 126 127 128 /** 129 * @} 130 */ -
uspace/drv/uhci-hcd/pci.h
r458e40c r400575c5 33 33 * @brief UHCI driver 34 34 */ 35 #ifndef DRV_UHCI_ UHCI_H36 #define DRV_UHCI_ UHCI_H35 #ifndef DRV_UHCI_PCI_H 36 #define DRV_UHCI_PCI_H 37 37 38 #include <usbhc_iface.h> 39 40 #define NAME "uhci" 41 42 usbhc_iface_t uhci_iface; 38 #include <driver.h> 43 39 44 40 int pci_get_my_registers(device_t *, uintptr_t *, size_t *, int *); … … 48 44 * @} 49 45 */ 46 -
uspace/drv/uhci-rhd/Makefile
r458e40c r400575c5 1 1 # 2 # Copyright (c) 2010 Vojtech Horky2 # Copyright (c) 2010 Jan Vesely 3 3 # All rights reserved. 4 4 # … … 29 29 USPACE_PREFIX = ../.. 30 30 LIBS = $(LIBDRV_PREFIX)/libdrv.a $(LIBUSB_PREFIX)/libusb.a 31 EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBUSB_PREFIX)/include 32 BINARY = uhci 31 EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBUSB_PREFIX)/include -I. 32 BINARY = uhci-rhd 33 33 34 34 SOURCES = \ 35 35 main.c \ 36 pci.c \ 37 transfers.c 36 port.c \ 37 port_status.c \ 38 root_hub.c 38 39 39 40 include $(USPACE_PREFIX)/Makefile.common -
uspace/drv/usbhid/main.c
r458e40c r400575c5 56 56 #include "layout.h" 57 57 58 #define BUFFER_SIZE 3258 #define BUFFER_SIZE 8 59 59 #define NAME "usbhid" 60 60 … … 262 262 } 263 263 264 # if 0 264 265 /* 265 266 * Kbd functions … … 297 298 return EOK; 298 299 } 299 300 300 static int usbkbd_process_descriptors(usb_hid_dev_kbd_t *kbd_dev) 301 301 { … … 363 363 return EOK; 364 364 } 365 365 #endif 366 366 static usb_hid_dev_kbd_t *usbkbd_init_device(device_t *dev) 367 367 { … … 404 404 */ 405 405 406 406 407 // TODO: get descriptors, parse descriptors and save endpoints 407 usbkbd_process_descriptors(kbd_dev); 408 //usbkbd_process_descriptors(kbd_dev); 409 usb_drv_req_set_configuration( 410 kbd_dev->device->parent_phone, kbd_dev->address, 1); 408 411 409 412 … … 467 470 468 471 while (true) { 469 async_usleep(1000 * 10 00 * 2);472 async_usleep(1000 * 10); 470 473 471 474 sess_rc = usb_endpoint_pipe_start_session(&kbd_dev->poll_pipe); -
uspace/lib/usb/include/usb/devreq.h
r458e40c r400575c5 70 70 /** Main parameter to the request. */ 71 71 union { 72 uint16_t value; 72 73 /* FIXME: add #ifdefs according to host endianess */ 73 74 struct { … … 75 76 uint8_t value_high; 76 77 }; 77 uint16_t value;78 78 }; 79 79 /** Auxiliary parameter to the request.
Note:
See TracChangeset
for help on using the changeset viewer.