Changeset 63b4f90 in mainline
- Timestamp:
- 2010-11-19T18:36:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 91db50ac
- Parents:
- 3f0a7971
- Files:
-
- 2 added
- 1 deleted
- 6 edited
- 14 moved
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r3f0a7971 r63b4f90 95 95 ./uspace/dist/drv/uhci/ 96 96 ./uspace/dist/drv/usbkbd/ 97 ./uspace/dist/drv/vhc/ 97 98 ./uspace/dist/srv/arp 98 99 ./uspace/dist/srv/ata_bd … … 130 131 ./uspace/drv/uhci/uhci 131 132 ./uspace/drv/usbkbd/usbkbd 133 ./uspace/drv/vhc/vhc 132 134 ./uspace/srv/bd/ata_bd/ata_bd 133 135 ./uspace/srv/bd/file_bd/file_bd … … 149 151 ./uspace/srv/hid/s3c24xx_ts/s3c24ts 150 152 ./uspace/srv/hw/bus/pci/pci 151 ./uspace/srv/hw/bus/usb/hcd/virtual/vhcd152 153 ./uspace/srv/hw/char/i8042/i8042 153 154 ./uspace/srv/hw/char/s3c24xx_uart/s3c24ser -
boot/Makefile.common
r3f0a7971 r63b4f90 110 110 111 111 RD_DRVS = \ 112 root 112 root \ 113 vhc 113 114 114 115 RD_DRV_CFG = -
uspace/Makefile
r3f0a7971 r63b4f90 81 81 srv/hw/char/s3c24xx_uart \ 82 82 srv/hw/netif/dp8390 \ 83 srv/hw/bus/usb/hcd/virtual \84 83 srv/net/cfg \ 85 84 srv/net/netif/lo \ … … 90 89 srv/net/tl/tcp \ 91 90 srv/net/net \ 92 drv/root 91 drv/root \ 92 drv/vhc 93 93 94 94 ## Networking -
uspace/app/init/init.c
r3f0a7971 r63b4f90 312 312 getterm("term/vc5", "/app/bdsh", false); 313 313 getterm("term/vc6", "/app/klog", false); 314 getterm("term/vc7", "/srv/devman", false); 314 315 315 316 return 0; -
uspace/drv/root/root.c
r3f0a7971 r63b4f90 119 119 } 120 120 121 /** Create virtual USB host controller device. 122 * Note that the virtual HC is actually device and driver in one 123 * task. 124 * 125 * @param parent Parent device. 126 * @return Error code. 127 */ 128 static int add_virtual_usb_host_controller(device_t *parent) 129 { 130 printf(NAME ": adding virtual host contoller.\n"); 131 132 int rc; 133 device_t *vhc = NULL; 134 match_id_t *match_id = NULL; 135 136 vhc = create_device(); 137 if (vhc == NULL) { 138 rc = ENOMEM; 139 goto failure; 140 } 141 142 vhc->name = "vhc"; 143 printf(NAME ": the new device's name is %s.\n", vhc->name); 144 145 /* Initialize match id list. */ 146 match_id = create_match_id(); 147 if (match_id == NULL) { 148 rc = ENOMEM; 149 goto failure; 150 } 151 152 match_id->id = "usb&hc=vhc"; 153 match_id->score = 100; 154 add_match_id(&vhc->match_ids, match_id); 155 156 /* Register child device. */ 157 rc = child_device_register(vhc, parent); 158 if (rc != EOK) 159 goto failure; 160 161 return EOK; 162 163 failure: 164 if (match_id != NULL) 165 match_id->id = NULL; 166 167 if (vhc != NULL) { 168 vhc->name = NULL; 169 delete_device(vhc); 170 } 171 172 return rc; 173 } 174 121 175 /** Get the root device. 122 176 * … … 133 187 printf(NAME ": failed to add child device for platform.\n"); 134 188 189 /* Register virtual USB host controller. */ 190 int rc = add_virtual_usb_host_controller(dev); 191 if (EOK != rc) { 192 printf(NAME ": failed to add child device - virtual USB HC.\n"); 193 } 194 135 195 return res; 136 196 } -
uspace/drv/uhci/uhci.ma
r3f0a7971 r63b4f90 1 10 pci/ven=8086&dev=70201 0 pci/ven=8086&dev=7020 2 2 10 usb&hc=uhci 3 3 10 usb&hc=uhci&hub -
uspace/drv/vhc/Makefile
r3f0a7971 r63b4f90 27 27 # 28 28 29 USPACE_PREFIX = ../../../../../.. 30 LIBS = $(LIBUSB_PREFIX)/libusb.a $(LIBUSBVIRT_PREFIX)/libusbvirt.a 31 EXTRA_CFLAGS = -I$(LIB_PREFIX) 32 BINARY = vhcd 29 USPACE_PREFIX = ../.. 30 LIBS = \ 31 $(LIBUSB_PREFIX)/libusb.a \ 32 $(LIBUSBVIRT_PREFIX)/libusbvirt.a \ 33 $(LIBDRV_PREFIX)/libdrv.a 34 EXTRA_CFLAGS += \ 35 -I$(LIB_PREFIX) \ 36 -I$(LIBDRV_PREFIX)/include 37 BINARY = vhc 33 38 34 39 SOURCES = \ -
uspace/drv/vhc/conn.h
r3f0a7971 r63b4f90 37 37 38 38 #include <usb/hcd.h> 39 #include <usb/hcdhubd.h> 39 40 #include "vhcd.h" 40 41 #include "devices.h" … … 42 43 void connection_handler_host(ipcarg_t); 43 44 void connection_handler_device(ipcarg_t, virtdev_connection_t *); 45 usb_hcd_transfer_ops_t vhc_transfer_ops; 44 46 45 47 #endif -
uspace/drv/vhc/connhost.c
r3f0a7971 r63b4f90 264 264 } 265 265 266 static int enqueue_transfer_out(usb_hc_device_t *hc, 267 usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint, 268 void *buffer, size_t size, 269 usb_hcd_transfer_callback_out_t callback, void *arg) 270 { 271 printf(NAME ": transfer OUT [%d.%d (%s); %u]\n", 272 dev->address, endpoint->endpoint, 273 usb_str_transfer_type(endpoint->transfer_type), 274 size); 275 return ENOTSUP; 276 } 277 278 static int enqueue_transfer_setup(usb_hc_device_t *hc, 279 usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint, 280 void *buffer, size_t size, 281 usb_hcd_transfer_callback_out_t callback, void *arg) 282 { 283 printf(NAME ": transfer SETUP [%d.%d (%s); %u]\n", 284 dev->address, endpoint->endpoint, 285 usb_str_transfer_type(endpoint->transfer_type), 286 size); 287 return ENOTSUP; 288 } 289 290 static int enqueue_transfer_in(usb_hc_device_t *hc, 291 usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint, 292 void *buffer, size_t size, 293 usb_hcd_transfer_callback_in_t callback, void *arg) 294 { 295 printf(NAME ": transfer IN [%d.%d (%s); %u]\n", 296 dev->address, endpoint->endpoint, 297 usb_str_transfer_type(endpoint->transfer_type), 298 size); 299 return ENOTSUP; 300 } 301 302 303 usb_hcd_transfer_ops_t vhc_transfer_ops = { 304 .transfer_out = enqueue_transfer_out, 305 .transfer_in = enqueue_transfer_in, 306 .transfer_setup = enqueue_transfer_setup 307 }; 308 266 309 /** 267 310 * @} -
uspace/drv/vhc/devices.c
r3f0a7971 r63b4f90 53 53 pos = pos->next) 54 54 55 LIST_INITIALIZE(devices);55 static LIST_INITIALIZE(devices); 56 56 57 57 /** Create virtual device. -
uspace/drv/vhc/vhcd.h
r3f0a7971 r63b4f90 36 36 #define VHCD_VHCD_H_ 37 37 38 #define NAME " hcd-virt"38 #define NAME "vhc" 39 39 #define NAME_DEV "hcd-virt-dev" 40 40 #define NAMESPACE "usb"
Note:
See TracChangeset
for help on using the changeset viewer.