aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index a88c51f0879b..01355701bf8e 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -419,7 +419,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
419 adapter->ctx_desc->cmd_consumer_offset = 419 adapter->ctx_desc->cmd_consumer_offset =
420 cpu_to_le64(adapter->ctx_desc_phys_addr + 420 cpu_to_le64(adapter->ctx_desc_phys_addr +
421 sizeof(struct netxen_ring_ctx)); 421 sizeof(struct netxen_ring_ctx));
422 adapter->cmd_consumer = (uint32_t *) (((char *)addr) + 422 adapter->cmd_consumer = (__le32 *) (((char *)addr) +
423 sizeof(struct netxen_ring_ctx)); 423 sizeof(struct netxen_ring_ctx));
424 424
425 addr = netxen_alloc(adapter->ahw.pdev, 425 addr = netxen_alloc(adapter->ahw.pdev,
@@ -586,35 +586,35 @@ int netxen_is_flash_supported(struct netxen_adapter *adapter)
586} 586}
587 587
588static int netxen_get_flash_block(struct netxen_adapter *adapter, int base, 588static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
589 int size, u32 * buf) 589 int size, __le32 * buf)
590{ 590{
591 int i, addr; 591 int i, addr;
592 u32 *ptr32; 592 __le32 *ptr32;
593 u32 v;
593 594
594 addr = base; 595 addr = base;
595 ptr32 = buf; 596 ptr32 = buf;
596 for (i = 0; i < size / sizeof(u32); i++) { 597 for (i = 0; i < size / sizeof(u32); i++) {
597 if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) 598 if (netxen_rom_fast_read(adapter, addr, &v) == -1)
598 return -1; 599 return -1;
599 *ptr32 = cpu_to_le32(*ptr32); 600 *ptr32 = cpu_to_le32(v);
600 ptr32++; 601 ptr32++;
601 addr += sizeof(u32); 602 addr += sizeof(u32);
602 } 603 }
603 if ((char *)buf + size > (char *)ptr32) { 604 if ((char *)buf + size > (char *)ptr32) {
604 u32 local; 605 __le32 local;
605 606 if (netxen_rom_fast_read(adapter, addr, &v) == -1)
606 if (netxen_rom_fast_read(adapter, addr, &local) == -1)
607 return -1; 607 return -1;
608 local = cpu_to_le32(local); 608 local = cpu_to_le32(v);
609 memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32); 609 memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32);
610 } 610 }
611 611
612 return 0; 612 return 0;
613} 613}
614 614
615int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]) 615int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[])
616{ 616{
617 u32 *pmac = (u32 *) & mac[0]; 617 __le32 *pmac = (__le32 *) & mac[0];
618 618
619 if (netxen_get_flash_block(adapter, 619 if (netxen_get_flash_block(adapter,
620 NETXEN_USER_START + 620 NETXEN_USER_START +
@@ -623,7 +623,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
623 FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) { 623 FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
624 return -1; 624 return -1;
625 } 625 }
626 if (*mac == ~0ULL) { 626 if (*mac == cpu_to_le64(~0ULL)) {
627 if (netxen_get_flash_block(adapter, 627 if (netxen_get_flash_block(adapter,
628 NETXEN_USER_START_OLD + 628 NETXEN_USER_START_OLD +
629 offsetof(struct netxen_user_old_info, 629 offsetof(struct netxen_user_old_info,
@@ -631,7 +631,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
631 FLASH_NUM_PORTS * sizeof(u64), 631 FLASH_NUM_PORTS * sizeof(u64),
632 pmac) == -1) 632 pmac) == -1)
633 return -1; 633 return -1;
634 if (*mac == ~0ULL) 634 if (*mac == cpu_to_le64(~0ULL))
635 return -1; 635 return -1;
636 } 636 }
637 return 0; 637 return 0;