FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_read_rss_vf_config - read VF RSS Configuration Table
 *	@adapter: the adapter
 *	@index: the entry in the VF RSS table to read
 *	@vfl: where to store the returned VFL
 *	@vfh: where to store the returned VFH
 *
 *	Reads the VF RSS Configuration Table at the specified index and returns
 *	the (VFL, VFH) values found there.
 */
read VF RSS Configuration Table
@adapter: the adapter
@index: the entry in the VF RSS table to read
@vfl: where to store the returned VFL
@vfh: where to store the returned VFH

Reads the VF RSS Configuration Table at the specified index and returns
the (VFL, VFH) values found there.
read VF RSS Configuration Table @adapter : the adapter @index : the entry in the VF RSS table to read @vfl : where to store the returned VFL @vfh : where to store the returned VFH Reads the VF RSS Configuration Table at the specified index and returns the ( VFL VFH ) values found there .
void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index,
			   u32 *vfl, u32 *vfh)
{
	u32 vrt, mask, data;
	if (chip_id(adapter) <= CHELSIO_T5) {
		mask = V_VFWRADDR(M_VFWRADDR);
		data = V_VFWRADDR(index);
	} else {
		 mask =  V_T6_VFWRADDR(M_T6_VFWRADDR);
		 data = V_T6_VFWRADDR(index);
	}
	vrt = t4_read_reg(adapter, A_TP_RSS_CONFIG_VRT);
	vrt &= ~(F_VFRDRG | F_VFWREN | F_KEYWREN | mask);
	vrt |= data | F_VFRDEN;
	t4_write_reg(adapter, A_TP_RSS_CONFIG_VRT, vrt);
	if (t4_use_ldst(adapter)) {
		t4_fw_tp_pio_rw(adapter, vfl, 1, A_TP_RSS_VFL_CONFIG, 1);
		t4_fw_tp_pio_rw(adapter, vfh, 1, A_TP_RSS_VFH_CONFIG, 1);
	} else {
		t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA,
				 vfl, 1, A_TP_RSS_VFL_CONFIG);
		t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA,
				 vfh, 1, A_TP_RSS_VFH_CONFIG);
	}
}
void t4_read_rss_vf_config ( struct adapter * adapter , unsigned int index , u32 * vfl , u32 * vfh ) { u32 vrt , mask , data ; if ( chip_id ( adapter ) <= CHELSIO_T5 ) { mask = V_VFWRADDR ( M_VFWRADDR ) ; data = V_VFWRADDR ( index ) ; } else { mask = V_T6_VFWRADDR ( M_T6_VFWRADDR ) ; data = V_T6_VFWRADDR ( index ) ; } vrt = t4_read_reg ( adapter , A_TP_RSS_CONFIG_VRT ) ; vrt &= ~ ( F_VFRDRG | F_VFWREN | F_KEYWREN | mask ) ; vrt |= data | F_VFRDEN ; t4_write_reg ( adapter , A_TP_RSS_CONFIG_VRT , vrt ) ; if ( t4_use_ldst ( adapter ) ) { t4_fw_tp_pio_rw ( adapter , vfl , 1 , A_TP_RSS_VFL_CONFIG , 1 ) ; t4_fw_tp_pio_rw ( adapter , vfh , 1 , A_TP_RSS_VFH_CONFIG , 1 ) ; } else { t4_read_indirect ( adapter , A_TP_PIO_ADDR , A_TP_PIO_DATA , vfl , 1 , A_TP_RSS_VFL_CONFIG ) ; t4_read_indirect ( adapter , A_TP_PIO_ADDR , A_TP_PIO_DATA , vfh , 1 , A_TP_RSS_VFH_CONFIG ) ; } }
t4_read_rss_vf_config - read VF RSS Configuration Table
      @adapter: the adapter
      @index: the entry in the VF RSS table to read
      @vfl: where to store the returned VFL
      @vfh: where to store the returned VFH
t4_read_rss_vf_config - read VF RSS Configuration Table @adapter : the adapter @index : the entry in the VF RSS table to read @vfl : where to store the returned VFL @vfh : where to store the returned VFH
/*
	 * Request that the index'th VF Table values be read into VFL/VFH.
	 */ /*
	 * Grab the VFL/VFH values ...
	 */