Changeset ee9ea16 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c
- Timestamp:
- 2011-09-19T12:29:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d46b13d
- Parents:
- c94f643
- File:
-
- 1 edited
-
uspace/drv/bus/usb/usbhub/usbhub.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
rc94f643 ree9ea16 57 57 58 58 static usb_hub_info_t * usb_hub_info_create(usb_device_t *usb_dev); 59 60 59 static int usb_hub_process_hub_specific_info(usb_hub_info_t *hub_info); 61 62 60 static int usb_hub_set_configuration(usb_hub_info_t *hub_info); 63 64 61 static int usb_hub_start_hub_fibril(usb_hub_info_t *hub_info); 65 66 62 static int usb_process_hub_over_current(usb_hub_info_t *hub_info, 67 63 usb_hub_status_t status); 68 69 64 static int usb_process_hub_local_power_change(usb_hub_info_t *hub_info, 70 65 usb_hub_status_t status); 71 72 66 static void usb_hub_process_global_interrupt(usb_hub_info_t *hub_info); 73 74 67 static void usb_hub_polling_terminated_callback(usb_device_t *device, 75 68 bool was_error, void *data); … … 93 86 if (!usb_dev) return EINVAL; 94 87 usb_hub_info_t *hub_info = usb_hub_info_create(usb_dev); 88 95 89 //create hc connection 96 90 usb_log_debug("Initializing USB wire abstraction.\n"); 97 91 int opResult = usb_hc_connection_initialize_from_device( 98 &hub_info->connection, 99 hub_info->usb_device->ddf_dev); 100 if (opResult != EOK) { 101 usb_log_error("Could not initialize connection to device, " 102 " %s\n", 92 &hub_info->connection, hub_info->usb_device->ddf_dev); 93 if (opResult != EOK) { 94 usb_log_error("Could not initialize connection to device: %s\n", 103 95 str_error(opResult)); 104 96 free(hub_info); … … 109 101 opResult = usb_hub_set_configuration(hub_info); 110 102 if (opResult != EOK) { 111 usb_log_error("Could not set hub configuration ,%s\n",103 usb_log_error("Could not set hub configuration: %s\n", 112 104 str_error(opResult)); 113 105 free(hub_info); … … 190 182 * @return basic usb_hub_info_t structure 191 183 */ 192 static usb_hub_info_t * usb_hub_info_create(usb_device_t *usb_dev) { 193 usb_hub_info_t * result = malloc(sizeof (usb_hub_info_t)); 194 if (!result) return NULL; 184 static usb_hub_info_t * usb_hub_info_create(usb_device_t *usb_dev) 185 { 186 usb_hub_info_t *result = malloc(sizeof (usb_hub_info_t)); 187 if (!result) 188 return NULL; 189 195 190 result->usb_device = usb_dev; 196 191 result->status_change_pipe = usb_dev->pipes[0].pipe; … … 205 200 fibril_condvar_initialize(&result->pending_ops_cv); 206 201 result->pending_ops_count = 0; 202 207 203 return result; 208 204 }
Note:
See TracChangeset
for help on using the changeset viewer.
