FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_write_rss_vf_config - write VF RSS Configuration Table
 *
 *	@adapter: the adapter
 *	@index: the entry in the VF RSS table to write
 *	@vfl: the VFL to store
 *	@vfh: the VFH to store
 *
 *	Writes the VF RSS Configuration Table at the specified index with the
 *	specified (VFL, VFH) values.
 */
write VF RSS Configuration Table
@adapter: the adapter
@index: the entry in the VF RSS table to write
@vfl: the VFL to store
@vfh: the VFH to store

Writes the VF RSS Configuration Table at the specified index with the
specified (VFL, VFH) values.
write VF RSS Configuration Table @adapter : the adapter @index : the entry in the VF RSS table to write @vfl : the VFL to store @vfh : the VFH to store Writes the VF RSS Configuration Table at the specified index with the specified ( VFL VFH ) values .
void t4_write_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);
	}
	if (t4_use_ldst(adapter)) {
		t4_fw_tp_pio_rw(adapter, &vfl, 1, A_TP_RSS_VFL_CONFIG, 0);
		t4_fw_tp_pio_rw(adapter, &vfh, 1, A_TP_RSS_VFH_CONFIG, 0);
	} else {
		t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA,
				  &vfl, 1, A_TP_RSS_VFL_CONFIG);
		t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA,
				  &vfh, 1, A_TP_RSS_VFH_CONFIG);
	}
	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);
}
void t4_write_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 ) ; } if ( t4_use_ldst ( adapter ) ) { t4_fw_tp_pio_rw ( adapter , & vfl , 1 , A_TP_RSS_VFL_CONFIG , 0 ) ; t4_fw_tp_pio_rw ( adapter , & vfh , 1 , A_TP_RSS_VFH_CONFIG , 0 ) ; } else { t4_write_indirect ( adapter , A_TP_PIO_ADDR , A_TP_PIO_DATA , & vfl , 1 , A_TP_RSS_VFL_CONFIG ) ; t4_write_indirect ( adapter , A_TP_PIO_ADDR , A_TP_PIO_DATA , & vfh , 1 , A_TP_RSS_VFH_CONFIG ) ; } 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 ) ; }
t4_write_rss_vf_config - write VF RSS Configuration Table
      @adapter: the adapter
      @index: the entry in the VF RSS table to write
      @vfl: the VFL to store
      @vfh: the VFH to store
t4_write_rss_vf_config - write VF RSS Configuration Table @adapter : the adapter @index : the entry in the VF RSS table to write @vfl : the VFL to store @vfh : the VFH to store
/*
	 * Load up VFL/VFH with the values to be written ...
	 */ /*
	 * Write the VFL/VFH into the VF Table at index'th location.
	 */