FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_query_trace_filter - query a tracing filter
 *	@adapter: the adapter
 *	@tp: the current trace filter parameters
 *	@filter_index: which filter to query
 *	@inverted: non-zero if the filter is inverted
 *	@enabled: non-zero if the filter is enabled
 *
 *	Returns the current settings of the specified HW tracing filter.
 */


Returns the current settings of the specified HW tracing filter.
Returns the current settings of the specified HW tracing filter .
void t3_query_trace_filter(adapter_t *adapter, struct trace_params *tp,
			   int filter_index, int *inverted, int *enabled)
{
	u32 addr, key[4], mask[4];
	addr = filter_index ? A_TP_RX_TRC_KEY0 : A_TP_TX_TRC_KEY0;
	key[0]  = tp_rd_indirect(adapter, addr++);
	mask[0] = tp_rd_indirect(adapter, addr++);
	key[1]  = tp_rd_indirect(adapter, addr++);
	mask[1] = tp_rd_indirect(adapter, addr++);
	key[2]  = tp_rd_indirect(adapter, addr++);
	mask[2] = tp_rd_indirect(adapter, addr++);
	key[3]  = tp_rd_indirect(adapter, addr++);
	mask[3] = tp_rd_indirect(adapter, addr);
	tp->sport = key[0] & 0xffff;
	tp->sip   = (key[0] >> 16) | ((key[1] & 0xffff) << 16);
	tp->dport = key[1] >> 16;
	tp->dip   = key[2];
	tp->proto = key[3] & 0xff;
	tp->vlan  = key[3] >> 8;
	tp->intf  = key[3] >> 20;
	tp->sport_mask = mask[0] & 0xffff;
	tp->sip_mask   = (mask[0] >> 16) | ((mask[1] & 0xffff) << 16);
	tp->dport_mask = mask[1] >> 16;
	tp->dip_mask   = mask[2];
	tp->proto_mask = mask[3] & 0xff;
	tp->vlan_mask  = mask[3] >> 8;
	tp->intf_mask  = mask[3] >> 20;
	*inverted = key[3] & (1 << 29);
	*enabled  = key[3] & (1 << 28);
}
void t3_query_trace_filter ( adapter_t * adapter , struct trace_params * tp , int filter_index , int * inverted , int * enabled ) { u32 addr , key [ 4 ] , mask [ 4 ] ; addr = filter_index ? A_TP_RX_TRC_KEY0 : A_TP_TX_TRC_KEY0 ; key [ 0 ] = tp_rd_indirect ( adapter , addr ++ ) ; mask [ 0 ] = tp_rd_indirect ( adapter , addr ++ ) ; key [ 1 ] = tp_rd_indirect ( adapter , addr ++ ) ; mask [ 1 ] = tp_rd_indirect ( adapter , addr ++ ) ; key [ 2 ] = tp_rd_indirect ( adapter , addr ++ ) ; mask [ 2 ] = tp_rd_indirect ( adapter , addr ++ ) ; key [ 3 ] = tp_rd_indirect ( adapter , addr ++ ) ; mask [ 3 ] = tp_rd_indirect ( adapter , addr ) ; tp -> sport = key [ 0 ] & 0xffff ; tp -> sip = ( key [ 0 ] >> 16 ) | ( ( key [ 1 ] & 0xffff ) << 16 ) ; tp -> dport = key [ 1 ] >> 16 ; tp -> dip = key [ 2 ] ; tp -> proto = key [ 3 ] & 0xff ; tp -> vlan = key [ 3 ] >> 8 ; tp -> intf = key [ 3 ] >> 20 ; tp -> sport_mask = mask [ 0 ] & 0xffff ; tp -> sip_mask = ( mask [ 0 ] >> 16 ) | ( ( mask [ 1 ] & 0xffff ) << 16 ) ; tp -> dport_mask = mask [ 1 ] >> 16 ; tp -> dip_mask = mask [ 2 ] ; tp -> proto_mask = mask [ 3 ] & 0xff ; tp -> vlan_mask = mask [ 3 ] >> 8 ; tp -> intf_mask = mask [ 3 ] >> 20 ; * inverted = key [ 3 ] & ( 1 << 29 ) ; * enabled = key [ 3 ] & ( 1 << 28 ) ; }
t3_query_trace_filter - query a tracing filter
      @adapter: the adapter
      @tp: the current trace filter parameters
      @filter_index: which filter to query
      @inverted: non-zero if the filter is inverted
      @enabled: non-zero if the filter is enabled
t3_query_trace_filter - query a tracing filter @adapter : the adapter @tp : the current trace filter parameters @filter_index : which filter to query @inverted : non - zero if the filter is inverted @enabled : non - zero if the filter is enabled