diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-07-05 23:06:07 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-07-05 23:06:07 +0000 |
commit | c223e82fd455290ae2db23503c1197bc25981548 (patch) | |
tree | 81fb17362cf107668648d5ae2db7e40b86b14286 /target/linux/ifxmips/files/drivers/net | |
parent | c4b8e2f0b84b5f0e845e696f7ac12144dfafa66b (diff) |
lots of ifxmips fixes and features
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11673 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ifxmips/files/drivers/net')
-rw-r--r-- | target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c b/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c index cc3b9d46a..fe7f25ec2 100644 --- a/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c +++ b/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c @@ -36,10 +36,15 @@ #include <linux/init.h> #include <asm/delay.h> #include <asm/ifxmips/ifxmips.h> -#include <asm/ifxmips/ifxmips_mii0.h> #include <asm/ifxmips/ifxmips_dma.h> #include <asm/ifxmips/ifxmips_pmu.h> +struct ifxmips_mii_priv { + struct net_device_stats stats; + struct dma_device_info *dma_device; + struct sk_buff *skb; +}; + static struct net_device *ifxmips_mii0_dev; static unsigned char mac_addr[MAX_ADDR_LEN]; @@ -63,6 +68,7 @@ ifxmips_read_mdio(u32 phy_addr, u32 phy_reg) ((phy_addr & MDIO_ACC_ADDR_MASK) << MDIO_ACC_ADDR_OFFSET) | ((phy_reg & MDIO_ACC_REG_MASK) << MDIO_ACC_REG_OFFSET); + while(ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_REQUEST); ifxmips_w32(val, IFXMIPS_PPE32_MDIO_ACC); while(ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_REQUEST){}; val = ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_VAL_MASK; @@ -343,10 +349,10 @@ static int ifxmips_mii_probe(struct platform_device *dev) { int result = 0; - struct ifxmips_mac *mac = (struct ifxmips_mac*)dev->dev.platform_data; + unsigned char *mac = (unsigned char*)dev->dev.platform_data; ifxmips_mii0_dev = alloc_etherdev(sizeof(struct ifxmips_mii_priv)); ifxmips_mii0_dev->init = ifxmips_mii_dev_init; - memcpy(mac_addr, mac->mac, 6); + memcpy(mac_addr, mac, 6); strcpy(ifxmips_mii0_dev->name, "eth%d"); ifxmips_mii_chip_init(REV_MII_MODE); result = register_netdev(ifxmips_mii0_dev); |