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
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
net
/
wan
/
dscc4.c
diff --git
a/drivers/net/wan/dscc4.c
b/drivers/net/wan/dscc4.c
index
520a77a
..
4505540
100644
(file)
--- a/
drivers/net/wan/dscc4.c
+++ b/
drivers/net/wan/dscc4.c
@@
-105,6
+105,7
@@
#include <linux/delay.h>
#include <net/syncppp.h>
#include <linux/hdlc.h>
#include <linux/delay.h>
#include <net/syncppp.h>
#include <linux/hdlc.h>
+#include <linux/mutex.h>
/* Version */
static const char version[] = "$Id: dscc4.c,v 1.173 2003/09/20 23:55:34 romieu Exp $ for Linux\n";
/* Version */
static const char version[] = "$Id: dscc4.c,v 1.173 2003/09/20 23:55:34 romieu Exp $ for Linux\n";
@@
-112,7
+113,7
@@
static int debug;
static int quartz;
#ifdef CONFIG_DSCC4_PCI_RST
static int quartz;
#ifdef CONFIG_DSCC4_PCI_RST
-static DE
CLARE_MUTEX(dscc4_sem
);
+static DE
FINE_MUTEX(dscc4_mutex
);
static u32 dscc4_pci_config_store[16];
#endif
static u32 dscc4_pci_config_store[16];
#endif
@@
-446,8
+447,8
@@
static inline unsigned int dscc4_tx_quiescent(struct dscc4_dev_priv *dpriv,
return readl(dpriv->base_addr + CH0FTDA + dpriv->dev_id*4) == dpriv->ltda;
}
return readl(dpriv->base_addr + CH0FTDA + dpriv->dev_id*4) == dpriv->ltda;
}
-
int state_check(u32 state, struct dscc4_dev_priv *dpriv, struct net_device *de
v,
- const char *msg)
+
static int state_check(u32 state, struct dscc4_dev_priv *dpri
v,
+
struct net_device *dev,
const char *msg)
{
int ret = 0;
{
int ret = 0;
@@
-466,8
+467,9
@@
int state_check(u32 state, struct dscc4_dev_priv *dpriv, struct net_device *dev,
return ret;
}
return ret;
}
-void dscc4_tx_print(struct net_device *dev, struct dscc4_dev_priv *dpriv,
- char *msg)
+static void dscc4_tx_print(struct net_device *dev,
+ struct dscc4_dev_priv *dpriv,
+ char *msg)
{
printk(KERN_DEBUG "%s: tx_current=%02d tx_dirty=%02d (%s)\n",
dev->name, dpriv->tx_current, dpriv->tx_dirty, msg);
{
printk(KERN_DEBUG "%s: tx_current=%02d tx_dirty=%02d (%s)\n",
dev->name, dpriv->tx_current, dpriv->tx_dirty, msg);
@@
-507,7
+509,8
@@
static void dscc4_release_ring(struct dscc4_dev_priv *dpriv)
}
}
}
}
-inline int try_get_rx_skb(struct dscc4_dev_priv *dpriv, struct net_device *dev)
+static inline int try_get_rx_skb(struct dscc4_dev_priv *dpriv,
+ struct net_device *dev)
{
unsigned int dirty = dpriv->rx_dirty%RX_RING_SIZE;
struct RxFD *rx_fd = dpriv->rx_fd + dirty;
{
unsigned int dirty = dpriv->rx_dirty%RX_RING_SIZE;
struct RxFD *rx_fd = dpriv->rx_fd + dirty;
@@
-542,8
+545,7
@@
static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv,
msg, i);
goto done;
}
msg, i);
goto done;
}
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(10);
+ schedule_timeout_uninterruptible(10);
rmb();
} while (++i > 0);
printk(KERN_ERR "%s: %s timeout\n", dev->name, msg);
rmb();
} while (++i > 0);
printk(KERN_ERR "%s: %s timeout\n", dev->name, msg);
@@
-588,8
+590,7
@@
static inline int dscc4_xpr_ack(struct dscc4_dev_priv *dpriv)
(dpriv->iqtx[cur] & Xpr))
break;
smp_rmb();
(dpriv->iqtx[cur] & Xpr))
break;
smp_rmb();
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(10);
+ schedule_timeout_uninterruptible(10);
} while (++i > 0);
return (i >= 0 ) ? i : -EAGAIN;
} while (++i > 0);
return (i >= 0 ) ? i : -EAGAIN;
@@
-1018,7
+1019,7
@@
static void dscc4_pci_reset(struct pci_dev *pdev, void __iomem *ioaddr)
{
int i;
{
int i;
-
down(&dscc4_sem
);
+
mutex_lock(&dscc4_mutex
);
for (i = 0; i < 16; i++)
pci_read_config_dword(pdev, i << 2, dscc4_pci_config_store + i);
for (i = 0; i < 16; i++)
pci_read_config_dword(pdev, i << 2, dscc4_pci_config_store + i);
@@
-1035,12
+1036,11
@@
static void dscc4_pci_reset(struct pci_dev *pdev, void __iomem *ioaddr)
/* Flush posted writes */
readl(ioaddr + GSTAR);
/* Flush posted writes */
readl(ioaddr + GSTAR);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(10);
+ schedule_timeout_uninterruptible(10);
for (i = 0; i < 16; i++)
pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]);
for (i = 0; i < 16; i++)
pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]);
-
up(&dscc4_sem
);
+
mutex_unlock(&dscc4_mutex
);
}
#else
#define dscc4_pci_reset(pdev,ioaddr) do {} while (0)
}
#else
#define dscc4_pci_reset(pdev,ioaddr) do {} while (0)
@@
-1894,7
+1894,7
@@
try:
* It failed and locked solid. Thus the introduction of a dummy skb.
* Problem is acknowledged in errata sheet DS5. Joy :o/
*/
* It failed and locked solid. Thus the introduction of a dummy skb.
* Problem is acknowledged in errata sheet DS5. Joy :o/
*/
-struct sk_buff *dscc4_init_dummy_skb(struct dscc4_dev_priv *dpriv)
+st
atic st
ruct sk_buff *dscc4_init_dummy_skb(struct dscc4_dev_priv *dpriv)
{
struct sk_buff *skb;
{
struct sk_buff *skb;
@@
-1944,7
+1944,7
@@
static int dscc4_init_ring(struct net_device *dev)
(++i%TX_RING_SIZE)*sizeof(*tx_fd));
} while (i < TX_RING_SIZE);
(++i%TX_RING_SIZE)*sizeof(*tx_fd));
} while (i < TX_RING_SIZE);
- if (
dscc4_init_dummy_skb(dpriv) < 0
)
+ if (
!dscc4_init_dummy_skb(dpriv)
)
goto err_free_dma_tx;
memset(dpriv->rx_skbuff, 0, sizeof(struct sk_buff *)*RX_RING_SIZE);
goto err_free_dma_tx;
memset(dpriv->rx_skbuff, 0, sizeof(struct sk_buff *)*RX_RING_SIZE);