usb: move usb_{hi,lo} helpers to header file.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
2b81ba5388
commit
0b1fa34e1d
@ -6,16 +6,6 @@
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
static uint8_t usb_lo(uint16_t val)
|
|
||||||
{
|
|
||||||
return val & 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint8_t usb_hi(uint16_t val)
|
|
||||||
{
|
|
||||||
return (val >> 8) & 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
int usb_desc_device(const USBDescID *id, const USBDescDevice *dev,
|
int usb_desc_device(const USBDescID *id, const USBDescDevice *dev,
|
||||||
uint8_t *dest, size_t len)
|
uint8_t *dest, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -194,6 +194,17 @@ struct USBDesc {
|
|||||||
|
|
||||||
#define USB_DESC_FLAG_SUPER (1 << 1)
|
#define USB_DESC_FLAG_SUPER (1 << 1)
|
||||||
|
|
||||||
|
/* little helpers */
|
||||||
|
static inline uint8_t usb_lo(uint16_t val)
|
||||||
|
{
|
||||||
|
return val & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline uint8_t usb_hi(uint16_t val)
|
||||||
|
{
|
||||||
|
return (val >> 8) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
/* generate usb packages from structs */
|
/* generate usb packages from structs */
|
||||||
int usb_desc_device(const USBDescID *id, const USBDescDevice *dev,
|
int usb_desc_device(const USBDescID *id, const USBDescDevice *dev,
|
||||||
uint8_t *dest, size_t len);
|
uint8_t *dest, size_t len);
|
||||||
|
Loading…
Reference in New Issue
Block a user