Changeset 6626bba9 in mainline
- Timestamp:
- 2011-10-12T19:04:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 205f0766
- Parents:
- 196fbb0
- Location:
- uspace/drv/bus/usb/usbhub
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/port.c
r196fbb0 r6626bba9 50 50 /** Information for fibril for device discovery. */ 51 51 struct add_device_phase1 { 52 usb_hub_ info_t *hub;52 usb_hub_dev_t *hub; 53 53 usb_hub_port_t *port; 54 54 usb_speed_t speed; … … 56 56 57 57 static void usb_hub_port_removed_device(usb_hub_port_t *port, 58 usb_hub_ info_t *hub);58 usb_hub_dev_t *hub); 59 59 static void usb_hub_port_reset_completed(usb_hub_port_t *port, 60 60 usb_port_status_t status); … … 62 62 static int enable_port_callback(int port_no, void *arg); 63 63 static int add_device_phase1_worker_fibril(void *arg); 64 static int create_add_device_fibril(usb_hub_port_t *port, usb_hub_ info_t *hub,64 static int create_add_device_fibril(usb_hub_port_t *port, usb_hub_dev_t *hub, 65 65 usb_speed_t speed); 66 66 … … 130 130 * @param port port number, starting from 1 131 131 */ 132 void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_ info_t *hub)132 void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_dev_t *hub) 133 133 { 134 134 assert(port); … … 249 249 */ 250 250 static void usb_hub_port_removed_device(usb_hub_port_t *port, 251 usb_hub_ info_t *hub)251 usb_hub_dev_t *hub) 252 252 { 253 253 assert(port); … … 375 375 * 376 376 * @param port_no Port number (starting at 1). 377 * @param arg Custom argument, points to @c usb_hub_ info_t.377 * @param arg Custom argument, points to @c usb_hub_dev_t. 378 378 * @return Error code. 379 379 */ … … 463 463 * @return Error code. 464 464 */ 465 static int create_add_device_fibril(usb_hub_port_t *port, usb_hub_ info_t *hub,465 static int create_add_device_fibril(usb_hub_port_t *port, usb_hub_dev_t *hub, 466 466 usb_speed_t speed) 467 467 { -
uspace/drv/bus/usb/usbhub/port.h
r196fbb0 r6626bba9 40 40 #include <usb/classes/hub.h> 41 41 42 typedef struct usb_hub_ info usb_hub_info_t;42 typedef struct usb_hub_dev usb_hub_dev_t; 43 43 44 44 /** Information about single port on a hub. */ … … 78 78 79 79 void usb_hub_port_reset_fail(usb_hub_port_t *port); 80 void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_ info_t *hub);80 void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_dev_t *hub); 81 81 int usb_hub_port_clear_feature( 82 82 usb_hub_port_t *port, usb_hub_class_feature_t feature); -
uspace/drv/bus/usb/usbhub/usbhub.c
r196fbb0 r6626bba9 68 68 69 69 static int usb_set_first_configuration(usb_device_t *usb_device); 70 static usb_hub_ info_t * usb_hub_info_create(usb_device_t *usb_dev);71 static int usb_hub_process_hub_specific_info(usb_hub_ info_t *hub_info);72 static void usb_hub_over_current(const usb_hub_ info_t *hub_info,70 static usb_hub_dev_t * usb_hub_dev_create(usb_device_t *usb_dev); 71 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_info); 72 static void usb_hub_over_current(const usb_hub_dev_t *hub_info, 73 73 usb_hub_status_t status); 74 static void usb_hub_global_interrupt(const usb_hub_ info_t *hub_info);74 static void usb_hub_global_interrupt(const usb_hub_dev_t *hub_info); 75 75 static void usb_hub_polling_terminated_callback(usb_device_t *device, 76 76 bool was_error, void *data); … … 100 100 assert(usb_dev); 101 101 /* Create driver soft-state structure */ 102 usb_hub_ info_t *hub_info = usb_hub_info_create(usb_dev);102 usb_hub_dev_t *hub_info = usb_hub_dev_create(usb_dev); 103 103 if (hub_info == NULL) { 104 104 usb_log_error("Failed to create hun driver structure.\n"); … … 174 174 * @param change_bitmap Bitmap of changed ports. 175 175 * @param change_bitmap_size Size of the bitmap in bytes. 176 * @param arg Custom argument, points to @c usb_hub_ info_t.176 * @param arg Custom argument, points to @c usb_hub_dev_t. 177 177 * @return Whether to continue polling. 178 178 */ … … 181 181 { 182 182 usb_log_debug("hub_port_changes_callback\n"); 183 usb_hub_ info_t *hub = arg;183 usb_hub_dev_t *hub = arg; 184 184 assert(hub); 185 185 … … 207 207 /*----------------------------------------------------------------------------*/ 208 208 /** 209 * create usb_hub_ info_t structure209 * create usb_hub_dev_t structure 210 210 * 211 211 * Does only basic copying of known information into new structure. 212 212 * @param usb_dev usb device structure 213 * @return basic usb_hub_ info_t structure214 */ 215 static usb_hub_ info_t * usb_hub_info_create(usb_device_t *usb_dev)213 * @return basic usb_hub_dev_t structure 214 */ 215 static usb_hub_dev_t * usb_hub_dev_create(usb_device_t *usb_dev) 216 216 { 217 217 assert(usb_dev); 218 usb_hub_ info_t *info = malloc(sizeof(usb_hub_info_t));218 usb_hub_dev_t *info = malloc(sizeof(usb_hub_dev_t)); 219 219 if (!info) 220 220 return NULL; … … 241 241 * @return error code 242 242 */ 243 static int usb_hub_process_hub_specific_info(usb_hub_ info_t *hub_info)243 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_info) 244 244 { 245 245 assert(hub_info); … … 359 359 * @return error code 360 360 */ 361 static void usb_hub_over_current(const usb_hub_ info_t *hub_info,361 static void usb_hub_over_current(const usb_hub_dev_t *hub_info, 362 362 usb_hub_status_t status) 363 363 { … … 398 398 * @param hub_info hub instance 399 399 */ 400 static void usb_hub_global_interrupt(const usb_hub_ info_t *hub_info)400 static void usb_hub_global_interrupt(const usb_hub_dev_t *hub_info) 401 401 { 402 402 assert(hub_info); … … 459 459 * @param device usb device afected 460 460 * @param was_error indicates that the fibril is stoped due to an error 461 * @param data pointer to usb_hub_ info_t structure461 * @param data pointer to usb_hub_dev_t structure 462 462 */ 463 463 static void usb_hub_polling_terminated_callback(usb_device_t *device, 464 464 bool was_error, void *data) 465 465 { 466 usb_hub_ info_t *hub = data;466 usb_hub_dev_t *hub = data; 467 467 assert(hub); 468 468 -
uspace/drv/bus/usb/usbhub/usbhub.h
r196fbb0 r6626bba9 52 52 53 53 /** Information about attached hub. */ 54 struct usb_hub_ info{54 struct usb_hub_dev { 55 55 /** Number of ports. */ 56 56 size_t port_count; 57 58 /** Attached device handles, for each port one */ 57 /** Port structures, one for each port */ 59 58 usb_hub_port_t *ports; 60 61 59 /** Connection to hcd */ 62 60 usb_hc_connection_t connection; 63 64 61 /** Generic usb device data*/ 65 62 usb_device_t *usb_device; … … 76 73 /** Condition variable for pending_ops_count. */ 77 74 fibril_condvar_t pending_ops_cv; 75 /** Pointer to devman usbhub function. */ 78 76 ddf_fun_t *hub_fun; 79 77 };
Note:
See TracChangeset
for help on using the changeset viewer.