Changes in uspace/lib/usbdev/include/usb/dev/pipes.h [b4292e7:47dfb34] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/pipes.h
rb4292e7 r47dfb34 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup libusbdev 30 29 * @{ … … 38 37 #include <sys/types.h> 39 38 #include <usb/usb.h> 40 #include <usb/ hc.h>39 #include <usb/dev.h> 41 40 #include <usb/descriptor.h> 42 41 #include <ipc/devman.h> … … 44 43 #include <fibril_synch.h> 45 44 #include <async.h> 46 47 /** Abstraction of a physical connection to the device.48 * This type is an abstraction of the USB wire that connects the host and49 * the function (device).50 */51 typedef struct {52 /** Handle of the host controller device is connected to. */53 devman_handle_t hc_handle;54 /** Address of the device. */55 usb_address_t address;56 } usb_device_connection_t;57 45 58 46 /** Abstraction of a logical connection to USB device endpoint. … … 85 73 /** Maximum packet size for the endpoint. */ 86 74 size_t max_packet_size; 87 88 /** Session to the host controller.89 * NULL when no session is active.90 * It is an error to access this member without @c hc_sess_mutex91 * being locked.92 * If call over the phone is to be made, it must be preceeded by93 * call to pipe_add_ref() [internal libusb function].94 */95 async_sess_t *hc_sess;96 97 /** Guard for serialization of requests over the session. */98 fibril_mutex_t hc_sess_mutex;99 100 /** Number of active transfers over the pipe. */101 int refcount;102 /** Number of failed attempts to open the HC phone.103 * When user requests usb_pipe_start_long_transfer() and the operation104 * fails, there is no way to report this to the user.105 * That the soft reference counter is increased to record the attempt.106 * When the user then request e.g. usb_pipe_read(), it will try to107 * add reference as well.108 * If that fails, it is reported to the user. If it is okay, the109 * real reference counter is incremented.110 * The problem might arise when ending the long transfer (since111 * the number of references would be only 1, but logically it shall be112 * two).113 * Decrementing the soft counter first shall solve this.114 */115 int refcount_soft;116 75 117 76 /** Whether to automatically reset halt on the endpoint. … … 156 115 } usb_endpoint_mapping_t; 157 116 158 int usb_device_connection_initialize_on_default_address(159 usb_device_connection_t *, usb_hc_connection_t *);160 int usb_device_connection_initialize_from_device(usb_device_connection_t *,161 const ddf_dev_t *);162 int usb_device_connection_initialize(usb_device_connection_t *,163 devman_handle_t, usb_address_t);164 117 165 118 int usb_device_get_assigned_interface(const ddf_dev_t *); … … 169 122 int usb_pipe_initialize_default_control(usb_pipe_t *, 170 123 usb_device_connection_t *); 124 171 125 int usb_pipe_probe_default_control(usb_pipe_t *); 172 126 int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *, 173 127 size_t, const uint8_t *, size_t, usb_device_connection_t *); 174 int usb_pipe_register(usb_pipe_t *, unsigned int, usb_hc_connection_t *);175 int usb_pipe_unregister(usb_pipe_t * , usb_hc_connection_t *);128 int usb_pipe_register(usb_pipe_t *, unsigned); 129 int usb_pipe_unregister(usb_pipe_t *); 176 130 177 voidusb_pipe_start_long_transfer(usb_pipe_t *);178 voidusb_pipe_end_long_transfer(usb_pipe_t *);131 int usb_pipe_start_long_transfer(usb_pipe_t *); 132 int usb_pipe_end_long_transfer(usb_pipe_t *); 179 133 180 134 int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *);
Note:
See TracChangeset
for help on using the changeset viewer.