usb: move usb_{hi,lo} helpers to header file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2013-11-20 07:33:28 +01:00
parent 2b81ba5388
commit 0b1fa34e1d
2 changed files with 11 additions and 10 deletions

View File

@ -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,
uint8_t *dest, size_t len)
{

View File

@ -194,6 +194,17 @@ struct USBDesc {
#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 */
int usb_desc_device(const USBDescID *id, const USBDescDevice *dev,
uint8_t *dest, size_t len);