diff options
author | Mithlesh Thukral <mithlesh@netxen.com> | 2007-04-20 10:55:26 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 11:01:06 -0400 |
commit | 6c80b18df3537d1221ab34555c150bccbfd90260 (patch) | |
tree | b82c057feb8a4c5c4ba0171b268599ea357eb2a9 /drivers/net | |
parent | 5d512f5594f9f4829b099c87f7bc6f683ef146ca (diff) |
NetXen: Port swap feature for multi port cards
NetXen: Port Swap feature
This patch will allow a port numbers on the card to be swapped in
host driver. This feature is applicable to cards having more than
1 port.
Signed-off by: Milan Bag <mbag@netxen.com>
Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 21 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 143 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hdr.h | 3 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 67 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.h | 63 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_isr.c | 29 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 306 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_niu.c | 93 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_phan_reg.h | 7 |
10 files changed, 468 insertions, 266 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 923ae6c029d6..1e944d5eb45b 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -205,6 +205,7 @@ enum { | |||
205 | 205 | ||
206 | #define MAX_CMD_DESCRIPTORS 1024 | 206 | #define MAX_CMD_DESCRIPTORS 1024 |
207 | #define MAX_RCV_DESCRIPTORS 16384 | 207 | #define MAX_RCV_DESCRIPTORS 16384 |
208 | #define MAX_CMD_DESCRIPTORS_HOST (MAX_CMD_DESCRIPTORS / 4) | ||
208 | #define MAX_RCV_DESCRIPTORS_1G (MAX_RCV_DESCRIPTORS / 4) | 209 | #define MAX_RCV_DESCRIPTORS_1G (MAX_RCV_DESCRIPTORS / 4) |
209 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 | 210 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 |
210 | #define MAX_LRO_RCV_DESCRIPTORS 64 | 211 | #define MAX_LRO_RCV_DESCRIPTORS 64 |
@@ -303,6 +304,8 @@ struct netxen_ring_ctx { | |||
303 | 304 | ||
304 | #define netxen_set_cmd_desc_port(cmd_desc, var) \ | 305 | #define netxen_set_cmd_desc_port(cmd_desc, var) \ |
305 | ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) | 306 | ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) |
307 | #define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ | ||
308 | ((cmd_desc)->port_ctxid |= ((var) & 0xF0)) | ||
306 | 309 | ||
307 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ | 310 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ |
308 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ | 311 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ |
@@ -445,7 +448,7 @@ struct status_desc { | |||
445 | /* Bit pattern: 0-6 lro_count indicates frag sequence, | 448 | /* Bit pattern: 0-6 lro_count indicates frag sequence, |
446 | 7 last_frag indicates last frag */ | 449 | 7 last_frag indicates last frag */ |
447 | u8 lro; | 450 | u8 lro; |
448 | } __attribute__ ((aligned(8))); | 451 | } __attribute__ ((aligned(16))); |
449 | 452 | ||
450 | enum { | 453 | enum { |
451 | NETXEN_RCV_PEG_0 = 0, | 454 | NETXEN_RCV_PEG_0 = 0, |
@@ -723,6 +726,18 @@ struct netxen_skb_frag { | |||
723 | u32 length; | 726 | u32 length; |
724 | }; | 727 | }; |
725 | 728 | ||
729 | #define _netxen_set_bits(config_word, start, bits, val) {\ | ||
730 | unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start));\ | ||
731 | unsigned long long __tvalue = (val); \ | ||
732 | (config_word) &= ~__tmask; \ | ||
733 | (config_word) |= (((__tvalue) << (start)) & __tmask); \ | ||
734 | } | ||
735 | |||
736 | #define _netxen_clear_bits(config_word, start, bits) {\ | ||
737 | unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \ | ||
738 | (config_word) &= ~__tmask; \ | ||
739 | } | ||
740 | |||
726 | /* Following defines are for the state of the buffers */ | 741 | /* Following defines are for the state of the buffers */ |
727 | #define NETXEN_BUFFER_FREE 0 | 742 | #define NETXEN_BUFFER_FREE 0 |
728 | #define NETXEN_BUFFER_BUSY 1 | 743 | #define NETXEN_BUFFER_BUSY 1 |
@@ -767,6 +782,8 @@ struct netxen_hardware_context { | |||
767 | void __iomem *pci_base0; | 782 | void __iomem *pci_base0; |
768 | void __iomem *pci_base1; | 783 | void __iomem *pci_base1; |
769 | void __iomem *pci_base2; | 784 | void __iomem *pci_base2; |
785 | unsigned long first_page_group_end; | ||
786 | unsigned long first_page_group_start; | ||
770 | void __iomem *db_base; | 787 | void __iomem *db_base; |
771 | unsigned long db_len; | 788 | unsigned long db_len; |
772 | 789 | ||
@@ -862,6 +879,7 @@ struct netxen_adapter { | |||
862 | struct netxen_adapter *master; | 879 | struct netxen_adapter *master; |
863 | struct net_device *netdev; | 880 | struct net_device *netdev; |
864 | struct pci_dev *pdev; | 881 | struct pci_dev *pdev; |
882 | struct net_device_stats net_stats; | ||
865 | unsigned char mac_addr[ETH_ALEN]; | 883 | unsigned char mac_addr[ETH_ALEN]; |
866 | int mtu; | 884 | int mtu; |
867 | int portnum; | 885 | int portnum; |
@@ -1152,4 +1170,5 @@ extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, | |||
1152 | 1170 | ||
1153 | extern struct ethtool_ops netxen_nic_ethtool_ops; | 1171 | extern struct ethtool_ops netxen_nic_ethtool_ops; |
1154 | 1172 | ||
1173 | extern int physical_port[]; /* physical port # from virtual port.*/ | ||
1155 | #endif /* __NETXEN_NIC_H_ */ | 1174 | #endif /* __NETXEN_NIC_H_ */ |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 24c68f42584d..16fabb377488 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -40,8 +40,8 @@ | |||
40 | #include <linux/ethtool.h> | 40 | #include <linux/ethtool.h> |
41 | #include <linux/version.h> | 41 | #include <linux/version.h> |
42 | 42 | ||
43 | #include "netxen_nic_hw.h" | ||
44 | #include "netxen_nic.h" | 43 | #include "netxen_nic.h" |
44 | #include "netxen_nic_hw.h" | ||
45 | #include "netxen_nic_phan_reg.h" | 45 | #include "netxen_nic_phan_reg.h" |
46 | 46 | ||
47 | struct netxen_nic_stats { | 47 | struct netxen_nic_stats { |
@@ -379,7 +379,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) | |||
379 | for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { | 379 | for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { |
380 | /* GB: port specific registers */ | 380 | /* GB: port specific registers */ |
381 | if (mode == 0 && i >= 19) | 381 | if (mode == 0 && i >= 19) |
382 | window = adapter->portnum * | 382 | window = physical_port[adapter->portnum] * |
383 | NETXEN_NIC_PORT_WINDOW; | 383 | NETXEN_NIC_PORT_WINDOW; |
384 | 384 | ||
385 | NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. | 385 | NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. |
@@ -537,16 +537,43 @@ netxen_nic_get_pauseparam(struct net_device *dev, | |||
537 | { | 537 | { |
538 | struct netxen_adapter *adapter = netdev_priv(dev); | 538 | struct netxen_adapter *adapter = netdev_priv(dev); |
539 | __u32 val; | 539 | __u32 val; |
540 | int port = physical_port[adapter->portnum]; | ||
540 | 541 | ||
541 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 542 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
543 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | ||
544 | return; | ||
542 | /* get flow control settings */ | 545 | /* get flow control settings */ |
543 | netxen_nic_read_w0(adapter, | 546 | netxen_nic_read_w0(adapter,NETXEN_NIU_GB_MAC_CONFIG_0(port), |
544 | NETXEN_NIU_GB_MAC_CONFIG_0(adapter->portnum), | 547 | &val); |
545 | &val); | ||
546 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); | 548 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); |
547 | pause->tx_pause = netxen_gb_get_tx_flowctl(val); | 549 | netxen_nic_read_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, &val); |
548 | /* get autoneg settings */ | 550 | switch (port) { |
549 | pause->autoneg = adapter->link_autoneg; | 551 | case 0: |
552 | pause->tx_pause = !(netxen_gb_get_gb0_mask(val)); | ||
553 | break; | ||
554 | case 1: | ||
555 | pause->tx_pause = !(netxen_gb_get_gb1_mask(val)); | ||
556 | break; | ||
557 | case 2: | ||
558 | pause->tx_pause = !(netxen_gb_get_gb2_mask(val)); | ||
559 | break; | ||
560 | case 3: | ||
561 | default: | ||
562 | pause->tx_pause = !(netxen_gb_get_gb3_mask(val)); | ||
563 | break; | ||
564 | } | ||
565 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | ||
566 | if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) | ||
567 | return; | ||
568 | pause->rx_pause = 1; | ||
569 | netxen_nic_read_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, &val); | ||
570 | if (port == 0) | ||
571 | pause->tx_pause = !(netxen_xg_get_xg0_mask(val)); | ||
572 | else | ||
573 | pause->tx_pause = !(netxen_xg_get_xg1_mask(val)); | ||
574 | } else { | ||
575 | printk(KERN_ERR"%s: Unknown board type: %x\n", | ||
576 | netxen_nic_driver_name, adapter->ahw.board_type); | ||
550 | } | 577 | } |
551 | } | 578 | } |
552 | 579 | ||
@@ -556,39 +583,74 @@ netxen_nic_set_pauseparam(struct net_device *dev, | |||
556 | { | 583 | { |
557 | struct netxen_adapter *adapter = netdev_priv(dev); | 584 | struct netxen_adapter *adapter = netdev_priv(dev); |
558 | __u32 val; | 585 | __u32 val; |
559 | unsigned int autoneg; | 586 | int port = physical_port[adapter->portnum]; |
560 | |||
561 | /* read mode */ | 587 | /* read mode */ |
562 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 588 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
589 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | ||
590 | return -EIO; | ||
563 | /* set flow control */ | 591 | /* set flow control */ |
564 | netxen_nic_read_w0(adapter, | 592 | netxen_nic_read_w0(adapter, |
565 | NETXEN_NIU_GB_MAC_CONFIG_0(adapter->portnum), | 593 | NETXEN_NIU_GB_MAC_CONFIG_0(port), &val); |
566 | (u32 *) & val); | 594 | |
567 | if (pause->tx_pause) | ||
568 | netxen_gb_tx_flowctl(val); | ||
569 | else | ||
570 | netxen_gb_unset_tx_flowctl(val); | ||
571 | if (pause->rx_pause) | 595 | if (pause->rx_pause) |
572 | netxen_gb_rx_flowctl(val); | 596 | netxen_gb_rx_flowctl(val); |
573 | else | 597 | else |
574 | netxen_gb_unset_rx_flowctl(val); | 598 | netxen_gb_unset_rx_flowctl(val); |
575 | 599 | ||
576 | netxen_nic_write_w0(adapter, | 600 | netxen_nic_write_w0(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
577 | NETXEN_NIU_GB_MAC_CONFIG_0(adapter->portnum), | 601 | val); |
578 | *&val); | ||
579 | /* set autoneg */ | 602 | /* set autoneg */ |
580 | autoneg = pause->autoneg; | 603 | netxen_nic_read_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, &val); |
581 | if (adapter->phy_write | 604 | switch (port) { |
582 | && adapter->phy_write(adapter, | 605 | case 0: |
583 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 606 | if (pause->tx_pause) |
584 | autoneg) != 0) | 607 | netxen_gb_unset_gb0_mask(val); |
608 | else | ||
609 | netxen_gb_set_gb0_mask(val); | ||
610 | break; | ||
611 | case 1: | ||
612 | if (pause->tx_pause) | ||
613 | netxen_gb_unset_gb1_mask(val); | ||
614 | else | ||
615 | netxen_gb_set_gb1_mask(val); | ||
616 | break; | ||
617 | case 2: | ||
618 | if (pause->tx_pause) | ||
619 | netxen_gb_unset_gb2_mask(val); | ||
620 | else | ||
621 | netxen_gb_set_gb2_mask(val); | ||
622 | break; | ||
623 | case 3: | ||
624 | default: | ||
625 | if (pause->tx_pause) | ||
626 | netxen_gb_unset_gb3_mask(val); | ||
627 | else | ||
628 | netxen_gb_set_gb3_mask(val); | ||
629 | break; | ||
630 | } | ||
631 | netxen_nic_write_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, val); | ||
632 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | ||
633 | if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) | ||
585 | return -EIO; | 634 | return -EIO; |
586 | else { | 635 | netxen_nic_read_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, &val); |
587 | adapter->link_autoneg = pause->autoneg; | 636 | if (port == 0) { |
588 | return 0; | 637 | if (pause->tx_pause) |
638 | netxen_xg_unset_xg0_mask(val); | ||
639 | else | ||
640 | netxen_xg_set_xg0_mask(val); | ||
641 | } else { | ||
642 | if (pause->tx_pause) | ||
643 | netxen_xg_unset_xg1_mask(val); | ||
644 | else | ||
645 | netxen_xg_set_xg1_mask(val); | ||
589 | } | 646 | } |
590 | } else | 647 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val); |
591 | return -EOPNOTSUPP; | 648 | } else { |
649 | printk(KERN_ERR "%s: Unknown board type: %x\n", | ||
650 | netxen_nic_driver_name, | ||
651 | adapter->ahw.board_type); | ||
652 | } | ||
653 | return 0; | ||
592 | } | 654 | } |
593 | 655 | ||
594 | static int netxen_nic_reg_test(struct net_device *dev) | 656 | static int netxen_nic_reg_test(struct net_device *dev) |
@@ -619,23 +681,12 @@ static void | |||
619 | netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test, | 681 | netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test, |
620 | u64 * data) | 682 | u64 * data) |
621 | { | 683 | { |
622 | if (eth_test->flags == ETH_TEST_FL_OFFLINE) { /* offline tests */ | 684 | memset(data, 0, sizeof(uint64_t) * NETXEN_NIC_TEST_LEN); |
623 | /* link test */ | 685 | if ((data[0] = netxen_nic_reg_test(dev))) |
624 | if ((data[1] = (u64) netxen_nic_test_link(dev))) | 686 | eth_test->flags |= ETH_TEST_FL_FAILED; |
625 | eth_test->flags |= ETH_TEST_FL_FAILED; | 687 | /* link test */ |
626 | 688 | if ((data[1] = (u64) netxen_nic_test_link(dev))) | |
627 | /* register tests */ | 689 | eth_test->flags |= ETH_TEST_FL_FAILED; |
628 | if ((data[0] = netxen_nic_reg_test(dev))) | ||
629 | eth_test->flags |= ETH_TEST_FL_FAILED; | ||
630 | } else { /* online tests */ | ||
631 | /* register tests */ | ||
632 | if((data[0] = netxen_nic_reg_test(dev))) | ||
633 | eth_test->flags |= ETH_TEST_FL_FAILED; | ||
634 | |||
635 | /* link test */ | ||
636 | if ((data[1] = (u64) netxen_nic_test_link(dev))) | ||
637 | eth_test->flags |= ETH_TEST_FL_FAILED; | ||
638 | } | ||
639 | } | 690 | } |
640 | 691 | ||
641 | static void | 692 | static void |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index b826bca9c4e0..608e37b349b4 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -467,6 +467,8 @@ enum { | |||
467 | #define NETXEN_PCI_OCM1 (0x05100000UL) | 467 | #define NETXEN_PCI_OCM1 (0x05100000UL) |
468 | #define NETXEN_PCI_OCM1_MAX (0x051fffffUL) | 468 | #define NETXEN_PCI_OCM1_MAX (0x051fffffUL) |
469 | #define NETXEN_PCI_CRBSPACE (0x06000000UL) | 469 | #define NETXEN_PCI_CRBSPACE (0x06000000UL) |
470 | #define NETXEN_PCI_128MB_SIZE (0x08000000UL) | ||
471 | #define NETXEN_PCI_32MB_SIZE (0x02000000UL) | ||
470 | 472 | ||
471 | #define NETXEN_CRB_CAM NETXEN_PCI_CRB_WINDOW(NETXEN_HW_PX_MAP_CRB_CAM) | 473 | #define NETXEN_CRB_CAM NETXEN_PCI_CRB_WINDOW(NETXEN_HW_PX_MAP_CRB_CAM) |
472 | 474 | ||
@@ -528,6 +530,7 @@ enum { | |||
528 | #define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) | 530 | #define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) |
529 | #define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) | 531 | #define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) |
530 | #define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) | 532 | #define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) |
533 | #define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c) | ||
531 | 534 | ||
532 | #define NETXEN_NIU_FULL_LEVEL_XG (NETXEN_CRB_NIU + 0x00450) | 535 | #define NETXEN_NIU_FULL_LEVEL_XG (NETXEN_CRB_NIU + 0x00450) |
533 | 536 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 74517b640c2b..3f4853fdba7b 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -145,7 +145,7 @@ struct netxen_recv_crb recv_crb_registers[] = { | |||
145 | NETXEN_NIC_REG(0x184), | 145 | NETXEN_NIC_REG(0x184), |
146 | }, | 146 | }, |
147 | /* | 147 | /* |
148 | * Instance 3, | 148 | * Instance 2, |
149 | */ | 149 | */ |
150 | { | 150 | { |
151 | { | 151 | { |
@@ -194,7 +194,7 @@ struct netxen_recv_crb recv_crb_registers[] = { | |||
194 | NETXEN_NIC_REG(0x228), | 194 | NETXEN_NIC_REG(0x228), |
195 | }, | 195 | }, |
196 | /* | 196 | /* |
197 | * Instance 4, | 197 | * Instance 3, |
198 | */ | 198 | */ |
199 | { | 199 | { |
200 | { | 200 | { |
@@ -310,7 +310,6 @@ void netxen_nic_set_multi(struct net_device *netdev) | |||
310 | { | 310 | { |
311 | struct netxen_adapter *adapter = netdev_priv(netdev); | 311 | struct netxen_adapter *adapter = netdev_priv(netdev); |
312 | struct dev_mc_list *mc_ptr; | 312 | struct dev_mc_list *mc_ptr; |
313 | __u32 netxen_mac_addr_cntl_data = 0; | ||
314 | 313 | ||
315 | mc_ptr = netdev->mc_list; | 314 | mc_ptr = netdev->mc_list; |
316 | if (netdev->flags & IFF_PROMISC) { | 315 | if (netdev->flags & IFF_PROMISC) { |
@@ -318,43 +317,10 @@ void netxen_nic_set_multi(struct net_device *netdev) | |||
318 | adapter->set_promisc(adapter, | 317 | adapter->set_promisc(adapter, |
319 | NETXEN_NIU_PROMISC_MODE); | 318 | NETXEN_NIU_PROMISC_MODE); |
320 | } else { | 319 | } else { |
321 | if (adapter->unset_promisc && | 320 | if (adapter->unset_promisc) |
322 | adapter->ahw.boardcfg.board_type | ||
323 | != NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) | ||
324 | adapter->unset_promisc(adapter, | 321 | adapter->unset_promisc(adapter, |
325 | NETXEN_NIU_NON_PROMISC_MODE); | 322 | NETXEN_NIU_NON_PROMISC_MODE); |
326 | } | 323 | } |
327 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | ||
328 | netxen_nic_mcr_set_mode_select(netxen_mac_addr_cntl_data, 0x03); | ||
329 | netxen_nic_mcr_set_id_pool0(netxen_mac_addr_cntl_data, 0x00); | ||
330 | netxen_nic_mcr_set_id_pool1(netxen_mac_addr_cntl_data, 0x00); | ||
331 | netxen_nic_mcr_set_id_pool2(netxen_mac_addr_cntl_data, 0x00); | ||
332 | netxen_nic_mcr_set_id_pool3(netxen_mac_addr_cntl_data, 0x00); | ||
333 | netxen_nic_mcr_set_enable_xtnd0(netxen_mac_addr_cntl_data); | ||
334 | netxen_nic_mcr_set_enable_xtnd1(netxen_mac_addr_cntl_data); | ||
335 | netxen_nic_mcr_set_enable_xtnd2(netxen_mac_addr_cntl_data); | ||
336 | netxen_nic_mcr_set_enable_xtnd3(netxen_mac_addr_cntl_data); | ||
337 | } else { | ||
338 | netxen_nic_mcr_set_mode_select(netxen_mac_addr_cntl_data, 0x00); | ||
339 | netxen_nic_mcr_set_id_pool0(netxen_mac_addr_cntl_data, 0x00); | ||
340 | netxen_nic_mcr_set_id_pool1(netxen_mac_addr_cntl_data, 0x01); | ||
341 | netxen_nic_mcr_set_id_pool2(netxen_mac_addr_cntl_data, 0x02); | ||
342 | netxen_nic_mcr_set_id_pool3(netxen_mac_addr_cntl_data, 0x03); | ||
343 | } | ||
344 | writel(netxen_mac_addr_cntl_data, | ||
345 | NETXEN_CRB_NORMALIZE(adapter, NETXEN_MAC_ADDR_CNTL_REG)); | ||
346 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | ||
347 | writel(netxen_mac_addr_cntl_data, | ||
348 | NETXEN_CRB_NORMALIZE(adapter, | ||
349 | NETXEN_MULTICAST_ADDR_HI_0)); | ||
350 | } else { | ||
351 | writel(netxen_mac_addr_cntl_data, | ||
352 | NETXEN_CRB_NORMALIZE(adapter, | ||
353 | NETXEN_MULTICAST_ADDR_HI_1)); | ||
354 | } | ||
355 | netxen_mac_addr_cntl_data = 0; | ||
356 | writel(netxen_mac_addr_cntl_data, | ||
357 | NETXEN_CRB_NORMALIZE(adapter, NETXEN_NIU_GB_DROP_WRONGADDR)); | ||
358 | } | 324 | } |
359 | 325 | ||
360 | /* | 326 | /* |
@@ -390,7 +356,6 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
390 | void *addr; | 356 | void *addr; |
391 | int loops = 0, err = 0; | 357 | int loops = 0, err = 0; |
392 | int ctx, ring; | 358 | int ctx, ring; |
393 | u32 card_cmdring = 0; | ||
394 | struct netxen_recv_context *recv_ctx; | 359 | struct netxen_recv_context *recv_ctx; |
395 | struct netxen_rcv_desc_ctx *rcv_desc; | 360 | struct netxen_rcv_desc_ctx *rcv_desc; |
396 | int func_id = adapter->portnum; | 361 | int func_id = adapter->portnum; |
@@ -402,11 +367,6 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
402 | DPRINTK(INFO, "cam RAM: %lx %x", NETXEN_CAM_RAM_BASE, | 367 | DPRINTK(INFO, "cam RAM: %lx %x", NETXEN_CAM_RAM_BASE, |
403 | pci_base_offset(adapter, NETXEN_CAM_RAM_BASE)); | 368 | pci_base_offset(adapter, NETXEN_CAM_RAM_BASE)); |
404 | 369 | ||
405 | /* Window 1 call */ | ||
406 | card_cmdring = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_CMDRING)); | ||
407 | |||
408 | DPRINTK(INFO, "Command Peg sends 0x%x for cmdring base\n", | ||
409 | card_cmdring); | ||
410 | 370 | ||
411 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | 371 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { |
412 | DPRINTK(INFO, "Command Peg ready..waiting for rcv peg\n"); | 372 | DPRINTK(INFO, "Command Peg ready..waiting for rcv peg\n"); |
@@ -449,7 +409,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
449 | } | 409 | } |
450 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); | 410 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); |
451 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; | 411 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; |
452 | adapter->ctx_desc->ctx_id = adapter->portnum; | 412 | adapter->ctx_desc->ctx_id = cpu_to_le32(adapter->portnum); |
453 | adapter->ctx_desc->cmd_consumer_offset = | 413 | adapter->ctx_desc->cmd_consumer_offset = |
454 | cpu_to_le64(adapter->ctx_desc_phys_addr + | 414 | cpu_to_le64(adapter->ctx_desc_phys_addr + |
455 | sizeof(struct netxen_ring_ctx)); | 415 | sizeof(struct netxen_ring_ctx)); |
@@ -551,10 +511,6 @@ void netxen_free_hw_resources(struct netxen_adapter *adapter) | |||
551 | adapter->ahw.cmd_desc_phys_addr); | 511 | adapter->ahw.cmd_desc_phys_addr); |
552 | adapter->ahw.cmd_desc_head = NULL; | 512 | adapter->ahw.cmd_desc_head = NULL; |
553 | } | 513 | } |
554 | /* Special handling: there are 2 ports on this board */ | ||
555 | if (adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) { | ||
556 | adapter->ahw.max_ports = 2; | ||
557 | } | ||
558 | 514 | ||
559 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | 515 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { |
560 | recv_ctx = &adapter->recv_ctx[ctx]; | 516 | recv_ctx = &adapter->recv_ctx[ctx]; |
@@ -735,7 +691,10 @@ void netxen_nic_pci_change_crbwindow(struct netxen_adapter *adapter, u32 wndw) | |||
735 | count++; | 691 | count++; |
736 | } | 692 | } |
737 | 693 | ||
738 | adapter->curr_window = wndw; | 694 | if (wndw == NETXEN_WINDOW_ONE) |
695 | adapter->curr_window = 1; | ||
696 | else | ||
697 | adapter->curr_window = 0; | ||
739 | } | 698 | } |
740 | 699 | ||
741 | void netxen_load_firmware(struct netxen_adapter *adapter) | 700 | void netxen_load_firmware(struct netxen_adapter *adapter) |
@@ -1055,18 +1014,18 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
1055 | int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) | 1014 | int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) |
1056 | { | 1015 | { |
1057 | netxen_nic_write_w0(adapter, | 1016 | netxen_nic_write_w0(adapter, |
1058 | NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->portnum), | 1017 | NETXEN_NIU_GB_MAX_FRAME_SIZE( |
1059 | new_mtu); | 1018 | physical_port[adapter->portnum]), new_mtu); |
1060 | return 0; | 1019 | return 0; |
1061 | } | 1020 | } |
1062 | 1021 | ||
1063 | int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) | 1022 | int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) |
1064 | { | 1023 | { |
1065 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; | 1024 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; |
1066 | if (adapter->portnum == 0) | 1025 | if (physical_port[adapter->portnum] == 0) |
1067 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, | 1026 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, |
1068 | new_mtu); | 1027 | new_mtu); |
1069 | else if (adapter->portnum == 1) | 1028 | else |
1070 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, | 1029 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, |
1071 | new_mtu); | 1030 | new_mtu); |
1072 | return 0; | 1031 | return 0; |
@@ -1074,7 +1033,7 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) | |||
1074 | 1033 | ||
1075 | void netxen_nic_init_niu_gb(struct netxen_adapter *adapter) | 1034 | void netxen_nic_init_niu_gb(struct netxen_adapter *adapter) |
1076 | { | 1035 | { |
1077 | netxen_niu_gbe_init_port(adapter, adapter->portnum); | 1036 | netxen_niu_gbe_init_port(adapter, physical_port[adapter->portnum]); |
1078 | } | 1037 | } |
1079 | 1038 | ||
1080 | void | 1039 | void |
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index 94459cf6dc19..245bf13c7ba2 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h | |||
@@ -220,6 +220,69 @@ typedef enum { | |||
220 | _netxen_crb_get_bit(config_word, 1) | 220 | _netxen_crb_get_bit(config_word, 1) |
221 | #define netxen_get_gb_mii_mgmt_notvalid(config_word) \ | 221 | #define netxen_get_gb_mii_mgmt_notvalid(config_word) \ |
222 | _netxen_crb_get_bit(config_word, 2) | 222 | _netxen_crb_get_bit(config_word, 2) |
223 | /* | ||
224 | * NIU XG Pause Ctl Register | ||
225 | * | ||
226 | * Bit 0 : xg0_mask => 1:disable tx pause frames | ||
227 | * Bit 1 : xg0_request => 1:request single pause frame | ||
228 | * Bit 2 : xg0_on_off => 1:request is pause on, 0:off | ||
229 | * Bit 3 : xg1_mask => 1:disable tx pause frames | ||
230 | * Bit 4 : xg1_request => 1:request single pause frame | ||
231 | * Bit 5 : xg1_on_off => 1:request is pause on, 0:off | ||
232 | */ | ||
233 | |||
234 | #define netxen_xg_set_xg0_mask(config_word) \ | ||
235 | ((config_word) |= 1 << 0) | ||
236 | #define netxen_xg_set_xg1_mask(config_word) \ | ||
237 | ((config_word) |= 1 << 3) | ||
238 | |||
239 | #define netxen_xg_get_xg0_mask(config_word) \ | ||
240 | _netxen_crb_get_bit((config_word), 0) | ||
241 | #define netxen_xg_get_xg1_mask(config_word) \ | ||
242 | _netxen_crb_get_bit((config_word), 3) | ||
243 | |||
244 | #define netxen_xg_unset_xg0_mask(config_word) \ | ||
245 | ((config_word) &= ~(1 << 0)) | ||
246 | #define netxen_xg_unset_xg1_mask(config_word) \ | ||
247 | ((config_word) &= ~(1 << 3)) | ||
248 | |||
249 | /* | ||
250 | * NIU XG Pause Ctl Register | ||
251 | * | ||
252 | * Bit 0 : xg0_mask => 1:disable tx pause frames | ||
253 | * Bit 1 : xg0_request => 1:request single pause frame | ||
254 | * Bit 2 : xg0_on_off => 1:request is pause on, 0:off | ||
255 | * Bit 3 : xg1_mask => 1:disable tx pause frames | ||
256 | * Bit 4 : xg1_request => 1:request single pause frame | ||
257 | * Bit 5 : xg1_on_off => 1:request is pause on, 0:off | ||
258 | */ | ||
259 | #define netxen_gb_set_gb0_mask(config_word) \ | ||
260 | ((config_word) |= 1 << 0) | ||
261 | #define netxen_gb_set_gb1_mask(config_word) \ | ||
262 | ((config_word) |= 1 << 2) | ||
263 | #define netxen_gb_set_gb2_mask(config_word) \ | ||
264 | ((config_word) |= 1 << 4) | ||
265 | #define netxen_gb_set_gb3_mask(config_word) \ | ||
266 | ((config_word) |= 1 << 6) | ||
267 | |||
268 | #define netxen_gb_get_gb0_mask(config_word) \ | ||
269 | _netxen_crb_get_bit((config_word), 0) | ||
270 | #define netxen_gb_get_gb1_mask(config_word) \ | ||
271 | _netxen_crb_get_bit((config_word), 2) | ||
272 | #define netxen_gb_get_gb2_mask(config_word) \ | ||
273 | _netxen_crb_get_bit((config_word), 4) | ||
274 | #define netxen_gb_get_gb3_mask(config_word) \ | ||
275 | _netxen_crb_get_bit((config_word), 6) | ||
276 | |||
277 | #define netxen_gb_unset_gb0_mask(config_word) \ | ||
278 | ((config_word) &= ~(1 << 0)) | ||
279 | #define netxen_gb_unset_gb1_mask(config_word) \ | ||
280 | ((config_word) &= ~(1 << 2)) | ||
281 | #define netxen_gb_unset_gb2_mask(config_word) \ | ||
282 | ((config_word) &= ~(1 << 4)) | ||
283 | #define netxen_gb_unset_gb3_mask(config_word) \ | ||
284 | ((config_word) &= ~(1 << 6)) | ||
285 | |||
223 | 286 | ||
224 | /* | 287 | /* |
225 | * PHY-Specific MII control/status registers. | 288 | * PHY-Specific MII control/status registers. |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 2a3a91d2c389..3cd7e35bfbc7 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1033,7 +1033,7 @@ void netxen_watchdog_task(struct work_struct *work) | |||
1033 | struct netxen_adapter *adapter = | 1033 | struct netxen_adapter *adapter = |
1034 | container_of(work, struct netxen_adapter, watchdog_task); | 1034 | container_of(work, struct netxen_adapter, watchdog_task); |
1035 | 1035 | ||
1036 | if (netxen_nic_check_temp(adapter)) | 1036 | if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) |
1037 | return; | 1037 | return; |
1038 | 1038 | ||
1039 | netdev = adapter->netdev; | 1039 | netdev = adapter->netdev; |
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index 8510216c6b02..b213b062eb56 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c | |||
@@ -34,38 +34,38 @@ | |||
34 | #include "netxen_nic_hw.h" | 34 | #include "netxen_nic_hw.h" |
35 | #include "netxen_nic_phan_reg.h" | 35 | #include "netxen_nic_phan_reg.h" |
36 | 36 | ||
37 | #if 0 | ||
38 | /* | 37 | /* |
39 | * netxen_nic_get_stats - Get System Network Statistics | 38 | * netxen_nic_get_stats - Get System Network Statistics |
40 | * @netdev: network interface device structure | 39 | * @netdev: network interface device structure |
41 | */ | 40 | */ |
42 | struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) | 41 | struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) |
43 | { | 42 | { |
44 | struct netxen_port *port = netdev_priv(netdev); | 43 | struct netxen_adapter *adapter = netdev_priv(netdev); |
45 | struct net_device_stats *stats = &adapter->net_stats; | 44 | struct net_device_stats *stats = &adapter->net_stats; |
46 | 45 | ||
47 | memset(stats, 0, sizeof(*stats)); | 46 | memset(stats, 0, sizeof(*stats)); |
48 | 47 | ||
49 | /* total packets received */ | 48 | /* total packets received */ |
50 | stats->rx_packets = port->stats.no_rcv; | 49 | stats->rx_packets = adapter->stats.no_rcv; |
51 | /* total packets transmitted */ | 50 | /* total packets transmitted */ |
52 | stats->tx_packets = port->stats.xmitedframes + port->stats.xmitfinished; | 51 | stats->tx_packets = adapter->stats.xmitedframes + |
52 | adapter->stats.xmitfinished; | ||
53 | /* total bytes received */ | 53 | /* total bytes received */ |
54 | stats->rx_bytes = port->stats.rxbytes; | 54 | stats->rx_bytes = adapter->stats.rxbytes; |
55 | /* total bytes transmitted */ | 55 | /* total bytes transmitted */ |
56 | stats->tx_bytes = port->stats.txbytes; | 56 | stats->tx_bytes = adapter->stats.txbytes; |
57 | /* bad packets received */ | 57 | /* bad packets received */ |
58 | stats->rx_errors = port->stats.rcvdbadskb; | 58 | stats->rx_errors = adapter->stats.rcvdbadskb; |
59 | /* packet transmit problems */ | 59 | /* packet transmit problems */ |
60 | stats->tx_errors = port->stats.nocmddescriptor; | 60 | stats->tx_errors = adapter->stats.nocmddescriptor; |
61 | /* no space in linux buffers */ | 61 | /* no space in linux buffers */ |
62 | stats->rx_dropped = port->stats.updropped; | 62 | stats->rx_dropped = adapter->stats.updropped; |
63 | /* no space available in linux */ | 63 | /* no space available in linux */ |
64 | stats->tx_dropped = port->stats.txdropped; | 64 | stats->tx_dropped = adapter->stats.txdropped; |
65 | 65 | ||
66 | return stats; | 66 | return stats; |
67 | } | 67 | } |
68 | #endif | 68 | |
69 | void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link) | 69 | void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link) |
70 | { | 70 | { |
71 | struct net_device *netdev = adapter->netdev; | 71 | struct net_device *netdev = adapter->netdev; |
@@ -116,9 +116,6 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) | |||
116 | &status) == 0) { | 116 | &status) == 0) { |
117 | if (netxen_get_phy_int_link_status_changed(int_src)) { | 117 | if (netxen_get_phy_int_link_status_changed(int_src)) { |
118 | if (netxen_get_phy_link(status)) { | 118 | if (netxen_get_phy_link(status)) { |
119 | netxen_niu_gbe_init_port( | ||
120 | adapter, | ||
121 | adapter->portnum); | ||
122 | printk(KERN_INFO "%s: %s Link UP\n", | 119 | printk(KERN_INFO "%s: %s Link UP\n", |
123 | netxen_nic_driver_name, | 120 | netxen_nic_driver_name, |
124 | adapter->netdev->name); | 121 | adapter->netdev->name); |
@@ -145,7 +142,7 @@ void netxen_nic_isr_other(struct netxen_adapter *adapter) | |||
145 | 142 | ||
146 | /* verify the offset */ | 143 | /* verify the offset */ |
147 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); | 144 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); |
148 | val = val >> adapter->portnum; | 145 | val = val >> physical_port[adapter->portnum]; |
149 | if (val == adapter->ahw.qg_linksup) | 146 | if (val == adapter->ahw.qg_linksup) |
150 | return; | 147 | return; |
151 | 148 | ||
@@ -179,7 +176,7 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) | |||
179 | 176 | ||
180 | /* WINDOW = 1 */ | 177 | /* WINDOW = 1 */ |
181 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); | 178 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); |
182 | val >>= (adapter->portnum * 8); | 179 | val >>= (physical_port[adapter->portnum] * 8); |
183 | val1 = val & 0xff; | 180 | val1 = val & 0xff; |
184 | 181 | ||
185 | if (adapter->ahw.xg_linkup == 1 && val1 != XG_LINK_UP) { | 182 | if (adapter->ahw.xg_linkup == 1 && val1 != XG_LINK_UP) { |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 137fb579bd15..4e32bb678ea9 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -76,6 +76,8 @@ static void netxen_nic_poll_controller(struct net_device *netdev); | |||
76 | #endif | 76 | #endif |
77 | static irqreturn_t netxen_intr(int irq, void *data); | 77 | static irqreturn_t netxen_intr(int irq, void *data); |
78 | 78 | ||
79 | int physical_port[] = {0, 1, 2, 3}; | ||
80 | |||
79 | /* PCI Device ID Table */ | 81 | /* PCI Device ID Table */ |
80 | static struct pci_device_id netxen_pci_tbl[] __devinitdata = { | 82 | static struct pci_device_id netxen_pci_tbl[] __devinitdata = { |
81 | {PCI_DEVICE(0x4040, 0x0001)}, | 83 | {PCI_DEVICE(0x4040, 0x0001)}, |
@@ -174,6 +176,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
174 | void __iomem *mem_ptr0 = NULL; | 176 | void __iomem *mem_ptr0 = NULL; |
175 | void __iomem *mem_ptr1 = NULL; | 177 | void __iomem *mem_ptr1 = NULL; |
176 | void __iomem *mem_ptr2 = NULL; | 178 | void __iomem *mem_ptr2 = NULL; |
179 | unsigned long first_page_group_end; | ||
180 | unsigned long first_page_group_start; | ||
181 | |||
177 | 182 | ||
178 | u8 __iomem *db_ptr = NULL; | 183 | u8 __iomem *db_ptr = NULL; |
179 | unsigned long mem_base, mem_len, db_base, db_len; | 184 | unsigned long mem_base, mem_len, db_base, db_len; |
@@ -183,11 +188,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
183 | struct netxen_rcv_desc_ctx *rcv_desc = NULL; | 188 | struct netxen_rcv_desc_ctx *rcv_desc = NULL; |
184 | struct netxen_cmd_buffer *cmd_buf_arr = NULL; | 189 | struct netxen_cmd_buffer *cmd_buf_arr = NULL; |
185 | u64 mac_addr[FLASH_NUM_PORTS + 1]; | 190 | u64 mac_addr[FLASH_NUM_PORTS + 1]; |
186 | static int valid_mac = 0; | 191 | int valid_mac = 0; |
187 | static int netxen_probe_flag; | 192 | u32 val; |
188 | int pci_func_id = PCI_FUNC(pdev->devfn); | 193 | int pci_func_id = PCI_FUNC(pdev->devfn); |
189 | 194 | ||
190 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); | 195 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); |
196 | |||
191 | if (pdev->class != 0x020000) { | 197 | if (pdev->class != 0x020000) { |
192 | printk(KERN_ERR"NetXen function %d, class %x will not" | 198 | printk(KERN_ERR"NetXen function %d, class %x will not" |
193 | "be enabled.\n",pci_func_id, pdev->class); | 199 | "be enabled.\n",pci_func_id, pdev->class); |
@@ -234,19 +240,35 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
234 | 240 | ||
235 | adapter->ahw.pdev = pdev; | 241 | adapter->ahw.pdev = pdev; |
236 | adapter->ahw.pci_func = pci_func_id; | 242 | adapter->ahw.pci_func = pci_func_id; |
243 | spin_lock_init(&adapter->tx_lock); | ||
244 | spin_lock_init(&adapter->lock); | ||
237 | 245 | ||
238 | /* remap phys address */ | 246 | /* remap phys address */ |
239 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ | 247 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ |
240 | mem_len = pci_resource_len(pdev, 0); | 248 | mem_len = pci_resource_len(pdev, 0); |
241 | 249 | ||
242 | /* 128 Meg of memory */ | 250 | /* 128 Meg of memory */ |
243 | mem_ptr0 = ioremap(mem_base, FIRST_PAGE_GROUP_SIZE); | 251 | if (mem_len == NETXEN_PCI_128MB_SIZE) { |
244 | mem_ptr1 = | 252 | mem_ptr0 = ioremap(mem_base, FIRST_PAGE_GROUP_SIZE); |
245 | ioremap(mem_base + SECOND_PAGE_GROUP_START, SECOND_PAGE_GROUP_SIZE); | 253 | mem_ptr1 = ioremap(mem_base + SECOND_PAGE_GROUP_START, |
246 | mem_ptr2 = | 254 | SECOND_PAGE_GROUP_SIZE); |
247 | ioremap(mem_base + THIRD_PAGE_GROUP_START, THIRD_PAGE_GROUP_SIZE); | 255 | mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START, |
256 | THIRD_PAGE_GROUP_SIZE); | ||
257 | first_page_group_start = FIRST_PAGE_GROUP_START; | ||
258 | first_page_group_end = FIRST_PAGE_GROUP_END; | ||
259 | } else if (mem_len == NETXEN_PCI_32MB_SIZE) { | ||
260 | mem_ptr1 = ioremap(mem_base, SECOND_PAGE_GROUP_SIZE); | ||
261 | mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START - | ||
262 | SECOND_PAGE_GROUP_START, THIRD_PAGE_GROUP_SIZE); | ||
263 | first_page_group_start = 0; | ||
264 | first_page_group_end = 0; | ||
265 | } else { | ||
266 | err = -EIO; | ||
267 | goto err_out_free_netdev; | ||
268 | } | ||
248 | 269 | ||
249 | if ((mem_ptr0 == 0UL) || (mem_ptr1 == 0UL) || (mem_ptr2 == 0UL)) { | 270 | if (((mem_ptr0 == 0UL) && (mem_len == NETXEN_PCI_128MB_SIZE)) || |
271 | (mem_ptr1 == 0UL) || (mem_ptr2 == 0UL)) { | ||
250 | DPRINTK(ERR, | 272 | DPRINTK(ERR, |
251 | "Cannot remap adapter memory aborting.:" | 273 | "Cannot remap adapter memory aborting.:" |
252 | "0 -> %p, 1 -> %p, 2 -> %p\n", | 274 | "0 -> %p, 1 -> %p, 2 -> %p\n", |
@@ -276,17 +298,13 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
276 | } | 298 | } |
277 | DPRINTK(INFO, "doorbell ioremaped at %p\n", db_ptr); | 299 | DPRINTK(INFO, "doorbell ioremaped at %p\n", db_ptr); |
278 | 300 | ||
279 | adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS; | 301 | adapter->ahw.pci_base0 = mem_ptr0; |
280 | if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) || | 302 | adapter->ahw.first_page_group_start = first_page_group_start; |
281 | (adapter->ahw.boardcfg.board_type == | 303 | adapter->ahw.first_page_group_end = first_page_group_end; |
282 | NETXEN_BRDTYPE_P2_SB31_2G)) | 304 | adapter->ahw.pci_base1 = mem_ptr1; |
283 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | 305 | adapter->ahw.pci_base2 = mem_ptr2; |
284 | else | 306 | adapter->ahw.db_base = db_ptr; |
285 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS; | 307 | adapter->ahw.db_len = db_len; |
286 | adapter->max_jumbo_rx_desc_count = MAX_JUMBO_RCV_DESCRIPTORS; | ||
287 | adapter->max_lro_rx_desc_count = MAX_LRO_RCV_DESCRIPTORS; | ||
288 | |||
289 | pci_set_drvdata(pdev, netdev); | ||
290 | 308 | ||
291 | adapter->netdev = netdev; | 309 | adapter->netdev = netdev; |
292 | adapter->pdev = pdev; | 310 | adapter->pdev = pdev; |
@@ -295,6 +313,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
295 | netdev->open = netxen_nic_open; | 313 | netdev->open = netxen_nic_open; |
296 | netdev->stop = netxen_nic_close; | 314 | netdev->stop = netxen_nic_close; |
297 | netdev->hard_start_xmit = netxen_nic_xmit_frame; | 315 | netdev->hard_start_xmit = netxen_nic_xmit_frame; |
316 | netdev->get_stats = netxen_nic_get_stats; | ||
298 | netdev->set_multicast_list = netxen_nic_set_multi; | 317 | netdev->set_multicast_list = netxen_nic_set_multi; |
299 | netdev->set_mac_address = netxen_nic_set_mac; | 318 | netdev->set_mac_address = netxen_nic_set_mac; |
300 | netdev->change_mtu = netxen_nic_change_mtu; | 319 | netdev->change_mtu = netxen_nic_change_mtu; |
@@ -324,6 +343,42 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
324 | } else | 343 | } else |
325 | adapter->flags |= NETXEN_NIC_MSI_ENABLED; | 344 | adapter->flags |= NETXEN_NIC_MSI_ENABLED; |
326 | 345 | ||
346 | netdev->irq = pdev->irq; | ||
347 | INIT_WORK(&adapter->tx_timeout_task, netxen_tx_timeout_task); | ||
348 | |||
349 | /* | ||
350 | * Set the CRB window to invalid. If any register in window 0 is | ||
351 | * accessed it should set the window to 0 and then reset it to 1. | ||
352 | */ | ||
353 | adapter->curr_window = 255; | ||
354 | |||
355 | /* initialize the adapter */ | ||
356 | netxen_initialize_adapter_hw(adapter); | ||
357 | |||
358 | #ifdef CONFIG_PPC | ||
359 | if ((adapter->ahw.boardcfg.board_type == | ||
360 | NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) && | ||
361 | (pci_func_id == 2)) | ||
362 | goto err_out_free_adapter; | ||
363 | #endif /* CONFIG_PPC */ | ||
364 | |||
365 | /* | ||
366 | * Adapter in our case is quad port so initialize it before | ||
367 | * initializing the ports | ||
368 | */ | ||
369 | |||
370 | netxen_initialize_adapter_ops(adapter); | ||
371 | |||
372 | adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS_HOST; | ||
373 | if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) || | ||
374 | (adapter->ahw.boardcfg.board_type == | ||
375 | NETXEN_BRDTYPE_P2_SB31_2G)) | ||
376 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | ||
377 | else | ||
378 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS; | ||
379 | adapter->max_jumbo_rx_desc_count = MAX_JUMBO_RCV_DESCRIPTORS; | ||
380 | adapter->max_lro_rx_desc_count = MAX_LRO_RCV_DESCRIPTORS; | ||
381 | |||
327 | cmd_buf_arr = (struct netxen_cmd_buffer *)vmalloc(TX_RINGSIZE); | 382 | cmd_buf_arr = (struct netxen_cmd_buffer *)vmalloc(TX_RINGSIZE); |
328 | if (cmd_buf_arr == NULL) { | 383 | if (cmd_buf_arr == NULL) { |
329 | printk(KERN_ERR | 384 | printk(KERN_ERR |
@@ -333,6 +388,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
333 | goto err_out_free_adapter; | 388 | goto err_out_free_adapter; |
334 | } | 389 | } |
335 | memset(cmd_buf_arr, 0, TX_RINGSIZE); | 390 | memset(cmd_buf_arr, 0, TX_RINGSIZE); |
391 | adapter->cmd_buf_arr = cmd_buf_arr; | ||
336 | 392 | ||
337 | for (i = 0; i < MAX_RCV_CTX; ++i) { | 393 | for (i = 0; i < MAX_RCV_CTX; ++i) { |
338 | recv_ctx = &adapter->recv_ctx[i]; | 394 | recv_ctx = &adapter->recv_ctx[i]; |
@@ -380,23 +436,11 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
380 | 436 | ||
381 | } | 437 | } |
382 | 438 | ||
383 | adapter->cmd_buf_arr = cmd_buf_arr; | ||
384 | adapter->ahw.pci_base0 = mem_ptr0; | ||
385 | adapter->ahw.pci_base1 = mem_ptr1; | ||
386 | adapter->ahw.pci_base2 = mem_ptr2; | ||
387 | adapter->ahw.db_base = db_ptr; | ||
388 | adapter->ahw.db_len = db_len; | ||
389 | spin_lock_init(&adapter->tx_lock); | ||
390 | spin_lock_init(&adapter->lock); | ||
391 | /* initialize the adapter */ | ||
392 | netxen_initialize_adapter_hw(adapter); | ||
393 | |||
394 | netxen_initialize_adapter_ops(adapter); | ||
395 | |||
396 | netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */ | 439 | netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */ |
440 | |||
397 | /* Mezz cards have PCI function 0,2,3 enabled */ | 441 | /* Mezz cards have PCI function 0,2,3 enabled */ |
398 | if (adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) | 442 | if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) |
399 | if (pci_func_id >= 2) | 443 | && (pci_func_id >= 2)) |
400 | adapter->portnum = pci_func_id - 2; | 444 | adapter->portnum = pci_func_id - 2; |
401 | 445 | ||
402 | #ifdef CONFIG_IA64 | 446 | #ifdef CONFIG_IA64 |
@@ -407,16 +451,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
407 | } | 451 | } |
408 | #endif | 452 | #endif |
409 | 453 | ||
410 | /* | ||
411 | * Set the CRB window to invalid. If any register in window 0 is | ||
412 | * accessed it should set the window to 0 and then reset it to 1. | ||
413 | */ | ||
414 | adapter->curr_window = 255; | ||
415 | /* | ||
416 | * Adapter in our case is quad port so initialize it before | ||
417 | * initializing the ports | ||
418 | */ | ||
419 | |||
420 | init_timer(&adapter->watchdog_timer); | 454 | init_timer(&adapter->watchdog_timer); |
421 | adapter->ahw.xg_linkup = 0; | 455 | adapter->ahw.xg_linkup = 0; |
422 | adapter->watchdog_timer.function = &netxen_watchdog; | 456 | adapter->watchdog_timer.function = &netxen_watchdog; |
@@ -426,8 +460,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
426 | adapter->proc_cmd_buf_counter = 0; | 460 | adapter->proc_cmd_buf_counter = 0; |
427 | adapter->ahw.revision_id = nx_p2_id; | 461 | adapter->ahw.revision_id = nx_p2_id; |
428 | 462 | ||
463 | /* make sure Window == 1 */ | ||
464 | netxen_nic_pci_change_crbwindow(adapter, 1); | ||
465 | |||
429 | netxen_nic_update_cmd_producer(adapter, 0); | 466 | netxen_nic_update_cmd_producer(adapter, 0); |
430 | netxen_nic_update_cmd_consumer(adapter, 0); | 467 | netxen_nic_update_cmd_consumer(adapter, 0); |
468 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_HOST_CMD_ADDR_LO)); | ||
431 | 469 | ||
432 | if (netxen_is_flash_supported(adapter) == 0 && | 470 | if (netxen_is_flash_supported(adapter) == 0 && |
433 | netxen_get_flash_mac_addr(adapter, mac_addr) == 0) | 471 | netxen_get_flash_mac_addr(adapter, mac_addr) == 0) |
@@ -463,20 +501,41 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
463 | } | 501 | } |
464 | } | 502 | } |
465 | 503 | ||
466 | /* | 504 | if (adapter->portnum == 0) { |
467 | * Initialize all the CRB registers here. | ||
468 | */ | ||
469 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMD_PRODUCER_OFFSET)); | ||
470 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMD_CONSUMER_OFFSET)); | ||
471 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_HOST_CMD_ADDR_LO)); | ||
472 | |||
473 | /* do this before waking up pegs so that we have valid dummy dma addr */ | ||
474 | if (adapter->portnum == 0) | ||
475 | err = netxen_initialize_adapter_offload(adapter); | 505 | err = netxen_initialize_adapter_offload(adapter); |
476 | if (err) | 506 | if (err) |
477 | goto err_out_free_dev; | 507 | goto err_out_free_rx_buffer; |
508 | val = readl(NETXEN_CRB_NORMALIZE(adapter, | ||
509 | NETXEN_CAM_RAM(0x1fc))); | ||
510 | if (val == 0x55555555) { | ||
511 | /* This is the first boot after power up */ | ||
512 | val = readl(NETXEN_CRB_NORMALIZE(adapter, | ||
513 | NETXEN_ROMUSB_GLB_SW_RESET)); | ||
514 | printk(KERN_INFO"NetXen: read 0x%08x for reset reg.\n",val); | ||
515 | if (val != 0x80000f) { | ||
516 | /* clear the register for future unloads/loads */ | ||
517 | writel(0, NETXEN_CRB_NORMALIZE(adapter, | ||
518 | NETXEN_CAM_RAM(0x1fc))); | ||
519 | printk(KERN_ERR "ERROR in NetXen HW init sequence.\n"); | ||
520 | err = -ENODEV; | ||
521 | goto err_out_free_dev; | ||
522 | } | ||
523 | |||
524 | /* clear the register for future unloads/loads */ | ||
525 | writel(0, NETXEN_CRB_NORMALIZE(adapter, | ||
526 | NETXEN_CAM_RAM(0x1fc))); | ||
527 | } | ||
528 | printk(KERN_INFO "State: 0x%0x\n", | ||
529 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | ||
530 | |||
531 | /* | ||
532 | * Tell the hardware our version number. | ||
533 | */ | ||
534 | i = (_NETXEN_NIC_LINUX_MAJOR << 16) | ||
535 | | ((_NETXEN_NIC_LINUX_MINOR << 8)) | ||
536 | | (_NETXEN_NIC_LINUX_SUBVERSION); | ||
537 | writel(i, NETXEN_CRB_NORMALIZE(adapter, CRB_DRIVER_VERSION)); | ||
478 | 538 | ||
479 | if (netxen_probe_flag == 0) { | ||
480 | /* Unlock the HW, prompting the boot sequence */ | 539 | /* Unlock the HW, prompting the boot sequence */ |
481 | writel(1, | 540 | writel(1, |
482 | NETXEN_CRB_NORMALIZE(adapter, | 541 | NETXEN_CRB_NORMALIZE(adapter, |
@@ -485,26 +544,25 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
485 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | 544 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); |
486 | } | 545 | } |
487 | 546 | ||
488 | if(netxen_probe_flag == 0) { | ||
489 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); | ||
490 | netxen_pinit_from_rom(adapter, 0); | ||
491 | udelay(500); | ||
492 | netxen_load_firmware(adapter); | ||
493 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | ||
494 | } | ||
495 | /* | 547 | /* |
496 | * delay a while to ensure that the Pegs are up & running. | 548 | * See if the firmware gave us a virtual-physical port mapping. |
497 | * Otherwise, we might see some flaky behaviour. | ||
498 | */ | 549 | */ |
499 | udelay(100); | 550 | i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); |
500 | INIT_WORK(&adapter->tx_timeout_task, netxen_tx_timeout_task); | 551 | if (i != 0x55555555) |
501 | netxen_nic_erase_pxe(adapter); | 552 | physical_port[adapter->portnum] = i; |
553 | |||
502 | netif_carrier_off(netdev); | 554 | netif_carrier_off(netdev); |
503 | netif_stop_queue(netdev); | 555 | netif_stop_queue(netdev); |
504 | 556 | ||
505 | if((err = register_netdev(netdev))) | 557 | if ((err = register_netdev(netdev))) { |
506 | DPRINTK(1, ERR, "register_netdev failed port #%d" | 558 | printk(KERN_ERR "%s: register_netdev failed port #%d" |
507 | " aborting\n", i+1); | 559 | " aborting\n", netxen_nic_driver_name, |
560 | adapter->portnum); | ||
561 | err = -EIO; | ||
562 | goto err_out_free_dev; | ||
563 | } | ||
564 | |||
565 | pci_set_drvdata(pdev, adapter); | ||
508 | 566 | ||
509 | switch (adapter->ahw.board_type) { | 567 | switch (adapter->ahw.board_type) { |
510 | case NETXEN_NIC_GBE: | 568 | case NETXEN_NIC_GBE: |
@@ -519,21 +577,14 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
519 | } | 577 | } |
520 | 578 | ||
521 | adapter->driver_mismatch = 0; | 579 | adapter->driver_mismatch = 0; |
522 | if(netxen_probe_flag == 0) | ||
523 | netxen_probe_flag ++; | ||
524 | 580 | ||
525 | return 0; | 581 | return 0; |
526 | 582 | ||
527 | err_out_free_dev: | 583 | err_out_free_dev: |
528 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) | 584 | if (adapter->portnum == 0) |
529 | pci_disable_msi(pdev); | 585 | netxen_free_adapter_offload(adapter); |
530 | |||
531 | unregister_netdev(adapter->netdev); | ||
532 | free_netdev(adapter->netdev); | ||
533 | |||
534 | netxen_free_adapter_offload(adapter); | ||
535 | 586 | ||
536 | err_out_free_rx_buffer: | 587 | err_out_free_rx_buffer: |
537 | for (i = 0; i < MAX_RCV_CTX; ++i) { | 588 | for (i = 0; i < MAX_RCV_CTX; ++i) { |
538 | recv_ctx = &adapter->recv_ctx[i]; | 589 | recv_ctx = &adapter->recv_ctx[i]; |
539 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { | 590 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { |
@@ -546,14 +597,16 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
546 | } | 597 | } |
547 | vfree(cmd_buf_arr); | 598 | vfree(cmd_buf_arr); |
548 | 599 | ||
549 | err_out_free_adapter: | 600 | err_out_free_adapter: |
601 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) | ||
602 | pci_disable_msi(pdev); | ||
603 | |||
550 | pci_set_drvdata(pdev, NULL); | 604 | pci_set_drvdata(pdev, NULL); |
551 | kfree(adapter); | ||
552 | 605 | ||
553 | if (db_ptr) | 606 | if (db_ptr) |
554 | iounmap(db_ptr); | 607 | iounmap(db_ptr); |
555 | 608 | ||
556 | err_out_iounmap: | 609 | err_out_iounmap: |
557 | if (mem_ptr0) | 610 | if (mem_ptr0) |
558 | iounmap(mem_ptr0); | 611 | iounmap(mem_ptr0); |
559 | if (mem_ptr1) | 612 | if (mem_ptr1) |
@@ -561,9 +614,13 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
561 | if (mem_ptr2) | 614 | if (mem_ptr2) |
562 | iounmap(mem_ptr2); | 615 | iounmap(mem_ptr2); |
563 | 616 | ||
564 | err_out_free_res: | 617 | err_out_free_netdev: |
618 | free_netdev(netdev); | ||
619 | |||
620 | err_out_free_res: | ||
565 | pci_release_regions(pdev); | 621 | pci_release_regions(pdev); |
566 | err_out_disable_pdev: | 622 | |
623 | err_out_disable_pdev: | ||
567 | pci_disable_device(pdev); | 624 | pci_disable_device(pdev); |
568 | return err; | 625 | return err; |
569 | } | 626 | } |
@@ -578,36 +635,39 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
578 | int i; | 635 | int i; |
579 | int ctxid, ring; | 636 | int ctxid, ring; |
580 | 637 | ||
581 | netdev = pci_get_drvdata(pdev); | 638 | adapter = pci_get_drvdata(pdev); |
582 | adapter = netdev_priv(netdev); | ||
583 | if (adapter == NULL) | 639 | if (adapter == NULL) |
584 | return; | 640 | return; |
585 | 641 | ||
642 | netdev = adapter->netdev; | ||
643 | |||
644 | netxen_nic_disable_int(adapter); | ||
645 | if (adapter->irq) | ||
646 | free_irq(adapter->irq, adapter); | ||
647 | |||
586 | if (adapter->stop_port) | 648 | if (adapter->stop_port) |
587 | adapter->stop_port(adapter); | 649 | adapter->stop_port(adapter); |
588 | 650 | ||
651 | if ((adapter->flags & NETXEN_NIC_MSI_ENABLED)) | ||
652 | pci_disable_msi(pdev); | ||
653 | |||
654 | if (adapter->portnum == 0) | ||
655 | netxen_free_adapter_offload(adapter); | ||
656 | |||
589 | if (adapter->irq) | 657 | if (adapter->irq) |
590 | free_irq(adapter->irq, adapter); | 658 | free_irq(adapter->irq, adapter); |
591 | if(adapter->portnum == 0) { | 659 | if(adapter->portnum == 0) { |
592 | /* leave the hw in the same state as reboot */ | 660 | /* leave the hw in the same state as reboot */ |
593 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); | 661 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); |
594 | netxen_pinit_from_rom(adapter, 0); | 662 | netxen_pinit_from_rom(adapter, 0); |
663 | udelay(500); | ||
595 | netxen_load_firmware(adapter); | 664 | netxen_load_firmware(adapter); |
596 | netxen_free_adapter_offload(adapter); | 665 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); |
597 | } | 666 | } |
598 | 667 | ||
599 | udelay(500); | ||
600 | |||
601 | if ((adapter->flags & NETXEN_NIC_MSI_ENABLED)) | ||
602 | pci_disable_msi(pdev); | ||
603 | if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) | 668 | if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) |
604 | netxen_free_hw_resources(adapter); | 669 | netxen_free_hw_resources(adapter); |
605 | 670 | ||
606 | iounmap(adapter->ahw.db_base); | ||
607 | iounmap(adapter->ahw.pci_base0); | ||
608 | iounmap(adapter->ahw.pci_base1); | ||
609 | iounmap(adapter->ahw.pci_base2); | ||
610 | |||
611 | for (ctxid = 0; ctxid < MAX_RCV_CTX; ++ctxid) { | 671 | for (ctxid = 0; ctxid < MAX_RCV_CTX; ++ctxid) { |
612 | recv_ctx = &adapter->recv_ctx[ctxid]; | 672 | recv_ctx = &adapter->recv_ctx[ctxid]; |
613 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { | 673 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { |
@@ -626,14 +686,20 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
626 | } | 686 | } |
627 | } | 687 | } |
628 | 688 | ||
629 | vfree(adapter->cmd_buf_arr); | ||
630 | unregister_netdev(netdev); | 689 | unregister_netdev(netdev); |
631 | free_netdev(netdev); | 690 | |
691 | vfree(adapter->cmd_buf_arr); | ||
692 | |||
693 | iounmap(adapter->ahw.db_base); | ||
694 | iounmap(adapter->ahw.pci_base0); | ||
695 | iounmap(adapter->ahw.pci_base1); | ||
696 | iounmap(adapter->ahw.pci_base2); | ||
632 | 697 | ||
633 | pci_release_regions(pdev); | 698 | pci_release_regions(pdev); |
634 | pci_disable_device(pdev); | 699 | pci_disable_device(pdev); |
635 | pci_set_drvdata(pdev, NULL); | 700 | pci_set_drvdata(pdev, NULL); |
636 | 701 | ||
702 | free_netdev(netdev); | ||
637 | } | 703 | } |
638 | 704 | ||
639 | /* | 705 | /* |
@@ -668,9 +734,9 @@ static int netxen_nic_open(struct net_device *netdev) | |||
668 | netxen_post_rx_buffers(adapter, ctx, ring); | 734 | netxen_post_rx_buffers(adapter, ctx, ring); |
669 | } | 735 | } |
670 | adapter->irq = adapter->ahw.pdev->irq; | 736 | adapter->irq = adapter->ahw.pdev->irq; |
671 | err = request_irq(adapter->ahw.pdev->irq, &netxen_intr, | 737 | err = request_irq(adapter->ahw.pdev->irq, netxen_intr, |
672 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, | 738 | SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, |
673 | netdev->name, adapter); | 739 | adapter); |
674 | if (err) { | 740 | if (err) { |
675 | printk(KERN_ERR "request_irq failed with: %d\n", err); | 741 | printk(KERN_ERR "request_irq failed with: %d\n", err); |
676 | netxen_free_hw_resources(adapter); | 742 | netxen_free_hw_resources(adapter); |
@@ -690,10 +756,9 @@ static int netxen_nic_open(struct net_device *netdev) | |||
690 | adapter->macaddr_set(adapter, netdev->dev_addr); | 756 | adapter->macaddr_set(adapter, netdev->dev_addr); |
691 | if (adapter->init_port | 757 | if (adapter->init_port |
692 | && adapter->init_port(adapter, adapter->portnum) != 0) { | 758 | && adapter->init_port(adapter, adapter->portnum) != 0) { |
759 | del_timer_sync(&adapter->watchdog_timer); | ||
693 | printk(KERN_ERR "%s: Failed to initialize port %d\n", | 760 | printk(KERN_ERR "%s: Failed to initialize port %d\n", |
694 | netxen_nic_driver_name, adapter->portnum); | 761 | netxen_nic_driver_name, adapter->portnum); |
695 | free_irq(adapter->irq, adapter); | ||
696 | netxen_free_hw_resources(adapter); | ||
697 | return -EIO; | 762 | return -EIO; |
698 | } | 763 | } |
699 | 764 | ||
@@ -722,10 +787,6 @@ static int netxen_nic_close(struct net_device *netdev) | |||
722 | netif_carrier_off(netdev); | 787 | netif_carrier_off(netdev); |
723 | netif_stop_queue(netdev); | 788 | netif_stop_queue(netdev); |
724 | 789 | ||
725 | netxen_nic_disable_int(adapter); | ||
726 | if (adapter->irq) | ||
727 | free_irq(adapter->irq, adapter); | ||
728 | |||
729 | cmd_buff = adapter->cmd_buf_arr; | 790 | cmd_buff = adapter->cmd_buf_arr; |
730 | for (i = 0; i < adapter->max_tx_desc_count; i++) { | 791 | for (i = 0; i < adapter->max_tx_desc_count; i++) { |
731 | buffrag = cmd_buff->frag_array; | 792 | buffrag = cmd_buff->frag_array; |
@@ -879,6 +940,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
879 | netxen_set_cmd_desc_opcode(hwdesc, TX_ETHER_PKT); | 940 | netxen_set_cmd_desc_opcode(hwdesc, TX_ETHER_PKT); |
880 | 941 | ||
881 | netxen_set_cmd_desc_port(hwdesc, adapter->portnum); | 942 | netxen_set_cmd_desc_port(hwdesc, adapter->portnum); |
943 | netxen_set_cmd_desc_ctxid(hwdesc, adapter->portnum); | ||
882 | hwdesc->buffer1_length = cpu_to_le16(first_seg_len); | 944 | hwdesc->buffer1_length = cpu_to_le16(first_seg_len); |
883 | hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); | 945 | hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); |
884 | 946 | ||
@@ -968,9 +1030,18 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
968 | producer = get_next_index(producer, max_tx_desc_count); | 1030 | producer = get_next_index(producer, max_tx_desc_count); |
969 | } | 1031 | } |
970 | } | 1032 | } |
1033 | |||
1034 | i = netxen_get_cmd_desc_totallength(&hw->cmd_desc_head[saved_producer]); | ||
1035 | |||
1036 | hw->cmd_desc_head[saved_producer].flags_opcode = | ||
1037 | cpu_to_le16(hw->cmd_desc_head[saved_producer].flags_opcode); | ||
1038 | hw->cmd_desc_head[saved_producer].num_of_buffers_total_length = | ||
1039 | cpu_to_le32(hw->cmd_desc_head[saved_producer]. | ||
1040 | num_of_buffers_total_length); | ||
1041 | |||
971 | spin_lock_bh(&adapter->tx_lock); | 1042 | spin_lock_bh(&adapter->tx_lock); |
972 | adapter->stats.txbytes += | 1043 | adapter->stats.txbytes += i; |
973 | netxen_get_cmd_desc_totallength(&hw->cmd_desc_head[saved_producer]); | 1044 | |
974 | /* Code to update the adapter considering how many producer threads | 1045 | /* Code to update the adapter considering how many producer threads |
975 | are currently working */ | 1046 | are currently working */ |
976 | if ((--adapter->num_threads) == 0) { | 1047 | if ((--adapter->num_threads) == 0) { |
@@ -1010,18 +1081,17 @@ static void netxen_tx_timeout_task(struct work_struct *work) | |||
1010 | { | 1081 | { |
1011 | struct netxen_adapter *adapter = | 1082 | struct netxen_adapter *adapter = |
1012 | container_of(work, struct netxen_adapter, tx_timeout_task); | 1083 | container_of(work, struct netxen_adapter, tx_timeout_task); |
1013 | struct net_device *netdev = adapter->netdev; | ||
1014 | unsigned long flags; | 1084 | unsigned long flags; |
1015 | 1085 | ||
1016 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", | 1086 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", |
1017 | netxen_nic_driver_name, netdev->name); | 1087 | netxen_nic_driver_name, adapter->netdev->name); |
1018 | 1088 | ||
1019 | spin_lock_irqsave(&adapter->lock, flags); | 1089 | spin_lock_irqsave(&adapter->lock, flags); |
1020 | netxen_nic_close(netdev); | 1090 | netxen_nic_close(adapter->netdev); |
1021 | netxen_nic_open(netdev); | 1091 | netxen_nic_open(adapter->netdev); |
1022 | spin_unlock_irqrestore(&adapter->lock, flags); | 1092 | spin_unlock_irqrestore(&adapter->lock, flags); |
1023 | netdev->trans_start = jiffies; | 1093 | adapter->netdev->trans_start = jiffies; |
1024 | netif_wake_queue(netdev); | 1094 | netif_wake_queue(adapter->netdev); |
1025 | } | 1095 | } |
1026 | 1096 | ||
1027 | static int | 1097 | static int |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index ad2486f2f646..cef90a78351e 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -94,7 +94,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
94 | long timeout = 0; | 94 | long timeout = 0; |
95 | long result = 0; | 95 | long result = 0; |
96 | long restore = 0; | 96 | long restore = 0; |
97 | long phy = adapter->portnum; | 97 | long phy = physical_port[adapter->portnum]; |
98 | __u32 address; | 98 | __u32 address; |
99 | __u32 command; | 99 | __u32 command; |
100 | __u32 status; | 100 | __u32 status; |
@@ -190,7 +190,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, | |||
190 | long timeout = 0; | 190 | long timeout = 0; |
191 | long result = 0; | 191 | long result = 0; |
192 | long restore = 0; | 192 | long restore = 0; |
193 | long phy = adapter->portnum; | 193 | long phy = physical_port[adapter->portnum]; |
194 | __u32 address; | 194 | __u32 address; |
195 | __u32 command; | 195 | __u32 command; |
196 | __u32 status; | 196 | __u32 status; |
@@ -454,16 +454,18 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) | |||
454 | 454 | ||
455 | int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) | 455 | int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) |
456 | { | 456 | { |
457 | u32 ret = 0; | 457 | u32 reg; |
458 | int portnum = adapter->portnum; | 458 | u32 portnum = physical_port[adapter->portnum]; |
459 | netxen_crb_writelit_adapter(adapter, | 459 | |
460 | NETXEN_NIU_XGE_CONFIG_1 +(0x10000 * portnum), | 460 | netxen_crb_writelit_adapter(adapter, |
461 | 0x1447); | 461 | NETXEN_NIU_XGE_CONFIG_0+(0x10000*portnum), 0x5); |
462 | netxen_crb_writelit_adapter(adapter, | 462 | netxen_nic_hw_read_wx(adapter, |
463 | NETXEN_NIU_XG1_CONFIG_1 + | 463 | NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), ®, 4); |
464 | (0x10000 * portnum), 0x5); | 464 | reg = (reg & ~0x2000UL); |
465 | netxen_crb_writelit_adapter(adapter, | ||
466 | NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), reg); | ||
465 | 467 | ||
466 | return ret; | 468 | return 0; |
467 | } | 469 | } |
468 | 470 | ||
469 | /* | 471 | /* |
@@ -571,7 +573,7 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
571 | { | 573 | { |
572 | u32 stationhigh; | 574 | u32 stationhigh; |
573 | u32 stationlow; | 575 | u32 stationlow; |
574 | int phy = adapter->portnum; | 576 | int phy = physical_port[adapter->portnum]; |
575 | u8 val[8]; | 577 | u8 val[8]; |
576 | 578 | ||
577 | if (addr == NULL) | 579 | if (addr == NULL) |
@@ -602,7 +604,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
602 | { | 604 | { |
603 | u8 temp[4]; | 605 | u8 temp[4]; |
604 | u32 val; | 606 | u32 val; |
605 | int phy = adapter->portnum; | 607 | int phy = physical_port[adapter->portnum]; |
606 | unsigned char mac_addr[6]; | 608 | unsigned char mac_addr[6]; |
607 | int i; | 609 | int i; |
608 | 610 | ||
@@ -724,8 +726,10 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
724 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | 726 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) |
725 | { | 727 | { |
726 | __u32 mac_cfg0; | 728 | __u32 mac_cfg0; |
727 | int port = adapter->portnum; | 729 | u32 port = physical_port[adapter->portnum]; |
728 | 730 | ||
731 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | ||
732 | return -EINVAL; | ||
729 | mac_cfg0 = 0; | 733 | mac_cfg0 = 0; |
730 | netxen_gb_soft_reset(mac_cfg0); | 734 | netxen_gb_soft_reset(mac_cfg0); |
731 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), | 735 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
@@ -738,7 +742,10 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | |||
738 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | 742 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) |
739 | { | 743 | { |
740 | __u32 mac_cfg; | 744 | __u32 mac_cfg; |
745 | u32 port = physical_port[adapter->portnum]; | ||
741 | 746 | ||
747 | if (port != 0) | ||
748 | return -EINVAL; | ||
742 | mac_cfg = 0; | 749 | mac_cfg = 0; |
743 | netxen_xg_soft_reset(mac_cfg); | 750 | netxen_xg_soft_reset(mac_cfg); |
744 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0, | 751 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0, |
@@ -752,7 +759,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
752 | netxen_niu_prom_mode_t mode) | 759 | netxen_niu_prom_mode_t mode) |
753 | { | 760 | { |
754 | __u32 reg; | 761 | __u32 reg; |
755 | int port = adapter->portnum; | 762 | u32 port = physical_port[adapter->portnum]; |
756 | 763 | ||
757 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 764 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
758 | return -EINVAL; | 765 | return -EINVAL; |
@@ -809,21 +816,47 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
809 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | 816 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, |
810 | netxen_ethernet_macaddr_t addr) | 817 | netxen_ethernet_macaddr_t addr) |
811 | { | 818 | { |
819 | int phy = physical_port[adapter->portnum]; | ||
812 | u8 temp[4]; | 820 | u8 temp[4]; |
813 | u32 val; | 821 | u32 val; |
814 | 822 | ||
823 | if ((phy < 0) || (phy > NETXEN_NIU_MAX_XG_PORTS)) | ||
824 | return -EIO; | ||
825 | |||
815 | temp[0] = temp[1] = 0; | 826 | temp[0] = temp[1] = 0; |
816 | memcpy(temp + 2, addr, 2); | 827 | switch (phy) { |
817 | val = le32_to_cpu(*(__le32 *)temp); | 828 | case 0: |
818 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 829 | memcpy(temp + 2, addr, 2); |
819 | &val, 4)) | 830 | val = le32_to_cpu(*(__le32 *)temp); |
831 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | ||
832 | &val, 4)) | ||
820 | return -EIO; | 833 | return -EIO; |
821 | 834 | ||
822 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | 835 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); |
823 | val = le32_to_cpu(*(__le32 *)temp); | 836 | val = le32_to_cpu(*(__le32 *)temp); |
824 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, | 837 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, |
825 | &val, 4)) | 838 | &val, 4)) |
839 | return -EIO; | ||
840 | break; | ||
841 | |||
842 | case 1: | ||
843 | memcpy(temp + 2, addr, 2); | ||
844 | val = le32_to_cpu(*(__le32 *)temp); | ||
845 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XG1_STATION_ADDR_0_1, | ||
846 | &val, 4)) | ||
847 | return -EIO; | ||
848 | |||
849 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | ||
850 | val = le32_to_cpu(*(__le32 *)temp); | ||
851 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XG1_STATION_ADDR_0_HI, | ||
852 | &val, 4)) | ||
826 | return -EIO; | 853 | return -EIO; |
854 | break; | ||
855 | |||
856 | default: | ||
857 | printk(KERN_ERR "Unknown port %d\n", phy); | ||
858 | break; | ||
859 | } | ||
827 | 860 | ||
828 | return 0; | 861 | return 0; |
829 | } | 862 | } |
@@ -835,7 +868,7 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | |||
835 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, | 868 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, |
836 | netxen_ethernet_macaddr_t * addr) | 869 | netxen_ethernet_macaddr_t * addr) |
837 | { | 870 | { |
838 | int phy = adapter->portnum; | 871 | int phy = physical_port[adapter->portnum]; |
839 | u32 stationhigh; | 872 | u32 stationhigh; |
840 | u32 stationlow; | 873 | u32 stationlow; |
841 | u8 val[8]; | 874 | u8 val[8]; |
@@ -863,21 +896,21 @@ int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
863 | netxen_niu_prom_mode_t mode) | 896 | netxen_niu_prom_mode_t mode) |
864 | { | 897 | { |
865 | __u32 reg; | 898 | __u32 reg; |
866 | int port = adapter->portnum; | 899 | u32 port = physical_port[adapter->portnum]; |
867 | 900 | ||
868 | if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) | 901 | if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) |
869 | return -EINVAL; | 902 | return -EINVAL; |
870 | 903 | ||
871 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_CONFIG_1 + | 904 | if (netxen_nic_hw_read_wx(adapter, |
872 | (0x10000 * port), ®, 4)) | 905 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), ®, 4)) |
873 | return -EIO; | 906 | return -EIO; |
874 | if (mode == NETXEN_NIU_PROMISC_MODE) | 907 | if (mode == NETXEN_NIU_PROMISC_MODE) |
875 | reg = (reg | 0x2000UL); | 908 | reg = (reg | 0x2000UL); |
876 | else | 909 | else |
877 | reg = (reg & ~0x2000UL); | 910 | reg = (reg & ~0x2000UL); |
878 | 911 | ||
879 | netxen_crb_writelit_adapter(adapter, NETXEN_NIU_XGE_CONFIG_1 + | 912 | netxen_crb_writelit_adapter(adapter, |
880 | (0x10000 * port), reg); | 913 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg); |
881 | 914 | ||
882 | return 0; | 915 | return 0; |
883 | } | 916 | } |
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h index 12bcaf9743bb..9457fc7249c8 100644 --- a/drivers/net/netxen/netxen_nic_phan_reg.h +++ b/drivers/net/netxen/netxen_nic_phan_reg.h | |||
@@ -108,6 +108,13 @@ | |||
108 | #define CRB_CMD_CONSUMER_OFFSET_3 NETXEN_NIC_REG(0x1d4) | 108 | #define CRB_CMD_CONSUMER_OFFSET_3 NETXEN_NIC_REG(0x1d4) |
109 | #define CRB_TEMP_STATE NETXEN_NIC_REG(0x1b4) | 109 | #define CRB_TEMP_STATE NETXEN_NIC_REG(0x1b4) |
110 | 110 | ||
111 | #define CRB_V2P_0 NETXEN_NIC_REG(0x290) | ||
112 | #define CRB_V2P_1 NETXEN_NIC_REG(0x294) | ||
113 | #define CRB_V2P_2 NETXEN_NIC_REG(0x298) | ||
114 | #define CRB_V2P_3 NETXEN_NIC_REG(0x29c) | ||
115 | #define CRB_V2P(port) (CRB_V2P_0+((port)*4)) | ||
116 | #define CRB_DRIVER_VERSION NETXEN_NIC_REG(0x2a0) | ||
117 | |||
111 | /* used for ethtool tests */ | 118 | /* used for ethtool tests */ |
112 | #define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280) | 119 | #define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280) |
113 | 120 | ||