tulip: endianness annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Al Viro 2007-08-23 00:43:22 -04:00 committed by David S. Miller
parent 701181ac1d
commit c559a5bc94
6 changed files with 28 additions and 28 deletions

View File

@ -264,10 +264,10 @@ struct de_srom_info_leaf {
} __attribute__((packed));
struct de_desc {
u32 opts1;
u32 opts2;
u32 addr1;
u32 addr2;
__le32 opts1;
__le32 opts2;
__le32 addr1;
__le32 addr2;
};
struct media_info {
@ -1771,8 +1771,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
/* download entire eeprom */
for (i = 0; i < DE_EEPROM_WORDS; i++)
((u16 *)ee_data)[i] =
le16_to_cpu(tulip_read_eeprom(de->regs, i, ee_addr_size));
((__le16 *)ee_data)[i] =
cpu_to_le16(tulip_read_eeprom(de->regs, i, ee_addr_size));
/* DEC now has a specification but early board makers
just put the address in the first EEPROM locations. */

View File

@ -482,7 +482,7 @@
static char version[] __devinitdata = "de4x5.c:V0.546 2001/02/22 davies@maniac.ultranet.com\n";
#define c_char const char
#define TWIDDLE(a) (u_short)le16_to_cpu(get_unaligned((u_short *)(a)))
#define TWIDDLE(a) (u_short)le16_to_cpu(get_unaligned((__le16 *)(a)))
/*
** MII Information
@ -756,10 +756,10 @@ struct de4x5_srom {
/* Multiple of 4 for DC21040 */
/* Allows 512 byte alignment */
struct de4x5_desc {
volatile s32 status;
u32 des1;
u32 buf;
u32 next;
volatile __le32 status;
__le32 des1;
__le32 buf;
__le32 next;
DESC_ALIGN
};

View File

@ -178,18 +178,18 @@ enum tulip_busconfig_bits {
/* The Tulip Rx and Tx buffer descriptors. */
struct tulip_rx_desc {
s32 status;
s32 length;
u32 buffer1;
u32 buffer2;
__le32 status;
__le32 length;
__le32 buffer1;
__le32 buffer2;
};
struct tulip_tx_desc {
s32 status;
s32 length;
u32 buffer1;
u32 buffer2; /* We use only buffer 1. */
__le32 status;
__le32 length;
__le32 buffer1;
__le32 buffer2; /* We use only buffer 1. */
};

View File

@ -326,8 +326,8 @@ static void tulip_up(struct net_device *dev)
tp->dirty_rx = tp->dirty_tx = 0;
if (tp->flags & MC_HASH_ONLY) {
u32 addr_low = le32_to_cpu(get_unaligned((u32 *)dev->dev_addr));
u32 addr_high = le16_to_cpu(get_unaligned((u16 *)(dev->dev_addr+4)));
u32 addr_low = le32_to_cpu(get_unaligned((__le32 *)dev->dev_addr));
u32 addr_high = le16_to_cpu(get_unaligned((__le16 *)(dev->dev_addr+4)));
if (tp->chip_id == AX88140) {
iowrite32(0, ioaddr + CSR13);
iowrite32(addr_low, ioaddr + CSR14);
@ -1443,13 +1443,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
do
value = ioread32(ioaddr + CSR9);
while (value < 0 && --boguscnt > 0);
put_unaligned(le16_to_cpu(value), ((u16*)dev->dev_addr) + i);
put_unaligned(cpu_to_le16(value), ((__le16*)dev->dev_addr) + i);
sum += value & 0xffff;
}
} else if (chip_idx == COMET) {
/* No need to read the EEPROM. */
put_unaligned(cpu_to_le32(ioread32(ioaddr + 0xA4)), (u32 *)dev->dev_addr);
put_unaligned(cpu_to_le16(ioread32(ioaddr + 0xA8)), (u16 *)(dev->dev_addr + 4));
put_unaligned(cpu_to_le32(ioread32(ioaddr + 0xA4)), (__le32 *)dev->dev_addr);
put_unaligned(cpu_to_le16(ioread32(ioaddr + 0xA8)), (__le16 *)(dev->dev_addr + 4));
for (i = 0; i < 6; i ++)
sum += dev->dev_addr[i];
} else {

View File

@ -112,13 +112,13 @@
/* Structure/enum declaration ------------------------------- */
struct tx_desc {
u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
__le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
char *tx_buf_ptr; /* Data for us */
struct tx_desc *next_tx_desc;
} __attribute__(( aligned(32) ));
struct rx_desc {
u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */
__le32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */
struct sk_buff *rx_skb_ptr; /* Data for us */
struct rx_desc *next_rx_desc;
} __attribute__(( aligned(32) ));
@ -344,7 +344,7 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
/* read 64 word srom data */
for (i = 0; i < 64; i++)
((u16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, i));
((__le16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, i));
/* Set Node address */
if(((u16 *) db->srom)[0] == 0xffff || ((u16 *) db->srom)[0] == 0) /* SROM absent, so read MAC address from ID Table */

View File

@ -381,7 +381,7 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
goto err_out_free_res;
for (i = 0; i < 3; i++)
((u16 *)dev->dev_addr)[i] = le16_to_cpu(eeprom_read(ioaddr, i));
((__le16 *)dev->dev_addr)[i] = cpu_to_le16(eeprom_read(ioaddr, i));
/* Reset the chip to erase previous misconfiguration.
No hold time required! */