Commit 0b1fa34e authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

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



Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 2b81ba53
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -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)
{
+11 −0
Original line number Diff line number Diff line
@@ -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);