/* dump parts of shared memory - only needed during debugging */
#ifdef DEBUG
-static void dumpmem(struct SKMCA_NETDEV *dev, u32 start, u32 len)
+static void dumpmem(struct net_device *dev, u32 start, u32 len)
{
int z;
/* reset the whole board */
-static void ResetBoard(struct SKMCA_NETDEV *dev)
+static void ResetBoard(struct net_device *dev)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
/* wait for LANCE interface to become not busy */
-static int WaitLANCE(struct SKMCA_NETDEV *dev)
+static int WaitLANCE(struct net_device *dev)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
int t = 0;
/* set LANCE register - must be atomic */
-static void SetLANCE(struct SKMCA_NETDEV *dev, u16 addr, u16 value)
+static void SetLANCE(struct net_device *dev, u16 addr, u16 value)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
unsigned long flags;
/* get LANCE register */
-static u16 GetLANCE(struct SKMCA_NETDEV *dev, u16 addr)
+static u16 GetLANCE(struct net_device *dev, u16 addr)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
unsigned long flags;
/* build up descriptors in shared RAM */
-static void InitDscrs(struct SKMCA_NETDEV *dev)
+static void InitDscrs(struct net_device *dev)
{
u32 bufaddr;
/* feed ready-built initialization block into LANCE */
-static void InitLANCE(struct SKMCA_NETDEV *dev)
+static void InitLANCE(struct net_device *dev)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
/* we don't get ready until the LANCE has read the init block */
-#if (LINUX_VERSION_CODE >= 0x02032a)
netif_stop_queue(dev);
-#else
- dev->tbusy = 1;
-#endif
/* let LANCE read the initialization block. LANCE is ready
when we receive the corresponding interrupt. */
/* stop the LANCE so we can reinitialize it */
-static void StopLANCE(struct SKMCA_NETDEV *dev)
+static void StopLANCE(struct net_device *dev)
{
/* can't take frames any more */
-#if (LINUX_VERSION_CODE >= 0x02032a)
netif_stop_queue(dev);
-#else
- dev->tbusy = 1;
-#endif
/* disable interrupts, stop it */
/* initialize card and LANCE for proper operation */
-static void InitBoard(struct SKMCA_NETDEV *dev)
+static void InitBoard(struct net_device *dev)
{
LANCE_InitBlock block;
/* deinitialize card and LANCE */
-static void DeinitBoard(struct SKMCA_NETDEV *dev)
+static void DeinitBoard(struct net_device *dev)
{
/* stop LANCE */
/* probe for device's irq */
-static int __init ProbeIRQ(struct SKMCA_NETDEV *dev)
+static int __init ProbeIRQ(struct net_device *dev)
{
unsigned long imaskval, njiffies, irq;
u16 csr0val;
/* LANCE has read initialization block -> start it */
-static u16 irqstart_handler(struct SKMCA_NETDEV *dev, u16 oldcsr0)
+static u16 irqstart_handler(struct net_device *dev, u16 oldcsr0)
{
/* now we're ready to transmit */
-#if (LINUX_VERSION_CODE >= 0x02032a)
netif_wake_queue(dev);
-#else
- dev->tbusy = 0;
-#endif
/* reset IDON bit, start LANCE */
/* did we lose blocks due to a FIFO overrun ? */
-static u16 irqmiss_handler(struct SKMCA_NETDEV *dev, u16 oldcsr0)
+static u16 irqmiss_handler(struct net_device *dev, u16 oldcsr0)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
/* receive interrupt */
-static u16 irqrx_handler(struct SKMCA_NETDEV *dev, u16 oldcsr0)
+static u16 irqrx_handler(struct net_device *dev, u16 oldcsr0)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
LANCE_RxDescr descr;
/* transmit interrupt */
-static u16 irqtx_handler(struct SKMCA_NETDEV *dev, u16 oldcsr0)
+static u16 irqtx_handler(struct net_device *dev, u16 oldcsr0)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
LANCE_TxDescr descr;
a new one */
/* inform upper layers we're in business again */
-#if (LINUX_VERSION_CODE >= 0x02032a)
netif_wake_queue(dev);
-#else
- dev->tbusy = 0;
- mark_bh(NET_BH);
-#endif
return oldcsr0;
}
static irqreturn_t irq_handler(int irq, void *device, struct pt_regs *regs)
{
- struct SKMCA_NETDEV *dev = (struct SKMCA_NETDEV *) device;
+ struct net_device *dev = (struct net_device *) device;
u16 csr0val;
/* read CSR0 to get interrupt cause */
if ((csr0val & CSR0_INTR) == 0)
return IRQ_NONE;
-#if (LINUX_VERSION_CODE >= 0x02032a)
#if 0
set_bit(LINK_STATE_RXSEM, &dev->state);
#endif
-#else
- dev->interrupt = 1;
-#endif
/* loop through the interrupt bits until everything is clear */
}
while ((csr0val & CSR0_INTR) != 0);
-#if (LINUX_VERSION_CODE >= 0x02032a)
#if 0
clear_bit(LINK_STATE_RXSEM, &dev->state);
-#endif
-#else
- dev->interrupt = 0;
#endif
return IRQ_HANDLED;
}
static int skmca_getinfo(char *buf, int slot, void *d)
{
int len = 0, i;
- struct SKMCA_NETDEV *dev = (struct SKMCA_NETDEV *) d;
+ struct net_device *dev = (struct net_device *) d;
skmca_priv *priv;
/* can't say anything about an uninitialized device... */
/* open driver. Means also initialization and start of LANCE */
-static int skmca_open(struct SKMCA_NETDEV *dev)
+static int skmca_open(struct net_device *dev)
{
int result;
skmca_priv *priv = (skmca_priv *) dev->priv;
/* set up flags */
-#if (LINUX_VERSION_CODE >= 0x02032a)
netif_start_queue(dev);
-#else
- dev->interrupt = 0;
- dev->tbusy = 0;
- dev->start = 0;
- MOD_INC_USE_COUNT;
-#endif
return 0;
}
/* close driver. Shut down board and free allocated resources */
-static int skmca_close(struct SKMCA_NETDEV *dev)
+static int skmca_close(struct net_device *dev)
{
/* turn off board */
DeinitBoard(dev);
free_irq(dev->irq, dev);
dev->irq = 0;
-#if (LINUX_VERSION_CODE < 0x02032a)
- MOD_DEC_USE_COUNT;
-#endif
-
return 0;
}
/* transmit a block. */
-static int skmca_tx(struct sk_buff *skb, struct SKMCA_NETDEV *dev)
+static int skmca_tx(struct sk_buff *skb, struct net_device *dev)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
LANCE_TxDescr descr;
/* are we saturated ? */
if (priv->txbusy >= TXCOUNT)
-#if (LINUX_VERSION_CODE >= 0x02032a)
netif_stop_queue(dev);
-#else
- dev->tbusy = 1;
-#endif
/* write descriptor back to RAM */
SKMCA_TOIO(dev->mem_start + address, &descr,
/* return pointer to Ethernet statistics */
-static struct net_device_stats *skmca_stats(struct SKMCA_NETDEV *dev)
+static struct net_device_stats *skmca_stats(struct net_device *dev)
{
skmca_priv *priv = (skmca_priv *) dev->priv;
/* we don't support runtime reconfiguration, since an MCA card can
be unambigously identified by its POS registers. */
-static int skmca_config(struct SKMCA_NETDEV *dev, struct ifmap *map)
+static int skmca_config(struct net_device *dev, struct ifmap *map)
{
return 0;
}
/* switch receiver mode. We use the LANCE's multicast filter to prefilter
multicast addresses. */
-static void skmca_set_multicast_list(struct SKMCA_NETDEV *dev)
+static void skmca_set_multicast_list(struct net_device *dev)
{
LANCE_InitBlock block;
static int startslot; /* counts through slots when probing multiple devices */
-int __init skmca_probe(struct SKMCA_NETDEV *dev)
+int __init skmca_probe(struct net_device *dev)
{
int force_detect = 0;
int junior, slot, i;
getaddrs(slot, junior, &base, &irq, &medium);
-#if LINUX_VERSION_CODE >= 0x020300
/* slot already in use ? */
if (mca_is_adapter_used(slot)) {
slot = dofind(&junior, slot + 1);
continue;
}
-#endif
/* were we looking for something different ? */
#define DEVMAX 5
-#if (LINUX_VERSION_CODE >= 0x020369)
-static struct SKMCA_NETDEV moddevs[DEVMAX] =
- { {" ", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{" ", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{" ", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{" ", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{" ", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe}
-};
-#else
-static char NameSpace[8 * DEVMAX];
-static struct SKMCA_NETDEV moddevs[DEVMAX] =
- { {NameSpace + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{NameSpace + 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{NameSpace + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{NameSpace + 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe},
-{NameSpace + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, skmca_probe}
+static struct net_device moddevs[DEVMAX] = {
+ { .name = " ", .init = skmca_probe },
+ { .name = " ", .init = skmca_probe },
+ { .name = " ", .init = skmca_probe },
+ { .name = " ", .init = skmca_probe },
+ { .name = " ", .init = skmca_probe }
};
-#endif
int irq;
int io;
void cleanup_module(void)
{
- struct SKMCA_NETDEV *dev;
+ struct net_device *dev;
skmca_priv *priv;
int z;