Changes in uspace/lib/usbhost/include/usb/host/usb_device_manager.h [8b54fe6:0cd8089] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/usb_device_manager.h
r8b54fe6 r0cd8089 49 49 #define USB_ADDRESS_COUNT (USB11_ADDRESS_MAX + 1) 50 50 51 /** Information about attached USB device. */52 struct usb_device_info {53 usb_speed_t speed;54 bool occupied;55 devman_handle_t handle;56 };57 58 51 /** Host controller device manager. 59 * You shall not access members directly but only using functions below.52 * You shall not access members directly. 60 53 */ 61 54 typedef struct { 62 struct usb_device_info devices[USB_ADDRESS_COUNT]; 55 /** Information about attached USB devices. */ 56 struct { 57 usb_speed_t speed; /**< Device speed */ 58 bool occupied; /**< The address is in use. */ 59 devman_handle_t handle; /**< Devman handle of the device. */ 60 } devices[USB_ADDRESS_COUNT]; 61 usb_speed_t max_speed; 63 62 fibril_mutex_t guard; 63 /** The last reserved address */ 64 64 usb_address_t last_address; 65 65 } usb_device_manager_t; 66 66 67 void usb_device_manager_init(usb_device_manager_t *instance); 67 void usb_device_manager_init( 68 usb_device_manager_t *instance, usb_speed_t max_speed); 68 69 69 usb_address_t usb_device_manager_get_free_address( 70 usb_ device_manager_t *instance, usb_speed_t speed);70 int usb_device_manager_request_address(usb_device_manager_t *instance, 71 usb_address_t *address, bool strict, usb_speed_t speed); 71 72 72 void usb_device_manager_bind(usb_device_manager_t *instance,73 int usb_device_manager_bind_address(usb_device_manager_t *instance, 73 74 usb_address_t address, devman_handle_t handle); 74 75 75 void usb_device_manager_release(usb_device_manager_t *instance,76 int usb_device_manager_release_address(usb_device_manager_t *instance, 76 77 usb_address_t address); 77 78 78 usb_address_t usb_device_manager_find (usb_device_manager_t *instance,79 usb_address_t usb_device_manager_find_address(usb_device_manager_t *instance, 79 80 devman_handle_t handle); 80 81 81 bool usb_device_manager_find_by_address(usb_device_manager_t *instance, 82 usb_address_t address, devman_handle_t *handle); 83 84 usb_speed_t usb_device_manager_get_speed(usb_device_manager_t *instance, 85 usb_address_t address); 82 int usb_device_manager_get_info_by_address(usb_device_manager_t *instance, 83 usb_address_t address, devman_handle_t *handle, usb_speed_t *speed); 86 84 #endif 87 85 /**
Note:
See TracChangeset
for help on using the changeset viewer.