projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
natsemi: Consistently use interrupt enable/disable functions
[powerpc.git]
/
drivers
/
net
/
ioc3-eth.c
diff --git
a/drivers/net/ioc3-eth.c
b/drivers/net/ioc3-eth.c
index
65f897d
..
4ad7807
100644
(file)
--- a/
drivers/net/ioc3-eth.c
+++ b/
drivers/net/ioc3-eth.c
@@
-28,7
+28,7
@@
*/
#define IOC3_NAME "ioc3-eth"
*/
#define IOC3_NAME "ioc3-eth"
-#define IOC3_VERSION "2.6.3-
3
"
+#define IOC3_VERSION "2.6.3-
4
"
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/delay.h>
@@
-57,7
+57,6
@@
#include <net/ip.h>
#include <asm/byteorder.h>
#include <net/ip.h>
#include <asm/byteorder.h>
-#include <asm/checksum.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
@@
-115,7
+114,7
@@
static inline void ioc3_stop(struct ioc3_private *ip);
static void ioc3_init(struct net_device *dev);
static const char ioc3_str[] = "IOC3 Ethernet";
static void ioc3_init(struct net_device *dev);
static const char ioc3_str[] = "IOC3 Ethernet";
-static struct ethtool_ops ioc3_ethtool_ops;
+static
const
struct ethtool_ops ioc3_ethtool_ops;
/* We use this to acquire receive skb's that we can DMA directly into. */
/* We use this to acquire receive skb's that we can DMA directly into. */
@@
-750,7
+749,7
@@
static void ioc3_error(struct ioc3_private *ip, u32 eisr)
/* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */
/* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */
-static irqreturn_t ioc3_interrupt(int irq, void *_dev
, struct pt_regs *regs
)
+static irqreturn_t ioc3_interrupt(int irq, void *_dev)
{
struct net_device *dev = (struct net_device *)_dev;
struct ioc3_private *ip = netdev_priv(dev);
{
struct net_device *dev = (struct net_device *)_dev;
struct ioc3_private *ip = netdev_priv(dev);
@@
-837,13
+836,17
@@
static int ioc3_mii_init(struct ioc3_private *ip)
}
ip->mii.phy_id = i;
}
ip->mii.phy_id = i;
+
+out:
+ return res;
+}
+
+static void ioc3_mii_start(struct ioc3_private *ip)
+{
ip->ioc3_timer.expires = jiffies + (12 * HZ)/10; /* 1.2 sec. */
ip->ioc3_timer.data = (unsigned long) ip;
ip->ioc3_timer.function = &ioc3_timer;
add_timer(&ip->ioc3_timer);
ip->ioc3_timer.expires = jiffies + (12 * HZ)/10; /* 1.2 sec. */
ip->ioc3_timer.data = (unsigned long) ip;
ip->ioc3_timer.function = &ioc3_timer;
add_timer(&ip->ioc3_timer);
-
-out:
- return res;
}
static inline void ioc3_clean_rx_ring(struct ioc3_private *ip)
}
static inline void ioc3_clean_rx_ring(struct ioc3_private *ip)
@@
-1017,7
+1020,7
@@
static void ioc3_init(struct net_device *dev)
struct ioc3_private *ip = netdev_priv(dev);
struct ioc3 *ioc3 = ip->regs;
struct ioc3_private *ip = netdev_priv(dev);
struct ioc3 *ioc3 = ip->regs;
- del_timer
(&ip->ioc3_timer);
/* Kill if running */
+ del_timer
_sync(&ip->ioc3_timer);
/* Kill if running */
ioc3_w_emcr(EMCR_RST); /* Reset */
(void) ioc3_r_emcr(); /* Flush WB */
ioc3_w_emcr(EMCR_RST); /* Reset */
(void) ioc3_r_emcr(); /* Flush WB */
@@
-1072,6
+1075,7
@@
static int ioc3_open(struct net_device *dev)
ip->ehar_h = 0;
ip->ehar_l = 0;
ioc3_init(dev);
ip->ehar_h = 0;
ip->ehar_l = 0;
ioc3_init(dev);
+ ioc3_mii_start(ip);
netif_start_queue(dev);
return 0;
netif_start_queue(dev);
return 0;
@@
-1081,7
+1085,7
@@
static int ioc3_close(struct net_device *dev)
{
struct ioc3_private *ip = netdev_priv(dev);
{
struct ioc3_private *ip = netdev_priv(dev);
- del_timer(&ip->ioc3_timer);
+ del_timer
_sync
(&ip->ioc3_timer);
netif_stop_queue(dev);
netif_stop_queue(dev);
@@
-1275,6
+1279,7
@@
static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_stop;
}
goto out_stop;
}
+ ioc3_mii_start(ip);
ioc3_ssram_disc(ip);
ioc3_get_eaddr(ip);
ioc3_ssram_disc(ip);
ioc3_get_eaddr(ip);
@@
-1315,6
+1320,7
@@
static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
out_stop:
ioc3_stop(ip);
out_stop:
ioc3_stop(ip);
+ del_timer_sync(&ip->ioc3_timer);
ioc3_free_rings(ip);
out_res:
pci_release_regions(pdev);
ioc3_free_rings(ip);
out_res:
pci_release_regions(pdev);
@@
-1336,6
+1342,8
@@
static void __devexit ioc3_remove_one (struct pci_dev *pdev)
struct ioc3 *ioc3 = ip->regs;
unregister_netdev(dev);
struct ioc3 *ioc3 = ip->regs;
unregister_netdev(dev);
+ del_timer_sync(&ip->ioc3_timer);
+
iounmap(ioc3);
pci_release_regions(pdev);
free_netdev(dev);
iounmap(ioc3);
pci_release_regions(pdev);
free_netdev(dev);
@@
-1493,6
+1501,7
@@
static void ioc3_timeout(struct net_device *dev)
ioc3_stop(ip);
ioc3_init(dev);
ioc3_mii_init(ip);
ioc3_stop(ip);
ioc3_init(dev);
ioc3_mii_init(ip);
+ ioc3_mii_start(ip);
spin_unlock_irq(&ip->ioc3_lock);
spin_unlock_irq(&ip->ioc3_lock);
@@
-1580,7
+1589,7
@@
static u32 ioc3_get_link(struct net_device *dev)
return rc;
}
return rc;
}
-static struct ethtool_ops ioc3_ethtool_ops = {
+static
const
struct ethtool_ops ioc3_ethtool_ops = {
.get_drvinfo = ioc3_get_drvinfo,
.get_settings = ioc3_get_settings,
.set_settings = ioc3_set_settings,
.get_drvinfo = ioc3_get_drvinfo,
.get_settings = ioc3_get_settings,
.set_settings = ioc3_set_settings,
@@
-1611,8
+1620,6
@@
static void ioc3_set_multicast_list(struct net_device *dev)
netif_stop_queue(dev); /* Lock out others. */
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
netif_stop_queue(dev); /* Lock out others. */
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
- /* Unconditionally log net taps. */
- printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name);
ip->emcr |= EMCR_PROMISC;
ioc3_w_emcr(ip->emcr);
(void) ioc3_r_emcr();
ip->emcr |= EMCR_PROMISC;
ioc3_w_emcr(ip->emcr);
(void) ioc3_r_emcr();