29 #ifndef __EHEA_PHYP_H__
30 #define __EHEA_PHYP_H__
42 static inline u32 get_longbusy_msecs(
int long_busy_ret_code)
44 switch (long_busy_ret_code) {
45 case H_LONG_BUSY_ORDER_1_MSEC:
47 case H_LONG_BUSY_ORDER_10_MSEC:
49 case H_LONG_BUSY_ORDER_100_MSEC:
51 case H_LONG_BUSY_ORDER_1_SEC:
53 case H_LONG_BUSY_ORDER_10_SEC:
55 case H_LONG_BUSY_ORDER_100_SEC:
63 #define EHEA_MAX_RPAGE 512
66 #define NEQE_EVENT_CODE EHEA_BMASK_IBM(2, 7)
67 #define NEQE_PORTNUM EHEA_BMASK_IBM(32, 47)
68 #define NEQE_PORT_UP EHEA_BMASK_IBM(16, 16)
69 #define NEQE_EXTSWITCH_PORT_UP EHEA_BMASK_IBM(17, 17)
70 #define NEQE_EXTSWITCH_PRIMARY EHEA_BMASK_IBM(18, 18)
71 #define NEQE_PLID EHEA_BMASK_IBM(16, 47)
74 #define EHEA_EC_PORTSTATE_CHG 0x30
75 #define EHEA_EC_ADAPTER_MALFUNC 0x32
76 #define EHEA_EC_PORT_MALFUNC 0x33
79 #define NELR_PORT_MALFUNC EHEA_BMASK_IBM(61, 61)
80 #define NELR_ADAPTER_MALFUNC EHEA_BMASK_IBM(62, 62)
81 #define NELR_PORTSTATE_CHG EHEA_BMASK_IBM(63, 63)
83 static inline void hcp_epas_ctor(
struct h_epas *epas,
u64 paddr_kernel,
88 (paddr_kernel & ~PAGE_MASK);
89 epas->
user.addr = paddr_user;
92 static inline void hcp_epas_dtor(
struct h_epas *epas)
112 #define H_QPCB0_ALL EHEA_BMASK_IBM(0, 5)
113 #define H_QPCB0_QP_CTL_REG EHEA_BMASK_IBM(0, 0)
114 #define H_QPCB0_MAX_SWQE EHEA_BMASK_IBM(1, 1)
115 #define H_QPCB0_MAX_RWQE EHEA_BMASK_IBM(2, 2)
116 #define H_QPCB0_PORT_NB EHEA_BMASK_IBM(3, 3)
117 #define H_QPCB0_QP_AER EHEA_BMASK_IBM(4, 4)
118 #define H_QPCB0_QP_TENURE EHEA_BMASK_IBM(5, 5)
121 #define H_QP_CR_ENABLED 0x8000000000000000ULL
123 #define H_QP_CR_STATE_RESET 0x0000010000000000ULL
124 #define H_QP_CR_STATE_INITIALIZED 0x0000020000000000ULL
125 #define H_QP_CR_STATE_RDY2RCV 0x0000030000000000ULL
126 #define H_QP_CR_STATE_RDY2SND 0x0000050000000000ULL
127 #define H_QP_CR_STATE_ERROR 0x0000800000000000ULL
128 #define H_QP_CR_RES_STATE 0x0000007F00000000ULL
143 #define H_QPCB1_ALL EHEA_BMASK_IBM(0, 7)
144 #define H_QPCB1_QPN EHEA_BMASK_IBM(0, 0)
145 #define H_QPCB1_ASYN_EV_EQ_NB EHEA_BMASK_IBM(1, 1)
146 #define H_QPCB1_SQ_CQ_HANDLE EHEA_BMASK_IBM(2, 2)
147 #define H_QPCB1_RQ_CQ_HANDLE EHEA_BMASK_IBM(3, 3)
148 #define H_QPCB1_SGEL_NB_SQ EHEA_BMASK_IBM(4, 4)
149 #define H_QPCB1_SGEL_NB_RQ1 EHEA_BMASK_IBM(5, 5)
150 #define H_QPCB1_SGEL_NB_RQ2 EHEA_BMASK_IBM(6, 6)
151 #define H_QPCB1_SGEL_NB_RQ3 EHEA_BMASK_IBM(7, 7)
214 #define H_PORT_CB0_ALL EHEA_BMASK_IBM(0, 7)
215 #define H_PORT_CB0_MAC EHEA_BMASK_IBM(0, 0)
216 #define H_PORT_CB0_PRC EHEA_BMASK_IBM(1, 1)
217 #define H_PORT_CB0_DEFQPNARRAY EHEA_BMASK_IBM(7, 7)
220 #define H_SPEED_10M_H 1
221 #define H_SPEED_10M_F 2
222 #define H_SPEED_100M_H 3
223 #define H_SPEED_100M_F 4
224 #define H_SPEED_1G_F 6
225 #define H_SPEED_10G_F 8
228 #define PXLY_RC_VALID EHEA_BMASK_IBM(49, 49)
229 #define PXLY_RC_VLAN_XTRACT EHEA_BMASK_IBM(50, 50)
230 #define PXLY_RC_TCP_6_TUPLE EHEA_BMASK_IBM(51, 51)
231 #define PXLY_RC_UDP_6_TUPLE EHEA_BMASK_IBM(52, 52)
232 #define PXLY_RC_TCP_3_TUPLE EHEA_BMASK_IBM(53, 53)
233 #define PXLY_RC_TCP_2_TUPLE EHEA_BMASK_IBM(54, 54)
234 #define PXLY_RC_LLC_SNAP EHEA_BMASK_IBM(55, 55)
235 #define PXLY_RC_JUMBO_FRAME EHEA_BMASK_IBM(56, 56)
236 #define PXLY_RC_FRAG_IP_PKT EHEA_BMASK_IBM(57, 57)
237 #define PXLY_RC_TCP_UDP_CHKSUM EHEA_BMASK_IBM(58, 58)
238 #define PXLY_RC_IP_CHKSUM EHEA_BMASK_IBM(59, 59)
239 #define PXLY_RC_MAC_FILTER EHEA_BMASK_IBM(60, 60)
240 #define PXLY_RC_UNTAG_FILTER EHEA_BMASK_IBM(61, 61)
241 #define PXLY_RC_VLAN_TAG_FILTER EHEA_BMASK_IBM(62, 63)
243 #define PXLY_RC_VLAN_FILTER 2
244 #define PXLY_RC_VLAN_PERM 0
247 #define H_PORT_CB1_ALL 0x8000000000000000ULL
253 #define H_PORT_CB2_ALL 0xFFE0000000000000ULL
276 #define H_PORT_CB4_ALL 0xF000000000000000ULL
277 #define H_PORT_CB4_JUMBO 0x1000000000000000ULL
278 #define H_PORT_CB4_SPEED 0x8000000000000000ULL
289 #define H_PORT_CB5_RCU 0x0001000000000000ULL
290 #define PXS_RCU EHEA_BMASK_IBM(61, 63)
320 #define H_PORT_CB6_ALL 0xFFFFFE7FFFFF8000ULL
374 #define H_PORT_CB7_DUCQPN 0x8000000000000000ULL
381 const u8 qp_category,
391 u64 *proc_mask,
u16 *out_swr,
u16 *out_rwr);
405 #define H_REG_RPAGE_PAGE_SIZE EHEA_BMASK_IBM(48, 55)
406 #define H_REG_RPAGE_QT EHEA_BMASK_IBM(62, 63)
414 #define H_DISABLE_GET_EHEA_WQE_P 1
415 #define H_DISABLE_GET_SQ_WQE_P 2
416 #define H_DISABLE_GET_RQC 3
421 #define NORMAL_FREE 0
435 const u64 vaddr_in,
const u32 access_ctrl,
const u32 pd,
441 #define H_MEHEAPORT_CAT EHEA_BMASK_IBM(40, 47)
442 #define H_MEHEAPORT_PN EHEA_BMASK_IBM(48, 63)
445 const u8 cb_cat,
const u64 select_mask,
449 const u8 cb_cat,
const u64 select_mask,
452 #define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63)
453 #define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(60, 63)
454 #define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63)
455 #define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)
458 const u8 reg_type,
const u64 mc_mac_addr,
462 const u64 event_mask);