mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
usbhook: make ctrl endpoint OUT treat request as const
The req parameter is passed to the OUT stage as a convenience. Since the OUT callback is called *after* the transfer has occurred, modifying the req would have absolutely no effect. Marking this as const makes this expectation clear.
This commit is contained in:
parent
590feefd9b
commit
02addaf4a0
@ -55,7 +55,7 @@ struct pios_usb_ifops {
|
|||||||
void (*init)(uint32_t context);
|
void (*init)(uint32_t context);
|
||||||
void (*deinit)(uint32_t context);
|
void (*deinit)(uint32_t context);
|
||||||
bool (*setup)(uint32_t context, struct usb_setup_request * req);
|
bool (*setup)(uint32_t context, struct usb_setup_request * req);
|
||||||
void (*ctrl_data_out)(uint32_t context, struct usb_setup_request * req);
|
void (*ctrl_data_out)(uint32_t context, const struct usb_setup_request * req);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void PIOS_USBHOOK_RegisterIfOps(uint8_t ifnum, struct pios_usb_ifops * ifops, uint32_t context);
|
extern void PIOS_USBHOOK_RegisterIfOps(uint8_t ifnum, struct pios_usb_ifops * ifops, uint32_t context);
|
||||||
|
@ -114,7 +114,7 @@ static struct pios_usb_hid_dev * PIOS_USB_HID_alloc(void)
|
|||||||
static void PIOS_USB_HID_IF_Init(uint32_t usb_hid_id);
|
static void PIOS_USB_HID_IF_Init(uint32_t usb_hid_id);
|
||||||
static void PIOS_USB_HID_IF_DeInit(uint32_t usb_hid_id);
|
static void PIOS_USB_HID_IF_DeInit(uint32_t usb_hid_id);
|
||||||
static bool PIOS_USB_HID_IF_Setup(uint32_t usb_hid_id, struct usb_setup_request *req);
|
static bool PIOS_USB_HID_IF_Setup(uint32_t usb_hid_id, struct usb_setup_request *req);
|
||||||
static void PIOS_USB_HID_IF_CtrlDataOut(uint32_t usb_hid_id, struct usb_setup_request *req);
|
static void PIOS_USB_HID_IF_CtrlDataOut(uint32_t usb_hid_id, const struct usb_setup_request *req);
|
||||||
|
|
||||||
static struct pios_usb_ifops usb_hid_ifops = {
|
static struct pios_usb_ifops usb_hid_ifops = {
|
||||||
.init = PIOS_USB_HID_IF_Init,
|
.init = PIOS_USB_HID_IF_Init,
|
||||||
@ -425,7 +425,7 @@ static bool PIOS_USB_HID_IF_Setup(uint32_t usb_hid_id, struct usb_setup_request
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PIOS_USB_HID_IF_CtrlDataOut(__attribute__((unused)) uint32_t usb_hid_id, __attribute__((unused)) struct usb_setup_request *req)
|
static void PIOS_USB_HID_IF_CtrlDataOut(__attribute__((unused)) uint32_t usb_hid_id, __attribute__((unused)) const struct usb_setup_request *req)
|
||||||
{
|
{
|
||||||
/* HID devices don't have any OUT data stages on the control endpoint */
|
/* HID devices don't have any OUT data stages on the control endpoint */
|
||||||
PIOS_Assert(0);
|
PIOS_Assert(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user