Changeset 5e07cbc0 in mainline
- Timestamp:
- 2011-10-31T13:39:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0cd8089
- Parents:
- 27ed734c
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
r27ed734c r5e07cbc0 193 193 list_initialize(&instance->pending_batches); 194 194 195 hcd_init(&instance->generic, BANDWIDTH_AVAILABLE_USB11,196 bandwidth_count_usb11);195 hcd_init(&instance->generic, USB_SPEED_FULL, 196 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 197 197 instance->generic.private_data = instance; 198 198 instance->generic.schedule = hc_schedule; -
uspace/drv/bus/usb/uhci/hc.c
r27ed734c r5e07cbc0 199 199 #undef CHECK_RET_RETURN 200 200 201 hcd_init(&instance->generic, BANDWIDTH_AVAILABLE_USB11,202 bandwidth_count_usb11);201 hcd_init(&instance->generic, USB_SPEED_FULL, 202 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 203 203 204 204 instance->generic.private_data = instance; -
uspace/drv/bus/usb/vhc/main.c
r27ed734c r5e07cbc0 80 80 return rc; 81 81 } 82 usb_device_manager_init(&data->dev_manager );82 usb_device_manager_init(&data->dev_manager, USB_SPEED_MAX); 83 83 84 84 ddf_fun_t *hc = ddf_fun_create(dev, fun_exposed, "hc"); -
uspace/lib/usbhost/include/usb/host/hcd.h
r27ed734c r5e07cbc0 68 68 * @param bw_count Bandwidth compute function, passed to endpoint manager. 69 69 */ 70 static inline void hcd_init(hcd_t *hcd, size_t bandwidth,70 static inline void hcd_init(hcd_t *hcd, usb_speed_t max_speed, size_t bandwidth, 71 71 size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t)) 72 72 { 73 73 assert(hcd); 74 usb_device_manager_init(&hcd->dev_manager );74 usb_device_manager_init(&hcd->dev_manager, max_speed); 75 75 usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count); 76 76 hcd->private_data = NULL; -
uspace/lib/usbhost/include/usb/host/usb_device_manager.h
r27ed734c r5e07cbc0 59 59 devman_handle_t handle; /**< Devman handle of the device. */ 60 60 } devices[USB_ADDRESS_COUNT]; 61 usb_speed_t max_speed; 61 62 fibril_mutex_t guard; 62 63 /** The last reserved address */ … … 64 65 } usb_device_manager_t; 65 66 66 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); 67 69 68 70 usb_address_t usb_device_manager_get_free_address( -
uspace/lib/usbhost/src/usb_device_manager.c
r27ed734c r5e07cbc0 41 41 * 42 42 * @param[in] instance Memory place to initialize. 43 * @param[in] max_speed Maximum allowed USB speed of devices (inclusive). 43 44 * 44 45 * Set all values to false/0. 45 46 */ 46 void usb_device_manager_init(usb_device_manager_t *instance) 47 void usb_device_manager_init( 48 usb_device_manager_t *instance, usb_speed_t max_speed) 47 49 { 48 50 assert(instance); … … 56 58 instance->devices[0].occupied = true; 57 59 instance->last_address = 0; 60 instance->max_speed = max_speed; 58 61 fibril_mutex_initialize(&instance->guard); 59 62 } … … 69 72 { 70 73 assert(instance); 74 if (speed > instance->max_speed) 75 return ENOTSUP; 71 76 fibril_mutex_lock(&instance->guard); 72 77
Note:
See TracChangeset
for help on using the changeset viewer.