aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2008-07-21 22:44:07 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 17:52:11 -0400
commitc9fc891f86c062449116fde8826a0ead650e17ac (patch)
tree73496ddd8e43ef74634cae90ab9d12bf311d4139 /drivers/net/netxen/netxen_nic_main.c
parent48bfd1e0fc66b27254ec742b014e689ef218e76c (diff)
netxen: mtu, mac, link status changes
MAC addr, multicast filters, mtu are set through firmware commands in firmware v4.0.0+ because of virtualization of physical ports. Link status is also read from registers allocated by firmware for each virtual port. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 03d796d19ad9..df48f89afff1 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -123,7 +123,7 @@ static uint32_t crb_cmd_producer[4] = {
123 CRB_CMD_PRODUCER_OFFSET_2, CRB_CMD_PRODUCER_OFFSET_3 123 CRB_CMD_PRODUCER_OFFSET_2, CRB_CMD_PRODUCER_OFFSET_3
124}; 124};
125 125
126static inline void 126void
127netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, 127netxen_nic_update_cmd_producer(struct netxen_adapter *adapter,
128 uint32_t crb_producer) 128 uint32_t crb_producer)
129{ 129{
@@ -716,7 +716,10 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
716 netdev->stop = netxen_nic_close; 716 netdev->stop = netxen_nic_close;
717 netdev->hard_start_xmit = netxen_nic_xmit_frame; 717 netdev->hard_start_xmit = netxen_nic_xmit_frame;
718 netdev->get_stats = netxen_nic_get_stats; 718 netdev->get_stats = netxen_nic_get_stats;
719 netdev->set_multicast_list = netxen_nic_set_multi; 719 if (NX_IS_REVISION_P3(revision_id))
720 netdev->set_multicast_list = netxen_p3_nic_set_multi;
721 else
722 netdev->set_multicast_list = netxen_p2_nic_set_multi;
720 netdev->set_mac_address = netxen_nic_set_mac; 723 netdev->set_mac_address = netxen_nic_set_mac;
721 netdev->change_mtu = netxen_nic_change_mtu; 724 netdev->change_mtu = netxen_nic_change_mtu;
722 netdev->tx_timeout = netxen_tx_timeout; 725 netdev->tx_timeout = netxen_tx_timeout;
@@ -1100,7 +1103,7 @@ static int netxen_nic_open(struct net_device *netdev)
1100 1103
1101 /* Done here again so that even if phantom sw overwrote it, 1104 /* Done here again so that even if phantom sw overwrote it,
1102 * we set it */ 1105 * we set it */
1103 err = adapter->init_port(adapter, adapter->portnum); 1106 err = adapter->init_port(adapter, adapter->physical_port);
1104 if (err) { 1107 if (err) {
1105 printk(KERN_ERR "%s: Failed to initialize port %d\n", 1108 printk(KERN_ERR "%s: Failed to initialize port %d\n",
1106 netxen_nic_driver_name, adapter->portnum); 1109 netxen_nic_driver_name, adapter->portnum);
@@ -1110,8 +1113,11 @@ static int netxen_nic_open(struct net_device *netdev)
1110 1113
1111 netxen_nic_set_link_parameters(adapter); 1114 netxen_nic_set_link_parameters(adapter);
1112 1115
1113 netxen_nic_set_multi(netdev); 1116 netdev->set_multicast_list(netdev);
1114 adapter->set_mtu(adapter, netdev->mtu); 1117 if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
1118 nx_fw_cmd_set_mtu(adapter, netdev->mtu);
1119 else
1120 adapter->set_mtu(adapter, netdev->mtu);
1115 1121
1116 mod_timer(&adapter->watchdog_timer, jiffies); 1122 mod_timer(&adapter->watchdog_timer, jiffies);
1117 1123
@@ -1379,12 +1385,21 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
1379 1385
1380 port = adapter->physical_port; 1386 port = adapter->physical_port;
1381 1387
1382 val = adapter->pci_read_normalize(adapter, CRB_XG_STATE); 1388 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
1383 if (adapter->ahw.board_type == NETXEN_NIC_GBE) 1389 val = adapter->pci_read_normalize(adapter, CRB_XG_STATE);
1384 linkup = (val >> port) & 1; 1390 linkup = (val >> port) & 1;
1385 else { 1391 } else {
1386 val = (val >> port*8) & 0xff; 1392 if (adapter->fw_major < 4) {
1387 linkup = (val == XG_LINK_UP); 1393 val = adapter->pci_read_normalize(adapter,
1394 CRB_XG_STATE);
1395 val = (val >> port*8) & 0xff;
1396 linkup = (val == XG_LINK_UP);
1397 } else {
1398 val = adapter->pci_read_normalize(adapter,
1399 CRB_XG_STATE_P3);
1400 val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
1401 linkup = (val == XG_LINK_UP_P3);
1402 }
1388 } 1403 }
1389 1404
1390 if (adapter->ahw.linkup && !linkup) { 1405 if (adapter->ahw.linkup && !linkup) {