libpayload: Make OHCI enums into types

The OHCI header file declares various enums as follows:

    enum { ... } enum_name;

Since the name is at the end, this is actually declaring a variable
called enum_name and *not* a type, which is causing a multiple
definition error in GCC 10. Move the enum_name before the opening brace
to prevent this.

Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Change-Id: I452c0a1b118990942aa53f1e7e77f5e8378e8975
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47224
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Jacob Garber
2020-11-02 21:32:08 -07:00
committed by Nico Huber
parent c98baa7a80
commit 85d93ffc0a

View File

@@ -36,7 +36,7 @@
// FIXME: fake // FIXME: fake
typedef enum { CMD} reg; typedef enum { CMD} reg;
enum { enum HcRhDescriptorAReg {
NumberDownstreamPorts = 1 << 0, NumberDownstreamPorts = 1 << 0,
PowerSwitchingMode = 1 << 8, PowerSwitchingMode = 1 << 8,
NoPowerSwitching = 1 << 9, NoPowerSwitching = 1 << 9,
@@ -44,19 +44,19 @@
OverCurrentProtectionMode = 1 << 11, OverCurrentProtectionMode = 1 << 11,
NoOverCurrentProtection = 1 << 12, NoOverCurrentProtection = 1 << 12,
PowerOnToPowerGoodTime = 1 << 24 PowerOnToPowerGoodTime = 1 << 24
} HcRhDescriptorAReg; };
enum { enum HcRhDescriptorAMask {
NumberDownstreamPortsMask = MASK(0, 8), NumberDownstreamPortsMask = MASK(0, 8),
PowerOnToPowerGoodTimeMask = MASK(24, 8) PowerOnToPowerGoodTimeMask = MASK(24, 8)
} HcRhDescriptorAMask; };
enum { enum HcRhDescriptorBReg {
DeviceRemovable = 1 << 0, DeviceRemovable = 1 << 0,
PortPowerControlMask = 1 << 16 PortPowerControlMask = 1 << 16
} HcRhDescriptorBReg; };
enum { enum HcRhPortStatusRead {
CurrentConnectStatus = 1 << 0, CurrentConnectStatus = 1 << 0,
PortEnableStatus = 1 << 1, PortEnableStatus = 1 << 1,
PortSuspendStatus = 1 << 2, PortSuspendStatus = 1 << 2,
@@ -69,8 +69,9 @@
PortSuspendStatusChange = 1 << 18, PortSuspendStatusChange = 1 << 18,
PortOverCurrentIndicatorChange = 1 << 19, PortOverCurrentIndicatorChange = 1 << 19,
PortResetStatusChange = 1 << 20 PortResetStatusChange = 1 << 20
} HcRhPortStatusRead; };
enum {
enum HcRhPortStatusSet {
ClearPortEnable = 1 << 0, ClearPortEnable = 1 << 0,
SetPortEnable = 1 << 1, SetPortEnable = 1 << 1,
SetPortSuspend = 1 << 2, SetPortSuspend = 1 << 2,
@@ -78,29 +79,30 @@
SetPortReset = 1 << 4, SetPortReset = 1 << 4,
SetPortPower = 1 << 8, SetPortPower = 1 << 8,
ClearPortPower = 1 << 9, ClearPortPower = 1 << 9,
} HcRhPortStatusSet; };
enum { enum HcRhStatusReg {
LocalPowerStatus = 1 << 0, LocalPowerStatus = 1 << 0,
OverCurrentIndicator = 1 << 1, OverCurrentIndicator = 1 << 1,
DeviceRemoteWakeupEnable = 1 << 15, DeviceRemoteWakeupEnable = 1 << 15,
LocalPowerStatusChange = 1 << 16, LocalPowerStatusChange = 1 << 16,
OverCurrentIndicatorChange = 1 << 17, OverCurrentIndicatorChange = 1 << 17,
ClearRemoteWakeupEnable = 1 << 31 ClearRemoteWakeupEnable = 1 << 31
} HcRhStatusReg; };
enum { enum HcFmIntervalOffset {
FrameInterval = 1 << 0, FrameInterval = 1 << 0,
FSLargestDataPacket = 1 << 16, FSLargestDataPacket = 1 << 16,
FrameIntervalToggle = 1 << 31 FrameIntervalToggle = 1 << 31
} HcFmIntervalOffset; };
enum {
enum HcFmIntervalMask {
FrameIntervalMask = MASK(0, 14), FrameIntervalMask = MASK(0, 14),
FSLargestDataPacketMask = MASK(16, 15), FSLargestDataPacketMask = MASK(16, 15),
FrameIntervalToggleMask = MASK(31, 1) FrameIntervalToggleMask = MASK(31, 1)
} HcFmIntervalMask; };
enum { enum HcControlReg {
ControlBulkServiceRatio = 1 << 0, ControlBulkServiceRatio = 1 << 0,
PeriodicListEnable = 1 << 2, PeriodicListEnable = 1 << 2,
IsochronousEnable = 1 << 3, IsochronousEnable = 1 << 3,
@@ -110,12 +112,12 @@
InterruptRouting = 1 << 8, InterruptRouting = 1 << 8,
RemoteWakeupConnected = 1 << 9, RemoteWakeupConnected = 1 << 9,
RemoteWakeupEnable = 1 << 10 RemoteWakeupEnable = 1 << 10
} HcControlReg; };
enum { enum HcControlMask {
ControlBulkServiceRatioMask = MASK(0, 2), ControlBulkServiceRatioMask = MASK(0, 2),
HostControllerFunctionalStateMask = MASK(6, 2) HostControllerFunctionalStateMask = MASK(6, 2)
} HcControlMask; };
enum { enum {
USBReset = 0*HostControllerFunctionalState, USBReset = 0*HostControllerFunctionalState,
@@ -124,24 +126,24 @@
USBSuspend = 3*HostControllerFunctionalState USBSuspend = 3*HostControllerFunctionalState
}; };
enum { enum HcCommandStatusReg {
HostControllerReset = 1 << 0, HostControllerReset = 1 << 0,
ControlListFilled = 1 << 1, ControlListFilled = 1 << 1,
BulkListFilled = 1 << 2, BulkListFilled = 1 << 2,
OwnershipChangeRequest = 1 << 3, OwnershipChangeRequest = 1 << 3,
SchedulingOverrunCount = 1 << 16 SchedulingOverrunCount = 1 << 16
} HcCommandStatusReg; };
enum { enum HcCommandStatusMask {
SchedulingOverrunCountMask = MASK(16, 2) SchedulingOverrunCountMask = MASK(16, 2)
} HcCommandStatusMask; };
enum { enum HcFmRemainingReg {
FrameRemaining = 1 << 0, FrameRemaining = 1 << 0,
FrameRemainingToggle = 1 << 31 FrameRemainingToggle = 1 << 31
} HcFmRemainingReg; };
enum { enum HcInterruptStatusReg {
SchedulingOverrung = 1 << 0, SchedulingOverrung = 1 << 0,
WritebackDoneHead = 1 << 1, WritebackDoneHead = 1 << 1,
StartofFrame = 1 << 2, StartofFrame = 1 << 2,
@@ -150,7 +152,7 @@
FrameNumberOverflow = 1 << 5, FrameNumberOverflow = 1 << 5,
RootHubStatusChange = 1 << 6, RootHubStatusChange = 1 << 6,
OwnershipChange = 1 << 30 OwnershipChange = 1 << 30
} HcInterruptStatusReg; };
typedef struct { typedef struct {
// Control and Status Partition // Control and Status Partition