FreeBSD/sys/dev/qlxgb/qla_hw.c
/*
 * Name: qla_init_hw_if
 * Function: Creates the hardware specific entities corresponding to an
 *	Ethernet Interface - Transmit and Receive Contexts. Sets the MAC Address
 *	corresponding to the interface. Enables LRO if allowed.
 */
qla_init_hw_if
Function: Creates the hardware specific entities corresponding to an
Ethernet Interface - Transmit and Receive Contexts. Sets the MAC Address
corresponding to the interface. Enables LRO if allowed.
qla_init_hw_if Function : Creates the hardware specific entities corresponding to an Ethernet Interface - Transmit and Receive Contexts . Sets the MAC Address corresponding to the interface . Enables LRO if allowed .
int
qla_init_hw_if(qla_host_t *ha)
{
	device_t	dev;
	int		i;
	uint8_t		bcast_mac[6];
	qla_get_hw_caps(ha);
	dev = ha->pci_dev;
	for (i = 0; i < ha->hw.num_sds_rings; i++) {
		bzero(ha->hw.dma_buf.sds_ring[i].dma_b,
			ha->hw.dma_buf.sds_ring[i].size);
	}
	if (qla_init_rcv_cntxt(ha)) {
		return (-1);
	}
	ha->hw.rx_next = NUM_RX_DESCRIPTORS - 2;
	ha->hw.rxj_next = NUM_RX_JUMBO_DESCRIPTORS - 2;
	ha->hw.rx_in = ha->hw.rxj_in = 0;
	QL_UPDATE_RDS_PRODUCER_INDEX(ha, 0, ha->hw.rx_next);
	QL_UPDATE_RDS_PRODUCER_INDEX(ha, 1, ha->hw.rxj_next);
	if (qla_init_xmt_cntxt(ha)) {
		qla_del_rcv_cntxt(ha);
		return (-1);
	}
	qla_config_mac_addr(ha, ha->hw.mac_addr,
		(ha->hw.rx_cntxt_rsp)->rx_rsp.cntxt_id, 1);
	bcast_mac[0] = 0xFF; bcast_mac[1] = 0xFF; bcast_mac[2] = 0xFF;
	bcast_mac[3] = 0xFF; bcast_mac[4] = 0xFF; bcast_mac[5] = 0xFF;
	qla_config_mac_addr(ha, bcast_mac,
		(ha->hw.rx_cntxt_rsp)->rx_rsp.cntxt_id, 1);
	qla_config_rss(ha, (ha->hw.rx_cntxt_rsp)->rx_rsp.cntxt_id);
	qla_config_intr_coalesce(ha, (ha->hw.rx_cntxt_rsp)->rx_rsp.cntxt_id, 0);
	for (i = 0; i < ha->hw.num_sds_rings; i++)
		QL_ENABLE_INTERRUPTS(ha, i);
	return (0);
}
int qla_init_hw_if ( qla_host_t * ha ) { device_t dev ; int i ; uint8_t bcast_mac [ 6 ] ; qla_get_hw_caps ( ha ) ; dev = ha -> pci_dev ; for ( i = 0 ; i < ha -> hw . num_sds_rings ; i ++ ) { bzero ( ha -> hw . dma_buf . sds_ring [ i ] . dma_b , ha -> hw . dma_buf . sds_ring [ i ] . size ) ; } if ( qla_init_rcv_cntxt ( ha ) ) { return ( -1 ) ; } ha -> hw . rx_next = NUM_RX_DESCRIPTORS - 2 ; ha -> hw . rxj_next = NUM_RX_JUMBO_DESCRIPTORS - 2 ; ha -> hw . rx_in = ha -> hw . rxj_in = 0 ; QL_UPDATE_RDS_PRODUCER_INDEX ( ha , 0 , ha -> hw . rx_next ) ; QL_UPDATE_RDS_PRODUCER_INDEX ( ha , 1 , ha -> hw . rxj_next ) ; if ( qla_init_xmt_cntxt ( ha ) ) { qla_del_rcv_cntxt ( ha ) ; return ( -1 ) ; } qla_config_mac_addr ( ha , ha -> hw . mac_addr , ( ha -> hw . rx_cntxt_rsp ) -> rx_rsp . cntxt_id , 1 ) ; bcast_mac [ 0 ] = 0xFF ; bcast_mac [ 1 ] = 0xFF ; bcast_mac [ 2 ] = 0xFF ; bcast_mac [ 3 ] = 0xFF ; bcast_mac [ 4 ] = 0xFF ; bcast_mac [ 5 ] = 0xFF ; qla_config_mac_addr ( ha , bcast_mac , ( ha -> hw . rx_cntxt_rsp ) -> rx_rsp . cntxt_id , 1 ) ; qla_config_rss ( ha , ( ha -> hw . rx_cntxt_rsp ) -> rx_rsp . cntxt_id ) ; qla_config_intr_coalesce ( ha , ( ha -> hw . rx_cntxt_rsp ) -> rx_rsp . cntxt_id , 0 ) ; for ( i = 0 ; i < ha -> hw . num_sds_rings ; i ++ ) QL_ENABLE_INTERRUPTS ( ha , i ) ; return ( 0 ) ; }
Name: qla_init_hw_if
 Function: Creates the hardware specific entities corresponding to an
      Ethernet Interface - Transmit and Receive Contexts.
Name : qla_init_hw_if Function : Creates the hardware specific entities corresponding to an Ethernet Interface - Transmit and Receive Contexts .
/*
	 * Create Receive Context
	 */ /* Update the RDS Producer Indices */ /*
	 * Create Transmit Context
	 */