1 --- linux/drivers/net/au1000_eth.c.orig 2004-11-23 12:01:00.551663672 +0100
2 +++ linux/drivers/net/au1000_eth.c 2004-11-23 12:08:36.795304096 +0100
4 * Copyright 2002 TimeSys Corp.
5 * Author: MontaVista Software, Inc.
6 * ppopov@mvista.com or source@mvista.com
9 + * riemer@fokus.fraunhofer.de or riemer@riemer-nt.de
10 + * // fixed the link beat detection with ioctls (SIOCGMIIPHY)
11 * ########################################################################
13 * This program is free software; you can distribute it and/or modify it
14 @@ -1383,6 +1385,10 @@
15 aup->phy_ops->phy_status(dev, aup->phy_addr, &link, &speed);
16 control = MAC_DISABLE_RX_OWN | MAC_RX_ENABLE | MAC_TX_ENABLE;
17 #ifndef CONFIG_CPU_LITTLE_ENDIAN
18 + /*riemer: fix for startup without cable */
20 + dev->flags &= ~IFF_RUNNING;
22 control |= MAC_BIG_ENDIAN;
24 if (link && (dev->if_port == IF_PORT_100BASEFX)) {
25 @@ -1841,17 +1847,35 @@
27 static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
29 - //u16 *data = (u16 *)&rq->ifr_data;
31 +// This structure is used in all SIOCxMIIxxx ioctl calls
32 +struct mii_ioctl_data {
38 + u16 *data = (u16 *)&rq->ifr_data;
39 + struct au1000_private *aup = (struct au1000_private *) dev->priv;
40 + //struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
44 case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */
45 - //data[0] = PHY_ADDRESS;
47 + if (!netif_running(dev))
49 + data[0] = aup->phy_addr;
50 case SIOCDEVPRIVATE+1: /* Read the specified MII register. */
51 - //data[3] = mdio_read(ioaddr, data[0], data[1]);
53 + data[3] = mdio_read(dev, data[0], data[1]);
54 + //data->val_out = mdio_read(dev,data->phy_id,data->reg_num);
56 case SIOCDEVPRIVATE+2: /* Write the specified MII register */
57 - //mdio_write(ioaddr, data[0], data[1], data[2]);
59 + if (!capable(CAP_NET_ADMIN))
61 + mdio_write(dev, data[0], data[1],data[2]);