[RFC V2 5/6] net: add Realtek 8139 Ethernet controller support

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 9 13:17:22 EST 2012


On Thu, Mar 08, 2012 at 11:50:31PM +0400, Antony Pavlov wrote:
> This driver is based on Linux 2.6.39 8139too driver.
> 
> +
> +static void rtl8139_chip_reset(struct rtl8139_priv *priv)
> +{
> +	int i;
> +
> +#ifdef RTL8139_DEBUG
> +	printf("rtl8139_chip_reset()\n");
> +#endif

Please use dev_dbg()

> +
> +	/* Soft reset the chip. */
> +	RTL_W8(priv, ChipCmd, CmdReset);
> +
> +	/* Check that the chip has finished the reset. */
> +	for (i = 1000; i > 0; i--) {
> +		//barrier();
> +		if ((RTL_R8(priv, ChipCmd) & CmdReset) == 0)
> +			break;
> +		udelay(10);
> +	}

while (!is_timeout(start, 10 * MSECOND)

> +static struct pci_driver rtl8139_eth_driver = {
> +	.name = "rtl8139_eth",
> +	.id_table = rtl8139_pci_tbl,
> +	.probe = rtl8139_probe,
> +};
> +
> +static int rtl8139_init(void)
> +{
> +	pci_register_driver(&rtl8139_eth_driver);
> +
> +	add_generic_device("rtl8139_eth", -1, NULL, 0xb0000000, 16,
> +		IORESOURCE_MEM, NULL);

This makes me wonder. I assumed the PCI core would register the device.
Or is this just a leftover from an earlier version?

SAscha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list