aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 85e28e60ecf..a945591298a 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -19,7 +19,7 @@
19 * MA 02111-1307, USA. 19 * MA 02111-1307, USA.
20 * 20 *
21 * The full GNU General Public License is included in this distribution 21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE. 22 * in the file called "COPYING".
23 * 23 *
24 */ 24 */
25 25
@@ -539,7 +539,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
539 struct netxen_adapter *adapter = netdev_priv(netdev); 539 struct netxen_adapter *adapter = netdev_priv(netdev);
540 struct dev_mc_list *mc_ptr; 540 struct dev_mc_list *mc_ptr;
541 u8 null_addr[6]; 541 u8 null_addr[6];
542 int index = 0; 542 int i;
543 543
544 memset(null_addr, 0, 6); 544 memset(null_addr, 0, 6);
545 545
@@ -554,7 +554,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
554 return; 554 return;
555 } 555 }
556 556
557 if (netdev->mc_count == 0) { 557 if (netdev_mc_empty(netdev)) {
558 adapter->set_promisc(adapter, 558 adapter->set_promisc(adapter,
559 NETXEN_NIU_NON_PROMISC_MODE); 559 NETXEN_NIU_NON_PROMISC_MODE);
560 netxen_nic_disable_mcast_filter(adapter); 560 netxen_nic_disable_mcast_filter(adapter);
@@ -563,23 +563,20 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
563 563
564 adapter->set_promisc(adapter, NETXEN_NIU_ALLMULTI_MODE); 564 adapter->set_promisc(adapter, NETXEN_NIU_ALLMULTI_MODE);
565 if (netdev->flags & IFF_ALLMULTI || 565 if (netdev->flags & IFF_ALLMULTI ||
566 netdev->mc_count > adapter->max_mc_count) { 566 netdev_mc_count(netdev) > adapter->max_mc_count) {
567 netxen_nic_disable_mcast_filter(adapter); 567 netxen_nic_disable_mcast_filter(adapter);
568 return; 568 return;
569 } 569 }
570 570
571 netxen_nic_enable_mcast_filter(adapter); 571 netxen_nic_enable_mcast_filter(adapter);
572 572
573 for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next, index++) 573 i = 0;
574 netxen_nic_set_mcast_addr(adapter, index, mc_ptr->dmi_addr); 574 netdev_for_each_mc_addr(mc_ptr, netdev)
575 575 netxen_nic_set_mcast_addr(adapter, i++, mc_ptr->dmi_addr);
576 if (index != netdev->mc_count)
577 printk(KERN_WARNING "%s: %s multicast address count mismatch\n",
578 netxen_nic_driver_name, netdev->name);
579 576
580 /* Clear out remaining addresses */ 577 /* Clear out remaining addresses */
581 for (; index < adapter->max_mc_count; index++) 578 while (i < adapter->max_mc_count)
582 netxen_nic_set_mcast_addr(adapter, index, null_addr); 579 netxen_nic_set_mcast_addr(adapter, i++, null_addr);
583} 580}
584 581
585static int 582static int
@@ -704,16 +701,14 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
704 } 701 }
705 702
706 if ((netdev->flags & IFF_ALLMULTI) || 703 if ((netdev->flags & IFF_ALLMULTI) ||
707 (netdev->mc_count > adapter->max_mc_count)) { 704 (netdev_mc_count(netdev) > adapter->max_mc_count)) {
708 mode = VPORT_MISS_MODE_ACCEPT_MULTI; 705 mode = VPORT_MISS_MODE_ACCEPT_MULTI;
709 goto send_fw_cmd; 706 goto send_fw_cmd;
710 } 707 }
711 708
712 if (netdev->mc_count > 0) { 709 if (!netdev_mc_empty(netdev)) {
713 for (mc_ptr = netdev->mc_list; mc_ptr; 710 netdev_for_each_mc_addr(mc_ptr, netdev)
714 mc_ptr = mc_ptr->next) {
715 nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, &del_list); 711 nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, &del_list);
716 }
717 } 712 }
718 713
719send_fw_cmd: 714send_fw_cmd:
@@ -777,17 +772,20 @@ int netxen_p3_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr)
777int netxen_config_intr_coalesce(struct netxen_adapter *adapter) 772int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
778{ 773{
779 nx_nic_req_t req; 774 nx_nic_req_t req;
780 u64 word; 775 u64 word[6];
781 int rv; 776 int rv, i;
782 777
783 memset(&req, 0, sizeof(nx_nic_req_t)); 778 memset(&req, 0, sizeof(nx_nic_req_t));
779 memset(word, 0, sizeof(word));
784 780
785 req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); 781 req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23);
786 782
787 word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16); 783 word[0] = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16);
788 req.req_hdr = cpu_to_le64(word); 784 req.req_hdr = cpu_to_le64(word[0]);
789 785
790 memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); 786 memcpy(&word[0], &adapter->coal, sizeof(adapter->coal));
787 for (i = 0; i < 6; i++)
788 req.words[i] = cpu_to_le64(word[i]);
791 789
792 rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); 790 rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
793 if (rv != 0) { 791 if (rv != 0) {
@@ -1033,7 +1031,7 @@ static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
1033 return 0; 1031 return 0;
1034} 1032}
1035 1033
1036int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac) 1034int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 *mac)
1037{ 1035{
1038 __le32 *pmac = (__le32 *) mac; 1036 __le32 *pmac = (__le32 *) mac;
1039 u32 offset; 1037 u32 offset;
@@ -1058,7 +1056,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac)
1058 return 0; 1056 return 0;
1059} 1057}
1060 1058
1061int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac) 1059int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, u64 *mac)
1062{ 1060{
1063 uint32_t crbaddr, mac_hi, mac_lo; 1061 uint32_t crbaddr, mac_hi, mac_lo;
1064 int pci_func = adapter->ahw.pci_func; 1062 int pci_func = adapter->ahw.pci_func;