aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorMithlesh Thukral <mithlesh@netxen.com>2007-06-07 07:36:36 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-09 18:25:35 -0400
commit0d04761d17976ce560a22d9a21af575cd0d1bc21 (patch)
tree16b15581443757002991e1a2a614552844f3df7d /drivers/net/netxen
parent3e2facef86a1665d64961b541aa0773f5ca22125 (diff)
NetXen: Fix compile failure seen on PPC architecture
NetXen: Add NETXEN prefixes to macros to clean them up. This is a cleanup patch which adds NETXEN prefix to some stand alone macro names. These posed compile errors when NetXen driver was backported to 2.6.9 on PPC architecture as macros like USER_START are defined in file arch/ppc64/mm/hash_utils.c Signed-off-by: Andy Gospodarek <andy@greyhouse.net> Signed-off by: Wen Xiong <wenxiong@us.ibm.com> Acked-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic.h47
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c8
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c12
-rw-r--r--drivers/net/netxen/netxen_nic_init.c23
4 files changed, 46 insertions, 44 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index ad6688eab265..272f8c3c9546 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -68,9 +68,10 @@
68#define _NETXEN_NIC_LINUX_SUBVERSION 2 68#define _NETXEN_NIC_LINUX_SUBVERSION 2
69#define NETXEN_NIC_LINUX_VERSIONID "3.4.2" 69#define NETXEN_NIC_LINUX_VERSIONID "3.4.2"
70 70
71#define NUM_FLASH_SECTORS (64) 71#define NETXEN_NUM_FLASH_SECTORS (64)
72#define FLASH_SECTOR_SIZE (64 * 1024) 72#define NETXEN_FLASH_SECTOR_SIZE (64 * 1024)
73#define FLASH_TOTAL_SIZE (NUM_FLASH_SECTORS * FLASH_SECTOR_SIZE) 73#define NETXEN_FLASH_TOTAL_SIZE (NETXEN_NUM_FLASH_SECTORS \
74 * NETXEN_FLASH_SECTOR_SIZE)
74 75
75#define PHAN_VENDOR_ID 0x4040 76#define PHAN_VENDOR_ID 0x4040
76 77
@@ -677,28 +678,28 @@ struct netxen_new_user_info {
677 678
678/* Flash memory map */ 679/* Flash memory map */
679typedef enum { 680typedef enum {
680 CRBINIT_START = 0, /* Crbinit section */ 681 NETXEN_CRBINIT_START = 0, /* Crbinit section */
681 BRDCFG_START = 0x4000, /* board config */ 682 NETXEN_BRDCFG_START = 0x4000, /* board config */
682 INITCODE_START = 0x6000, /* pegtune code */ 683 NETXEN_INITCODE_START = 0x6000, /* pegtune code */
683 BOOTLD_START = 0x10000, /* bootld */ 684 NETXEN_BOOTLD_START = 0x10000, /* bootld */
684 IMAGE_START = 0x43000, /* compressed image */ 685 NETXEN_IMAGE_START = 0x43000, /* compressed image */
685 SECONDARY_START = 0x200000, /* backup images */ 686 NETXEN_SECONDARY_START = 0x200000, /* backup images */
686 PXE_START = 0x3E0000, /* user defined region */ 687 NETXEN_PXE_START = 0x3E0000, /* user defined region */
687 USER_START = 0x3E8000, /* User defined region for new boards */ 688 NETXEN_USER_START = 0x3E8000, /* User defined region for new boards */
688 FIXED_START = 0x3F0000 /* backup of crbinit */ 689 NETXEN_FIXED_START = 0x3F0000 /* backup of crbinit */
689} netxen_flash_map_t; 690} netxen_flash_map_t;
690 691
691#define USER_START_OLD PXE_START /* for backward compatibility */ 692#define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */
692 693
693#define FLASH_START (CRBINIT_START) 694#define NETXEN_FLASH_START (NETXEN_CRBINIT_START)
694#define INIT_SECTOR (0) 695#define NETXEN_INIT_SECTOR (0)
695#define PRIMARY_START (BOOTLD_START) 696#define NETXEN_PRIMARY_START (NETXEN_BOOTLD_START)
696#define FLASH_CRBINIT_SIZE (0x4000) 697#define NETXEN_FLASH_CRBINIT_SIZE (0x4000)
697#define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info)) 698#define NETXEN_FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info))
698#define FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32)) 699#define NETXEN_FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32))
699#define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START) 700#define NETXEN_FLASH_SECONDARY_SIZE (NETXEN_USER_START-NETXEN_SECONDARY_START)
700#define NUM_PRIMARY_SECTORS (0x20) 701#define NETXEN_NUM_PRIMARY_SECTORS (0x20)
701#define NUM_CONFIG_SECTORS (1) 702#define NETXEN_NUM_CONFIG_SECTORS (1)
702#define PFX "NetXen: " 703#define PFX "NetXen: "
703extern char netxen_nic_driver_name[]; 704extern char netxen_nic_driver_name[];
704 705
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 16fabb377488..0175f6c353f6 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -94,7 +94,7 @@ static const char netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = {
94 94
95static int netxen_nic_get_eeprom_len(struct net_device *dev) 95static int netxen_nic_get_eeprom_len(struct net_device *dev)
96{ 96{
97 return FLASH_TOTAL_SIZE; 97 return NETXEN_FLASH_TOTAL_SIZE;
98} 98}
99 99
100static void 100static void
@@ -470,7 +470,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
470 return 0; 470 return 0;
471 } 471 }
472 472
473 if (offset == BOOTLD_START) { 473 if (offset == NETXEN_BOOTLD_START) {
474 ret = netxen_flash_erase_primary(adapter); 474 ret = netxen_flash_erase_primary(adapter);
475 if (ret != FLASH_SUCCESS) { 475 if (ret != FLASH_SUCCESS) {
476 printk(KERN_ERR "%s: Flash erase failed.\n", 476 printk(KERN_ERR "%s: Flash erase failed.\n",
@@ -478,10 +478,10 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
478 return ret; 478 return ret;
479 } 479 }
480 480
481 ret = netxen_rom_se(adapter, USER_START); 481 ret = netxen_rom_se(adapter, NETXEN_USER_START);
482 if (ret != FLASH_SUCCESS) 482 if (ret != FLASH_SUCCESS)
483 return ret; 483 return ret;
484 ret = netxen_rom_se(adapter, FIXED_START); 484 ret = netxen_rom_se(adapter, NETXEN_FIXED_START);
485 if (ret != FLASH_SUCCESS) 485 if (ret != FLASH_SUCCESS)
486 return ret; 486 return ret;
487 487
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index baff17a24d63..c012764d1145 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -257,7 +257,7 @@ u64 ctx_addr_sig_regs[][3] = {
257#define ADDR_IN_RANGE(addr, low, high) \ 257#define ADDR_IN_RANGE(addr, low, high) \
258 (((addr) <= (high)) && ((addr) >= (low))) 258 (((addr) <= (high)) && ((addr) >= (low)))
259 259
260#define NETXEN_FLASH_BASE (BOOTLD_START) 260#define NETXEN_FLASH_BASE (NETXEN_BOOTLD_START)
261#define NETXEN_PHANTOM_MEM_BASE (NETXEN_FLASH_BASE) 261#define NETXEN_PHANTOM_MEM_BASE (NETXEN_FLASH_BASE)
262#define NETXEN_MAX_MTU 8000 + NETXEN_ENET_HEADER_SIZE + NETXEN_ETH_FCS_SIZE 262#define NETXEN_MAX_MTU 8000 + NETXEN_ENET_HEADER_SIZE + NETXEN_ETH_FCS_SIZE
263#define NETXEN_MIN_MTU 64 263#define NETXEN_MIN_MTU 64
@@ -611,7 +611,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
611 u32 *pmac = (u32 *) & mac[0]; 611 u32 *pmac = (u32 *) & mac[0];
612 612
613 if (netxen_get_flash_block(adapter, 613 if (netxen_get_flash_block(adapter,
614 USER_START + 614 NETXEN_USER_START +
615 offsetof(struct netxen_new_user_info, 615 offsetof(struct netxen_new_user_info,
616 mac_addr), 616 mac_addr),
617 FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) { 617 FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
@@ -619,7 +619,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
619 } 619 }
620 if (*mac == ~0ULL) { 620 if (*mac == ~0ULL) {
621 if (netxen_get_flash_block(adapter, 621 if (netxen_get_flash_block(adapter,
622 USER_START_OLD + 622 NETXEN_USER_START_OLD +
623 offsetof(struct netxen_user_old_info, 623 offsetof(struct netxen_user_old_info,
624 mac_addr), 624 mac_addr),
625 FLASH_NUM_PORTS * sizeof(u64), 625 FLASH_NUM_PORTS * sizeof(u64),
@@ -942,7 +942,7 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter,
942int 942int
943netxen_nic_erase_pxe(struct netxen_adapter *adapter) 943netxen_nic_erase_pxe(struct netxen_adapter *adapter)
944{ 944{
945 if (netxen_rom_fast_write(adapter, PXE_START, 0) == -1) { 945 if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) {
946 printk(KERN_ERR "%s: erase pxe failed\n", 946 printk(KERN_ERR "%s: erase pxe failed\n",
947 netxen_nic_driver_name); 947 netxen_nic_driver_name);
948 return -1; 948 return -1;
@@ -953,7 +953,7 @@ netxen_nic_erase_pxe(struct netxen_adapter *adapter)
953int netxen_nic_get_board_info(struct netxen_adapter *adapter) 953int netxen_nic_get_board_info(struct netxen_adapter *adapter)
954{ 954{
955 int rv = 0; 955 int rv = 0;
956 int addr = BRDCFG_START; 956 int addr = NETXEN_BRDCFG_START;
957 struct netxen_board_info *boardinfo; 957 struct netxen_board_info *boardinfo;
958 int index; 958 int index;
959 u32 *ptr32; 959 u32 *ptr32;
@@ -1115,7 +1115,7 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter)
1115 u32 fw_build = 0; 1115 u32 fw_build = 0;
1116 char brd_name[NETXEN_MAX_SHORT_NAME]; 1116 char brd_name[NETXEN_MAX_SHORT_NAME];
1117 struct netxen_new_user_info user_info; 1117 struct netxen_new_user_info user_info;
1118 int i, addr = USER_START; 1118 int i, addr = NETXEN_USER_START;
1119 __le32 *ptr32; 1119 __le32 *ptr32;
1120 1120
1121 struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); 1121 struct netxen_board_info *board_info = &(adapter->ahw.boardcfg);
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index a36892457761..8e7c4a5bc26a 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -585,7 +585,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
585{ 585{
586 int ret = FLASH_SUCCESS; 586 int ret = FLASH_SUCCESS;
587 int val; 587 int val;
588 char *buffer = kmalloc(FLASH_SECTOR_SIZE, GFP_KERNEL); 588 char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL);
589 589
590 if (!buffer) 590 if (!buffer)
591 return -ENOMEM; 591 return -ENOMEM;
@@ -601,13 +601,13 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
601 goto out_kfree; 601 goto out_kfree;
602 602
603 /* copy sector 0 to sector 63 */ 603 /* copy sector 0 to sector 63 */
604 ret = netxen_rom_fast_read_words(adapter, CRBINIT_START, 604 ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START,
605 buffer, FLASH_SECTOR_SIZE); 605 buffer, NETXEN_FLASH_SECTOR_SIZE);
606 if (ret != FLASH_SUCCESS) 606 if (ret != FLASH_SUCCESS)
607 goto out_kfree; 607 goto out_kfree;
608 608
609 ret = netxen_rom_fast_write_words(adapter, FIXED_START, 609 ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START,
610 buffer, FLASH_SECTOR_SIZE); 610 buffer, NETXEN_FLASH_SECTOR_SIZE);
611 if (ret != FLASH_SUCCESS) 611 if (ret != FLASH_SUCCESS)
612 goto out_kfree; 612 goto out_kfree;
613 613
@@ -654,7 +654,8 @@ void check_erased_flash(struct netxen_adapter *adapter, int addr)
654 int count = 0, erased_errors = 0; 654 int count = 0, erased_errors = 0;
655 int range; 655 int range;
656 656
657 range = (addr == USER_START) ? FIXED_START : addr + FLASH_SECTOR_SIZE; 657 range = (addr == NETXEN_USER_START) ?
658 NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE;
658 659
659 for (i = addr; i < range; i += 4) { 660 for (i = addr; i < range; i += 4) {
660 netxen_rom_fast_read(adapter, i, &val); 661 netxen_rom_fast_read(adapter, i, &val);
@@ -689,7 +690,7 @@ netxen_flash_erase_sections(struct netxen_adapter *adapter, int start, int end)
689 int i; 690 int i;
690 691
691 for (i = start; i < end; i++) { 692 for (i = start; i < end; i++) {
692 ret = netxen_rom_se(adapter, i * FLASH_SECTOR_SIZE); 693 ret = netxen_rom_se(adapter, i * NETXEN_FLASH_SECTOR_SIZE);
693 if (ret) 694 if (ret)
694 break; 695 break;
695 ret = netxen_rom_wip_poll(adapter); 696 ret = netxen_rom_wip_poll(adapter);
@@ -706,8 +707,8 @@ netxen_flash_erase_secondary(struct netxen_adapter *adapter)
706 int ret = FLASH_SUCCESS; 707 int ret = FLASH_SUCCESS;
707 int start, end; 708 int start, end;
708 709
709 start = SECONDARY_START / FLASH_SECTOR_SIZE; 710 start = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE;
710 end = USER_START / FLASH_SECTOR_SIZE; 711 end = NETXEN_USER_START / NETXEN_FLASH_SECTOR_SIZE;
711 ret = netxen_flash_erase_sections(adapter, start, end); 712 ret = netxen_flash_erase_sections(adapter, start, end);
712 713
713 return ret; 714 return ret;
@@ -719,8 +720,8 @@ netxen_flash_erase_primary(struct netxen_adapter *adapter)
719 int ret = FLASH_SUCCESS; 720 int ret = FLASH_SUCCESS;
720 int start, end; 721 int start, end;
721 722
722 start = PRIMARY_START / FLASH_SECTOR_SIZE; 723 start = NETXEN_PRIMARY_START / NETXEN_FLASH_SECTOR_SIZE;
723 end = SECONDARY_START / FLASH_SECTOR_SIZE; 724 end = NETXEN_SECONDARY_START / NETXEN_FLASH_SECTOR_SIZE;
724 ret = netxen_flash_erase_sections(adapter, start, end); 725 ret = netxen_flash_erase_sections(adapter, start, end);
725 726
726 return ret; 727 return ret;