Prior to kernel 2.6.23, architecture path was i386, allow that when switching kernel...
[openwrt.git] / target / linux / ixp4xx / patches-2.6.23 / 202-npe_driver_no_phy.patch
1 Index: linux-2.6.23.17/drivers/net/arm/ixp4xx_eth.c
2 ===================================================================
3 --- linux-2.6.23.17.orig/drivers/net/arm/ixp4xx_eth.c
4 +++ linux-2.6.23.17/drivers/net/arm/ixp4xx_eth.c
5 @@ -297,6 +297,27 @@ static int mdio_read(struct net_device *
6 unsigned long flags;
7 u16 val;
8
9 + /* For boards that use a switch chip (eg. Marvell 88E6060) */
10 + if ( phy_id < 0 || phy_id > 31 ) {
11 + switch (location) {
12 + case MII_BMCR:
13 + val = 0x3100;
14 + break;
15 + case MII_BMSR:
16 + val = 0x406d;
17 + break;
18 + case MII_ADVERTISE:
19 + val = 0x0101;
20 + break;
21 + case MII_LPA:
22 + val = 0x4101;
23 + break;
24 + default:
25 + val = 0;
26 + break;
27 + }
28 + return val;
29 + }
30 spin_lock_irqsave(&mdio_lock, flags);
31 val = mdio_cmd(dev, phy_id, location, 0, 0);
32 spin_unlock_irqrestore(&mdio_lock, flags);
33 @@ -308,6 +329,9 @@ static void mdio_write(struct net_device
34 {
35 unsigned long flags;
36
37 + if ( phy_id < 0 || phy_id > 31 ) {
38 + return;
39 + }
40 spin_lock_irqsave(&mdio_lock, flags);
41 mdio_cmd(dev, phy_id, location, 1, val);
42 spin_unlock_irqrestore(&mdio_lock, flags);
This page took 0.046335 seconds and 5 git commands to generate.