Changeset 8c9e71a in mainline for uspace/drv/bus/usb/usbhub/port.h
- Timestamp:
- 2011-09-27T15:55:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1069714
- Parents:
- d3a9ae74 (diff), 747a1e71 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/port.h
rd3a9ae74 r8c9e71a 1 1 /* 2 2 * Copyright (c) 2011 Vojtech Horky 3 * Copyright (c) 2011 Jan Vesely 3 4 * All rights reserved. 4 5 * … … 26 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 28 */ 28 29 29 /** @addtogroup drvusbhub 30 30 * @{ … … 33 33 * Hub ports related functions. 34 34 */ 35 #ifndef DRV_USBHUB_PORT S_H36 #define DRV_USBHUB_PORT S_H35 #ifndef DRV_USBHUB_PORT_H 36 #define DRV_USBHUB_PORT_H 37 37 38 38 #include <usb/dev/driver.h> 39 39 #include <usb/dev/hub.h> 40 #include <usb/classes/hub.h> 40 41 41 42 typedef struct usb_hub_info_t usb_hub_info_t; … … 43 44 /** Information about single port on a hub. */ 44 45 typedef struct { 45 /** Mutex needed by CV for checking port reset. */ 46 fibril_mutex_t reset_mutex; 46 size_t port_number; 47 usb_pipe_t *control_pipe; 48 /** Mutex needed not only by CV for checking port reset. */ 49 fibril_mutex_t mutex; 47 50 /** CV for waiting to port reset completion. */ 48 51 fibril_condvar_t reset_cv; … … 62 65 * @param port Port to be initialized. 63 66 */ 64 static inline void usb_hub_port_init(usb_hub_port_t *port) { 67 static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number, 68 usb_pipe_t *control_pipe) 69 { 70 assert(port); 65 71 port->attached_device.address = -1; 66 72 port->attached_device.handle = 0; 67 fibril_mutex_initialize(&port->reset_mutex); 73 port->port_number = port_number; 74 port->control_pipe = control_pipe; 75 fibril_mutex_initialize(&port->mutex); 68 76 fibril_condvar_initialize(&port->reset_cv); 69 77 } 70 78 71 72 void usb_hub_process_port_interrupt(usb_hub_info_t *hub, 73 uint16_t port); 74 75 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); 81 int usb_hub_port_clear_feature( 82 usb_hub_port_t *port, usb_hub_class_feature_t feature); 83 int usb_hub_port_set_feature( 84 usb_hub_port_t *port, usb_hub_class_feature_t feature); 76 85 77 86 #endif
Note:
See TracChangeset
for help on using the changeset viewer.