aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_init.c
diff options
context:
space:
mode:
authorLinsys Contractor Mithlesh Thukral <mithlesh@netxen.com>2007-02-28 08:16:40 -0500
committerJeff Garzik <jeff@garzik.org>2007-03-02 20:02:28 -0500
commite0e20a1a0822aa64335c05013f0966de6a8fc2c6 (patch)
tree20ea92792228cd533f586d4c64fa162048473314 /drivers/net/netxen/netxen_nic_init.c
parent0c25cfe18afffbc88a2bef28732be9e4846153fe (diff)
NetXen: Fix second rmmod failure observed on PowerPC machines.
Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r--drivers/net/netxen/netxen_nic_init.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 2f965701a95b..586d32b676af 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -38,13 +38,13 @@
38#include "netxen_nic_phan_reg.h" 38#include "netxen_nic_phan_reg.h"
39 39
40struct crb_addr_pair { 40struct crb_addr_pair {
41 long addr; 41 u32 addr;
42 long data; 42 u32 data;
43}; 43};
44 44
45#define NETXEN_MAX_CRB_XFORM 60 45#define NETXEN_MAX_CRB_XFORM 60
46static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; 46static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM];
47#define NETXEN_ADDR_ERROR ((unsigned long ) 0xffffffff ) 47#define NETXEN_ADDR_ERROR (0xffffffff)
48 48
49#define crb_addr_transform(name) \ 49#define crb_addr_transform(name) \
50 crb_addr_xform[NETXEN_HW_PX_MAP_CRB_##name] = \ 50 crb_addr_xform[NETXEN_HW_PX_MAP_CRB_##name] = \
@@ -252,10 +252,10 @@ void netxen_initialize_adapter_ops(struct netxen_adapter *adapter)
252 * netxen_decode_crb_addr(0 - utility to translate from internal Phantom CRB 252 * netxen_decode_crb_addr(0 - utility to translate from internal Phantom CRB
253 * address to external PCI CRB address. 253 * address to external PCI CRB address.
254 */ 254 */
255unsigned long netxen_decode_crb_addr(unsigned long addr) 255u32 netxen_decode_crb_addr(u32 addr)
256{ 256{
257 int i; 257 int i;
258 unsigned long base_addr, offset, pci_base; 258 u32 base_addr, offset, pci_base;
259 259
260 crb_addr_transform_setup(); 260 crb_addr_transform_setup();
261 261
@@ -756,7 +756,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
756 int n, i; 756 int n, i;
757 int init_delay = 0; 757 int init_delay = 0;
758 struct crb_addr_pair *buf; 758 struct crb_addr_pair *buf;
759 unsigned long off; 759 u32 off;
760 760
761 /* resetall */ 761 /* resetall */
762 status = netxen_nic_get_board_info(adapter); 762 status = netxen_nic_get_board_info(adapter);
@@ -813,14 +813,13 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
813 if (verbose) 813 if (verbose)
814 printk("%s: PCI: 0x%08x == 0x%08x\n", 814 printk("%s: PCI: 0x%08x == 0x%08x\n",
815 netxen_nic_driver_name, (unsigned int) 815 netxen_nic_driver_name, (unsigned int)
816 netxen_decode_crb_addr((unsigned long) 816 netxen_decode_crb_addr(addr), val);
817 addr), val);
818 } 817 }
819 for (i = 0; i < n; i++) { 818 for (i = 0; i < n; i++) {
820 819
821 off = netxen_decode_crb_addr((unsigned long)buf[i].addr); 820 off = netxen_decode_crb_addr(buf[i].addr);
822 if (off == NETXEN_ADDR_ERROR) { 821 if (off == NETXEN_ADDR_ERROR) {
823 printk(KERN_ERR"CRB init value out of range %lx\n", 822 printk(KERN_ERR"CRB init value out of range %x\n",
824 buf[i].addr); 823 buf[i].addr);
825 continue; 824 continue;
826 } 825 }
@@ -927,6 +926,10 @@ int netxen_initialize_adapter_offload(struct netxen_adapter *adapter)
927void netxen_free_adapter_offload(struct netxen_adapter *adapter) 926void netxen_free_adapter_offload(struct netxen_adapter *adapter)
928{ 927{
929 if (adapter->dummy_dma.addr) { 928 if (adapter->dummy_dma.addr) {
929 writel(0, NETXEN_CRB_NORMALIZE(adapter,
930 CRB_HOST_DUMMY_BUF_ADDR_HI));
931 writel(0, NETXEN_CRB_NORMALIZE(adapter,
932 CRB_HOST_DUMMY_BUF_ADDR_LO));
930 pci_free_consistent(adapter->ahw.pdev, 933 pci_free_consistent(adapter->ahw.pdev,
931 NETXEN_HOST_DUMMY_DMA_SIZE, 934 NETXEN_HOST_DUMMY_DMA_SIZE,
932 adapter->dummy_dma.addr, 935 adapter->dummy_dma.addr,