Skip to contentSkip to conversation

{PATCH] Fix IBM EMAC driver ioctl bug

PATCH Applied Geoff Levand 3 participants 3 messages Apr 14, 2005 – May 16, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

Fix IBM EMAC driver ioctl bug.

I found IBM EMAC driver bug.
So mii-tool command print wrong status.

  # mii-tool
  eth0: 10 Mbit, half duplex, no link
  eth1: 10 Mbit, half duplex, no link

I can get correct status on fixed kernel.

  # mii-tool
  eth0: negotiated 100baseTx-FD, link okZZ
  eth1: negotiated 100baseTx-FD, link ok

Hiroaki Fuse

---

drivers/net/ibm_emac/ibm_emac_core.c +1 -1
Index: linux-2.6.11/drivers/net/ibm_emac/ibm_emac_core.c
===================================================================
@@ -1587,7 +1587,7 @@
 static int emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct ocp_enet_private *fep = dev->priv;
-	uint *data = (uint *) & rq->ifr_ifru;
+	uint16_t *data = (uint16_t *) & rq->ifr_ifru;
 
 	switch (cmd) {
 	case SIOCGMIIPHY:

-EOF

#1 lore raw
Quoted 9 lines · Geoff Levand

Fix IBM EMAC driver ioctl bug.

I found IBM EMAC driver bug.
So mii-tool command print wrong status.

  # mii-tool
  eth0: 10 Mbit, half duplex, no link
  eth1: 10 Mbit, half duplex, no link
Quoted 6 lines

I can get correct status on fixed kernel.

  # mii-tool
  eth0: negotiated 100baseTx-FD, link okZZ
  eth1: negotiated 100baseTx-FD, link ok

There is a problem with this patch. I'm aware of this problem for quite some time, but chose to keep the current code.

This IOCTL implementation has been here for many years in all revisions of the driver, so I think we should keep it as is, because some software could rely on it, and your change will break it.

And all new code should use ethtool anyway :).

Signature · 1 line
Eugene