Subject: Re: [PATCH] r8169: partial support and phy init for the 8168d

From: Ben Hutchings <[email-masked]>
Date: Sun, 01 Nov 2009 16:24:43 +0000

On Thu, 2009-10-08 at 00:44 +0200, Francois Romieu wrote:
> Extracted from Realtek's 8.012.00 r8168 driver.

There is a problem with this change:

[...]
> static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
> {
[...]
> +	static struct phy_reg phy_reg_init_2[] = {
> +		{ 0x1f, 0x0005 },
> +		{ 0x05, 0xffc2 },
> +		{ 0x1f, 0x0005 },

I interpret the following sequence of register writes as:

> +		{ 0x05, 0x8000 },
> +		{ 0x06, 0xf8f9 },
> +		{ 0x06, 0xfaef },
> +		{ 0x06, 0x59ee },
[...]

Write memory sequentially from 0x8000,

> +		{ 0x05, 0x83d4 },
> +		{ 0x06, 0x8000 },
> +		{ 0x05, 0x83d8 },
> +		{ 0x06, 0x8051 },
[...]

Change two vectors to point into what was just written. 

I believe this is patching machine code in the PHY.  And we do not have
source for that code, so it cannot possibly be distributed under GPL.

Please replace this with use of request_firmware() and submit the blob
to linux-firmware.git instead.

The same goes for phy_reg_init_1 in rtl8168d_2_hw_phy_config().

Ben.

-- 
Ben Hutchings
The generation of random numbers is too important to be left to chance.
                                                            - Robert Coveyou