aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-08-23 00:43:22 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:00 -0400
commitc559a5bc9417c00ba2df59397a27eaf8d8e52aec (patch)
treed3f0896f675bb98824d87090423f49f5eb3204b2 /drivers/net/tulip
parent701181ac1d9ac465a3614061cb60ded4033c4d07 (diff)
tulip: endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/de2104x.c12
-rw-r--r--drivers/net/tulip/de4x5.c10
-rw-r--r--drivers/net/tulip/tulip.h16
-rw-r--r--drivers/net/tulip/tulip_core.c10
-rw-r--r--drivers/net/tulip/uli526x.c6
-rw-r--r--drivers/net/tulip/winbond-840.c2
6 files changed, 28 insertions, 28 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index f12e33a1736..77d9dd7ea34 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -264,10 +264,10 @@ struct de_srom_info_leaf {
264} __attribute__((packed)); 264} __attribute__((packed));
265 265
266struct de_desc { 266struct de_desc {
267 u32 opts1; 267 __le32 opts1;
268 u32 opts2; 268 __le32 opts2;
269 u32 addr1; 269 __le32 addr1;
270 u32 addr2; 270 __le32 addr2;
271}; 271};
272 272
273struct media_info { 273struct media_info {
@@ -1771,8 +1771,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
1771 1771
1772 /* download entire eeprom */ 1772 /* download entire eeprom */
1773 for (i = 0; i < DE_EEPROM_WORDS; i++) 1773 for (i = 0; i < DE_EEPROM_WORDS; i++)
1774 ((u16 *)ee_data)[i] = 1774 ((__le16 *)ee_data)[i] =
1775 le16_to_cpu(tulip_read_eeprom(de->regs, i, ee_addr_size)); 1775 cpu_to_le16(tulip_read_eeprom(de->regs, i, ee_addr_size));
1776 1776
1777 /* DEC now has a specification but early board makers 1777 /* DEC now has a specification but early board makers
1778 just put the address in the first EEPROM locations. */ 1778 just put the address in the first EEPROM locations. */
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 4633cc6dd41..9b9cd83fb8b 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -482,7 +482,7 @@
482static char version[] __devinitdata = "de4x5.c:V0.546 2001/02/22 davies@maniac.ultranet.com\n"; 482static char version[] __devinitdata = "de4x5.c:V0.546 2001/02/22 davies@maniac.ultranet.com\n";
483 483
484#define c_char const char 484#define c_char const char
485#define TWIDDLE(a) (u_short)le16_to_cpu(get_unaligned((u_short *)(a))) 485#define TWIDDLE(a) (u_short)le16_to_cpu(get_unaligned((__le16 *)(a)))
486 486
487/* 487/*
488** MII Information 488** MII Information
@@ -756,10 +756,10 @@ struct de4x5_srom {
756 /* Multiple of 4 for DC21040 */ 756 /* Multiple of 4 for DC21040 */
757 /* Allows 512 byte alignment */ 757 /* Allows 512 byte alignment */
758struct de4x5_desc { 758struct de4x5_desc {
759 volatile s32 status; 759 volatile __le32 status;
760 u32 des1; 760 __le32 des1;
761 u32 buf; 761 __le32 buf;
762 u32 next; 762 __le32 next;
763 DESC_ALIGN 763 DESC_ALIGN
764}; 764};
765 765
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
index 5a4d7270973..3f69f53d776 100644
--- a/drivers/net/tulip/tulip.h
+++ b/drivers/net/tulip/tulip.h
@@ -178,18 +178,18 @@ enum tulip_busconfig_bits {
178 178
179/* The Tulip Rx and Tx buffer descriptors. */ 179/* The Tulip Rx and Tx buffer descriptors. */
180struct tulip_rx_desc { 180struct tulip_rx_desc {
181 s32 status; 181 __le32 status;
182 s32 length; 182 __le32 length;
183 u32 buffer1; 183 __le32 buffer1;
184 u32 buffer2; 184 __le32 buffer2;
185}; 185};
186 186
187 187
188struct tulip_tx_desc { 188struct tulip_tx_desc {
189 s32 status; 189 __le32 status;
190 s32 length; 190 __le32 length;
191 u32 buffer1; 191 __le32 buffer1;
192 u32 buffer2; /* We use only buffer 1. */ 192 __le32 buffer2; /* We use only buffer 1. */
193}; 193};
194 194
195 195
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 80fee229253..ee08292bcf8 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -326,8 +326,8 @@ static void tulip_up(struct net_device *dev)
326 tp->dirty_rx = tp->dirty_tx = 0; 326 tp->dirty_rx = tp->dirty_tx = 0;
327 327
328 if (tp->flags & MC_HASH_ONLY) { 328 if (tp->flags & MC_HASH_ONLY) {
329 u32 addr_low = le32_to_cpu(get_unaligned((u32 *)dev->dev_addr)); 329 u32 addr_low = le32_to_cpu(get_unaligned((__le32 *)dev->dev_addr));
330 u32 addr_high = le16_to_cpu(get_unaligned((u16 *)(dev->dev_addr+4))); 330 u32 addr_high = le16_to_cpu(get_unaligned((__le16 *)(dev->dev_addr+4)));
331 if (tp->chip_id == AX88140) { 331 if (tp->chip_id == AX88140) {
332 iowrite32(0, ioaddr + CSR13); 332 iowrite32(0, ioaddr + CSR13);
333 iowrite32(addr_low, ioaddr + CSR14); 333 iowrite32(addr_low, ioaddr + CSR14);
@@ -1443,13 +1443,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1443 do 1443 do
1444 value = ioread32(ioaddr + CSR9); 1444 value = ioread32(ioaddr + CSR9);
1445 while (value < 0 && --boguscnt > 0); 1445 while (value < 0 && --boguscnt > 0);
1446 put_unaligned(le16_to_cpu(value), ((u16*)dev->dev_addr) + i); 1446 put_unaligned(cpu_to_le16(value), ((__le16*)dev->dev_addr) + i);
1447 sum += value & 0xffff; 1447 sum += value & 0xffff;
1448 } 1448 }
1449 } else if (chip_idx == COMET) { 1449 } else if (chip_idx == COMET) {
1450 /* No need to read the EEPROM. */ 1450 /* No need to read the EEPROM. */
1451 put_unaligned(cpu_to_le32(ioread32(ioaddr + 0xA4)), (u32 *)dev->dev_addr); 1451 put_unaligned(cpu_to_le32(ioread32(ioaddr + 0xA4)), (__le32 *)dev->dev_addr);
1452 put_unaligned(cpu_to_le16(ioread32(ioaddr + 0xA8)), (u16 *)(dev->dev_addr + 4)); 1452 put_unaligned(cpu_to_le16(ioread32(ioaddr + 0xA8)), (__le16 *)(dev->dev_addr + 4));
1453 for (i = 0; i < 6; i ++) 1453 for (i = 0; i < 6; i ++)
1454 sum += dev->dev_addr[i]; 1454 sum += dev->dev_addr[i];
1455 } else { 1455 } else {
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index a4fd782bcd2..53c7523960c 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -112,13 +112,13 @@
112 112
113/* Structure/enum declaration ------------------------------- */ 113/* Structure/enum declaration ------------------------------- */
114struct tx_desc { 114struct tx_desc {
115 u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ 115 __le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
116 char *tx_buf_ptr; /* Data for us */ 116 char *tx_buf_ptr; /* Data for us */
117 struct tx_desc *next_tx_desc; 117 struct tx_desc *next_tx_desc;
118} __attribute__(( aligned(32) )); 118} __attribute__(( aligned(32) ));
119 119
120struct rx_desc { 120struct rx_desc {
121 u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ 121 __le32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */
122 struct sk_buff *rx_skb_ptr; /* Data for us */ 122 struct sk_buff *rx_skb_ptr; /* Data for us */
123 struct rx_desc *next_rx_desc; 123 struct rx_desc *next_rx_desc;
124} __attribute__(( aligned(32) )); 124} __attribute__(( aligned(32) ));
@@ -344,7 +344,7 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
344 344
345 /* read 64 word srom data */ 345 /* read 64 word srom data */
346 for (i = 0; i < 64; i++) 346 for (i = 0; i < 64; i++)
347 ((u16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, i)); 347 ((__le16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, i));
348 348
349 /* Set Node address */ 349 /* Set Node address */
350 if(((u16 *) db->srom)[0] == 0xffff || ((u16 *) db->srom)[0] == 0) /* SROM absent, so read MAC address from ID Table */ 350 if(((u16 *) db->srom)[0] == 0xffff || ((u16 *) db->srom)[0] == 0) /* SROM absent, so read MAC address from ID Table */
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 3c40dd6e1a2..3c8e3b63be0 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -381,7 +381,7 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
381 goto err_out_free_res; 381 goto err_out_free_res;
382 382
383 for (i = 0; i < 3; i++) 383 for (i = 0; i < 3; i++)
384 ((u16 *)dev->dev_addr)[i] = le16_to_cpu(eeprom_read(ioaddr, i)); 384 ((__le16 *)dev->dev_addr)[i] = cpu_to_le16(eeprom_read(ioaddr, i));
385 385
386 /* Reset the chip to erase previous misconfiguration. 386 /* Reset the chip to erase previous misconfiguration.
387 No hold time required! */ 387 No hold time required! */