Commit f66aa001 authored by Alan Cox's avatar Alan Cox Committed by David Mosberger

Fix endiannes problems in ISA net drivers:

3c503, hp-plus, smc-ultra, smc-ultra32, wd
parent 67c5f644
...@@ -512,6 +512,7 @@ el2_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_pag ...@@ -512,6 +512,7 @@ el2_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_pag
if (dev->mem_start) { /* Use the shared memory. */ if (dev->mem_start) { /* Use the shared memory. */
isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
hdr->count = le16_to_cpu(hdr->count);
return; return;
} }
......
...@@ -351,7 +351,7 @@ hpp_mem_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring ...@@ -351,7 +351,7 @@ hpp_mem_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring
outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION); outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
isa_memcpy_fromio(hdr, dev->mem_start, sizeof(struct e8390_pkt_hdr)); isa_memcpy_fromio(hdr, dev->mem_start, sizeof(struct e8390_pkt_hdr));
outw(option_reg, ioaddr + HPP_OPTION); outw(option_reg, ioaddr + HPP_OPTION);
hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ hdr->count = (le16_to_cpu(hdr->count) + 3) & ~3; /* Round up allocation. */
} }
static void static void
......
...@@ -383,9 +383,11 @@ ultra_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p ...@@ -383,9 +383,11 @@ ultra_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p
unsigned long hdr_start = dev->mem_start + ((ring_page - START_PG)<<8); unsigned long hdr_start = dev->mem_start + ((ring_page - START_PG)<<8);
outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET); /* shmem on */ outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET); /* shmem on */
#ifdef notdef #ifdef __BIG_ENDIAN
/* Officially this is what we are doing, but the readl() is faster */ /* Officially this is what we are doing, but the readl() is faster */
/* unfortunately it isn't endian aware of the struct */
isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
hdr->count = le16_to_cpu(hdr->count);
#else #else
((unsigned int*)hdr)[0] = isa_readl(hdr_start); ((unsigned int*)hdr)[0] = isa_readl(hdr_start);
#endif #endif
......
...@@ -320,9 +320,11 @@ static void ultra32_get_8390_hdr(struct net_device *dev, ...@@ -320,9 +320,11 @@ static void ultra32_get_8390_hdr(struct net_device *dev,
/* Select correct 8KB Window. */ /* Select correct 8KB Window. */
outb(ei_status.reg0 | ((ring_page & 0x60) >> 5), RamReg); outb(ei_status.reg0 | ((ring_page & 0x60) >> 5), RamReg);
#ifdef notdef #ifdef __BIG_ENDIAN
/* Officially this is what we are doing, but the readl() is faster */ /* Officially this is what we are doing, but the readl() is faster */
/* unfortunately it isn't endian aware of the struct */
isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
hdr->count = le16_to_cpu(hdr->count);
#else #else
((unsigned int*)hdr)[0] = isa_readl(hdr_start); ((unsigned int*)hdr)[0] = isa_readl(hdr_start);
#endif #endif
......
...@@ -370,9 +370,11 @@ wd_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page ...@@ -370,9 +370,11 @@ wd_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page
if (ei_status.word16) if (ei_status.word16)
outb(ISA16 | ei_status.reg5, wd_cmdreg+WD_CMDREG5); outb(ISA16 | ei_status.reg5, wd_cmdreg+WD_CMDREG5);
#ifdef notdef #ifdef __BIG_ENDIAN
/* Officially this is what we are doing, but the readl() is faster */ /* Officially this is what we are doing, but the readl() is faster */
/* unfortunately it isn't endian aware of the struct */
isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
hdr->count = le16_to_cpu(hdr->count);
#else #else
((unsigned int*)hdr)[0] = isa_readl(hdr_start); ((unsigned int*)hdr)[0] = isa_readl(hdr_start);
#endif #endif
......
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