Skip to content

Commit

Permalink
sis190 endianness
Browse files Browse the repository at this point in the history
	Check in sis190_rx_interrupt() is broken on big-endian
(desc->status is little-endian and everything else actually uses
it correctly, including other checks for OWNbit.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Al Viro authored and Jeff Garzik committed Dec 17, 2007
1 parent 87e417b commit 961994a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/sis190.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ static inline void sis190_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
static inline void sis190_make_unusable_by_asic(struct RxDesc *desc)
{
desc->PSize = 0x0;
desc->addr = 0xdeadbeef;
desc->addr = cpu_to_le32(0xdeadbeef);
desc->size &= cpu_to_le32(RingEnd);
wmb();
desc->status = 0x0;
Expand Down Expand Up @@ -580,7 +580,7 @@ static int sis190_rx_interrupt(struct net_device *dev,
struct RxDesc *desc = tp->RxDescRing + entry;
u32 status;

if (desc->status & OWNbit)
if (le32_to_cpu(desc->status) & OWNbit)
break;

status = le32_to_cpu(desc->PSize);
Expand Down Expand Up @@ -1538,9 +1538,9 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,

/* Get MAC address from EEPROM */
for (i = 0; i < MAC_ADDR_LEN / 2; i++) {
__le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i);
u16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i);

((u16 *)dev->dev_addr)[i] = le16_to_cpu(w);
((__le16 *)dev->dev_addr)[i] = cpu_to_le16(w);
}

sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo));
Expand Down

0 comments on commit 961994a

Please sign in to comment.