diff options
author | John Crispin <blogic@openwrt.org> | 2008-07-05 23:06:07 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2008-07-05 23:06:07 +0000 |
commit | 38c5ac9978fdc3cff0a5975a2ef93849872e9ecd (patch) | |
tree | 81fb17362cf107668648d5ae2db7e40b86b14286 /target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c | |
parent | f470171d1b1867ade4a1d3d671ff07db3efe5b09 (diff) | |
download | master-187ad058-38c5ac9978fdc3cff0a5975a2ef93849872e9ecd.tar.gz master-187ad058-38c5ac9978fdc3cff0a5975a2ef93849872e9ecd.tar.bz2 master-187ad058-38c5ac9978fdc3cff0a5975a2ef93849872e9ecd.zip |
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/ifxmips_mii0.c')
-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 cc3b9d46a7..fe7f25ec2a 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); |