]> git.hungrycats.org Git - linux/commitdiff
The struct netdev rmem_start and rmem_end entries are specific to 8390
authorPaul Gortmaker <p_gortmaker@yahoo.com>
Wed, 3 Apr 2002 12:19:32 +0000 (07:19 -0500)
committerJeff Garzik <jgarzik@mandrakesoft.com>
Wed, 3 Apr 2002 12:19:32 +0000 (07:19 -0500)
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.

13 files changed:
drivers/net/3c503.c
drivers/net/8390.h
drivers/net/ac3200.c
drivers/net/daynaport.c
drivers/net/e2100.c
drivers/net/es3210.c
drivers/net/hp-plus.c
drivers/net/lne390.c
drivers/net/ne3210.c
drivers/net/smc-mca.c
drivers/net/smc-ultra.c
drivers/net/smc-ultra32.c
drivers/net/wd.c

index 945476049d31097b4cabccbb4505e6d9d1ba8062..b66a44a74f32e99f6bac96753f0c9bce1357641b 100644 (file)
@@ -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);
index a098e7f1399d8a381a96568f5ffafd89e0377d00..91db251922b5cc48220f772fbb594481fb504cb6 100644 (file)
@@ -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. */
index ced6b5033411a22b21e708e08cfa44d2d73cf346..4a730e250400f47108cb4d9278b207d52e1feb39 100644 (file)
@@ -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);
index cc13e328cae63c1d39dc8cbe0784b5494ce4b6d7..ea424dcb74370131081d0aff5c5dedd82586e7ca 100644 (file)
@@ -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
        {
index 73c5728a1cc515c6b2de5cc054eaf712f340c24f..31493d863982f7d1e4705fe00ba9f1be4f096130 100644 (file)
@@ -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,
index 07ac2b091ee7930859d66acab4a9658571aaa47b..fa9ddc648790c06cb563b12550038ee410533ab8 100644 (file)
@@ -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);
index 330407a3183997bdb53f4cbf28fa375c94b2606d..0e05ee7803a4ab2ee851aba4d4ee95b898fa738d 100644 (file)
@@ -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;
        }
 
index 0866d905c37b6a86a74e83535998ad9fcb9a2e7e..c18997bbfcc7be465eeea03c2225c951a6078892 100644 (file)
@@ -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);
index 426530bbed93cd4a490b79e99be15aa737bb6137..818527d9b3e7c4f5d27feb6cb46f60b36f759c42 100644 (file)
@@ -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);
index 50baaf26db69304f294dda7b87f391e18e9298f7..7d947eaa40950e85ea2dbcfa8feafaa275ecff1e 100644 (file)
@@ -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);
index c6ac05f774bbfad0851b8edbaf96210e3757e5d1..5dcb815b767fe7da168788bbaada52cffbe6624c 100644 (file)
@@ -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);
index b0c295b5593d3ef0ff2b1f4789386460c3f7bc1f..52861584519c6fb3b176f029cb5ae9de3e8849df 100644 (file)
@@ -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. */
index 1292a71c61ec7db36e2387f52ca56384eccdb5ec..3f244b70ed394add82f9372f415d0bf3029e249b 100644 (file)
@@ -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);