FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/*
 * Read and cache the adapter's compressed filter mode and ingress config.
 */
Read and cache the adapter's compressed filter mode and ingress config.
Read and cache the adapter ' s compressed filter mode and ingress config .
static void read_filter_mode_and_ingress_config(struct adapter *adap)
{
	struct tp_params *tpp = &adap->params.tp;
	if (t4_use_ldst(adap)) {
		t4_fw_tp_pio_rw(adap, &tpp->vlan_pri_map, 1,
				A_TP_VLAN_PRI_MAP, 1);
		t4_fw_tp_pio_rw(adap, &tpp->ingress_config, 1,
				A_TP_INGRESS_CONFIG, 1);
	} else {
		t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
				 &tpp->vlan_pri_map, 1, A_TP_VLAN_PRI_MAP);
		t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA,
				 &tpp->ingress_config, 1, A_TP_INGRESS_CONFIG);
	}
	tpp->fcoe_shift = t4_filter_field_shift(adap, F_FCOE);
	tpp->port_shift = t4_filter_field_shift(adap, F_PORT);
	tpp->vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID);
	tpp->vlan_shift = t4_filter_field_shift(adap, F_VLAN);
	tpp->tos_shift = t4_filter_field_shift(adap, F_TOS);
	tpp->protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL);
	tpp->ethertype_shift = t4_filter_field_shift(adap, F_ETHERTYPE);
	tpp->macmatch_shift = t4_filter_field_shift(adap, F_MACMATCH);
	tpp->matchtype_shift = t4_filter_field_shift(adap, F_MPSHITTYPE);
	tpp->frag_shift = t4_filter_field_shift(adap, F_FRAGMENTATION);
	if ((tpp->ingress_config & F_VNIC) == 0)
		tpp->vnic_shift = -1;
}
static void read_filter_mode_and_ingress_config ( struct adapter * adap ) { struct tp_params * tpp = & adap -> params . tp ; if ( t4_use_ldst ( adap ) ) { t4_fw_tp_pio_rw ( adap , & tpp -> vlan_pri_map , 1 , A_TP_VLAN_PRI_MAP , 1 ) ; t4_fw_tp_pio_rw ( adap , & tpp -> ingress_config , 1 , A_TP_INGRESS_CONFIG , 1 ) ; } else { t4_read_indirect ( adap , A_TP_PIO_ADDR , A_TP_PIO_DATA , & tpp -> vlan_pri_map , 1 , A_TP_VLAN_PRI_MAP ) ; t4_read_indirect ( adap , A_TP_PIO_ADDR , A_TP_PIO_DATA , & tpp -> ingress_config , 1 , A_TP_INGRESS_CONFIG ) ; } tpp -> fcoe_shift = t4_filter_field_shift ( adap , F_FCOE ) ; tpp -> port_shift = t4_filter_field_shift ( adap , F_PORT ) ; tpp -> vnic_shift = t4_filter_field_shift ( adap , F_VNIC_ID ) ; tpp -> vlan_shift = t4_filter_field_shift ( adap , F_VLAN ) ; tpp -> tos_shift = t4_filter_field_shift ( adap , F_TOS ) ; tpp -> protocol_shift = t4_filter_field_shift ( adap , F_PROTOCOL ) ; tpp -> ethertype_shift = t4_filter_field_shift ( adap , F_ETHERTYPE ) ; tpp -> macmatch_shift = t4_filter_field_shift ( adap , F_MACMATCH ) ; tpp -> matchtype_shift = t4_filter_field_shift ( adap , F_MPSHITTYPE ) ; tpp -> frag_shift = t4_filter_field_shift ( adap , F_FRAGMENTATION ) ; if ( ( tpp -> ingress_config & F_VNIC ) == 0 ) tpp -> vnic_shift = -1 ; }
Read and cache the adapter's compressed filter mode and ingress config.
Read and cache the adapter ' s compressed filter mode and ingress config .
/*
	 * Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field
	 * shift positions of several elements of the Compressed Filter Tuple
	 * for this adapter which we need frequently ...
	 */ /*
	 * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID
	 * represents the presence of an Outer VLAN instead of a VNIC ID.
	 */