summaryrefslogtreecommitdiff
path: root/packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2005-06-30 08:19:37 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-06-30 08:19:37 +0000
commitc8e5702127e507e82e6f68a4b8c546803accea9d (patch)
tree00583491f40ecc640f2b28452af995e3a63a09d7 /packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff
parent87ec8ca4d2e2eb4d1c1e1e1a6b46a395d56805b9 (diff)
import clean BK tree at cset 1.3670
Diffstat (limited to 'packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff')
-rw-r--r--packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff64
1 files changed, 64 insertions, 0 deletions
diff --git a/packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff b/packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff
index e69de29bb2..f848d2a224 100644
--- a/packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff
+++ b/packages/linux/linux-mtx-1-2.4.27/14-au1000-eth-link-beat.diff
@@ -0,0 +1,64 @@
+--- linux/drivers/net/au1000_eth.c.orig 2004-11-23 12:01:00.551663672 +0100
++++ linux/drivers/net/au1000_eth.c 2004-11-23 12:08:36.795304096 +0100
+@@ -6,7 +6,9 @@
+ * Copyright 2002 TimeSys Corp.
+ * Author: MontaVista Software, Inc.
+ * ppopov@mvista.com or source@mvista.com
+- *
++ * Bjoern Riemer 2004
++ * riemer@fokus.fraunhofer.de or riemer@riemer-nt.de
++ * // fixed the link beat detection with ioctls (SIOCGMIIPHY)
+ * ########################################################################
+ *
+ * This program is free software; you can distribute it and/or modify it
+@@ -1383,6 +1385,10 @@
+ aup->phy_ops->phy_status(dev, aup->phy_addr, &link, &speed);
+ control = MAC_DISABLE_RX_OWN | MAC_RX_ENABLE | MAC_TX_ENABLE;
+ #ifndef CONFIG_CPU_LITTLE_ENDIAN
++ /*riemer: fix for startup without cable */
++ if (!link)
++ dev->flags &= ~IFF_RUNNING;
++
+ control |= MAC_BIG_ENDIAN;
+ #endif
+ if (link && (dev->if_port == IF_PORT_100BASEFX)) {
+@@ -1841,17 +1847,35 @@
+
+ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+ {
+- //u16 *data = (u16 *)&rq->ifr_data;
++/*
++// This structure is used in all SIOCxMIIxxx ioctl calls
++struct mii_ioctl_data {
++ 0 u16 phy_id;
++ 1 u16 reg_num;
++ 2 u16 val_in;
++ 3 u16 val_out;
++};*/
++ u16 *data = (u16 *)&rq->ifr_data;
++ struct au1000_private *aup = (struct au1000_private *) dev->priv;
++ //struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
+
+ /* fixme */
+ switch(cmd) {
+ case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */
+- //data[0] = PHY_ADDRESS;
++ case SIOCGMIIPHY:
++ if (!netif_running(dev))
++ return -EINVAL;
++ data[0] = aup->phy_addr;
+ case SIOCDEVPRIVATE+1: /* Read the specified MII register. */
+- //data[3] = mdio_read(ioaddr, data[0], data[1]);
++ case SIOCGMIIREG:
++ data[3] = mdio_read(dev, data[0], data[1]);
++ //data->val_out = mdio_read(dev,data->phy_id,data->reg_num);
+ return 0;
+ case SIOCDEVPRIVATE+2: /* Write the specified MII register */
+- //mdio_write(ioaddr, data[0], data[1], data[2]);
++ case SIOCSMIIREG:
++ if (!capable(CAP_NET_ADMIN))
++ return -EPERM;
++ mdio_write(dev, data[0], data[1],data[2]);
+ return 0;
+ default:
+ return -EOPNOTSUPP;