summaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_niu.c
diff options
context:
space:
mode:
authorMithlesh Thukral <mithlesh@netxen.com>2007-04-20 07:52:37 -0700
committerJeff Garzik <jeff@garzik.org>2007-04-28 11:01:05 -0400
commit3176ff3ee71bddbd1d68e6a9e28dbcf0a2960c95 (patch)
tree260ba783bbd24bf21f17c11f9a6f06a7c50a9fc6 /drivers/net/netxen/netxen_nic_niu.c
parentd52df4a35af569071fda3f4eb08e47cc7023f094 (diff)
downloadop-kernel-dev-3176ff3ee71bddbd1d68e6a9e28dbcf0a2960c95.zip
op-kernel-dev-3176ff3ee71bddbd1d68e6a9e28dbcf0a2960c95.tar.gz
NetXen: Use multiple PCI functions
NetXen: Make driver use multiple PCI functions. This patch will make NetXen driver work with multiple PCI functions. This will make the usage of memory resources as well as interrupts more independent among different functions which results in better throughput. This change has been done after the multiport support is added in firmware. Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_niu.c')
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index d5d9507..f6befc3 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -610,13 +610,12 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
* Set the station MAC address.
* Note that the passed-in value must already be in network byte order.
*/
-int netxen_niu_macaddr_set(struct netxen_port *port,
+int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
netxen_ethernet_macaddr_t addr)
{
u8 temp[4];
u32 val;
- struct netxen_adapter *adapter = port->adapter;
- int phy = port->portnum;
+ int phy = adapter->portnum;
unsigned char mac_addr[6];
int i;
@@ -642,7 +641,7 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
if (i == 10) {
printk(KERN_ERR "%s: cannot set Mac addr for %s\n",
- netxen_nic_driver_name, port->netdev->name);
+ netxen_nic_driver_name, adapter->netdev->name);
printk(KERN_ERR "MAC address set: "
"%02x:%02x:%02x:%02x:%02x:%02x.\n",
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
@@ -735,12 +734,10 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
}
/* Disable a GbE interface */
-int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port)
+int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter)
{
__u32 mac_cfg0;
-
- if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
- return -EINVAL;
+ int port = adapter->portnum;
mac_cfg0 = 0;
netxen_gb_soft_reset(mac_cfg0);
@@ -751,13 +748,10 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port)
}
/* Disable an XG interface */
-int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port)
+int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
{
__u32 mac_cfg;
- if (port != 0)
- return -EINVAL;
-
mac_cfg = 0;
netxen_xg_soft_reset(mac_cfg);
if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0,
@@ -767,10 +761,11 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port)
}
/* Set promiscuous mode for a GbE interface */
-int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port,
+int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
netxen_niu_prom_mode_t mode)
{
__u32 reg;
+ int port = adapter->portnum;
if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
return -EINVAL;
@@ -824,12 +819,11 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port,
* Set the MAC address for an XG port
* Note that the passed-in value must already be in network byte order.
*/
-int netxen_niu_xg_macaddr_set(struct netxen_port *port,
+int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter,
netxen_ethernet_macaddr_t addr)
{
u8 temp[4];
u32 val;
- struct netxen_adapter *adapter = port->adapter;
temp[0] = temp[1] = 0;
memcpy(temp + 2, addr, 2);
@@ -878,9 +872,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
}
int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
- int port, netxen_niu_prom_mode_t mode)
+ netxen_niu_prom_mode_t mode)
{
__u32 reg;
+ int port = adapter->portnum;
if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
return -EINVAL;
OpenPOWER on IntegriCloud