#include <pipes.h>
Data Fields | |
bool | auto_reset_halt |
Whether to automatically reset halt on the endpoint. | |
usb_direction_t | direction |
Endpoint direction. | |
usb_endpoint_t | endpoint_no |
Endpoint number. | |
fibril_mutex_t | guard |
Guard of the whole pipe. | |
int | hc_phone |
Phone to the host controller. | |
fibril_mutex_t | hc_phone_mutex |
Guard for serialization of requests over the phone. | |
size_t | max_packet_size |
Maximum packet size for the endpoint. | |
int | refcount |
Number of active transfers over the pipe. | |
int | refcount_soft |
Number of failed attempts to open the HC phone. | |
usb_transfer_type_t | transfer_type |
Endpoint transfer type. | |
usb_device_connection_t * | wire |
The connection used for sending the data. |
It encapsulates endpoint attributes (transfer type etc.) as well as information about currently running sessions. This endpoint must be bound with existing usb_device_connection_t (i.e. the wire to send data over).
Locking order: if you want to lock both mutexes (guard
and hc_phone_mutex
), lock guard
first. It is not necessary to lock guard
if you want to lock hc_phone_mutex
only.
Definition at line 68 of file pipes.h.
int hc_phone |
Phone to the host controller.
Negative when no session is active. It is an error to access this member without hc_phone_mutex
being locked. If call over the phone is to be made, it must be preceeded by call to pipe_add_ref() [internal libusb function].
int refcount_soft |
Number of failed attempts to open the HC phone.
When user requests usb_pipe_start_long_transfer() and the operation fails, there is no way to report this to the user. That the soft reference counter is increased to record the attempt. When the user then request e.g. usb_pipe_read(), it will try to add reference as well. If that fails, it is reported to the user. If it is okay, the real reference counter is incremented. The problem might arise when ending the long transfer (since the number of references would be only 1, but logically it shall be two). Decrementing the soft counter first shall solve this.