Commit 613b3d3c authored by Paul Gortmaker's avatar Paul Gortmaker Committed by Jeff Garzik

The struct netdev rmem_start and rmem_end entries are specific to 8390

based net cards and hence these should be moved into the dev->priv
for these cards.

This patch adds rmem_start and rmem_end to dev->priv in 8390.h, and does:

        s/dev->rmem_/ei_local.rmem_/g   on all 8390 shared mem drivers.
parent 0149be04
......@@ -263,13 +263,13 @@ el2_probe1(struct net_device *dev, int ioaddr)
#endif /* EL2MEMTEST */
if (dev->mem_start)
dev->mem_end = dev->rmem_end = dev->mem_start + EL2_MEMSIZE;
dev->mem_end = ei_status.rmem_end = dev->mem_start + EL2_MEMSIZE;
if (wordlength) { /* No Tx pages to skip over to get to Rx */
dev->rmem_start = dev->mem_start;
ei_status.rmem_start = dev->mem_start;
ei_status.name = "3c503/16";
} else {
dev->rmem_start = TX_PAGES*256 + dev->mem_start;
ei_status.rmem_start = TX_PAGES*256 + dev->mem_start;
ei_status.name = "3c503";
}
}
......@@ -549,7 +549,7 @@ el2_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring
unsigned short int *buf;
unsigned short word;
int end_of_ring = dev->rmem_end;
int end_of_ring = ei_status.rmem_end;
/* Maybe enable shared memory just be to be safe... nahh.*/
if (dev->mem_start) { /* Use the shared memory. */
......@@ -559,7 +559,7 @@ el2_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring
int semi_count = end_of_ring - (dev->mem_start + ring_offset);
isa_memcpy_fromio(skb->data, dev->mem_start + ring_offset, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk -- we can copy + cksum. */
isa_eth_io_copy_and_sum(skb, dev->mem_start + ring_offset, count, 0);
......
......@@ -51,8 +51,6 @@ extern int ei_open(struct net_device *dev);
extern int ei_close(struct net_device *dev);
extern void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
/* Most of these entries should be in 'struct net_device' (or most of the
things in there should be here!) */
/* You have one of these per-board */
struct ei_device {
const char *name;
......@@ -60,6 +58,8 @@ struct ei_device {
void (*get_8390_hdr)(struct net_device *, struct e8390_pkt_hdr *, int);
void (*block_output)(struct net_device *, int, const unsigned char *, int);
void (*block_input)(struct net_device *, int, struct sk_buff *, int);
unsigned long rmem_start;
unsigned long rmem_end;
unsigned char mcfilter[8];
unsigned open:1;
unsigned word16:1; /* We have the 16-bit (vs 8-bit) version of the card. */
......
......@@ -226,8 +226,8 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
AC_STOP_PG/4, dev->mem_start);
}
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = dev->rmem_end = dev->mem_start
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = ei_status.rmem_end = dev->mem_start
+ (AC_STOP_PG - AC_START_PG)*256;
ei_status.name = "AC3200";
......@@ -302,12 +302,12 @@ static void ac_block_input(struct net_device *dev, int count, struct sk_buff *sk
{
unsigned long xfer_start = dev->mem_start + ring_offset - (AC_START_PG<<8);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk -- we can copy + cksum. */
isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
......
......@@ -513,14 +513,14 @@ static int __init ns8390_probe1(struct net_device *dev, int word16, char *model_
ei_status.tx_start_page = CABLETRON_TX_START_PG;
ei_status.rx_start_page = CABLETRON_RX_START_PG;
ei_status.stop_page = CABLETRON_RX_STOP_PG;
dev->rmem_start = dev->mem_start;
dev->rmem_end = dev->mem_start + CABLETRON_RX_STOP_PG*256;
ei_status.rmem_start = dev->mem_start;
ei_status.rmem_end = dev->mem_start + CABLETRON_RX_STOP_PG*256;
} else {
ei_status.tx_start_page = WD_START_PG;
ei_status.rx_start_page = WD_START_PG + TX_PAGES;
ei_status.stop_page = (dev->mem_end - dev->mem_start)/256;
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->rmem_end = dev->mem_end;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_end = dev->mem_end;
}
if(promoff==-1) /* Use nubus resources ? */
......@@ -779,14 +779,14 @@ static void dayna_block_input(struct net_device *dev, int count, struct sk_buff
* is word per long onto our space.
*/
if (xfer_start + count > dev->rmem_end)
if (xfer_start + count > ei_status.rmem_end)
{
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
dayna_memcpy_fromcard(dev, skb->data, xfer_base, semi_count);
count -= semi_count;
dayna_memcpy_fromcard(dev, skb->data + semi_count,
dev->rmem_start - dev->mem_start, count);
ei_status.rmem_start - dev->mem_start, count);
}
else
{
......@@ -820,14 +820,14 @@ static void sane_block_input(struct net_device *dev, int count, struct sk_buff *
unsigned long xfer_base = ring_offset - (WD_START_PG<<8);
unsigned long xfer_start = xfer_base+dev->mem_start;
if (xfer_start + count > dev->rmem_end)
if (xfer_start + count > ei_status.rmem_end)
{
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
memcpy(skb->data, (char *)dev->mem_start+xfer_base, semi_count);
count -= semi_count;
memcpy(skb->data + semi_count,
(char *)dev->rmem_start, count);
(char *)ei_status.rmem_start, count);
}
else
{
......@@ -881,14 +881,14 @@ static void slow_sane_block_input(struct net_device *dev, int count, struct sk_b
unsigned long xfer_base = ring_offset - (WD_START_PG<<8);
unsigned long xfer_start = xfer_base+dev->mem_start;
if (xfer_start + count > dev->rmem_end)
if (xfer_start + count > ei_status.rmem_end)
{
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
word_memcpy_fromcard(skb->data, (char *)dev->mem_start+xfer_base, semi_count);
count -= semi_count;
word_memcpy_fromcard(skb->data + semi_count,
(char *)dev->rmem_start, count);
(char *)ei_status.rmem_start, count);
}
else
{
......
......@@ -234,8 +234,8 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
#ifdef notdef
/* These values are unused. The E2100 has a 2K window into the packet
buffer. The window can be set to start on any page boundary. */
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = dev->rmem_end = dev->mem_start + 2*1024;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = ei_status.rmem_end = dev->mem_start + 2*1024;
#endif
printk(", IRQ %d, %s media, memory @ %#lx.\n", dev->irq,
......
......@@ -233,9 +233,9 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
printk(" assigning ");
}
dev->mem_end = dev->rmem_end = dev->mem_start
dev->mem_end = ei_status.rmem_end = dev->mem_start
+ (ES_STOP_PG - ES_START_PG)*256;
dev->rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
printk("mem %#lx-%#lx\n", dev->mem_start, dev->mem_end-1);
......@@ -335,12 +335,12 @@ static void es_block_input(struct net_device *dev, int count, struct sk_buff *sk
{
unsigned long xfer_start = dev->mem_start + ring_offset - (ES_START_PG<<8);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* Packet wraps over end of ring buffer. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk. */
isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
......
......@@ -230,8 +230,8 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
ei_status.block_output = &hpp_mem_block_output;
ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr;
dev->mem_start = mem_start;
dev->rmem_start = dev->mem_start + TX_2X_PAGES*256;
dev->mem_end = dev->rmem_end
ei_status.rmem_start = dev->mem_start + TX_2X_PAGES*256;
dev->mem_end = ei_status.rmem_end
= dev->mem_start + (HP_STOP_PG - HP_START_PG)*256;
}
......
......@@ -247,9 +247,9 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
LNE390_STOP_PG/4, dev->mem_start);
}
dev->mem_end = dev->rmem_end = dev->mem_start
dev->mem_end = ei_status.rmem_end = dev->mem_start
+ (LNE390_STOP_PG - LNE390_START_PG)*256;
dev->rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
/* The 8390 offset is zero for the LNE390 */
dev->base_addr = ioaddr;
......@@ -334,12 +334,12 @@ static void lne390_block_input(struct net_device *dev, int count, struct sk_buff
{
unsigned long xfer_start = dev->mem_start + ring_offset - (LNE390_START_PG<<8);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* Packet wraps over end of ring buffer. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk. */
isa_memcpy_fromio(skb->data, xfer_start, count);
......
......@@ -234,9 +234,9 @@ static int __init ne3210_probe1(struct net_device *dev, int ioaddr)
NE3210_STOP_PG/4, dev->mem_start);
}
dev->mem_end = dev->rmem_end = dev->mem_start
dev->mem_end = ei_status.rmem_end = dev->mem_start
+ (NE3210_STOP_PG - NE3210_START_PG)*256;
dev->rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
/* The 8390 offset is zero for the NE3210 */
dev->base_addr = ioaddr;
......@@ -323,12 +323,12 @@ static void ne3210_block_input(struct net_device *dev, int count, struct sk_buff
{
unsigned long xfer_start = dev->mem_start + ring_offset - (NE3210_START_PG<<8);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* Packet wraps over end of ring buffer. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk. */
isa_memcpy_fromio(skb->data, xfer_start, count);
......
......@@ -299,8 +299,8 @@ int __init ultramca_probe(struct net_device *dev)
ei_status.rx_start_page = START_PG + TX_PAGES;
ei_status.stop_page = num_pages;
dev->rmem_start = dev->mem_start + TX_PAGES * 256;
dev->mem_end = dev->rmem_end =
ei_status.rmem_start = dev->mem_start + TX_PAGES * 256;
dev->mem_end = ei_status.rmem_end =
dev->mem_start + (ei_status.stop_page - START_PG) * 256;
printk(KERN_INFO ", IRQ %d memory %#lx-%#lx.\n",
......@@ -387,12 +387,12 @@ static void ultramca_block_input(struct net_device *dev, int count, struct sk_bu
{
unsigned long xfer_start = dev->mem_start + ring_offset - (START_PG << 8);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk -- we can copy + cksum. */
isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
......
......@@ -251,8 +251,8 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
ei_status.rx_start_page = START_PG + TX_PAGES;
ei_status.stop_page = num_pages;
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = dev->rmem_end
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = ei_status.rmem_end
= dev->mem_start + (ei_status.stop_page - START_PG)*256;
if (piomode) {
......@@ -403,12 +403,12 @@ ultra_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ri
/* Enable shared memory. */
outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk -- we can copy + cksum. */
isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
......
......@@ -231,8 +231,8 @@ static int __init ultra32_probe1(struct net_device *dev, int ioaddr)
/* All Ultra32 cards have 32KB memory with an 8KB window. */
ei_status.stop_page = 128;
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = dev->rmem_end = dev->mem_start + 0x1fff;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = ei_status.rmem_end = dev->mem_start + 0x1fff;
printk(", IRQ %d, 32KB memory, 8KB window at 0x%lx-0x%lx.\n",
dev->irq, dev->mem_start, dev->mem_end);
......@@ -353,7 +353,7 @@ static void ultra32_block_input(struct net_device *dev,
} else {
/* Select first 8KB Window. */
outb(ei_status.reg0, RamReg);
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
}
} else {
/* Packet is in one chunk -- we can copy + cksum. */
......
......@@ -281,7 +281,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
ei_status.rx_start_page = WD_START_PG + TX_PAGES;
/* Don't map in the shared memory until the board is actually opened. */
dev->rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
/* Some cards (eg WD8003EBT) can be jumpered for more (32k!) memory. */
if (dev->mem_end != 0) {
......@@ -290,7 +290,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
ei_status.stop_page = word16 ? WD13_STOP_PG : WD03_STOP_PG;
dev->mem_end = dev->mem_start + (ei_status.stop_page - WD_START_PG)*256;
}
dev->rmem_end = dev->mem_end;
ei_status.rmem_end = dev->mem_end;
printk(" %s, IRQ %d, shared memory at %#lx-%#lx.\n",
model_name, dev->irq, dev->mem_start, dev->mem_end-1);
......@@ -384,12 +384,12 @@ wd_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_
int wd_cmdreg = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */
unsigned long xfer_start = dev->mem_start + ring_offset - (WD_START_PG<<8);
if (xfer_start + count > dev->rmem_end) {
if (xfer_start + count > ei_status.rmem_end) {
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
int semi_count = ei_status.rmem_end - xfer_start;
isa_memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count);
} else {
/* Packet is in one chunk -- we can copy + cksum. */
isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment