Commit bd93976a authored by Pantelis Koukousoulas's avatar Pantelis Koukousoulas Committed by Gerd Hoffmann
Browse files

usb: Remove magic constants from device bmAttributes



Replace magic constants in device bmAttributes with symbolic ones
from Linux kernel ch9.h

Signed-off-by: default avatarPantelis Koukousoulas <pktoss@gmail.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 46eef33b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -759,7 +759,7 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
         * We return the same value that a configured device would return if
         * it used the first configuration.
         */
        if (config->bmAttributes & 0x40) {
        if (config->bmAttributes & USB_CFG_ATT_SELFPOWER) {
            data[0] |= 1 << USB_DEVICE_SELF_POWERED;
        }
        if (dev->remote_wakeup) {
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ static const USBDescDevice desc_device = {
            .bNumInterfaces        = 2,
            .bConfigurationValue   = DEV_CONFIG_VALUE,
            .iConfiguration        = STRING_CONFIG,
            .bmAttributes          = 0xc0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_SELFPOWER,
            .bMaxPower             = 0x32,
            .nif = ARRAY_SIZE(desc_iface),
            .ifs = desc_iface,
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ static const USBDescDevice desc_device_bluetooth = {
        {
            .bNumInterfaces        = 2,
            .bConfigurationValue   = 1,
            .bmAttributes          = 0xc0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_SELFPOWER,
            .bMaxPower             = 0,
            .nif = ARRAY_SIZE(desc_iface_bluetooth),
            .ifs = desc_iface_bluetooth,
+4 −4
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static const USBDescDevice desc_device_mouse = {
            .bNumInterfaces        = 1,
            .bConfigurationValue   = 1,
            .iConfiguration        = STR_CONFIG_MOUSE,
            .bmAttributes          = 0xa0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP,
            .bMaxPower             = 50,
            .nif = 1,
            .ifs = &desc_iface_mouse,
@@ -219,7 +219,7 @@ static const USBDescDevice desc_device_tablet = {
            .bNumInterfaces        = 1,
            .bConfigurationValue   = 1,
            .iConfiguration        = STR_CONFIG_TABLET,
            .bmAttributes          = 0xa0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP,
            .bMaxPower             = 50,
            .nif = 1,
            .ifs = &desc_iface_tablet,
@@ -236,7 +236,7 @@ static const USBDescDevice desc_device_tablet2 = {
            .bNumInterfaces        = 1,
            .bConfigurationValue   = 1,
            .iConfiguration        = STR_CONFIG_TABLET,
            .bmAttributes          = 0xa0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP,
            .bMaxPower             = 50,
            .nif = 1,
            .ifs = &desc_iface_tablet2,
@@ -253,7 +253,7 @@ static const USBDescDevice desc_device_keyboard = {
            .bNumInterfaces        = 1,
            .bConfigurationValue   = 1,
            .iConfiguration        = STR_CONFIG_KEYBOARD,
            .bmAttributes          = 0xa0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP,
            .bMaxPower             = 50,
            .nif = 1,
            .ifs = &desc_iface_keyboard,
+2 −1
Original line number Diff line number Diff line
@@ -119,7 +119,8 @@ static const USBDescDevice desc_device_hub = {
        {
            .bNumInterfaces        = 1,
            .bConfigurationValue   = 1,
            .bmAttributes          = 0xe0,
            .bmAttributes          = USB_CFG_ATT_ONE | USB_CFG_ATT_SELFPOWER |
                                     USB_CFG_ATT_WAKEUP,
            .nif = 1,
            .ifs = &desc_iface_hub,
        },
Loading