Commit 3e18826c authored by Al Viro's avatar Al Viro Committed by David S. Miller

e1000 endianness annotations

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent a39fe742
...@@ -595,35 +595,35 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw); ...@@ -595,35 +595,35 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
/* Receive Descriptor */ /* Receive Descriptor */
struct e1000_rx_desc { struct e1000_rx_desc {
uint64_t buffer_addr; /* Address of the descriptor's data buffer */ __le64 buffer_addr; /* Address of the descriptor's data buffer */
uint16_t length; /* Length of data DMAed into data buffer */ __le16 length; /* Length of data DMAed into data buffer */
uint16_t csum; /* Packet checksum */ __le16 csum; /* Packet checksum */
uint8_t status; /* Descriptor status */ uint8_t status; /* Descriptor status */
uint8_t errors; /* Descriptor Errors */ uint8_t errors; /* Descriptor Errors */
uint16_t special; __le16 special;
}; };
/* Receive Descriptor - Extended */ /* Receive Descriptor - Extended */
union e1000_rx_desc_extended { union e1000_rx_desc_extended {
struct { struct {
uint64_t buffer_addr; __le64 buffer_addr;
uint64_t reserved; __le64 reserved;
} read; } read;
struct { struct {
struct { struct {
uint32_t mrq; /* Multiple Rx Queues */ __le32 mrq; /* Multiple Rx Queues */
union { union {
uint32_t rss; /* RSS Hash */ __le32 rss; /* RSS Hash */
struct { struct {
uint16_t ip_id; /* IP id */ __le16 ip_id; /* IP id */
uint16_t csum; /* Packet Checksum */ __le16 csum; /* Packet Checksum */
} csum_ip; } csum_ip;
} hi_dword; } hi_dword;
} lower; } lower;
struct { struct {
uint32_t status_error; /* ext status/error */ __le32 status_error; /* ext status/error */
uint16_t length; __le16 length;
uint16_t vlan; /* VLAN tag */ __le16 vlan; /* VLAN tag */
} upper; } upper;
} wb; /* writeback */ } wb; /* writeback */
}; };
...@@ -633,29 +633,29 @@ union e1000_rx_desc_extended { ...@@ -633,29 +633,29 @@ union e1000_rx_desc_extended {
union e1000_rx_desc_packet_split { union e1000_rx_desc_packet_split {
struct { struct {
/* one buffer for protocol header(s), three data buffers */ /* one buffer for protocol header(s), three data buffers */
uint64_t buffer_addr[MAX_PS_BUFFERS]; __le64 buffer_addr[MAX_PS_BUFFERS];
} read; } read;
struct { struct {
struct { struct {
uint32_t mrq; /* Multiple Rx Queues */ __le32 mrq; /* Multiple Rx Queues */
union { union {
uint32_t rss; /* RSS Hash */ __le32 rss; /* RSS Hash */
struct { struct {
uint16_t ip_id; /* IP id */ __le16 ip_id; /* IP id */
uint16_t csum; /* Packet Checksum */ __le16 csum; /* Packet Checksum */
} csum_ip; } csum_ip;
} hi_dword; } hi_dword;
} lower; } lower;
struct { struct {
uint32_t status_error; /* ext status/error */ __le32 status_error; /* ext status/error */
uint16_t length0; /* length of buffer 0 */ __le16 length0; /* length of buffer 0 */
uint16_t vlan; /* VLAN tag */ __le16 vlan; /* VLAN tag */
} middle; } middle;
struct { struct {
uint16_t header_status; __le16 header_status;
uint16_t length[3]; /* length of buffers 1-3 */ __le16 length[3]; /* length of buffers 1-3 */
} upper; } upper;
uint64_t reserved; __le64 reserved;
} wb; /* writeback */ } wb; /* writeback */
}; };
...@@ -715,21 +715,21 @@ union e1000_rx_desc_packet_split { ...@@ -715,21 +715,21 @@ union e1000_rx_desc_packet_split {
/* Transmit Descriptor */ /* Transmit Descriptor */
struct e1000_tx_desc { struct e1000_tx_desc {
uint64_t buffer_addr; /* Address of the descriptor's data buffer */ __le64 buffer_addr; /* Address of the descriptor's data buffer */
union { union {
uint32_t data; __le32 data;
struct { struct {
uint16_t length; /* Data buffer length */ __le16 length; /* Data buffer length */
uint8_t cso; /* Checksum offset */ uint8_t cso; /* Checksum offset */
uint8_t cmd; /* Descriptor control */ uint8_t cmd; /* Descriptor control */
} flags; } flags;
} lower; } lower;
union { union {
uint32_t data; __le32 data;
struct { struct {
uint8_t status; /* Descriptor status */ uint8_t status; /* Descriptor status */
uint8_t css; /* Checksum start */ uint8_t css; /* Checksum start */
uint16_t special; __le16 special;
} fields; } fields;
} upper; } upper;
}; };
...@@ -759,49 +759,49 @@ struct e1000_tx_desc { ...@@ -759,49 +759,49 @@ struct e1000_tx_desc {
/* Offload Context Descriptor */ /* Offload Context Descriptor */
struct e1000_context_desc { struct e1000_context_desc {
union { union {
uint32_t ip_config; __le32 ip_config;
struct { struct {
uint8_t ipcss; /* IP checksum start */ uint8_t ipcss; /* IP checksum start */
uint8_t ipcso; /* IP checksum offset */ uint8_t ipcso; /* IP checksum offset */
uint16_t ipcse; /* IP checksum end */ __le16 ipcse; /* IP checksum end */
} ip_fields; } ip_fields;
} lower_setup; } lower_setup;
union { union {
uint32_t tcp_config; __le32 tcp_config;
struct { struct {
uint8_t tucss; /* TCP checksum start */ uint8_t tucss; /* TCP checksum start */
uint8_t tucso; /* TCP checksum offset */ uint8_t tucso; /* TCP checksum offset */
uint16_t tucse; /* TCP checksum end */ __le16 tucse; /* TCP checksum end */
} tcp_fields; } tcp_fields;
} upper_setup; } upper_setup;
uint32_t cmd_and_length; /* */ __le32 cmd_and_length; /* */
union { union {
uint32_t data; __le32 data;
struct { struct {
uint8_t status; /* Descriptor status */ uint8_t status; /* Descriptor status */
uint8_t hdr_len; /* Header length */ uint8_t hdr_len; /* Header length */
uint16_t mss; /* Maximum segment size */ __le16 mss; /* Maximum segment size */
} fields; } fields;
} tcp_seg_setup; } tcp_seg_setup;
}; };
/* Offload data descriptor */ /* Offload data descriptor */
struct e1000_data_desc { struct e1000_data_desc {
uint64_t buffer_addr; /* Address of the descriptor's buffer address */ __le64 buffer_addr; /* Address of the descriptor's buffer address */
union { union {
uint32_t data; __le32 data;
struct { struct {
uint16_t length; /* Data buffer length */ __le16 length; /* Data buffer length */
uint8_t typ_len_ext; /* */ uint8_t typ_len_ext; /* */
uint8_t cmd; /* */ uint8_t cmd; /* */
} flags; } flags;
} lower; } lower;
union { union {
uint32_t data; __le32 data;
struct { struct {
uint8_t status; /* Descriptor status */ uint8_t status; /* Descriptor status */
uint8_t popts; /* Packet Options */ uint8_t popts; /* Packet Options */
uint16_t special; /* */ __le16 special; /* */
} fields; } fields;
} upper; } upper;
}; };
...@@ -817,8 +817,8 @@ struct e1000_data_desc { ...@@ -817,8 +817,8 @@ struct e1000_data_desc {
/* Receive Address Register */ /* Receive Address Register */
struct e1000_rar { struct e1000_rar {
volatile uint32_t low; /* receive address low */ volatile __le32 low; /* receive address low */
volatile uint32_t high; /* receive address high */ volatile __le32 high; /* receive address high */
}; };
/* Number of entries in the Multicast Table Array (MTA). */ /* Number of entries in the Multicast Table Array (MTA). */
......
...@@ -272,14 +272,14 @@ module_exit(e1000_exit_module); ...@@ -272,14 +272,14 @@ module_exit(e1000_exit_module);
static int e1000_request_irq(struct e1000_adapter *adapter) static int e1000_request_irq(struct e1000_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
void (*handler) = &e1000_intr; irq_handler_t handler = e1000_intr;
int irq_flags = IRQF_SHARED; int irq_flags = IRQF_SHARED;
int err; int err;
if (adapter->hw.mac_type >= e1000_82571) { if (adapter->hw.mac_type >= e1000_82571) {
adapter->have_msi = !pci_enable_msi(adapter->pdev); adapter->have_msi = !pci_enable_msi(adapter->pdev);
if (adapter->have_msi) { if (adapter->have_msi) {
handler = &e1000_intr_msi; handler = e1000_intr_msi;
irq_flags = 0; irq_flags = 0;
} }
} }
...@@ -4092,8 +4092,8 @@ e1000_rx_checksum(struct e1000_adapter *adapter, ...@@ -4092,8 +4092,8 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
/* Hardware complements the payload checksum, so we undo it /* Hardware complements the payload checksum, so we undo it
* and then put the value in host order for further stack use. * and then put the value in host order for further stack use.
*/ */
csum = ntohl(csum ^ 0xFFFF); __sum16 sum = (__force __sum16)htons(csum);
skb->csum = csum; skb->csum = csum_unfold(~sum);
skb->ip_summed = CHECKSUM_COMPLETE; skb->ip_summed = CHECKSUM_COMPLETE;
} }
adapter->hw_csum_good++; adapter->hw_csum_good++;
...@@ -4621,7 +4621,7 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, ...@@ -4621,7 +4621,7 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
rx_desc->read.buffer_addr[j+1] = rx_desc->read.buffer_addr[j+1] =
cpu_to_le64(ps_page_dma->ps_page_dma[j]); cpu_to_le64(ps_page_dma->ps_page_dma[j]);
} else } else
rx_desc->read.buffer_addr[j+1] = ~0; rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0);
} }
skb = netdev_alloc_skb(netdev, skb = netdev_alloc_skb(netdev,
......
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