aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000e/hw.h82
-rw-r--r--drivers/net/e1000e/netdev.c12
2 files changed, 47 insertions, 47 deletions
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 71f93ce384dc..3c5862f97dbf 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -423,35 +423,35 @@ enum e1000_smart_speed {
423 423
424/* Receive Descriptor */ 424/* Receive Descriptor */
425struct e1000_rx_desc { 425struct e1000_rx_desc {
426 u64 buffer_addr; /* Address of the descriptor's data buffer */ 426 __le64 buffer_addr; /* Address of the descriptor's data buffer */
427 u16 length; /* Length of data DMAed into data buffer */ 427 __le16 length; /* Length of data DMAed into data buffer */
428 u16 csum; /* Packet checksum */ 428 __le16 csum; /* Packet checksum */
429 u8 status; /* Descriptor status */ 429 u8 status; /* Descriptor status */
430 u8 errors; /* Descriptor Errors */ 430 u8 errors; /* Descriptor Errors */
431 u16 special; 431 __le16 special;
432}; 432};
433 433
434/* Receive Descriptor - Extended */ 434/* Receive Descriptor - Extended */
435union e1000_rx_desc_extended { 435union e1000_rx_desc_extended {
436 struct { 436 struct {
437 u64 buffer_addr; 437 __le64 buffer_addr;
438 u64 reserved; 438 __le64 reserved;
439 } read; 439 } read;
440 struct { 440 struct {
441 struct { 441 struct {
442 u32 mrq; /* Multiple Rx Queues */ 442 __le32 mrq; /* Multiple Rx Queues */
443 union { 443 union {
444 u32 rss; /* RSS Hash */ 444 __le32 rss; /* RSS Hash */
445 struct { 445 struct {
446 u16 ip_id; /* IP id */ 446 __le16 ip_id; /* IP id */
447 u16 csum; /* Packet Checksum */ 447 __le16 csum; /* Packet Checksum */
448 } csum_ip; 448 } csum_ip;
449 } hi_dword; 449 } hi_dword;
450 } lower; 450 } lower;
451 struct { 451 struct {
452 u32 status_error; /* ext status/error */ 452 __le32 status_error; /* ext status/error */
453 u16 length; 453 __le16 length;
454 u16 vlan; /* VLAN tag */ 454 __le16 vlan; /* VLAN tag */
455 } upper; 455 } upper;
456 } wb; /* writeback */ 456 } wb; /* writeback */
457}; 457};
@@ -461,49 +461,49 @@ union e1000_rx_desc_extended {
461union e1000_rx_desc_packet_split { 461union e1000_rx_desc_packet_split {
462 struct { 462 struct {
463 /* one buffer for protocol header(s), three data buffers */ 463 /* one buffer for protocol header(s), three data buffers */
464 u64 buffer_addr[MAX_PS_BUFFERS]; 464 __le64 buffer_addr[MAX_PS_BUFFERS];
465 } read; 465 } read;
466 struct { 466 struct {
467 struct { 467 struct {
468 u32 mrq; /* Multiple Rx Queues */ 468 __le32 mrq; /* Multiple Rx Queues */
469 union { 469 union {
470 u32 rss; /* RSS Hash */ 470 __le32 rss; /* RSS Hash */
471 struct { 471 struct {
472 u16 ip_id; /* IP id */ 472 __le16 ip_id; /* IP id */
473 u16 csum; /* Packet Checksum */ 473 __le16 csum; /* Packet Checksum */
474 } csum_ip; 474 } csum_ip;
475 } hi_dword; 475 } hi_dword;
476 } lower; 476 } lower;
477 struct { 477 struct {
478 u32 status_error; /* ext status/error */ 478 __le32 status_error; /* ext status/error */
479 u16 length0; /* length of buffer 0 */ 479 __le16 length0; /* length of buffer 0 */
480 u16 vlan; /* VLAN tag */ 480 __le16 vlan; /* VLAN tag */
481 } middle; 481 } middle;
482 struct { 482 struct {
483 u16 header_status; 483 __le16 header_status;
484 u16 length[3]; /* length of buffers 1-3 */ 484 __le16 length[3]; /* length of buffers 1-3 */
485 } upper; 485 } upper;
486 u64 reserved; 486 __le64 reserved;
487 } wb; /* writeback */ 487 } wb; /* writeback */
488}; 488};
489 489
490/* Transmit Descriptor */ 490/* Transmit Descriptor */
491struct e1000_tx_desc { 491struct e1000_tx_desc {
492 u64 buffer_addr; /* Address of the descriptor's data buffer */ 492 __le64 buffer_addr; /* Address of the descriptor's data buffer */
493 union { 493 union {
494 u32 data; 494 __le32 data;
495 struct { 495 struct {
496 u16 length; /* Data buffer length */ 496 __le16 length; /* Data buffer length */
497 u8 cso; /* Checksum offset */ 497 u8 cso; /* Checksum offset */
498 u8 cmd; /* Descriptor control */ 498 u8 cmd; /* Descriptor control */
499 } flags; 499 } flags;
500 } lower; 500 } lower;
501 union { 501 union {
502 u32 data; 502 __le32 data;
503 struct { 503 struct {
504 u8 status; /* Descriptor status */ 504 u8 status; /* Descriptor status */
505 u8 css; /* Checksum start */ 505 u8 css; /* Checksum start */
506 u16 special; 506 __le16 special;
507 } fields; 507 } fields;
508 } upper; 508 } upper;
509}; 509};
@@ -511,49 +511,49 @@ struct e1000_tx_desc {
511/* Offload Context Descriptor */ 511/* Offload Context Descriptor */
512struct e1000_context_desc { 512struct e1000_context_desc {
513 union { 513 union {
514 u32 ip_config; 514 __le32 ip_config;
515 struct { 515 struct {
516 u8 ipcss; /* IP checksum start */ 516 u8 ipcss; /* IP checksum start */
517 u8 ipcso; /* IP checksum offset */ 517 u8 ipcso; /* IP checksum offset */
518 u16 ipcse; /* IP checksum end */ 518 __le16 ipcse; /* IP checksum end */
519 } ip_fields; 519 } ip_fields;
520 } lower_setup; 520 } lower_setup;
521 union { 521 union {
522 u32 tcp_config; 522 __le32 tcp_config;
523 struct { 523 struct {
524 u8 tucss; /* TCP checksum start */ 524 u8 tucss; /* TCP checksum start */
525 u8 tucso; /* TCP checksum offset */ 525 u8 tucso; /* TCP checksum offset */
526 u16 tucse; /* TCP checksum end */ 526 __le16 tucse; /* TCP checksum end */
527 } tcp_fields; 527 } tcp_fields;
528 } upper_setup; 528 } upper_setup;
529 u32 cmd_and_length; 529 __le32 cmd_and_length;
530 union { 530 union {
531 u32 data; 531 __le32 data;
532 struct { 532 struct {
533 u8 status; /* Descriptor status */ 533 u8 status; /* Descriptor status */
534 u8 hdr_len; /* Header length */ 534 u8 hdr_len; /* Header length */
535 u16 mss; /* Maximum segment size */ 535 __le16 mss; /* Maximum segment size */
536 } fields; 536 } fields;
537 } tcp_seg_setup; 537 } tcp_seg_setup;
538}; 538};
539 539
540/* Offload data descriptor */ 540/* Offload data descriptor */
541struct e1000_data_desc { 541struct e1000_data_desc {
542 u64 buffer_addr; /* Address of the descriptor's buffer address */ 542 __le64 buffer_addr; /* Address of the descriptor's buffer address */
543 union { 543 union {
544 u32 data; 544 __le32 data;
545 struct { 545 struct {
546 u16 length; /* Data buffer length */ 546 __le16 length; /* Data buffer length */
547 u8 typ_len_ext; 547 u8 typ_len_ext;
548 u8 cmd; 548 u8 cmd;
549 } flags; 549 } flags;
550 } lower; 550 } lower;
551 union { 551 union {
552 u32 data; 552 __le32 data;
553 struct { 553 struct {
554 u8 status; /* Descriptor status */ 554 u8 status; /* Descriptor status */
555 u8 popts; /* Packet Options */ 555 u8 popts; /* Packet Options */
556 u16 special; /* */ 556 __le16 special; /* */
557 } fields; 557 } fields;
558 } upper; 558 } upper;
559}; 559};
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 9b07a722e52d..0a2cb7960c9e 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -91,7 +91,7 @@ static int e1000_desc_unused(struct e1000_ring *ring)
91static void e1000_receive_skb(struct e1000_adapter *adapter, 91static void e1000_receive_skb(struct e1000_adapter *adapter,
92 struct net_device *netdev, 92 struct net_device *netdev,
93 struct sk_buff *skb, 93 struct sk_buff *skb,
94 u8 status, u16 vlan) 94 u8 status, __le16 vlan)
95{ 95{
96 skb->protocol = eth_type_trans(skb, netdev); 96 skb->protocol = eth_type_trans(skb, netdev);
97 97
@@ -142,8 +142,8 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
142 /* Hardware complements the payload checksum, so we undo it 142 /* Hardware complements the payload checksum, so we undo it
143 * and then put the value in host order for further stack use. 143 * and then put the value in host order for further stack use.
144 */ 144 */
145 csum = ntohl(csum ^ 0xFFFF); 145 __sum16 sum = (__force __sum16)htons(csum);
146 skb->csum = csum; 146 skb->csum = csum_unfold(~sum);
147 skb->ip_summed = CHECKSUM_COMPLETE; 147 skb->ip_summed = CHECKSUM_COMPLETE;
148 } 148 }
149 adapter->hw_csum_good++; 149 adapter->hw_csum_good++;
@@ -248,7 +248,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
248 ps_page = &buffer_info->ps_pages[j]; 248 ps_page = &buffer_info->ps_pages[j];
249 if (j >= adapter->rx_ps_pages) { 249 if (j >= adapter->rx_ps_pages) {
250 /* all unused desc entries get hw null ptr */ 250 /* all unused desc entries get hw null ptr */
251 rx_desc->read.buffer_addr[j+1] = ~0; 251 rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0);
252 continue; 252 continue;
253 } 253 }
254 if (!ps_page->page) { 254 if (!ps_page->page) {
@@ -941,7 +941,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
941static int e1000_request_irq(struct e1000_adapter *adapter) 941static int e1000_request_irq(struct e1000_adapter *adapter)
942{ 942{
943 struct net_device *netdev = adapter->netdev; 943 struct net_device *netdev = adapter->netdev;
944 void (*handler) = &e1000_intr; 944 irq_handler_t handler = e1000_intr;
945 int irq_flags = IRQF_SHARED; 945 int irq_flags = IRQF_SHARED;
946 int err; 946 int err;
947 947
@@ -951,7 +951,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
951 "Unable to allocate MSI interrupt Error: %d\n", err); 951 "Unable to allocate MSI interrupt Error: %d\n", err);
952 } else { 952 } else {
953 adapter->flags |= FLAG_MSI_ENABLED; 953 adapter->flags |= FLAG_MSI_ENABLED;
954 handler = &e1000_intr_msi; 954 handler = e1000_intr_msi;
955 irq_flags = 0; 955 irq_flags = 0;
956 } 956 }
957 957