Changeset 361fcec in mainline for uspace/drv/usbhub
- Timestamp:
- 2011-04-29T08:33:43Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 152ec79, a146aa33
- Parents:
- 54d71e1
- Location:
- uspace/drv/usbhub
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
r54d71e1 r361fcec 55 55 }; 56 56 57 57 /** 58 * usb hub driver operations 59 * 60 * The most important one is add_device, which is set to usb_hub_add_device. 61 */ 58 62 static usb_driver_ops_t usb_hub_driver_ops = { 59 63 .add_device = usb_hub_add_device 60 64 }; 61 65 66 /** 67 * hub endpoints, excluding control endpoint 68 */ 62 69 static usb_endpoint_description_t *usb_hub_endpoints[] = { 63 70 &hub_status_change_endpoint_description, … … 65 72 }; 66 73 74 /** 75 * static usb hub driver information 76 */ 67 77 static usb_driver_t usb_hub_driver = { 68 78 .name = NAME, -
uspace/drv/usbhub/ports.c
r54d71e1 r361fcec 167 167 168 168 //close address 169 //if (hub->attached_devs[port].address != 0) {170 169 if(hub->ports[port].attached_device.address >= 0){ 171 170 /*uncomment this code to use it when DDF allows device removal … … 182 181 */ 183 182 } else { 184 // TODO: is this really reason to print a warning?185 183 usb_log_warning("Device removed before being registered.\n"); 186 184 -
uspace/drv/usbhub/usbhub.c
r54d71e1 r361fcec 73 73 74 74 75 /// \TODO malloc checking76 77 75 //********************************************* 78 76 // … … 248 246 hub_info->ports = malloc( 249 247 sizeof (usb_hub_port_t) * (hub_info->port_count + 1)); 248 if(!hub_info->ports){ 249 return ENOMEM; 250 } 250 251 size_t port; 251 252 for (port = 0; port < hub_info->port_count + 1; ++port) { … … 255 256 usb_log_debug("is_power_switched\n"); 256 257 258 if(!has_individual_port_powering){ 259 usb_log_debug("!has_individual_port_powering\n"); 260 opResult = usb_hub_set_feature(hub_info->control_pipe, 261 USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 262 if (opResult != EOK) { 263 usb_log_error("cannot power hub: %s\n", 264 str_error(opResult)); 265 } 266 } 267 257 268 for (port = 1; port <= hub_info->port_count; ++port) { 258 269 usb_log_debug("Powering port %zu.\n",port); … … 264 275 } 265 276 } 266 if(!has_individual_port_powering){ 267 usb_log_debug("!has_individual_port_powering\n"); 268 opResult = usb_hub_set_feature(hub_info->control_pipe, 269 USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 270 if (opResult != EOK) { 271 usb_log_error("cannot power hub: %s\n", 272 str_error(opResult)); 273 } 274 } 277 275 278 }else{ 276 usb_log_debug("!is_power_switched \n");279 usb_log_debug("!is_power_switched, not going to be powered\n"); 277 280 } 278 281 usb_log_debug2("freeing data\n");
Note:
See TracChangeset
for help on using the changeset viewer.
