Changeset 00aece0 in mainline for uspace/lib/usbhost/include/usb/host/usb_device_manager.h
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (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/lib/usbhost/include/usb/host/usb_device_manager.h
rbd5f3b7 r00aece0 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup libusbhost 30 29 * @{ 31 30 */ 32 31 /** @file 33 * Device keeper structure and functions.32 * Device manager structure and functions. 34 33 * 35 34 * Typical USB host controller needs to keep track of various settings for … … 38 37 * This structure shall simplify the management. 39 38 */ 40 #ifndef LIBUSBHOST_HOST_ DEVICE_KEEPER_H41 #define LIBUSBHOST_HOST_ DEVICE_KEEPER_H39 #ifndef LIBUSBHOST_HOST_USB_DEVICE_MANAGER_H 40 #define LIBUSBHOST_HOST_USB_DEVICE_MANAGER_H 42 41 43 42 #include <adt/list.h> … … 50 49 #define USB_ADDRESS_COUNT (USB11_ADDRESS_MAX + 1) 51 50 52 /** Information about attached USB device. */ 53 struct usb_device_info { 54 usb_speed_t speed; 55 bool occupied; 56 devman_handle_t handle; 57 }; 58 59 /** Host controller device keeper. 60 * You shall not access members directly but only using functions below. 51 /** Host controller device manager. 52 * You shall not access members directly. 61 53 */ 62 54 typedef struct { 63 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 /** Maximum speed allowed. */ 62 usb_speed_t max_speed; 63 /** Protect access to members. */ 64 64 fibril_mutex_t guard; 65 /** The last reserved address */ 65 66 usb_address_t last_address; 66 } usb_device_ keeper_t;67 } usb_device_manager_t; 67 68 68 void usb_device_keeper_init(usb_device_keeper_t *instance); 69 void usb_device_manager_init( 70 usb_device_manager_t *instance, usb_speed_t max_speed); 69 71 70 usb_address_t device_keeper_get_free_address(usb_device_keeper_t *instance,71 usb_ speed_t speed);72 int usb_device_manager_request_address(usb_device_manager_t *instance, 73 usb_address_t *address, bool strict, usb_speed_t speed); 72 74 73 void usb_device_keeper_bind(usb_device_keeper_t *instance,75 int usb_device_manager_bind_address(usb_device_manager_t *instance, 74 76 usb_address_t address, devman_handle_t handle); 75 77 76 void usb_device_keeper_release(usb_device_keeper_t *instance,78 int usb_device_manager_release_address(usb_device_manager_t *instance, 77 79 usb_address_t address); 78 80 79 usb_address_t usb_device_ keeper_find(usb_device_keeper_t *instance,81 usb_address_t usb_device_manager_find_address(usb_device_manager_t *instance, 80 82 devman_handle_t handle); 81 83 82 bool usb_device_keeper_find_by_address(usb_device_keeper_t *instance, 83 usb_address_t address, devman_handle_t *handle); 84 85 usb_speed_t usb_device_keeper_get_speed(usb_device_keeper_t *instance, 86 usb_address_t address); 84 int usb_device_manager_get_info_by_address(usb_device_manager_t *instance, 85 usb_address_t address, devman_handle_t *handle, usb_speed_t *speed); 87 86 #endif 88 87 /**
Note:
See TracChangeset
for help on using the changeset viewer.