diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2008-07-21 22:44:03 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 17:51:44 -0400 |
commit | 3ce06a320f8d5a3f16960e63021cc372283efffb (patch) | |
tree | cea5b02fc44b8c2367c57d7c249592683edffcc9 /drivers/net/netxen/netxen_nic_niu.c | |
parent | e4c93c817ce650401db42db6c869cf7688217ff4 (diff) |
netxen: add 2MB PCI memory support
New revision of netxen chip has 2MB PCI memory. Older chips
had 128MB addressable PCI memory. To retain compatibility,
this patch adds function pointers based on pci bar0 size.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_niu.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_niu.c | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index d9664a0e08bc..78905d9dd4ba 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -46,9 +46,8 @@ static int phy_lock(struct netxen_adapter *adapter) | |||
46 | int done = 0, timeout = 0; | 46 | int done = 0, timeout = 0; |
47 | 47 | ||
48 | while (!done) { | 48 | while (!done) { |
49 | done = | 49 | done = netxen_nic_reg_read(adapter, |
50 | readl(pci_base_offset | 50 | NETXEN_PCIE_REG(PCIE_SEM3_LOCK)); |
51 | (adapter, NETXEN_PCIE_REG(PCIE_SEM3_LOCK))); | ||
52 | if (done == 1) | 51 | if (done == 1) |
53 | break; | 52 | break; |
54 | if (timeout >= phy_lock_timeout) { | 53 | if (timeout >= phy_lock_timeout) { |
@@ -63,14 +62,14 @@ static int phy_lock(struct netxen_adapter *adapter) | |||
63 | } | 62 | } |
64 | } | 63 | } |
65 | 64 | ||
66 | writel(PHY_LOCK_DRIVER, | 65 | netxen_crb_writelit_adapter(adapter, |
67 | NETXEN_CRB_NORMALIZE(adapter, NETXEN_PHY_LOCK_ID)); | 66 | NETXEN_PHY_LOCK_ID, PHY_LOCK_DRIVER); |
68 | return 0; | 67 | return 0; |
69 | } | 68 | } |
70 | 69 | ||
71 | static int phy_unlock(struct netxen_adapter *adapter) | 70 | static int phy_unlock(struct netxen_adapter *adapter) |
72 | { | 71 | { |
73 | readl(pci_base_offset(adapter, NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK))); | 72 | adapter->pci_read_immediate(adapter, NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK)); |
74 | 73 | ||
75 | return 0; | 74 | return 0; |
76 | } | 75 | } |
@@ -109,7 +108,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
109 | * so it cannot be in reset | 108 | * so it cannot be in reset |
110 | */ | 109 | */ |
111 | 110 | ||
112 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(0), | 111 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(0), |
113 | &mac_cfg0, 4)) | 112 | &mac_cfg0, 4)) |
114 | return -EIO; | 113 | return -EIO; |
115 | if (netxen_gb_get_soft_reset(mac_cfg0)) { | 114 | if (netxen_gb_get_soft_reset(mac_cfg0)) { |
@@ -119,7 +118,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
119 | netxen_gb_rx_reset_pb(temp); | 118 | netxen_gb_rx_reset_pb(temp); |
120 | netxen_gb_tx_reset_mac(temp); | 119 | netxen_gb_tx_reset_mac(temp); |
121 | netxen_gb_rx_reset_mac(temp); | 120 | netxen_gb_rx_reset_mac(temp); |
122 | if (netxen_nic_hw_write_wx(adapter, | 121 | if (adapter->hw_write_wx(adapter, |
123 | NETXEN_NIU_GB_MAC_CONFIG_0(0), | 122 | NETXEN_NIU_GB_MAC_CONFIG_0(0), |
124 | &temp, 4)) | 123 | &temp, 4)) |
125 | return -EIO; | 124 | return -EIO; |
@@ -129,22 +128,22 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
129 | address = 0; | 128 | address = 0; |
130 | netxen_gb_mii_mgmt_reg_addr(address, reg); | 129 | netxen_gb_mii_mgmt_reg_addr(address, reg); |
131 | netxen_gb_mii_mgmt_phy_addr(address, phy); | 130 | netxen_gb_mii_mgmt_phy_addr(address, phy); |
132 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR(0), | 131 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR(0), |
133 | &address, 4)) | 132 | &address, 4)) |
134 | return -EIO; | 133 | return -EIO; |
135 | command = 0; /* turn off any prior activity */ | 134 | command = 0; /* turn off any prior activity */ |
136 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0), | 135 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0), |
137 | &command, 4)) | 136 | &command, 4)) |
138 | return -EIO; | 137 | return -EIO; |
139 | /* send read command */ | 138 | /* send read command */ |
140 | netxen_gb_mii_mgmt_set_read_cycle(command); | 139 | netxen_gb_mii_mgmt_set_read_cycle(command); |
141 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0), | 140 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0), |
142 | &command, 4)) | 141 | &command, 4)) |
143 | return -EIO; | 142 | return -EIO; |
144 | 143 | ||
145 | status = 0; | 144 | status = 0; |
146 | do { | 145 | do { |
147 | if (netxen_nic_hw_read_wx(adapter, | 146 | if (adapter->hw_read_wx(adapter, |
148 | NETXEN_NIU_GB_MII_MGMT_INDICATE(0), | 147 | NETXEN_NIU_GB_MII_MGMT_INDICATE(0), |
149 | &status, 4)) | 148 | &status, 4)) |
150 | return -EIO; | 149 | return -EIO; |
@@ -154,7 +153,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
154 | && (timeout++ < NETXEN_NIU_PHY_WAITMAX)); | 153 | && (timeout++ < NETXEN_NIU_PHY_WAITMAX)); |
155 | 154 | ||
156 | if (timeout < NETXEN_NIU_PHY_WAITMAX) { | 155 | if (timeout < NETXEN_NIU_PHY_WAITMAX) { |
157 | if (netxen_nic_hw_read_wx(adapter, | 156 | if (adapter->hw_read_wx(adapter, |
158 | NETXEN_NIU_GB_MII_MGMT_STATUS(0), | 157 | NETXEN_NIU_GB_MII_MGMT_STATUS(0), |
159 | readval, 4)) | 158 | readval, 4)) |
160 | return -EIO; | 159 | return -EIO; |
@@ -163,7 +162,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
163 | result = -1; | 162 | result = -1; |
164 | 163 | ||
165 | if (restore) | 164 | if (restore) |
166 | if (netxen_nic_hw_write_wx(adapter, | 165 | if (adapter->hw_write_wx(adapter, |
167 | NETXEN_NIU_GB_MAC_CONFIG_0(0), | 166 | NETXEN_NIU_GB_MAC_CONFIG_0(0), |
168 | &mac_cfg0, 4)) | 167 | &mac_cfg0, 4)) |
169 | return -EIO; | 168 | return -EIO; |
@@ -201,7 +200,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, | |||
201 | * cannot be in reset | 200 | * cannot be in reset |
202 | */ | 201 | */ |
203 | 202 | ||
204 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(0), | 203 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(0), |
205 | &mac_cfg0, 4)) | 204 | &mac_cfg0, 4)) |
206 | return -EIO; | 205 | return -EIO; |
207 | if (netxen_gb_get_soft_reset(mac_cfg0)) { | 206 | if (netxen_gb_get_soft_reset(mac_cfg0)) { |
@@ -212,7 +211,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, | |||
212 | netxen_gb_tx_reset_mac(temp); | 211 | netxen_gb_tx_reset_mac(temp); |
213 | netxen_gb_rx_reset_mac(temp); | 212 | netxen_gb_rx_reset_mac(temp); |
214 | 213 | ||
215 | if (netxen_nic_hw_write_wx(adapter, | 214 | if (adapter->hw_write_wx(adapter, |
216 | NETXEN_NIU_GB_MAC_CONFIG_0(0), | 215 | NETXEN_NIU_GB_MAC_CONFIG_0(0), |
217 | &temp, 4)) | 216 | &temp, 4)) |
218 | return -EIO; | 217 | return -EIO; |
@@ -220,24 +219,24 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, | |||
220 | } | 219 | } |
221 | 220 | ||
222 | command = 0; /* turn off any prior activity */ | 221 | command = 0; /* turn off any prior activity */ |
223 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0), | 222 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0), |
224 | &command, 4)) | 223 | &command, 4)) |
225 | return -EIO; | 224 | return -EIO; |
226 | 225 | ||
227 | address = 0; | 226 | address = 0; |
228 | netxen_gb_mii_mgmt_reg_addr(address, reg); | 227 | netxen_gb_mii_mgmt_reg_addr(address, reg); |
229 | netxen_gb_mii_mgmt_phy_addr(address, phy); | 228 | netxen_gb_mii_mgmt_phy_addr(address, phy); |
230 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR(0), | 229 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR(0), |
231 | &address, 4)) | 230 | &address, 4)) |
232 | return -EIO; | 231 | return -EIO; |
233 | 232 | ||
234 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_CTRL(0), | 233 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_CTRL(0), |
235 | &val, 4)) | 234 | &val, 4)) |
236 | return -EIO; | 235 | return -EIO; |
237 | 236 | ||
238 | status = 0; | 237 | status = 0; |
239 | do { | 238 | do { |
240 | if (netxen_nic_hw_read_wx(adapter, | 239 | if (adapter->hw_read_wx(adapter, |
241 | NETXEN_NIU_GB_MII_MGMT_INDICATE(0), | 240 | NETXEN_NIU_GB_MII_MGMT_INDICATE(0), |
242 | &status, 4)) | 241 | &status, 4)) |
243 | return -EIO; | 242 | return -EIO; |
@@ -252,7 +251,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, | |||
252 | 251 | ||
253 | /* restore the state of port 0 MAC in case we tampered with it */ | 252 | /* restore the state of port 0 MAC in case we tampered with it */ |
254 | if (restore) | 253 | if (restore) |
255 | if (netxen_nic_hw_write_wx(adapter, | 254 | if (adapter->hw_write_wx(adapter, |
256 | NETXEN_NIU_GB_MAC_CONFIG_0(0), | 255 | NETXEN_NIU_GB_MAC_CONFIG_0(0), |
257 | &mac_cfg0, 4)) | 256 | &mac_cfg0, 4)) |
258 | return -EIO; | 257 | return -EIO; |
@@ -581,10 +580,10 @@ static int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
581 | if ((phy < 0) || (phy > 3)) | 580 | if ((phy < 0) || (phy > 3)) |
582 | return -EINVAL; | 581 | return -EINVAL; |
583 | 582 | ||
584 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), | 583 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), |
585 | &stationhigh, 4)) | 584 | &stationhigh, 4)) |
586 | return -EIO; | 585 | return -EIO; |
587 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), | 586 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), |
588 | &stationlow, 4)) | 587 | &stationlow, 4)) |
589 | return -EIO; | 588 | return -EIO; |
590 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); | 589 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); |
@@ -613,14 +612,14 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
613 | temp[0] = temp[1] = 0; | 612 | temp[0] = temp[1] = 0; |
614 | memcpy(temp + 2, addr, 2); | 613 | memcpy(temp + 2, addr, 2); |
615 | val = le32_to_cpu(*(__le32 *)temp); | 614 | val = le32_to_cpu(*(__le32 *)temp); |
616 | if (netxen_nic_hw_write_wx | 615 | if (adapter->hw_write_wx(adapter, |
617 | (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4)) | 616 | NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4)) |
618 | return -EIO; | 617 | return -EIO; |
619 | 618 | ||
620 | memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32)); | 619 | memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32)); |
621 | val = le32_to_cpu(*(__le32 *)temp); | 620 | val = le32_to_cpu(*(__le32 *)temp); |
622 | if (netxen_nic_hw_write_wx | 621 | if (adapter->hw_write_wx(adapter, |
623 | (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) | 622 | NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) |
624 | return -2; | 623 | return -2; |
625 | 624 | ||
626 | netxen_niu_macaddr_get(adapter, | 625 | netxen_niu_macaddr_get(adapter, |
@@ -654,7 +653,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
654 | 653 | ||
655 | mac_cfg0 = 0; | 654 | mac_cfg0 = 0; |
656 | netxen_gb_soft_reset(mac_cfg0); | 655 | netxen_gb_soft_reset(mac_cfg0); |
657 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 656 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
658 | &mac_cfg0, 4)) | 657 | &mac_cfg0, 4)) |
659 | return -EIO; | 658 | return -EIO; |
660 | mac_cfg0 = 0; | 659 | mac_cfg0 = 0; |
@@ -666,7 +665,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
666 | netxen_gb_tx_reset_mac(mac_cfg0); | 665 | netxen_gb_tx_reset_mac(mac_cfg0); |
667 | netxen_gb_rx_reset_mac(mac_cfg0); | 666 | netxen_gb_rx_reset_mac(mac_cfg0); |
668 | 667 | ||
669 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 668 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
670 | &mac_cfg0, 4)) | 669 | &mac_cfg0, 4)) |
671 | return -EIO; | 670 | return -EIO; |
672 | mac_cfg1 = 0; | 671 | mac_cfg1 = 0; |
@@ -679,7 +678,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
679 | 678 | ||
680 | if (mode == NETXEN_NIU_10_100_MB) { | 679 | if (mode == NETXEN_NIU_10_100_MB) { |
681 | netxen_gb_set_intfmode(mac_cfg1, 1); | 680 | netxen_gb_set_intfmode(mac_cfg1, 1); |
682 | if (netxen_nic_hw_write_wx(adapter, | 681 | if (adapter->hw_write_wx(adapter, |
683 | NETXEN_NIU_GB_MAC_CONFIG_1(port), | 682 | NETXEN_NIU_GB_MAC_CONFIG_1(port), |
684 | &mac_cfg1, 4)) | 683 | &mac_cfg1, 4)) |
685 | return -EIO; | 684 | return -EIO; |
@@ -692,7 +691,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
692 | 691 | ||
693 | } else if (mode == NETXEN_NIU_1000_MB) { | 692 | } else if (mode == NETXEN_NIU_1000_MB) { |
694 | netxen_gb_set_intfmode(mac_cfg1, 2); | 693 | netxen_gb_set_intfmode(mac_cfg1, 2); |
695 | if (netxen_nic_hw_write_wx(adapter, | 694 | if (adapter->hw_write_wx(adapter, |
696 | NETXEN_NIU_GB_MAC_CONFIG_1(port), | 695 | NETXEN_NIU_GB_MAC_CONFIG_1(port), |
697 | &mac_cfg1, 4)) | 696 | &mac_cfg1, 4)) |
698 | return -EIO; | 697 | return -EIO; |
@@ -704,7 +703,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
704 | } | 703 | } |
705 | mii_cfg = 0; | 704 | mii_cfg = 0; |
706 | netxen_gb_set_mii_mgmt_clockselect(mii_cfg, 7); | 705 | netxen_gb_set_mii_mgmt_clockselect(mii_cfg, 7); |
707 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_CONFIG(port), | 706 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_CONFIG(port), |
708 | &mii_cfg, 4)) | 707 | &mii_cfg, 4)) |
709 | return -EIO; | 708 | return -EIO; |
710 | mac_cfg0 = 0; | 709 | mac_cfg0 = 0; |
@@ -713,7 +712,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
713 | netxen_gb_unset_rx_flowctl(mac_cfg0); | 712 | netxen_gb_unset_rx_flowctl(mac_cfg0); |
714 | netxen_gb_unset_tx_flowctl(mac_cfg0); | 713 | netxen_gb_unset_tx_flowctl(mac_cfg0); |
715 | 714 | ||
716 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 715 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
717 | &mac_cfg0, 4)) | 716 | &mac_cfg0, 4)) |
718 | return -EIO; | 717 | return -EIO; |
719 | return 0; | 718 | return 0; |
@@ -730,7 +729,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | |||
730 | return -EINVAL; | 729 | return -EINVAL; |
731 | mac_cfg0 = 0; | 730 | mac_cfg0 = 0; |
732 | netxen_gb_soft_reset(mac_cfg0); | 731 | netxen_gb_soft_reset(mac_cfg0); |
733 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 732 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
734 | &mac_cfg0, 4)) | 733 | &mac_cfg0, 4)) |
735 | return -EIO; | 734 | return -EIO; |
736 | return 0; | 735 | return 0; |
@@ -746,7 +745,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | |||
746 | return -EINVAL; | 745 | return -EINVAL; |
747 | 746 | ||
748 | mac_cfg = 0; | 747 | mac_cfg = 0; |
749 | if (netxen_nic_hw_write_wx(adapter, | 748 | if (adapter->hw_write_wx(adapter, |
750 | NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), &mac_cfg, 4)) | 749 | NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), &mac_cfg, 4)) |
751 | return -EIO; | 750 | return -EIO; |
752 | return 0; | 751 | return 0; |
@@ -763,7 +762,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
763 | return -EINVAL; | 762 | return -EINVAL; |
764 | 763 | ||
765 | /* save previous contents */ | 764 | /* save previous contents */ |
766 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_DROP_WRONGADDR, | 765 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_GB_DROP_WRONGADDR, |
767 | ®, 4)) | 766 | ®, 4)) |
768 | return -EIO; | 767 | return -EIO; |
769 | if (mode == NETXEN_NIU_PROMISC_MODE) { | 768 | if (mode == NETXEN_NIU_PROMISC_MODE) { |
@@ -801,7 +800,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
801 | return -EIO; | 800 | return -EIO; |
802 | } | 801 | } |
803 | } | 802 | } |
804 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_DROP_WRONGADDR, | 803 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_GB_DROP_WRONGADDR, |
805 | ®, 4)) | 804 | ®, 4)) |
806 | return -EIO; | 805 | return -EIO; |
807 | return 0; | 806 | return 0; |
@@ -826,13 +825,13 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | |||
826 | case 0: | 825 | case 0: |
827 | memcpy(temp + 2, addr, 2); | 826 | memcpy(temp + 2, addr, 2); |
828 | val = le32_to_cpu(*(__le32 *)temp); | 827 | val = le32_to_cpu(*(__le32 *)temp); |
829 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 828 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, |
830 | &val, 4)) | 829 | &val, 4)) |
831 | return -EIO; | 830 | return -EIO; |
832 | 831 | ||
833 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | 832 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); |
834 | val = le32_to_cpu(*(__le32 *)temp); | 833 | val = le32_to_cpu(*(__le32 *)temp); |
835 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, | 834 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, |
836 | &val, 4)) | 835 | &val, 4)) |
837 | return -EIO; | 836 | return -EIO; |
838 | break; | 837 | break; |
@@ -840,13 +839,13 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | |||
840 | case 1: | 839 | case 1: |
841 | memcpy(temp + 2, addr, 2); | 840 | memcpy(temp + 2, addr, 2); |
842 | val = le32_to_cpu(*(__le32 *)temp); | 841 | val = le32_to_cpu(*(__le32 *)temp); |
843 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XG1_STATION_ADDR_0_1, | 842 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_XG1_STATION_ADDR_0_1, |
844 | &val, 4)) | 843 | &val, 4)) |
845 | return -EIO; | 844 | return -EIO; |
846 | 845 | ||
847 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | 846 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); |
848 | val = le32_to_cpu(*(__le32 *)temp); | 847 | val = le32_to_cpu(*(__le32 *)temp); |
849 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XG1_STATION_ADDR_0_HI, | 848 | if (adapter->hw_write_wx(adapter, NETXEN_NIU_XG1_STATION_ADDR_0_HI, |
850 | &val, 4)) | 849 | &val, 4)) |
851 | return -EIO; | 850 | return -EIO; |
852 | break; | 851 | break; |
@@ -877,10 +876,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, | |||
877 | if (phy != 0) | 876 | if (phy != 0) |
878 | return -EINVAL; | 877 | return -EINVAL; |
879 | 878 | ||
880 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, | 879 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, |
881 | &stationhigh, 4)) | 880 | &stationhigh, 4)) |
882 | return -EIO; | 881 | return -EIO; |
883 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 882 | if (adapter->hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, |
884 | &stationlow, 4)) | 883 | &stationlow, 4)) |
885 | return -EIO; | 884 | return -EIO; |
886 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); | 885 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); |
@@ -901,7 +900,7 @@ int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
901 | if (port > NETXEN_NIU_MAX_XG_PORTS) | 900 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
902 | return -EINVAL; | 901 | return -EINVAL; |
903 | 902 | ||
904 | if (netxen_nic_hw_read_wx(adapter, | 903 | if (adapter->hw_read_wx(adapter, |
905 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), ®, 4)) | 904 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), ®, 4)) |
906 | return -EIO; | 905 | return -EIO; |
907 | if (mode == NETXEN_NIU_PROMISC_MODE) | 906 | if (mode == NETXEN_NIU_PROMISC_MODE) |