patch-2.2.13 linux/drivers/net/rtl8139.c

Next file: linux/drivers/net/sb1000.c
Previous file: linux/drivers/net/ppp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/drivers/net/rtl8139.c linux/drivers/net/rtl8139.c
@@ -424,13 +424,15 @@
 	/* Bring the chip out of low-power mode. */
 	outb(0x00, ioaddr + Config1);
 
-	if (read_eeprom(ioaddr, 0) != 0xffff)
-		for (i = 0; i < 3; i++)
-			((u16 *)(dev->dev_addr))[i] = read_eeprom(ioaddr, i + 7);
-	else
+	if (read_eeprom(ioaddr, 0) != 0xffff) {
+		for (i = 0; i < 3; i++) {
+			((u16 *)(dev->dev_addr))[i] =
+				le16_to_cpu(read_eeprom(ioaddr, i + 7));
+		}
+	} else {
 		for (i = 0; i < 6; i++)
 			dev->dev_addr[i] = inb(ioaddr + MAC0 + i);
-
+	}
 	for (i = 0; i < 5; i++)
 		printk("%2.2x:", dev->dev_addr[i]);
 	printk("%2.2x.\n", dev->dev_addr[i]);
@@ -1187,7 +1189,7 @@
 
 	while ((inb(ioaddr + ChipCmd) & 1) == 0) {
 		int ring_offset = cur_rx % RX_BUF_LEN;
-		u32 rx_status = *(u32*)(rx_ring + ring_offset);
+		u32 rx_status = le32_to_cpu(*(u32*)(rx_ring + ring_offset));
 		int rx_size = rx_status >> 16;
 
 		if (rtl8129_debug > 4) {
@@ -1196,7 +1198,7 @@
 				   dev->name, rx_status, rx_size, cur_rx);
 			printk(KERN_DEBUG"%s: Frame contents ", dev->name);
 			for (i = 0; i < 70; i++)
-				printk(" %2.2x", rx_ring[ring_offset + i]);
+				printk(" %2.2x", le32_to_cpu(rx_ring[ring_offset + i]));
 			printk(".\n");
 		}
 		if (rx_status & RxTooLong) {
@@ -1247,7 +1249,7 @@
 					printk(KERN_DEBUG"%s:  Frame wrap @%d",
 						   dev->name, semi_count);
 					for (i = 0; i < 16; i++)
-						printk(" %2.2x", rx_ring[i]);
+						printk(" %2.2x", le32_to_cpu(rx_ring[i]));
 					printk(".\n");
 					memset(rx_ring, 0xcc, 16);
 				}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)