1 --- linux-2.6.24/drivers/net/Kconfig 2008-01-25 02:20:37.000000000 +0100
2 +++ linux-2.6.24/drivers/net/Kconfig 2008-02-08 18:12:02.000000000 +0100
4 tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)"
5 depends on NET_ETHERNET && EXPERIMENTAL && AR7
8 - select FIXED_MII_100_FDX
10 TI AR7 CPMAC Ethernet support
12 --- linux-2.6.24/drivers/net/cpmac.c 2008-01-25 02:20:37.000000000 +0100
13 +++ linux-2.6.24/drivers/net/cpmac.c 2008-02-08 18:05:35.000000000 +0100
21 priv = netdev_priv(dev);
23 status = cpmac_read(priv->regs, CPMAC_MAC_INT_VECTOR);
25 spin_unlock(&priv->lock);
28 -static int cpmac_link_update(struct net_device *dev,
29 - struct fixed_phy_status *status)
32 - status->speed = 100;
37 static int cpmac_open(struct net_device *dev)
41 static int __devinit cpmac_probe(struct platform_device *pdev)
44 + int mdio_bus_id = cpmac_mii.id;
46 struct cpmac_priv *priv;
47 struct net_device *dev;
48 struct plat_cpmac_data *pdata;
49 - struct fixed_info *fixed_phy;
52 pdata = pdev->dev.platform_data;
53 @@ -1017,9 +1005,23 @@
56 if (phy_id == PHY_MAX_ADDR) {
57 - if (external_switch || dumb_switch)
58 + if (external_switch || dumb_switch) {
59 + struct fixed_phy_status status = {};
64 + * FIXME: this should be in the platform code!
65 + * Since there is not platform code at all (that is,
66 + * no mainline users of that driver), place it here
74 + fixed_phy_add(PHY_POLL, phy_id, &status);
76 printk(KERN_ERR "cpmac: no PHY present\n");
79 @@ -1063,32 +1065,8 @@
80 priv->msg_enable = netif_msg_init(debug_level, 0xff);
81 memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
84 - snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, cpmac_mii.id,
87 - /* Let's try to get a free fixed phy... */
88 - for (i = 0; i < MAX_PHY_AMNT; i++) {
89 - fixed_phy = fixed_mdio_get_phydev(i);
92 - if (!fixed_phy->phydev->attached_dev) {
93 - strncpy(priv->phy_name,
94 - fixed_phy->phydev->dev.bus_id,
96 - fixed_mdio_set_link_update(fixed_phy->phydev,
97 - &cpmac_link_update);
101 - if (netif_msg_drv(priv))
102 - printk(KERN_ERR "%s: Could not find fixed PHY\n",
107 + snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
110 priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
111 PHY_INTERFACE_MODE_MII);
112 if (IS_ERR(priv->phy)) {