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 core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
net
/
dgrs.c
diff --git
a/drivers/net/dgrs.c
b/drivers/net/dgrs.c
index
91d32f7
..
a795202
100644
(file)
--- a/
drivers/net/dgrs.c
+++ b/
drivers/net/dgrs.c
@@
-110,7
+110,6
@@
static char version[] __initdata =
* DGRS include files
*/
typedef unsigned char uchar;
* DGRS include files
*/
typedef unsigned char uchar;
-typedef unsigned int bool;
#define vol volatile
#include "dgrs.h"
#define vol volatile
#include "dgrs.h"
@@
-454,7
+453,7
@@
do_plx_dma(
* up some state variables to let the host CPU continue doing
* other things until a DMA completion interrupt comes along.
*/
* up some state variables to let the host CPU continue doing
* other things until a DMA completion interrupt comes along.
*/
-void
+
static
void
dgrs_rcv_frame(
struct net_device *dev0,
DGRS_PRIV *priv0,
dgrs_rcv_frame(
struct net_device *dev0,
DGRS_PRIV *priv0,
@@
-874,7
+873,7
@@
static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd)
privN->bcomm->bc_filter_port = ioc.port;
privN->bcomm->bc_filter_num = ioc.filter;
privN->bcomm->bc_filter_len = ioc.len;
privN->bcomm->bc_filter_port = ioc.port;
privN->bcomm->bc_filter_num = ioc.filter;
privN->bcomm->bc_filter_len = ioc.len;
-
+
if (ioc.len)
{
if(copy_from_user(S2HN(privN->bcomm->bc_filter_area),
if (ioc.len)
{
if(copy_from_user(S2HN(privN->bcomm->bc_filter_area),
@@
-896,10
+895,10
@@
static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd)
* dev, priv will always refer to the 0th device in Multi-NIC mode.
*/
* dev, priv will always refer to the 0th device in Multi-NIC mode.
*/
-static irqreturn_t dgrs_intr(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t dgrs_intr(int irq, void *dev_id)
{
{
- struct net_device *dev0 =
(struct net_device *)
dev_id;
- DGRS_PRIV *priv0 =
(DGRS_PRIV *)
dev0->priv;
+ struct net_device *dev0 = dev_id;
+ DGRS_PRIV *priv0 = dev0->priv;
I596_CB *cbp;
int cmd;
int i;
I596_CB *cbp;
int cmd;
int i;
@@
-986,14
+985,14
@@
ack_intr:
/*
* Download the board firmware
*/
/*
* Download the board firmware
*/
-static int __init
+static int __init
dgrs_download(struct net_device *dev0)
{
DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv;
int is;
unsigned long i;
dgrs_download(struct net_device *dev0)
{
DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv;
int is;
unsigned long i;
- static
int
iv2is[16] = {
+ static
const int
iv2is[16] = {
0, 0, 0, ES4H_IS_INT3,
0, ES4H_IS_INT5, 0, ES4H_IS_INT7,
0, 0, ES4H_IS_INT10, ES4H_IS_INT11,
0, 0, 0, ES4H_IS_INT3,
0, ES4H_IS_INT5, 0, ES4H_IS_INT7,
0, 0, ES4H_IS_INT10, ES4H_IS_INT11,
@@
-1150,7
+1149,7
@@
dgrs_download(struct net_device *dev0)
/*
* Probe (init) a board
*/
/*
* Probe (init) a board
*/
-int __init
+static int __init
dgrs_probe1(struct net_device *dev)
{
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
dgrs_probe1(struct net_device *dev)
{
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
@@
-1190,8
+1189,8
@@
dgrs_probe1(struct net_device *dev)
*/
if (priv->plxreg)
OUTL(dev->base_addr + PLX_LCL2PCI_DOORBELL, 1);
*/
if (priv->plxreg)
OUTL(dev->base_addr + PLX_LCL2PCI_DOORBELL, 1);
-
- rc = request_irq(dev->irq, &dgrs_intr,
SA_SHIRQ
, "RightSwitch", dev);
+
+ rc = request_irq(dev->irq, &dgrs_intr,
IRQF_SHARED
, "RightSwitch", dev);
if (rc)
goto err_out;
if (rc)
goto err_out;
@@
-1228,7
+1227,7
@@
err_out:
return rc;
}
return rc;
}
-int __init
+static int __init
dgrs_initclone(struct net_device *dev)
{
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
dgrs_initclone(struct net_device *dev)
{
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
@@
-1243,7
+1242,7
@@
dgrs_initclone(struct net_device *dev)
return (0);
}
return (0);
}
-static struct net_device * __init
+static struct net_device * __init
dgrs_found_device(
int io,
ulong mem,
dgrs_found_device(
int io,
ulong mem,
@@
-1276,9
+1275,9
@@
dgrs_found_device(
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, pdev);
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, pdev);
-
+
ret = dgrs_probe1(dev);
ret = dgrs_probe1(dev);
- if (ret)
+ if (ret)
goto err1;
ret = register_netdev(dev);
goto err1;
ret = register_netdev(dev);
@@
-1301,7
+1300,7
@@
dgrs_found_device(
/* Allocate new dev and priv structures */
devN = alloc_etherdev(sizeof(DGRS_PRIV));
ret = -ENOMEM;
/* Allocate new dev and priv structures */
devN = alloc_etherdev(sizeof(DGRS_PRIV));
ret = -ENOMEM;
- if (!devN)
+ if (!devN)
goto fail;
/* Don't copy the network device structure! */
goto fail;
/* Don't copy the network device structure! */
@@
-1335,7
+1334,7
@@
dgrs_found_device(
}
return dev;
}
return dev;
- fail:
+ fail:
while (i >= 0) {
struct net_device *d = priv->devtbl[i--];
unregister_netdev(d);
while (i >= 0) {
struct net_device *d = priv->devtbl[i--];
unregister_netdev(d);
@@
-1458,6
+1457,8
@@
static struct pci_driver dgrs_pci_driver = {
.probe = dgrs_pci_probe,
.remove = __devexit_p(dgrs_pci_remove),
};
.probe = dgrs_pci_probe,
.remove = __devexit_p(dgrs_pci_remove),
};
+#else
+static struct pci_driver dgrs_pci_driver = {};
#endif
#endif
@@
-1478,7
+1479,7
@@
static int __init dgrs_eisa_probe (struct device *gendev)
return -EBUSY;
}
return -EBUSY;
}
- if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) )
+ if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) )
goto err_out;
mem = (inb(io+ES4H_AS_31_24) << 24)
goto err_out;
mem = (inb(io+ES4H_AS_31_24) << 24)
@@
-1502,11
+1503,11
@@
static int __init dgrs_eisa_probe (struct device *gendev)
static int __devexit dgrs_eisa_remove(struct device *gendev)
{
struct net_device *dev = gendev->driver_data;
static int __devexit dgrs_eisa_remove(struct device *gendev)
{
struct net_device *dev = gendev->driver_data;
-
+
dgrs_remove(dev);
release_region(dev->base_addr, 256);
dgrs_remove(dev);
release_region(dev->base_addr, 256);
-
+
free_netdev(dev);
return 0;
}
free_netdev(dev);
return 0;
}
@@
-1549,7
+1550,7
@@
MODULE_PARM_DESC(nicmode, "Digi RightSwitch operating mode (1: switch, 2: multi-
static int __init dgrs_init_module (void)
{
int i;
static int __init dgrs_init_module (void)
{
int i;
- int
eisacount = 0, pcicount = 0
;
+ int
err
;
/*
* Command line variable overrides
/*
* Command line variable overrides
@@
-1591,15
+1592,13
@@
static int __init dgrs_init_module (void)
* Find and configure all the cards
*/
#ifdef CONFIG_EISA
* Find and configure all the cards
*/
#ifdef CONFIG_EISA
- eisacount = eisa_driver_register(&dgrs_eisa_driver);
- if (eisacount < 0)
- return eisacount;
-#endif
-#ifdef CONFIG_PCI
- pcicount = pci_register_driver(&dgrs_pci_driver);
- if (pcicount)
- return pcicount;
+ err = eisa_driver_register(&dgrs_eisa_driver);
+ if (err)
+ return err;
#endif
#endif
+ err = pci_register_driver(&dgrs_pci_driver);
+ if (err)
+ return err;
return 0;
}
return 0;
}