mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-16 18:48:12 +00:00
[hermon] Add infrastructure for Ethernet devices
Add PRM structures to support Hermon Ethernet devices. Signed-off-by: Itay Gazit <itaygazit@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
f62c433d66
commit
ed0ea7cfc2
@ -305,7 +305,7 @@ hermon_cmd_close_port ( struct hermon *hermon, unsigned int port ) {
|
||||
|
||||
static inline int
|
||||
hermon_cmd_set_port ( struct hermon *hermon, unsigned int port,
|
||||
struct hermonprm_set_port *set_port ) {
|
||||
union hermonprm_set_port *set_port ) {
|
||||
return hermon_cmd ( hermon,
|
||||
HERMON_HCR_IN_CMD ( HERMON_HCR_SET_PORT,
|
||||
1, sizeof ( *set_port ) ),
|
||||
@ -1939,7 +1939,7 @@ static int hermon_sense_port_type ( struct ib_device *ibdev ) {
|
||||
*/
|
||||
static int hermon_open ( struct ib_device *ibdev ) {
|
||||
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
||||
struct hermonprm_set_port set_port;
|
||||
union hermonprm_set_port set_port;
|
||||
int port_type;
|
||||
int rc;
|
||||
|
||||
@ -1954,7 +1954,7 @@ static int hermon_open ( struct ib_device *ibdev ) {
|
||||
|
||||
/* Set port parameters */
|
||||
memset ( &set_port, 0, sizeof ( set_port ) );
|
||||
MLX_FILL_7 ( &set_port, 0,
|
||||
MLX_FILL_7 ( &set_port.ib, 0,
|
||||
mmc, 1,
|
||||
mvc, 1,
|
||||
mp, 1,
|
||||
@ -1962,7 +1962,7 @@ static int hermon_open ( struct ib_device *ibdev ) {
|
||||
mtu_cap, IB_MTU_2048,
|
||||
vl_cap, IB_VL_0,
|
||||
rcm, 1 );
|
||||
MLX_FILL_2 ( &set_port, 10,
|
||||
MLX_FILL_2 ( &set_port.ib, 10,
|
||||
max_pkey, 1,
|
||||
max_gid, 1 );
|
||||
if ( ( rc = hermon_cmd_set_port ( hermon, ibdev->port,
|
||||
|
@ -68,6 +68,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#define HERMON_HCR_READ_MCG 0x0025
|
||||
#define HERMON_HCR_WRITE_MCG 0x0026
|
||||
#define HERMON_HCR_MGID_HASH 0x0027
|
||||
#define HERMON_HCR_MOD_STAT_CFG 0x0034
|
||||
#define HERMON_HCR_QUERY_PORT 0x0043
|
||||
#define HERMON_HCR_SENSE_PORT 0x004d
|
||||
#define HERMON_HCR_RUN_FW 0x0ff6
|
||||
#define HERMON_HCR_DISABLE_LAM 0x0ff7
|
||||
@ -86,7 +88,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#define HERMON_ST_MLX 0x07
|
||||
|
||||
/* Port types */
|
||||
#define HERMON_PORT_TYPE_UNKNOWN 0
|
||||
#define HERMON_PORT_TYPE_IB 1
|
||||
#define HERMON_PORT_TYPE_ETH 2
|
||||
|
||||
/* MTUs */
|
||||
#define HERMON_MTU_2048 0x04
|
||||
@ -191,16 +195,18 @@ struct hermonprm_event_mask_st {
|
||||
|
||||
struct hermonprm_port_state_change_event_st {
|
||||
pseudo_bit_t reserved[0x00020];
|
||||
/* -------------- */
|
||||
struct hermonprm_port_state_change_st data;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_sense_port_st {
|
||||
pseudo_bit_t port_type[0x00020];
|
||||
pseudo_bit_t reserved0[0x00020];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved[0x00020];
|
||||
pseudo_bit_t port_type[0x00002];
|
||||
pseudo_bit_t reserved1[0x00018];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_set_port_st {
|
||||
struct hermonprm_set_port_ib_st {
|
||||
pseudo_bit_t rqk[0x00001];
|
||||
pseudo_bit_t rcm[0x00001];
|
||||
pseudo_bit_t reserved0[0x00002];
|
||||
@ -242,6 +248,134 @@ struct hermonprm_set_port_st {
|
||||
pseudo_bit_t max_pkey[0x00010];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_query_port_cap_st {
|
||||
pseudo_bit_t eth_mtu[0x00010];
|
||||
pseudo_bit_t ib_mtu[0x00004];
|
||||
pseudo_bit_t reserved0[0x00004];
|
||||
pseudo_bit_t ib[0x00001];
|
||||
pseudo_bit_t eth[0x00001];
|
||||
pseudo_bit_t reserved1[0x00005];
|
||||
pseudo_bit_t link_state[0x00001];
|
||||
/* -------------- */
|
||||
pseudo_bit_t log_max_pkey[0x00004];
|
||||
pseudo_bit_t log_max_gid[0x00004];
|
||||
pseudo_bit_t ib_port_width[0x00004];
|
||||
pseudo_bit_t reserved2[0x00004];
|
||||
pseudo_bit_t eth_link_speed[0x00004];
|
||||
pseudo_bit_t reserved3[0x00004];
|
||||
pseudo_bit_t ib_link_speed[0x00004];
|
||||
pseudo_bit_t reserved4[0x00004];
|
||||
/* -------------- */
|
||||
pseudo_bit_t max_vl_ib[0x00004];
|
||||
pseudo_bit_t reserved5[0x00004];
|
||||
pseudo_bit_t log_max_mac[0x00004];
|
||||
pseudo_bit_t log_max_vlan[0x00004];
|
||||
pseudo_bit_t reserved6[0x00010];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved7[0x00020];
|
||||
/* -------------- */
|
||||
pseudo_bit_t mac_47_32[0x00010];
|
||||
pseudo_bit_t reserved8[0x00010];
|
||||
/* -------------- */
|
||||
pseudo_bit_t mac_31_0[0x00020];
|
||||
/* -------------- */
|
||||
pseudo_bit_t vendor_oui[0x00018];
|
||||
pseudo_bit_t transceiver_type[0x00008];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved9[0x00010];
|
||||
pseudo_bit_t wavelength[0x00010];
|
||||
/* -------------- */
|
||||
pseudo_bit_t transceiver_code_hi[0x00020];
|
||||
/* -------------- */
|
||||
pseudo_bit_t transceiver_code_lo[0x00020];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved10[0x000c0];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_set_port_general_context_st {
|
||||
pseudo_bit_t v_mtu[0x00001];
|
||||
pseudo_bit_t v_pprx[0x00001];
|
||||
pseudo_bit_t v_pptx[0x00001];
|
||||
pseudo_bit_t reserved0[0x0001d];
|
||||
/* -------------- */
|
||||
pseudo_bit_t mtu[0x00010];
|
||||
pseudo_bit_t reserved1[0x00010];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved2[0x00010];
|
||||
pseudo_bit_t pfctx[0x00008];
|
||||
pseudo_bit_t reserved3[0x00007];
|
||||
pseudo_bit_t pptx[0x00001];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved4[0x00010];
|
||||
pseudo_bit_t pfcrx[0x00008];
|
||||
pseudo_bit_t reserved5[0x00007];
|
||||
pseudo_bit_t pprx[0x00001];
|
||||
/* -------------- */
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_set_port_rqp_calc_st {
|
||||
pseudo_bit_t base_qpn[0x00018];
|
||||
pseudo_bit_t reserved0[0x00008];
|
||||
/* -------------- */
|
||||
pseudo_bit_t n_p[0x00002];
|
||||
pseudo_bit_t reserved1[0x00006];
|
||||
pseudo_bit_t n_v[0x00003];
|
||||
pseudo_bit_t reserved2[0x00005];
|
||||
pseudo_bit_t n_m[0x00004];
|
||||
pseudo_bit_t reserved3[0x0000c];
|
||||
/* -------------- */
|
||||
pseudo_bit_t mac_miss_index[0x00008];
|
||||
pseudo_bit_t reserved4[0x00018];
|
||||
/* -------------- */
|
||||
pseudo_bit_t vlan_miss_index[0x00007];
|
||||
pseudo_bit_t reserved5[0x00008];
|
||||
pseudo_bit_t intra_miss[0x00001];
|
||||
pseudo_bit_t no_vlan_index[0x00007];
|
||||
pseudo_bit_t reserved6[0x00008];
|
||||
pseudo_bit_t intra_no_vlan[0x00001];
|
||||
/* -------------- */
|
||||
pseudo_bit_t no_vlan_prio[0x00003];
|
||||
pseudo_bit_t reserved7[0x0001d];
|
||||
/* -------------- */
|
||||
pseudo_bit_t promisc_qpn[0x00018];
|
||||
pseudo_bit_t reserved8[0x00007];
|
||||
pseudo_bit_t en_uc_promisc[0x00001];
|
||||
/* -------------- */
|
||||
pseudo_bit_t def_mcast_qpn[0x00018];
|
||||
pseudo_bit_t reserved9[0x00005];
|
||||
pseudo_bit_t mc_by_vlan[0x00001];
|
||||
pseudo_bit_t mc_promisc_mode[0x00002];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved10[0x00020];
|
||||
/* -------------- */
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_set_port_mac_table_st {
|
||||
pseudo_bit_t mac_h[0x00010];
|
||||
pseudo_bit_t reserved0[0x0000f];
|
||||
pseudo_bit_t v[0x00001];
|
||||
/* -------------- */
|
||||
pseudo_bit_t mac_l[0x00020];
|
||||
/* -------------- */
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_set_port_vlan_st {
|
||||
pseudo_bit_t vlan_id[0x0000c];
|
||||
pseudo_bit_t reserved0[0x00012];
|
||||
pseudo_bit_t intra[0x00001];
|
||||
pseudo_bit_t v[0x00001];
|
||||
/* -------------- */
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
struct hermonprm_mod_stat_cfg_pf_net_boot_st {
|
||||
pseudo_bit_t reserved1[0x0001c];
|
||||
pseudo_bit_t pf_net_boot[0x00001];
|
||||
pseudo_bit_t reserved2[0x00002];
|
||||
pseudo_bit_t pf_net_boot_m[0x00001];
|
||||
/* -------------- */
|
||||
pseudo_bit_t reserved0[0x00020];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/*
|
||||
* Wrapper structures for hardware datatypes
|
||||
*
|
||||
@ -260,6 +394,7 @@ struct MLX_DECLARE_STRUCT ( hermonprm_init_hca );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_mad_ifc );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_mcg_entry );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_mgm_hash );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_mod_stat_cfg_pf_net_boot );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_mpt );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_mtt );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_port_state_change_event );
|
||||
@ -267,11 +402,16 @@ struct MLX_DECLARE_STRUCT ( hermonprm_qp_db_record );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_qp_ee_state_transitions );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_query_dev_cap );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_query_fw );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_query_port_cap );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_queue_pair_ee_context_entry );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_scalar_parameter );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_sense_port );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_send_db_register );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_set_port );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_set_port_ib );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_set_port_general_context );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_set_port_mac_table );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_set_port_rqp_calc );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_set_port_vlan );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_ud_address_vector );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_virtual_physical_mapping );
|
||||
struct MLX_DECLARE_STRUCT ( hermonprm_wqe_segment_ctrl_mlx );
|
||||
@ -336,6 +476,14 @@ union hermonprm_mad {
|
||||
union ib_mad mad;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
union hermonprm_set_port {
|
||||
struct hermonprm_set_port_ib ib;
|
||||
struct hermonprm_set_port_general_context general;
|
||||
struct hermonprm_set_port_rqp_calc rqp_calc;
|
||||
struct hermonprm_set_port_mac_table mac_table[128];
|
||||
struct hermonprm_set_port_vlan vlan;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/*
|
||||
* iPXE-specific definitions
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user