Changeset 7a7bfeb3 in mainline for uspace/srv/hw/bus/usb/hcd/virtual/hub.c
- Timestamp:
- 2010-10-24T16:43:40Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 355f7c2
- Parents:
- b8a3cda
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/usb/hcd/virtual/hub.c
rb8a3cda r7a7bfeb3 144 144 hub_device_t hub_dev; 145 145 146 static int send_data(struct usbvirt_device *dev,147 usb_endpoint_t endpoint, void *buffer, size_t size)148 {149 usb_target_t target = { dev->address, endpoint };150 void *my_buffer = NULL;151 if (size > 0) {152 my_buffer = malloc(size);153 memcpy(my_buffer, buffer, size);154 }155 hc_fillin_transaction_from_device(target, my_buffer, size);156 157 return EOK;158 }159 160 146 void hub_init(void) 161 147 { … … 170 156 171 157 usbvirt_connect_local(&virthub_dev); 172 virthub_dev.send_data = send_data;158 //virthub_dev.send_data = send_data; 173 159 174 160 printf("%s: virtual hub (%d ports) created.\n", NAME, HUB_PORT_COUNT); … … 235 221 } 236 222 237 void hub_check_port_changes(void)238 {239 /* FIXME - what if HUB_PORT_COUNT is greater than 8. */240 uint8_t change_map = 0;241 242 size_t i;243 for (i = 0; i < HUB_PORT_COUNT; i++) {244 hub_port_t *port = &hub_dev.ports[i];245 246 if (port->status_change != 0) {247 change_map |= (1 << (i + 1));248 }249 }250 251 /* FIXME - do not send when it has not changed since previous run. */252 if (change_map != 0) {253 virthub_dev.send_data(&virthub_dev, HUB_STATUS_CHANGE_PIPE,254 &change_map, 1);255 }256 }257 223 258 224 /**
Note:
See TracChangeset
for help on using the changeset viewer.