- added support for Arco Electronics AE/2-card (experimental)
Mon Sep 14 09:53:42 CET 1998 (David Weinehall)
- - added support for Compex ENET-16MC/P (experimental)
+ - added support for Compex ENET-16MC/P (experimental)
Tue Sep 15 16:21:12 CET 1998 (David Weinehall, Magnus Jonsson, Tomas Ogren)
- Miscellaneous bugfixes
- Version# bump
Mon Nov 16 15:28:23 CET 1998 (Wim Dumon)
- - pass 'dev' as last parameter of request_irq in stead of 'NULL'
+ - pass 'dev' as last parameter of request_irq in stead of 'NULL'
Wed Feb 7 21:24:00 CET 2001 (Alfred Arnold)
- added support for the D-Link DE-320CT
-
+
* WARNING
-------
This is alpha-test software. It is not guaranteed to work. As a
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/bitops.h>
+#include <linux/jiffies.h>
#include <asm/system.h>
#include <asm/io.h>
/*
- * special code to read the DE-320's MAC address EEPROM. In contrast to a
+ * special code to read the DE-320's MAC address EEPROM. In contrast to a
* standard NE design, this is a serial EEPROM (93C46) that has to be read
- * bit by bit. The EEPROM cotrol port at base + 0x1e has the following
+ * bit by bit. The EEPROM cotrol port at base + 0x1e has the following
* layout:
*
* Bit 0 = Data out (read from EEPROM)
{
int z;
unsigned int value = 0;
-
+
/* pull the CS line low for a moment. This resets the EEPROM-
internal logic, and makes it ready for a new command. */
SET_MODULE_OWNER(dev);
- /* Do not check any supplied i/o locations.
+ /* Do not check any supplied i/o locations.
POS registers usually don't fail :) */
- /* MCA cards have POS registers.
- Autodetecting MCA cards is extremely simple.
+ /* MCA cards have POS registers.
+ Autodetecting MCA cards is extremely simple.
Just search for the card. */
for(i = 0; (ne2_adapters[i].name != NULL) && !adapter_found; i++) {
- current_mca_slot =
+ current_mca_slot =
mca_find_unused_adapter(ne2_adapters[i].id, 0);
if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) {
int res;
- mca_set_adapter_name(current_mca_slot,
+ mca_set_adapter_name(current_mca_slot,
ne2_adapters[i].name);
mca_mark_as_used(current_mca_slot);
-
+
res = ne2_probe1(dev, current_mca_slot);
if (res)
mca_mark_as_unused(current_mca_slot);
len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" );
len += sprintf(buf+len, "Driver written by Wim Dumon ");
- len += sprintf(buf+len, "<wimpie@kotnet.org>\n");
+ len += sprintf(buf+len, "<wimpie@kotnet.org>\n");
len += sprintf(buf+len, "Modified by ");
len += sprintf(buf+len, "David Weinehall <tao@acc.umu.se>\n");
len += sprintf(buf+len, "and by Magnus Jonsson <bigfoot@acc.umu.se>\n");
len += sprintf(buf+len, "IRQ : %d\n", dev->irq);
#define HW_ADDR(i) dev->dev_addr[i]
- len += sprintf(buf+len, "HW addr : %x:%x:%x:%x:%x:%x\n",
- HW_ADDR(0), HW_ADDR(1), HW_ADDR(2),
+ len += sprintf(buf+len, "HW addr : %x:%x:%x:%x:%x:%x\n",
+ HW_ADDR(0), HW_ADDR(1), HW_ADDR(2),
HW_ADDR(3), HW_ADDR(4), HW_ADDR(5) );
#undef HW_ADDR
#ifndef CRYNWR_WAY
/* Reset the card the way they do it in the Crynwr packet driver */
- for (i=0; i<8; i++)
+ for (i=0; i<8; i++)
outb(0x0, base_addr + NE_RESET);
inb(base_addr + NE_RESET);
outb(0x21, base_addr + NE_CMD);
#else /* _I_ never tested it this way .. Go ahead and try ...*/
/* Reset card. Who knows what dain-bramaged state it was left in. */
- {
+ {
unsigned long reset_start_time = jiffies;
- /* DON'T change these to inb_p/outb_p or reset will fail on
+ /* DON'T change these to inb_p/outb_p or reset will fail on
clones.. */
outb(inb(base_addr + NE_RESET), base_addr + NE_RESET);
while ((inb_p(base_addr + EN0_ISR) & ENISR_RESET) == 0)
- if (jiffies - reset_start_time > 2*HZ/100) {
+ if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
printk(" not found (no reset ack).\n");
retval = -ENODEV;
goto out;
/* Read the 16 bytes of station address PROM.
- We must first initialize registers, similar to
+ We must first initialize registers, similar to
NS8390_init(eifdev, 0).
We can't reliably read the SAPROM address without this.
(I learned the hard way!). */
{
- struct {
- unsigned char value, offset;
+ struct {
+ unsigned char value, offset;
} program_seq[] = {
/* Select page 0 */
- {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD},
+ {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD},
{0x49, EN0_DCFG}, /* Set WORD-wide (0x49) access. */
{0x00, EN0_RCNTLO}, /* Clear the count regs. */
{0x00, EN0_RCNTHI},
};
for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
- outb_p(program_seq[i].value, base_addr +
+ outb_p(program_seq[i].value, base_addr +
program_seq[i].offset);
}
share and the board will usually be enabled. */
retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
if (retval) {
- printk (" unable to get IRQ %d (irqval=%d).\n",
+ printk (" unable to get IRQ %d (irqval=%d).\n",
dev->irq, retval);
goto out;
}
ei_status.block_input = &ne_block_input;
ei_status.block_output = &ne_block_output;
ei_status.get_8390_hdr = &ne_get_8390_hdr;
-
+
ei_status.priv = slot;
-
+
dev->open = &ne_open;
dev->stop = &ne_close;
#ifdef CONFIG_NET_POLL_CONTROLLER
{
unsigned long reset_start_time = jiffies;
- if (ei_debug > 1)
+ if (ei_debug > 1)
printk("resetting the 8390 t=%ld...", jiffies);
/* DON'T change these to inb_p/outb_p or reset will fail on clones. */
/* This check _should_not_ be necessary, omit eventually. */
while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
- if (jiffies - reset_start_time > 2*HZ/100) {
- printk("%s: ne_reset_8390() did not complete.\n",
+ if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
+ printk("%s: ne_reset_8390() did not complete.\n",
dev->name);
break;
}
we don't need to be concerned with ring wrap as the header will be at
the start of a page, so we optimize accordingly. */
-static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
+static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page)
{
int nic_base = dev->base_addr;
- /* This *shouldn't* happen.
+ /* This *shouldn't* happen.
If it does, it's the last thing you'll see */
if (ei_status.dmaing) {
printk("%s: DMAing conflict in ne_get_8390_hdr "
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
if (ei_status.word16)
- insw(NE_BASE + NE_DATAPORT, hdr,
+ insw(NE_BASE + NE_DATAPORT, hdr,
sizeof(struct e8390_pkt_hdr)>>1);
else
- insb(NE_BASE + NE_DATAPORT, hdr,
+ insb(NE_BASE + NE_DATAPORT, hdr,
sizeof(struct e8390_pkt_hdr));
outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
hints. The NEx000 doesn't share the on-board packet memory -- you have
to put the packet out through the "remote DMA" dataport using outb. */
-static void ne_block_input(struct net_device *dev, int count, struct sk_buff *skb,
+static void ne_block_input(struct net_device *dev, int count, struct sk_buff *skb,
int ring_offset)
{
#ifdef NE_SANITY_CHECK
int nic_base = dev->base_addr;
char *buf = skb->data;
- /* This *shouldn't* happen.
+ /* This *shouldn't* happen.
If it does, it's the last thing you'll see */
if (ei_status.dmaing) {
printk("%s: DMAing conflict in ne_block_input "
if (ei_status.word16 && (count & 0x01))
count++;
- /* This *shouldn't* happen.
+ /* This *shouldn't* happen.
If it does, it's the last thing you'll see */
if (ei_status.dmaing) {
printk("%s: DMAing conflict in ne_block_output."
#endif
while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
- if (jiffies - dma_start > 2*HZ/100) { /* 20ms */
+ if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
printk("%s: timeout waiting for Tx RDC.\n", dev->name);
ne_reset_8390(dev);
NS8390_init(dev,1);
/* Module code fixed by David Weinehall */
-int init_module(void)
+int __init init_module(void)
{
struct net_device *dev;
int this_dev, found = 0;