USB: Support physical-vector bulk requests.

Introduce a new utility method, "generic_memcpy", which takes
generic_addr_t plus indications of whether these specify virtual or
physical addresses (and potentially user addresess) and calls the
appropriate memcpy variant depending.

All bus drivers adjusted to support this at once. We don't actually
take advantage of the physical addresses in any way (yet), as USB
controllers have some pretty specific requirements that would have
to be carefully validated to use these directly.

All bus drivers tested and confirmed to still be working.

Change-Id: I66326667e148091147bb2b3d0843a26fb7e5bda6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6479
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2023-05-30 17:54:28 +00:00
committed by waddlesplash
parent 99626c2908
commit 55a468820c
14 changed files with 199 additions and 93 deletions
+9 -5
View File
@@ -182,6 +182,11 @@ struct usb_module_info {
usb_callback_func callback,
void *callbackCookie);
status_t (*queue_bulk_v_physical)(usb_pipe pipe,
physical_entry *vectors, size_t vectorCount,
usb_callback_func callback,
void *callbackCookie);
status_t (*queue_isochronous)(usb_pipe pipe,
void *data, size_t dataLength,
usb_iso_packet_descriptor *packetDesc,
@@ -206,6 +211,9 @@ struct usb_module_info {
/* Cancel all pending async requests in a pipe */
status_t (*cancel_queued_transfers)(usb_pipe pipe);
/* Cancel all pending async requests in a device control pipe */
status_t (*cancel_queued_requests)(usb_device device);
/* Tuning, configuration of timeouts, etc */
status_t (*usb_ioctl)(uint32 opcode, void *buffer,
size_t bufferSize);
@@ -247,14 +255,10 @@ struct usb_module_info {
uint8 portIndex);
status_t (*disable_port)(usb_device hub,
uint8 portIndex);
/* Cancel all pending async requests in a device control pipe */
status_t (*cancel_queued_requests)(usb_device device);
};
#define B_USB_MODULE_NAME "bus_managers/usb/v3"
#define B_USB_MODULE_NAME "bus_managers/usb/v3.1"
#ifdef __cplusplus