[PATCH v6 05/17] net/r8169: add support for hw config

Ferruh Yigit ferruh.yigit at amd.com
Mon Nov 11 01:15:19 CET 2024


On 11/8/2024 12:11 PM, Howard Wang wrote:
> Implement the rtl_hw_config function to configure the hardware.
> 
> Signed-off-by: Howard Wang <howard_wang at realsil.com.cn>
> 

<...>

> +void
> +rtl_nic_reset(struct rtl_hw *hw)
> +{
> +	int i;
> +
> +	rtl_disable_rx_packet_filter(hw);
> +
> +	rtl_enable_rxdvgate(hw);
> +
> +	rtl_stop_all_request(hw);
> +
> +	rtl_wait_txrx_fifo_empty(hw);
> +
> +	rte_delay_ms(2);
> +
> +	/* Soft reset the chip. */
> +	RTL_W8(hw, ChipCmd, CmdReset);
> +
> +	/* Check that the chip has finished the reset. */
> +	for (i = 100; i > 0; i--) {
> +		rte_delay_us(100);
> +		if ((RTL_R8(hw, ChipCmd) & CmdReset) == 0)
> +			break;
> +	}
> +}
>

Can you please make functions static as much as possible? Like above
'rtl_nic_reset()' seems can be static.
That is OK keep as it is if functions will be called later in the set.



More information about the dev mailing list