0001
0002
0003
0004
0005
0006 #ifndef _LINUX_H
0007 #define _LINUX_H
0008
0009
0010
0011
0012
0013
0014
0015
0016 #define OPA_ATTRIB_ID_CONGESTION_INFO cpu_to_be16(0x008b)
0017 #define OPA_ATTRIB_ID_HFI_CONGESTION_LOG cpu_to_be16(0x008f)
0018 #define OPA_ATTRIB_ID_HFI_CONGESTION_SETTING cpu_to_be16(0x0090)
0019 #define OPA_ATTRIB_ID_CONGESTION_CONTROL_TABLE cpu_to_be16(0x0091)
0020
0021
0022 #define OPA_PM_ATTRIB_ID_PORT_STATUS cpu_to_be16(0x0040)
0023 #define OPA_PM_ATTRIB_ID_CLEAR_PORT_STATUS cpu_to_be16(0x0041)
0024 #define OPA_PM_ATTRIB_ID_DATA_PORT_COUNTERS cpu_to_be16(0x0042)
0025 #define OPA_PM_ATTRIB_ID_ERROR_PORT_COUNTERS cpu_to_be16(0x0043)
0026 #define OPA_PM_ATTRIB_ID_ERROR_INFO cpu_to_be16(0x0044)
0027
0028
0029 #define OPA_PM_STATUS_REQUEST_TOO_LARGE cpu_to_be16(0x100)
0030
0031 static inline u8 port_states_to_logical_state(struct opa_port_states *ps)
0032 {
0033 return ps->portphysstate_portstate & OPA_PI_MASK_PORT_STATE;
0034 }
0035
0036 static inline u8 port_states_to_phys_state(struct opa_port_states *ps)
0037 {
0038 return ((ps->portphysstate_portstate &
0039 OPA_PI_MASK_PORT_PHYSICAL_STATE) >> 4) & 0xf;
0040 }
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 enum opa_port_phys_state {
0054
0055
0056 IB_PORTPHYSSTATE_NOP = 0,
0057
0058 IB_PORTPHYSSTATE_POLLING = 2,
0059 IB_PORTPHYSSTATE_DISABLED = 3,
0060 IB_PORTPHYSSTATE_TRAINING = 4,
0061 IB_PORTPHYSSTATE_LINKUP = 5,
0062 IB_PORTPHYSSTATE_LINK_ERROR_RECOVERY = 6,
0063 IB_PORTPHYSSTATE_PHY_TEST = 7,
0064
0065
0066
0067
0068
0069
0070
0071 OPA_PORTPHYSSTATE_OFFLINE = 9,
0072
0073
0074
0075
0076
0077
0078
0079
0080 OPA_PORTPHYSSTATE_TEST = 11,
0081
0082 OPA_PORTPHYSSTATE_MAX = 11,
0083
0084 };
0085
0086 #endif