Changeset b8507a1 in mainline for uspace/srv/hw/bus/usb/hcd/virtual/devices.c
- Timestamp:
- 2010-10-20T21:17:32Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 6c741e1d
- Parents:
- 08af5a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/usb/hcd/virtual/devices.c
r08af5a6 rb8507a1 47 47 48 48 #include "devices.h" 49 #include "hub.h" 49 50 50 51 #define list_foreach(pos, head) \ … … 61 62 virtdev_connection_t *virtdev_recognise(int id, int phone) 62 63 { 63 virtdev_connection_t * dev = NULL; 64 switch (id) { 65 case USBVIRT_DEV_KEYBOARD_ID: 66 dev = virtdev_add_device(phone); 67 break; 68 default: 69 break; 70 } 64 virtdev_connection_t * dev = virtdev_add_device(phone); 71 65 72 66 /* … … 98 92 list_append(&dev->link, &devices); 99 93 94 hub_add_device(dev); 95 100 96 return dev; 101 97 } … … 105 101 void virtdev_destroy_device(virtdev_connection_t *dev) 106 102 { 103 hub_remove_device(dev); 107 104 list_remove(&dev->link); 108 105 free(dev); … … 119 116 virtdev_connection_t *dev 120 117 = list_get_instance(pos, virtdev_connection_t, link); 118 119 if (!hub_can_device_signal(dev)) { 120 continue; 121 } 121 122 122 123 ipc_call_t answer_data; … … 143 144 144 145 /* 146 * Send the data to the virtual hub as well 147 * (if the address matches). 148 */ 149 if (virthub_dev.address == transaction->target.address) { 150 virthub_dev.receive_data(&virthub_dev, transaction->target.endpoint, 151 transaction->buffer, transaction->len); 152 } 153 154 /* 145 155 * TODO: maybe screw some transactions to get more 146 156 * real-life image.
Note:
See TracChangeset
for help on using the changeset viewer.