diff options
author | Amit S. Kale <amitkale@netxen.com> | 2006-12-04 12:18:00 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-04 18:36:03 -0500 |
commit | 80922fbcb6f00127e91580e7565bb665947ac5d3 (patch) | |
tree | e7847240ca0813c217cb1d21dd94833c39845120 /drivers/net/netxen/netxen_nic_hw.c | |
parent | 59dc76a4e3bed66f5be474dcdc81cc39c7290cec (diff) |
[PATCH] NetXen: whitespace cleaup and more cleanup fixes
Signed-off-by: Amit S. Kale <amitkale@netxen.com>
netxen_nic.h | 56 ++++++++++++++++++++--------------------------
netxen_nic_ethtool.c | 53 +++++++++++++++++++++-----------------------
netxen_nic_hdr.h | 6 ++---
netxen_nic_hw.c | 54 +++++++++++++++++++++------------------------
netxen_nic_hw.h | 10 ++++----
netxen_nic_init.c | 61 +++++++++++++++++++++++++--------------------------
netxen_nic_ioctl.h | 6 ++---
netxen_nic_isr.c | 48 +++++++++++++++++-----------------------
netxen_nic_main.c | 54 +++++++++++++++++----------------------------
netxen_nic_niu.c | 10 ++++----
10 files changed, 165 insertions(+), 193 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 105c24f0ad4c..7470852ab582 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2003 - 2006 NetXen, Inc. | 2 | * Copyright (C) 2003 - 2006 NetXen, Inc. |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License | 6 | * modify it under the terms of the GNU General Public License |
7 | * as published by the Free Software Foundation; either version 2 | 7 | * as published by the Free Software Foundation; either version 2 |
@@ -16,10 +16,10 @@ | |||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, | 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
18 | * MA 02111-1307, USA. | 18 | * MA 02111-1307, USA. |
19 | * | 19 | * |
20 | * The full GNU General Public License is included in this distribution | 20 | * The full GNU General Public License is included in this distribution |
21 | * in the file called LICENSE. | 21 | * in the file called LICENSE. |
22 | * | 22 | * |
23 | * Contact Information: | 23 | * Contact Information: |
24 | * info@netxen.com | 24 | * info@netxen.com |
25 | * NetXen, | 25 | * NetXen, |
@@ -81,8 +81,8 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p) | |||
81 | DPRINTK(INFO, "valid ether addr\n"); | 81 | DPRINTK(INFO, "valid ether addr\n"); |
82 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 82 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); |
83 | 83 | ||
84 | if (adapter->ops->macaddr_set) | 84 | if (adapter->macaddr_set) |
85 | adapter->ops->macaddr_set(port, addr->sa_data); | 85 | adapter->macaddr_set(port, addr->sa_data); |
86 | 86 | ||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
@@ -99,17 +99,17 @@ void netxen_nic_set_multi(struct net_device *netdev) | |||
99 | 99 | ||
100 | mc_ptr = netdev->mc_list; | 100 | mc_ptr = netdev->mc_list; |
101 | if (netdev->flags & IFF_PROMISC) { | 101 | if (netdev->flags & IFF_PROMISC) { |
102 | if (adapter->ops->set_promisc) | 102 | if (adapter->set_promisc) |
103 | adapter->ops->set_promisc(adapter, | 103 | adapter->set_promisc(adapter, |
104 | port->portnum, | 104 | port->portnum, |
105 | NETXEN_NIU_PROMISC_MODE); | 105 | NETXEN_NIU_PROMISC_MODE); |
106 | } else { | 106 | } else { |
107 | if (adapter->ops->unset_promisc && | 107 | if (adapter->unset_promisc && |
108 | adapter->ahw.boardcfg.board_type | 108 | adapter->ahw.boardcfg.board_type |
109 | != NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) | 109 | != NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) |
110 | adapter->ops->unset_promisc(adapter, | 110 | adapter->unset_promisc(adapter, |
111 | port->portnum, | 111 | port->portnum, |
112 | NETXEN_NIU_NON_PROMISC_MODE); | 112 | NETXEN_NIU_NON_PROMISC_MODE); |
113 | } | 113 | } |
114 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | 114 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
115 | netxen_nic_mcr_set_mode_select(netxen_mac_addr_cntl_data, 0x03); | 115 | netxen_nic_mcr_set_mode_select(netxen_mac_addr_cntl_data, 0x03); |
@@ -160,8 +160,8 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu) | |||
160 | return -EINVAL; | 160 | return -EINVAL; |
161 | } | 161 | } |
162 | 162 | ||
163 | if (adapter->ops->set_mtu) | 163 | if (adapter->set_mtu) |
164 | adapter->ops->set_mtu(port, mtu); | 164 | adapter->set_mtu(port, mtu); |
165 | netdev->mtu = mtu; | 165 | netdev->mtu = mtu; |
166 | 166 | ||
167 | return 0; | 167 | return 0; |
@@ -184,14 +184,12 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
184 | struct netxen_recv_context *recv_ctx; | 184 | struct netxen_recv_context *recv_ctx; |
185 | struct netxen_rcv_desc_ctx *rcv_desc; | 185 | struct netxen_rcv_desc_ctx *rcv_desc; |
186 | 186 | ||
187 | DPRINTK(INFO, "crb_base: %lx %lx", NETXEN_PCI_CRBSPACE, | 187 | DPRINTK(INFO, "crb_base: %lx %x", NETXEN_PCI_CRBSPACE, |
188 | PCI_OFFSET_SECOND_RANGE(adapter, NETXEN_PCI_CRBSPACE)); | 188 | PCI_OFFSET_SECOND_RANGE(adapter, NETXEN_PCI_CRBSPACE)); |
189 | DPRINTK(INFO, "cam base: %lx %lx", NETXEN_CRB_CAM, | 189 | DPRINTK(INFO, "cam base: %lx %x", NETXEN_CRB_CAM, |
190 | pci_base_offset(adapter, NETXEN_CRB_CAM)); | 190 | pci_base_offset(adapter, NETXEN_CRB_CAM)); |
191 | DPRINTK(INFO, "cam RAM: %lx %lx", NETXEN_CAM_RAM_BASE, | 191 | DPRINTK(INFO, "cam RAM: %lx %x", NETXEN_CAM_RAM_BASE, |
192 | pci_base_offset(adapter, NETXEN_CAM_RAM_BASE)); | 192 | pci_base_offset(adapter, NETXEN_CAM_RAM_BASE)); |
193 | DPRINTK(INFO, "NIC base:%lx %lx\n", NIC_CRB_BASE_PORT1, | ||
194 | pci_base_offset(adapter, NIC_CRB_BASE_PORT1)); | ||
195 | 193 | ||
196 | /* Window 1 call */ | 194 | /* Window 1 call */ |
197 | card_cmdring = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_CMDRING)); | 195 | card_cmdring = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_CMDRING)); |
@@ -648,7 +646,7 @@ void netxen_nic_reg_write(struct netxen_adapter *adapter, u64 off, u32 val) | |||
648 | 646 | ||
649 | addr = NETXEN_CRB_NORMALIZE(adapter, off); | 647 | addr = NETXEN_CRB_NORMALIZE(adapter, off); |
650 | DPRINTK(INFO, "writing to base %lx offset %llx addr %p data %x\n", | 648 | DPRINTK(INFO, "writing to base %lx offset %llx addr %p data %x\n", |
651 | pci_base(adapter, off), off, addr); | 649 | pci_base(adapter, off), off, addr, val); |
652 | writel(val, addr); | 650 | writel(val, addr); |
653 | 651 | ||
654 | } | 652 | } |
@@ -660,7 +658,7 @@ int netxen_nic_reg_read(struct netxen_adapter *adapter, u64 off) | |||
660 | 658 | ||
661 | addr = NETXEN_CRB_NORMALIZE(adapter, off); | 659 | addr = NETXEN_CRB_NORMALIZE(adapter, off); |
662 | DPRINTK(INFO, "reading from base %lx offset %llx addr %p\n", | 660 | DPRINTK(INFO, "reading from base %lx offset %llx addr %p\n", |
663 | adapter->ahw.pci_base, off, addr); | 661 | pci_base(adapter, off), off, addr); |
664 | val = readl(addr); | 662 | val = readl(addr); |
665 | writel(val, addr); | 663 | writel(val, addr); |
666 | 664 | ||
@@ -848,8 +846,8 @@ void netxen_nic_stop_all_ports(struct netxen_adapter *adapter) | |||
848 | 846 | ||
849 | for (port_nr = 0; port_nr < adapter->ahw.max_ports; port_nr++) { | 847 | for (port_nr = 0; port_nr < adapter->ahw.max_ports; port_nr++) { |
850 | port = adapter->port[port_nr]; | 848 | port = adapter->port[port_nr]; |
851 | if (adapter->ops->stop_port) | 849 | if (adapter->stop_port) |
852 | adapter->ops->stop_port(adapter, port->portnum); | 850 | adapter->stop_port(adapter, port->portnum); |
853 | } | 851 | } |
854 | } | 852 | } |
855 | 853 | ||
@@ -878,8 +876,8 @@ void netxen_nic_set_link_parameters(struct netxen_port *port) | |||
878 | 876 | ||
879 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 877 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); |
880 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 878 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ |
881 | if (adapter->ops->phy_read | 879 | if (adapter->phy_read |
882 | && adapter->ops-> | 880 | && adapter-> |
883 | phy_read(adapter, port->portnum, | 881 | phy_read(adapter, port->portnum, |
884 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 882 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
885 | &status) == 0) { | 883 | &status) == 0) { |
@@ -909,8 +907,8 @@ void netxen_nic_set_link_parameters(struct netxen_port *port) | |||
909 | port->link_duplex = -1; | 907 | port->link_duplex = -1; |
910 | break; | 908 | break; |
911 | } | 909 | } |
912 | if (adapter->ops->phy_read | 910 | if (adapter->phy_read |
913 | && adapter->ops-> | 911 | && adapter-> |
914 | phy_read(adapter, port->portnum, | 912 | phy_read(adapter, port->portnum, |
915 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 913 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
916 | (__le32 *) & autoneg) != 0) | 914 | (__le32 *) & autoneg) != 0) |