Changeset dc4c19e in mainline for uspace/lib/usb/include
- Timestamp:
- 2011-04-10T12:18:09Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 60c0573
- Parents:
- a49e171 (diff), 82e8861 (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. - Location:
- uspace/lib/usb/include/usb
- Files:
-
- 9 edited
-
classes/hub.h (modified) (2 diffs)
-
devdrv.h (modified) (1 diff)
-
host/batch.h (modified) (1 diff)
-
host/device_keeper.h (modified) (2 diffs)
-
host/endpoint.h (modified) (3 diffs)
-
host/usb_endpoint_manager.h (modified) (1 diff)
-
hub.h (modified) (1 diff)
-
pipes.h (modified) (5 diffs)
-
usb.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hub.h
ra49e171 rdc4c19e 43 43 */ 44 44 typedef enum { 45 USB_HUB_FEATURE_HUB_LOCAL_POWER = 0, 46 USB_HUB_FEATURE_HUB_OVER_CURRENT = 1, 45 47 USB_HUB_FEATURE_C_HUB_LOCAL_POWER = 0, 46 48 USB_HUB_FEATURE_C_HUB_OVER_CURRENT = 1, … … 59 61 /* USB_HUB_FEATURE_ = , */ 60 62 } usb_hub_class_feature_t; 63 61 64 62 65 /** Header of standard hub descriptor without the "variadic" part. */ -
uspace/lib/usb/include/usb/devdrv.h
ra49e171 rdc4c19e 169 169 usb_polling_callback_t, size_t, usb_polling_terminted_callback_t, void *); 170 170 171 int usb_device_retrieve_descriptors(usb_pipe_t *, usb_device_descriptors_t *); 172 int usb_device_create_pipes(ddf_dev_t *, usb_device_connection_t *, 173 usb_endpoint_description_t **, uint8_t *, size_t, int, int, 174 usb_endpoint_mapping_t **, size_t *); 175 int usb_device_destroy_pipes(ddf_dev_t *, usb_endpoint_mapping_t *, size_t); 176 177 size_t usb_interface_count_alternates(uint8_t *, size_t, uint8_t); 178 171 179 #endif 172 180 /** -
uspace/lib/usb/include/usb/host/batch.h
ra49e171 rdc4c19e 92 92 void usb_transfer_batch_call_in(usb_transfer_batch_t *instance); 93 93 void usb_transfer_batch_call_out(usb_transfer_batch_t *instance); 94 void usb_transfer_batch_finish(usb_transfer_batch_t *instance, int error); 94 void usb_transfer_batch_finish(usb_transfer_batch_t *instance); 95 96 static inline void usb_transfer_batch_finish_error( 97 usb_transfer_batch_t *instance, int error) 98 { 99 assert(instance); 100 instance->error = error; 101 usb_transfer_batch_finish(instance); 102 } 95 103 96 104 #endif -
uspace/lib/usb/include/usb/host/device_keeper.h
ra49e171 rdc4c19e 71 71 void usb_device_keeper_init(usb_device_keeper_t *instance); 72 72 73 void usb_device_keeper_add_ep(74 usb_device_keeper_t *instance, usb_address_t address, endpoint_t *ep);75 76 73 void usb_device_keeper_reserve_default_address( 77 74 usb_device_keeper_t *instance, usb_speed_t speed); … … 96 93 usb_speed_t usb_device_keeper_get_speed(usb_device_keeper_t *instance, 97 94 usb_address_t address); 98 99 void usb_device_keeper_use_control(usb_device_keeper_t *instance,100 usb_target_t target);101 102 void usb_device_keeper_release_control(usb_device_keeper_t *instance,103 usb_target_t target);104 105 95 #endif 106 96 /** -
uspace/lib/usb/include/usb/host/endpoint.h
ra49e171 rdc4c19e 39 39 #include <bool.h> 40 40 #include <adt/list.h> 41 #include <fibril_synch.h> 42 41 43 #include <usb/usb.h> 42 44 … … 48 50 usb_speed_t speed; 49 51 size_t max_packet_size; 50 bool active;51 52 unsigned toggle:1; 52 link_t same_device_eps; 53 fibril_mutex_t guard; 54 fibril_condvar_t avail; 55 volatile bool active; 53 56 } endpoint_t; 54 57 … … 59 62 void endpoint_destroy(endpoint_t *instance); 60 63 64 void endpoint_use(endpoint_t *instance); 65 66 void endpoint_release(endpoint_t *instance); 67 61 68 int endpoint_toggle_get(endpoint_t *instance); 62 69 63 70 void endpoint_toggle_set(endpoint_t *instance, int toggle); 64 71 65 void endpoint_toggle_reset(link_t *ep); 66 67 void endpoint_toggle_reset_filtered(link_t *ep, usb_endpoint_t epn); 68 72 void endpoint_toggle_reset_filtered(endpoint_t *instance, usb_target_t target); 69 73 #endif 70 74 /** -
uspace/lib/usb/include/usb/host/usb_endpoint_manager.h
ra49e171 rdc4c19e 78 78 size_t *bw); 79 79 80 void usb_endpoint_manager_reset_if_need( 81 usb_endpoint_manager_t *instance, usb_target_t target, const uint8_t *data); 80 82 #endif 81 83 /** -
uspace/lib/usb/include/usb/hub.h
ra49e171 rdc4c19e 59 59 } usb_hc_attached_device_t; 60 60 61 int usb_hc_reserve_default_address(usb_hc_connection_t *, usb_speed_t);62 int usb_hc_release_default_address(usb_hc_connection_t *);63 64 61 usb_address_t usb_hc_request_address(usb_hc_connection_t *, usb_speed_t); 65 62 int usb_hc_register_device(usb_hc_connection_t *, -
uspace/lib/usb/include/usb/pipes.h
ra49e171 rdc4c19e 42 42 #include <ipc/devman.h> 43 43 #include <ddf/driver.h> 44 #include <fibril_synch.h> 44 45 45 46 /** Abstraction of a physical connection to the device. … … 59 60 * This endpoint must be bound with existing usb_device_connection_t 60 61 * (i.e. the wire to send data over). 62 * 63 * Locking order: if you want to lock both mutexes 64 * (@c guard and @c hc_phone_mutex), lock @c guard first. 65 * It is not necessary to lock @c guard if you want to lock @c hc_phone_mutex 66 * only. 61 67 */ 62 68 typedef struct { 69 /** Guard of the whole pipe. */ 70 fibril_mutex_t guard; 71 63 72 /** The connection used for sending the data. */ 64 73 usb_device_connection_t *wire; … … 78 87 /** Phone to the host controller. 79 88 * Negative when no session is active. 89 * It is an error to access this member without @c hc_phone_mutex 90 * being locked. 91 * If call over the phone is to be made, it must be preceeded by 92 * call to pipe_add_ref() [internal libusb function]. 80 93 */ 81 94 int hc_phone; 95 96 /** Guard for serialization of requests over the phone. */ 97 fibril_mutex_t hc_phone_mutex; 98 99 /** Number of active transfers over the pipe. */ 100 int refcount; 82 101 } usb_pipe_t; 83 102 … … 134 153 int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *, 135 154 size_t, uint8_t *, size_t, usb_device_connection_t *); 155 int usb_pipe_register_with_speed(usb_pipe_t *, usb_speed_t, 156 unsigned int, usb_hc_connection_t *); 136 157 int usb_pipe_register(usb_pipe_t *, unsigned int, usb_hc_connection_t *); 137 158 int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *); … … 140 161 int usb_pipe_end_session(usb_pipe_t *); 141 162 bool usb_pipe_is_session_started(usb_pipe_t *); 163 164 int usb_pipe_start_long_transfer(usb_pipe_t *); 165 void usb_pipe_end_long_transfer(usb_pipe_t *); 142 166 143 167 int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *); -
uspace/lib/usb/include/usb/usb.h
ra49e171 rdc4c19e 77 77 USB_SPEED_FULL, 78 78 /** USB 2.0 high speed (480Mbits/s). */ 79 USB_SPEED_HIGH 79 USB_SPEED_HIGH, 80 /** Psuedo-speed serving as a boundary. */ 81 USB_SPEED_MAX 80 82 } usb_speed_t; 81 83
Note:
See TracChangeset
for help on using the changeset viewer.
