diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-07-20 12:04:29 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-07-20 12:04:29 +0000 |
commit | 8b276baecf1d410399719b35b67af3c7d14c2524 (patch) | |
tree | 9f6061ea75d1f2342f0103c25542b77cc47e498e /target/linux | |
parent | 1cd2aa24fb1ee3efa6d8331b373fa3d0361b2427 (diff) | |
download | master-187ad058-8b276baecf1d410399719b35b67af3c7d14c2524.tar.gz master-187ad058-8b276baecf1d410399719b35b67af3c7d14c2524.tar.bz2 master-187ad058-8b276baecf1d410399719b35b67af3c7d14c2524.zip |
ar71xx: make sure that rx and interrupts are disabled before issuing the hardware reset
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27702 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c index f0f4d2370a..c1143161af 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c @@ -423,10 +423,19 @@ static void ag71xx_dma_reset(struct ag71xx *ag) FIFO_CFG5_LE | FIFO_CFG5_FT | FIFO_CFG5_16 | \ FIFO_CFG5_17 | FIFO_CFG5_SF) +static void ag71xx_hw_stop(struct ag71xx *ag) +{ + /* disable all interrupts and stop the rx engine */ + ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, 0); + ag71xx_wr(ag, AG71XX_REG_RX_CTRL, 0); +} + static void ag71xx_hw_init(struct ag71xx *ag) { struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); + ag71xx_hw_stop(ag); + ag71xx_sb(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_SR); udelay(20); @@ -471,13 +480,6 @@ static void ag71xx_hw_start(struct ag71xx *ag) ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, AG71XX_INT_INIT); } -static void ag71xx_hw_stop(struct ag71xx *ag) -{ - /* disable all interrupts and stop the rx engine */ - ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, 0); - ag71xx_wr(ag, AG71XX_REG_RX_CTRL, 0); -} - void ag71xx_link_adjust(struct ag71xx *ag) { struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); |