diff options
author | Mithlesh Thukral <mithlesh@netxen.com> | 2007-04-20 10:52:37 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 11:01:05 -0400 |
commit | 3176ff3ee71bddbd1d68e6a9e28dbcf0a2960c95 (patch) | |
tree | 260ba783bbd24bf21f17c11f9a6f06a7c50a9fc6 /drivers/net/netxen/netxen_nic_niu.c | |
parent | d52df4a35af569071fda3f4eb08e47cc7023f094 (diff) |
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.c | 27 |
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 d5d95074e56..f6befc32aa5 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, | |||
610 | * Set the station MAC address. | 610 | * Set the station MAC address. |
611 | * Note that the passed-in value must already be in network byte order. | 611 | * Note that the passed-in value must already be in network byte order. |
612 | */ | 612 | */ |
613 | int netxen_niu_macaddr_set(struct netxen_port *port, | 613 | int netxen_niu_macaddr_set(struct netxen_adapter *adapter, |
614 | netxen_ethernet_macaddr_t addr) | 614 | netxen_ethernet_macaddr_t addr) |
615 | { | 615 | { |
616 | u8 temp[4]; | 616 | u8 temp[4]; |
617 | u32 val; | 617 | u32 val; |
618 | struct netxen_adapter *adapter = port->adapter; | 618 | int phy = adapter->portnum; |
619 | int phy = port->portnum; | ||
620 | unsigned char mac_addr[6]; | 619 | unsigned char mac_addr[6]; |
621 | int i; | 620 | int i; |
622 | 621 | ||
@@ -642,7 +641,7 @@ int netxen_niu_macaddr_set(struct netxen_port *port, | |||
642 | 641 | ||
643 | if (i == 10) { | 642 | if (i == 10) { |
644 | printk(KERN_ERR "%s: cannot set Mac addr for %s\n", | 643 | printk(KERN_ERR "%s: cannot set Mac addr for %s\n", |
645 | netxen_nic_driver_name, port->netdev->name); | 644 | netxen_nic_driver_name, adapter->netdev->name); |
646 | printk(KERN_ERR "MAC address set: " | 645 | printk(KERN_ERR "MAC address set: " |
647 | "%02x:%02x:%02x:%02x:%02x:%02x.\n", | 646 | "%02x:%02x:%02x:%02x:%02x:%02x.\n", |
648 | addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); | 647 | 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, | |||
735 | } | 734 | } |
736 | 735 | ||
737 | /* Disable a GbE interface */ | 736 | /* Disable a GbE interface */ |
738 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) | 737 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) |
739 | { | 738 | { |
740 | __u32 mac_cfg0; | 739 | __u32 mac_cfg0; |
741 | 740 | int port = adapter->portnum; | |
742 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | ||
743 | return -EINVAL; | ||
744 | 741 | ||
745 | mac_cfg0 = 0; | 742 | mac_cfg0 = 0; |
746 | netxen_gb_soft_reset(mac_cfg0); | 743 | netxen_gb_soft_reset(mac_cfg0); |
@@ -751,13 +748,10 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) | |||
751 | } | 748 | } |
752 | 749 | ||
753 | /* Disable an XG interface */ | 750 | /* Disable an XG interface */ |
754 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) | 751 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) |
755 | { | 752 | { |
756 | __u32 mac_cfg; | 753 | __u32 mac_cfg; |
757 | 754 | ||
758 | if (port != 0) | ||
759 | return -EINVAL; | ||
760 | |||
761 | mac_cfg = 0; | 755 | mac_cfg = 0; |
762 | netxen_xg_soft_reset(mac_cfg); | 756 | netxen_xg_soft_reset(mac_cfg); |
763 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0, | 757 | 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) | |||
767 | } | 761 | } |
768 | 762 | ||
769 | /* Set promiscuous mode for a GbE interface */ | 763 | /* Set promiscuous mode for a GbE interface */ |
770 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, | 764 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, |
771 | netxen_niu_prom_mode_t mode) | 765 | netxen_niu_prom_mode_t mode) |
772 | { | 766 | { |
773 | __u32 reg; | 767 | __u32 reg; |
768 | int port = adapter->portnum; | ||
774 | 769 | ||
775 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 770 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
776 | return -EINVAL; | 771 | return -EINVAL; |
@@ -824,12 +819,11 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, | |||
824 | * Set the MAC address for an XG port | 819 | * Set the MAC address for an XG port |
825 | * Note that the passed-in value must already be in network byte order. | 820 | * Note that the passed-in value must already be in network byte order. |
826 | */ | 821 | */ |
827 | int netxen_niu_xg_macaddr_set(struct netxen_port *port, | 822 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, |
828 | netxen_ethernet_macaddr_t addr) | 823 | netxen_ethernet_macaddr_t addr) |
829 | { | 824 | { |
830 | u8 temp[4]; | 825 | u8 temp[4]; |
831 | u32 val; | 826 | u32 val; |
832 | struct netxen_adapter *adapter = port->adapter; | ||
833 | 827 | ||
834 | temp[0] = temp[1] = 0; | 828 | temp[0] = temp[1] = 0; |
835 | memcpy(temp + 2, addr, 2); | 829 | memcpy(temp + 2, addr, 2); |
@@ -878,9 +872,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | |||
878 | } | 872 | } |
879 | 873 | ||
880 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 874 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
881 | int port, netxen_niu_prom_mode_t mode) | 875 | netxen_niu_prom_mode_t mode) |
882 | { | 876 | { |
883 | __u32 reg; | 877 | __u32 reg; |
878 | int port = adapter->portnum; | ||
884 | 879 | ||
885 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 880 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
886 | return -EINVAL; | 881 | return -EINVAL; |