git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git]
/
drivers
/
net
/
ns83820.c
diff --git
a/drivers/net/ns83820.c
b/drivers/net/ns83820.c
index
b6427a8
..
23397f9
100644
(file)
--- a/
drivers/net/ns83820.c
+++ b/
drivers/net/ns83820.c
@@
-96,7
+96,6
@@
//#define dprintk printk
#define dprintk(x...) do { } while (0)
//#define dprintk printk
#define dprintk(x...) do { } while (0)
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
@@
-804,7
+803,7
@@
static int ns83820_setup_rx(struct net_device *ndev)
writel(dev->IMR_cache, dev->base + IMR);
writel(1, dev->base + IER);
writel(dev->IMR_cache, dev->base + IMR);
writel(1, dev->base + IER);
- spin_unlock
_irq
(&dev->misc_lock);
+ spin_unlock(&dev->misc_lock);
kick_rx(ndev);
kick_rx(ndev);
@@
-1013,8
+1012,6
@@
static void do_tx_done(struct net_device *ndev)
struct ns83820 *dev = PRIV(ndev);
u32 cmdsts, tx_done_idx, *desc;
struct ns83820 *dev = PRIV(ndev);
u32 cmdsts, tx_done_idx, *desc;
- spin_lock_irq(&dev->tx_lock);
-
dprintk("do_tx_done(%p)\n", ndev);
tx_done_idx = dev->tx_done_idx;
desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
dprintk("do_tx_done(%p)\n", ndev);
tx_done_idx = dev->tx_done_idx;
desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
@@
-1070,7
+1067,6
@@
static void do_tx_done(struct net_device *ndev)
netif_start_queue(ndev);
netif_wake_queue(ndev);
}
netif_start_queue(ndev);
netif_wake_queue(ndev);
}
- spin_unlock_irq(&dev->tx_lock);
}
static void ns83820_cleanup_tx(struct ns83820 *dev)
}
static void ns83820_cleanup_tx(struct ns83820 *dev)
@@
-1282,11
+1278,13
@@
static struct ethtool_ops ops = {
.get_link = ns83820_get_link
};
.get_link = ns83820_get_link
};
+/* this function is called in irq context from the ISR */
static void ns83820_mib_isr(struct ns83820 *dev)
{
static void ns83820_mib_isr(struct ns83820 *dev)
{
- spin_lock(&dev->misc_lock);
+ unsigned long flags;
+ spin_lock_irqsave(&dev->misc_lock, flags);
ns83820_update_stats(dev);
ns83820_update_stats(dev);
- spin_unlock
(&dev->misc_lock
);
+ spin_unlock
_irqrestore(&dev->misc_lock, flags
);
}
static void ns83820_do_isr(struct net_device *ndev, u32 isr);
}
static void ns83820_do_isr(struct net_device *ndev, u32 isr);
@@
-1308,6
+1306,8
@@
static irqreturn_t ns83820_irq(int foo, void *data, struct pt_regs *regs)
static void ns83820_do_isr(struct net_device *ndev, u32 isr)
{
struct ns83820 *dev = PRIV(ndev);
static void ns83820_do_isr(struct net_device *ndev, u32 isr)
{
struct ns83820 *dev = PRIV(ndev);
+ unsigned long flags;
+
#ifdef DEBUG
if (isr & ~(ISR_PHY | ISR_RXDESC | ISR_RXEARLY | ISR_RXOK | ISR_RXERR | ISR_TXIDLE | ISR_TXOK | ISR_TXDESC))
Dprintk("odd isr? 0x%08x\n", isr);
#ifdef DEBUG
if (isr & ~(ISR_PHY | ISR_RXDESC | ISR_RXEARLY | ISR_RXOK | ISR_RXERR | ISR_TXIDLE | ISR_TXOK | ISR_TXDESC))
Dprintk("odd isr? 0x%08x\n", isr);
@@
-1322,10
+1322,10
@@
static void ns83820_do_isr(struct net_device *ndev, u32 isr)
if ((ISR_RXDESC | ISR_RXOK) & isr) {
prefetch(dev->rx_info.next_rx_desc);
if ((ISR_RXDESC | ISR_RXOK) & isr) {
prefetch(dev->rx_info.next_rx_desc);
- spin_lock_irq
(&dev->misc_lock
);
+ spin_lock_irq
save(&dev->misc_lock, flags
);
dev->IMR_cache &= ~(ISR_RXDESC | ISR_RXOK);
writel(dev->IMR_cache, dev->base + IMR);
dev->IMR_cache &= ~(ISR_RXDESC | ISR_RXOK);
writel(dev->IMR_cache, dev->base + IMR);
- spin_unlock_irq
(&dev->misc_lock
);
+ spin_unlock_irq
restore(&dev->misc_lock, flags
);
tasklet_schedule(&dev->rx_tasklet);
//rx_irq(ndev);
tasklet_schedule(&dev->rx_tasklet);
//rx_irq(ndev);
@@
-1371,16
+1371,18
@@
static void ns83820_do_isr(struct net_device *ndev, u32 isr)
* work has accumulated
*/
if ((ISR_TXDESC | ISR_TXIDLE | ISR_TXOK | ISR_TXERR) & isr) {
* work has accumulated
*/
if ((ISR_TXDESC | ISR_TXIDLE | ISR_TXOK | ISR_TXERR) & isr) {
+ spin_lock_irqsave(&dev->tx_lock, flags);
do_tx_done(ndev);
do_tx_done(ndev);
+ spin_unlock_irqrestore(&dev->tx_lock, flags);
/* Disable TxOk if there are no outstanding tx packets.
*/
if ((dev->tx_done_idx == dev->tx_free_idx) &&
(dev->IMR_cache & ISR_TXOK)) {
/* Disable TxOk if there are no outstanding tx packets.
*/
if ((dev->tx_done_idx == dev->tx_free_idx) &&
(dev->IMR_cache & ISR_TXOK)) {
- spin_lock_irq
(&dev->misc_lock
);
+ spin_lock_irq
save(&dev->misc_lock, flags
);
dev->IMR_cache &= ~ISR_TXOK;
writel(dev->IMR_cache, dev->base + IMR);
dev->IMR_cache &= ~ISR_TXOK;
writel(dev->IMR_cache, dev->base + IMR);
- spin_unlock_irq
(&dev->misc_lock
);
+ spin_unlock_irq
restore(&dev->misc_lock, flags
);
}
}
}
}
@@
-1391,10
+1393,10
@@
static void ns83820_do_isr(struct net_device *ndev, u32 isr)
* nature are expected, we must enable TxOk.
*/
if ((ISR_TXIDLE & isr) && (dev->tx_done_idx != dev->tx_free_idx)) {
* nature are expected, we must enable TxOk.
*/
if ((ISR_TXIDLE & isr) && (dev->tx_done_idx != dev->tx_free_idx)) {
- spin_lock_irq
(&dev->misc_lock
);
+ spin_lock_irq
save(&dev->misc_lock, flags
);
dev->IMR_cache |= ISR_TXOK;
writel(dev->IMR_cache, dev->base + IMR);
dev->IMR_cache |= ISR_TXOK;
writel(dev->IMR_cache, dev->base + IMR);
- spin_unlock_irq
(&dev->misc_lock
);
+ spin_unlock_irq
restore(&dev->misc_lock, flags
);
}
/* MIB interrupt: one of the statistics counters is about to overflow */
}
/* MIB interrupt: one of the statistics counters is about to overflow */
@@
-1456,7
+1458,7
@@
static void ns83820_tx_timeout(struct net_device *ndev)
u32 tx_done_idx, *desc;
unsigned long flags;
u32 tx_done_idx, *desc;
unsigned long flags;
-
local_irq_save(
flags);
+
spin_lock_irqsave(&dev->tx_lock,
flags);
tx_done_idx = dev->tx_done_idx;
desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
tx_done_idx = dev->tx_done_idx;
desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
@@
-1483,7
+1485,7
@@
static void ns83820_tx_timeout(struct net_device *ndev)
ndev->name,
tx_done_idx, dev->tx_free_idx, le32_to_cpu(desc[DESC_CMDSTS]));
ndev->name,
tx_done_idx, dev->tx_free_idx, le32_to_cpu(desc[DESC_CMDSTS]));
-
local_irq_restore(
flags);
+
spin_unlock_irqrestore(&dev->tx_lock,
flags);
}
static void ns83820_tx_watch(unsigned long data)
}
static void ns83820_tx_watch(unsigned long data)
@@
-1833,7
+1835,7
@@
static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
} else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
using_dac = 0;
} else {
} else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
using_dac = 0;
} else {
-
printk(KERN_WARNING "ns83820.c:
pci_set_dma_mask failed!\n");
+
dev_warn(&pci_dev->dev, "
pci_set_dma_mask failed!\n");
return -ENODEV;
}
return -ENODEV;
}
@@
-1856,7
+1858,7
@@
static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
err = pci_enable_device(pci_dev);
if (err) {
err = pci_enable_device(pci_dev);
if (err) {
-
printk(KERN_INFO "ns83820:
pci_enable_dev failed: %d\n", err);
+
dev_info(&pci_dev->dev, "
pci_enable_dev failed: %d\n", err);
goto out_free;
}
goto out_free;
}
@@
-1882,11
+1884,11
@@
static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
dev->IMR_cache = 0;
dev->IMR_cache = 0;
- err = request_irq(pci_dev->irq, ns83820_irq,
SA_SHIRQ
,
+ err = request_irq(pci_dev->irq, ns83820_irq,
IRQF_SHARED
,
DRV_NAME, ndev);
if (err) {
DRV_NAME, ndev);
if (err) {
-
printk(KERN_INFO "ns83820: unable to register irq
%d\n",
- pci_dev->irq);
+
dev_info(&pci_dev->dev, "unable to register irq %d, err
%d\n",
+ pci_dev->irq
, err
);
goto out_disable;
}
goto out_disable;
}
@@
-1900,7
+1902,7
@@
static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
rtnl_lock();
err = dev_alloc_name(ndev, ndev->name);
if (err < 0) {
rtnl_lock();
err = dev_alloc_name(ndev, ndev->name);
if (err < 0) {
-
printk(KERN_INFO "ns83820:
unable to get netdev name: %d\n", err);
+
dev_info(&pci_dev->dev, "
unable to get netdev name: %d\n", err);
goto out_free_irq;
}
goto out_free_irq;
}