Changes in uspace/drv/bus/usb/usbhub/usbhub.h [b7fd2a0:ae3a941] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.h
rb7fd2a0 rae3a941 2 2 * Copyright (c) 2010 Vojtech Horky 3 3 * Copyright (c) 2011 Vojtech Horky 4 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek 4 5 * All rights reserved. 5 6 * … … 39 40 40 41 #include <ddf/driver.h> 42 #include <fibril_synch.h> 41 43 42 44 #include <usb/classes/hub.h> … … 44 46 #include <usb/dev/pipes.h> 45 47 #include <usb/dev/driver.h> 46 47 #include <fibril_synch.h> 48 #include <usb/dev/poll.h> 48 49 49 50 #define NAME "usbhub" 50 51 51 52 #include "port.h" 53 #include "status.h" 52 54 53 55 /** Information about attached hub. */ … … 57 59 /** Port structures, one for each port */ 58 60 usb_hub_port_t *ports; 61 /** Speed of the hub */ 62 usb_speed_t speed; 59 63 /** Generic usb device data*/ 60 64 usb_device_t *usb_device; 61 62 /** Number of pending operations on the mutex to prevent shooting 63 * ourselves in the foot. 64 * When the hub is disconnected but we are in the middle of some 65 * operation, we cannot destroy this structure right away because 66 * the pending operation might use it. 67 */ 68 size_t pending_ops_count; 69 /** Guard for pending_ops_count. */ 70 fibril_mutex_t pending_ops_mutex; 71 /** Condition variable for pending_ops_count. */ 72 fibril_condvar_t pending_ops_cv; 65 /** Data polling handle. */ 66 usb_polling_t polling; 73 67 /** Pointer to usbhub function. */ 74 68 ddf_fun_t *hub_fun; 75 /** Status indicator*/76 bool running;69 /** Device communication pipe. */ 70 usb_pipe_t *control_pipe; 77 71 /** Hub supports port power switching. */ 78 72 bool power_switched; 79 73 /** Each port is switched individually. */ 80 74 bool per_port_power; 75 /** Whether MTT is available */ 76 bool mtt_available; 81 77 }; 82 78 83 extern const usb_endpoint_description_t hub_status_change_endpoint_description;79 extern const usb_endpoint_description_t *usb_hub_endpoints []; 84 80 85 e xtern errno_t usb_hub_device_add(usb_device_t *);86 e xtern errno_t usb_hub_device_remove(usb_device_t *);87 e xtern errno_t usb_hub_device_gone(usb_device_t *);81 errno_t usb_hub_device_add(usb_device_t *); 82 errno_t usb_hub_device_remove(usb_device_t *); 83 errno_t usb_hub_device_gone(usb_device_t *); 88 84 89 extern bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t, 90 void *); 85 errno_t usb_hub_set_depth(const usb_hub_dev_t *); 86 errno_t usb_hub_get_port_status(const usb_hub_dev_t *, size_t, 87 usb_port_status_t *); 88 errno_t usb_hub_set_port_feature(const usb_hub_dev_t *, size_t, 89 usb_hub_class_feature_t); 90 errno_t usb_hub_clear_port_feature(const usb_hub_dev_t *, size_t, 91 usb_hub_class_feature_t); 92 93 bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t, void *); 94 95 errno_t usb_hub_reserve_default_address(usb_hub_dev_t *, async_exch_t *, 96 usb_port_t *); 97 errno_t usb_hub_release_default_address(usb_hub_dev_t *, async_exch_t *); 91 98 92 99 #endif
Note:
See TracChangeset
for help on using the changeset viewer.