linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux 2.4.18 8139too.c driver fix for mii-tool
@ 2002-12-02 16:11 David Ashley
  2002-12-02 16:23 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: David Ashley @ 2002-12-02 16:11 UTC (permalink / raw)
  To: linux-kernel

mii-tool doesn't work with the 8139too.c driver (RTL8139 based network cards).
Internally the driver uses phy ID #'s 32+, but when ioctls are used to
access the phy registers, the ID is masked down to 0-0x1f, so none of them
work properly, and mii-tool fails.

The fix is to change the masking done in the top of netdev_ioctl:
	if (cmd != SIOCETHTOOL) {
		/* With SIOCETHTOOL, this would corrupt the pointer.  */
		data->phy_id &= 0x3f; // was 0x1f (DA) 20021202
		data->reg_num &= 0x1f;
	}

-Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linux 2.4.18 8139too.c driver fix for mii-tool
  2002-12-02 16:11 Linux 2.4.18 8139too.c driver fix for mii-tool David Ashley
@ 2002-12-02 16:23 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2002-12-02 16:23 UTC (permalink / raw)
  To: David Ashley; +Cc: linux-kernel

David Ashley wrote:
> mii-tool doesn't work with the 8139too.c driver (RTL8139 based network cards).
> Internally the driver uses phy ID #'s 32+, but when ioctls are used to
> access the phy registers, the ID is masked down to 0-0x1f, so none of them
> work properly, and mii-tool fails.
> 
> The fix is to change the masking done in the top of netdev_ioctl:
> 	if (cmd != SIOCETHTOOL) {
> 		/* With SIOCETHTOOL, this would corrupt the pointer.  */
> 		data->phy_id &= 0x3f; // was 0x1f (DA) 20021202
> 		data->reg_num &= 0x1f;
> 	}


Already fixed in the latest stable kernel, 2.4.20.

But thanks for testing though!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-02 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-02 16:11 Linux 2.4.18 8139too.c driver fix for mii-tool David Ashley
2002-12-02 16:23 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).