2002-10-07 22:05:47

by Stig Brautaset

[permalink] [raw]
Subject: [patch] 2.5.41: mii breakage in xircom_tulip_cb

I use the xircom_tulip_cb driver with 2.4.19, because it is mii-enabled,
and the new driver isn't.

In 2.5.41 (and .40, at least) the mii-capabilities is not there, I have
not tested earlier development kernels. The changes between the driver
in 2.4.19 and 2.5.41 are miniscule, so I was able to make mii work
again (this is my first attempt at kernel hacking; don't laugh :). It's
most definately _not_ the correct fix, it is just a revert from 2.4.19
that makes mii work for me again in 2.5.


--- drivers/net/tulip/xircom_tulip_cb.c.orig Mon Oct 7 22:53:22 2002
+++ drivers/net/tulip/xircom_tulip_cb.c Mon Oct 7 22:31:45 2002
@@ -1469,18 +1469,21 @@

/* Legacy mii-diag interface */
case SIOCGMIIPHY: /* Get address of MII PHY in use. */
+ case SIOCDEVPRIVATE: /* for binary compat, remove in 2.5 */
if (tp->mii_cnt)
data[0] = phy;
else
return -ENODEV;
return 0;
case SIOCGMIIREG: /* Read MII PHY register. */
+ case SIOCDEVPRIVATE+1: /* for binary compat, remove in 2.5 */
save_flags(flags);
cli();
data[3] = mdio_read(dev, data[0] & 0x1f, data[1] & 0x1f);
restore_flags(flags);
return 0;
case SIOCSMIIREG: /* Write MII PHY register. */
+ case SIOCDEVPRIVATE+2: /* for binary compat, remove in 2.5 */
if (!capable(CAP_NET_ADMIN))
return -EPERM;
save_flags(flags);


Stig
--
brautaset.org


2002-10-08 11:58:41

by Felipe W Damasio

[permalink] [raw]
Subject: Re: [patch] 2.5.41: mii breakage in xircom_tulip_cb


----- Original Message -----
From: "Stig Brautaset" <[email protected]>
To: <[email protected]>
Sent: Monday, October 07, 2002 7:07 PM
Subject: [patch] 2.5.41: mii breakage in xircom_tulip_cb


> In 2.5.41 (and .40, at least) the mii-capabilities is not there, I have
> not tested earlier development kernels. The changes between the driver
> in 2.4.19 and 2.5.41 are miniscule, so I was able to make mii work
> again (this is my first attempt at kernel hacking; don't laugh :). It's
> most definately _not_ the correct fix, it is just a revert from 2.4.19
> that makes mii work for me again in 2.5.

Isn't this (or shouldn't this) be supported by the 2.4 version of the
"generic_mii_ioctl"? Jeff?

Since this is a rather new function (in since 2.5.40) the fix is valid,
though the net drivers should use this function (I'll look into this).

Felipe

2002-10-10 18:36:33

by Jeff Garzik

[permalink] [raw]
Subject: Re: [patch] 2.5.41: mii breakage in xircom_tulip_cb

Felipe W Damasio wrote:
> ----- Original Message -----
> From: "Stig Brautaset" <[email protected]>
> To: <[email protected]>
> Sent: Monday, October 07, 2002 7:07 PM
> Subject: [patch] 2.5.41: mii breakage in xircom_tulip_cb
>
>
>
>>In 2.5.41 (and .40, at least) the mii-capabilities is not there, I have
>>not tested earlier development kernels. The changes between the driver
>>in 2.4.19 and 2.5.41 are miniscule, so I was able to make mii work
>>again (this is my first attempt at kernel hacking; don't laugh :). It's
>>most definately _not_ the correct fix, it is just a revert from 2.4.19
>>that makes mii work for me again in 2.5.
>
>
> Isn't this (or shouldn't this) be supported by the 2.4 version of the
> "generic_mii_ioctl"? Jeff?

Yes, current 2.4.x and 2.5.x trees both have generic_mii_ioctl...

Jeff