Requests are implemented as initialized request structures. Each different endpoint type takes a different type of request. Each type of request has a different request structure type. The following table shows the structure type for each type of request. This table also lists the functions to use to allocate and free each type of structure.
Table 20–1 Request Initialization
Pipe or Endpoint Type |
Request Structure |
Request Structure Allocation Function |
Request Structure Free Function |
---|---|---|---|
Control |
usb_ctrl_req_t (see the usb_ctrl_request(9S) man page) | ||
Bulk |
usb_bulk_req_t (see the usb_bulk_request(9S) man page) | ||
Interrupt |
usb_intr_req_t (see the usb_intr_request(9S) man page) | ||
Isochronous |
usb_isoc_req_t (see the usb_isoc_request(9S) man page) |
The following table lists the transfer functions that you can use for each type of request.
Table 20–2 Request Transfer Setup
Pipe or Endpoint Type |
Transfer Functions |
---|---|
Control | |
Bulk | |
Interrupt | |
Isochronous |
Use the following procedure to allocate and deallocate a request:
Use the appropriate allocation function to allocate a request structure for the type of request you need. The man pages for the request structure allocation functions are listed in Table 20–1.
Initialize any fields you need in the structure. See Request Features and Fields or the appropriate request structure man page for more information. The man pages for the request structures are listed in Table 20–1.
When the data transfer is complete, use the appropriate free function to free the request structure. The man pages for the request structure free functions are listed in Table 20–1.