From 60497373d08caf34e5dfae11facd763490f03af2 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 21 Feb 2019 20:15:58 -0500 Subject: [PATCH] USB: Pack the usb_request_data struct. We really should not be writing raw structs out to devices for endianness' sake, but that's currently what *all* the USB bus drivers do with this struct. So, add the _PACKED flag to ensure it's always precisely 8 bytes. Additionally, remove memory_chunk, as nothing uses it anymore. --- .../kernel/bus_managers/usb/usbspec_private.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/usb/usbspec_private.h b/src/add-ons/kernel/bus_managers/usb/usbspec_private.h index c9ca3686b7..dc8d068419 100644 --- a/src/add-ons/kernel/bus_managers/usb/usbspec_private.h +++ b/src/add-ons/kernel/bus_managers/usb/usbspec_private.h @@ -37,24 +37,16 @@ /* - Important data from the USB spec (not interesting for drivers) -*/ + * Important data from the USB spec. + */ -struct memory_chunk -{ - uint32 next_item; - uint32 physical; -}; - - -struct usb_request_data -{ +struct usb_request_data { uint8 RequestType; uint8 Request; uint16 Value; uint16 Index; uint16 Length; -}; +} _PACKED; struct usb_isochronous_data { @@ -65,8 +57,7 @@ struct usb_isochronous_data { }; -struct usb_hub_descriptor -{ +struct usb_hub_descriptor { uint8 length; uint8 descriptor_type; uint8 num_ports;