Changeset 0a5a950 in mainline
- Timestamp:
- 2010-12-09T00:25:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 040068c, 11feca8
- Parents:
- fe2333d
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
rfe2333d r0a5a950 68 68 ./uspace/dist/cfg/net/lo 69 69 ./uspace/dist/cfg/net/ne2k 70 ./uspace/dist/drv/isa/ 71 ./uspace/dist/drv/ns8250/ 72 ./uspace/dist/drv/pciintel/ 73 ./uspace/dist/drv/root/ 74 ./uspace/dist/drv/rootia32/ 75 ./uspace/dist/drv/uhci/ 76 ./uspace/dist/drv/usbhub/ 77 ./uspace/dist/drv/usbkbd/ 78 ./uspace/dist/drv/vhc/ 79 ./uspace/dist/srv/arp 80 ./uspace/dist/srv/ata_bd 81 ./uspace/dist/srv/char_ms 82 ./uspace/dist/srv/clip 83 ./uspace/dist/srv/console 84 ./uspace/dist/srv/devfs 85 ./uspace/dist/srv/devman 86 ./uspace/dist/srv/dp8390 87 ./uspace/dist/srv/eth 88 ./uspace/dist/srv/fat 89 ./uspace/dist/srv/fb 90 ./uspace/dist/srv/file_bd 91 ./uspace/dist/srv/g_part 92 ./uspace/dist/srv/i8042 93 ./uspace/dist/srv/icmp 94 ./uspace/dist/srv/ip 95 ./uspace/dist/srv/kbd 96 ./uspace/dist/srv/lo 97 ./uspace/dist/srv/mbr_part 98 ./uspace/dist/srv/net 99 ./uspace/dist/srv/netstart 100 ./uspace/dist/srv/nildummy 101 ./uspace/dist/srv/pci 102 ./uspace/dist/srv/taskmon 103 ./uspace/dist/srv/tcp 104 ./uspace/dist/srv/tmpfs 105 ./uspace/dist/srv/udp 106 ./uspace/dist/srv/vhcd 70 ./uspace/dist/drv/* 71 ./uspace/dist/srv/* 107 72 ./uspace/drv/root/root 108 73 ./uspace/drv/isa/isa 109 74 ./uspace/drv/ns8250/ns8250 110 75 ./uspace/drv/pciintel/pciintel 111 ./uspace/drv/rootia32/rootia32 76 ./uspace/drv/rootpc/rootpc 77 ./uspace/drv/rootvirt/rootvirt 78 ./uspace/drv/test1/test1 79 ./uspace/drv/test2/test2 112 80 ./uspace/drv/uhci/uhci 113 81 ./uspace/drv/usbhub/usbhub -
uspace/drv/root/root.c
rfe2333d r0a5a950 109 109 } 110 110 111 /** Create virtual USB host controller device.112 * Note that the virtual HC is actually device and driver in one113 * task.114 *115 * @param parent Parent device.116 * @return Error code.117 */118 static int add_virtual_usb_host_controller(device_t *parent)119 {120 printf(NAME ": adding virtual host contoller.\n");121 122 int rc;123 device_t *vhc = NULL;124 match_id_t *match_id = NULL;125 126 vhc = create_device();127 if (vhc == NULL) {128 rc = ENOMEM;129 goto failure;130 }131 132 vhc->name = "vhc";133 printf(NAME ": the new device's name is %s.\n", vhc->name);134 135 /* Initialize match id list. */136 match_id = create_match_id();137 if (match_id == NULL) {138 rc = ENOMEM;139 goto failure;140 }141 142 match_id->id = "usb&hc=vhc";143 match_id->score = 100;144 add_match_id(&vhc->match_ids, match_id);145 146 /* Register child device. */147 rc = child_device_register(vhc, parent);148 if (rc != EOK)149 goto failure;150 151 return EOK;152 153 failure:154 if (match_id != NULL)155 match_id->id = NULL;156 157 if (vhc != NULL) {158 vhc->name = NULL;159 delete_device(vhc);160 }161 162 return rc;163 }164 165 111 /** Get the root device. 166 112 * … … 185 131 printf(NAME ": failed to add child device for platform.\n"); 186 132 187 /* Register virtual USB host controller. */188 int rc = add_virtual_usb_host_controller(dev);189 if (EOK != rc) {190 printf(NAME ": failed to add child device - virtual USB HC.\n");191 }192 193 133 return res; 194 134 } -
uspace/drv/rootvirt/devices.def
rfe2333d r0a5a950 18 18 }, 19 19 #endif 20 /* Virtual USB host controller. */ 21 { 22 .name = "usbhc", 23 .match_id = "usb&hc=vhc" 24 }, -
uspace/lib/usb/src/usbdrv.c
rfe2333d r0a5a950 71 71 devman_handle_t handle; 72 72 73 rc = devman_device_get_handle("/v hc", &handle, 0);73 rc = devman_device_get_handle("/virt/usbhc", &handle, 0); 74 74 if (rc != EOK) { 75 75 return rc; -
uspace/lib/usbvirt/main.c
rfe2333d r0a5a950 183 183 } 184 184 185 /** Create necessary phones for com unication with virtual HCD.185 /** Create necessary phones for communication with virtual HCD. 186 186 * This function wraps following calls: 187 * -# open <code>/dev/devices/\\v hc for reading187 * -# open <code>/dev/devices/\\virt\\usbhc for reading 188 188 * -# access phone of file opened in previous step 189 189 * -# create callback through just opened phone … … 193 193 * @warning This function is wrapper for several actions and therefore 194 194 * it is not possible - in case of error - to determine at which point 195 * error occured. 196 * 197 * @param hcd_path HCD identification under devfs 198 * (without <code>/dev/usb/</code>). 195 * error occurred. 196 * 199 197 * @param dev Device to connect. 200 198 * @return EOK on success or error code from errno.h. … … 207 205 } 208 206 209 const char *vhc_path = "/v hc";207 const char *vhc_path = "/virt/usbhc"; 210 208 int rc; 211 209 devman_handle_t handle;
Note:
See TracChangeset
for help on using the changeset viewer.