diff options
Diffstat (limited to 'drivers/net/enic')
-rw-r--r-- | drivers/net/enic/cq_enet_desc.h | 12 | ||||
-rw-r--r-- | drivers/net/enic/enic.h | 4 | ||||
-rw-r--r-- | drivers/net/enic/enic_main.c | 11 | ||||
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 52 | ||||
-rw-r--r-- | drivers/net/enic/vnic_dev.h | 3 | ||||
-rw-r--r-- | drivers/net/enic/vnic_rq.c | 4 | ||||
-rw-r--r-- | drivers/net/enic/vnic_wq.c | 4 |
7 files changed, 63 insertions, 27 deletions
diff --git a/drivers/net/enic/cq_enet_desc.h b/drivers/net/enic/cq_enet_desc.h index 03dce9ed612c..337d1943af46 100644 --- a/drivers/net/enic/cq_enet_desc.h +++ b/drivers/net/enic/cq_enet_desc.h | |||
@@ -101,14 +101,18 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc, | |||
101 | u8 *tcp_udp_csum_ok, u8 *udp, u8 *tcp, u8 *ipv4_csum_ok, | 101 | u8 *tcp_udp_csum_ok, u8 *udp, u8 *tcp, u8 *ipv4_csum_ok, |
102 | u8 *ipv6, u8 *ipv4, u8 *ipv4_fragment, u8 *fcs_ok) | 102 | u8 *ipv6, u8 *ipv4, u8 *ipv4_fragment, u8 *fcs_ok) |
103 | { | 103 | { |
104 | u16 completed_index_flags = le16_to_cpu(desc->completed_index_flags); | 104 | u16 completed_index_flags; |
105 | u16 q_number_rss_type_flags = | 105 | u16 q_number_rss_type_flags; |
106 | le16_to_cpu(desc->q_number_rss_type_flags); | 106 | u16 bytes_written_flags; |
107 | u16 bytes_written_flags = le16_to_cpu(desc->bytes_written_flags); | ||
108 | 107 | ||
109 | cq_desc_dec((struct cq_desc *)desc, type, | 108 | cq_desc_dec((struct cq_desc *)desc, type, |
110 | color, q_number, completed_index); | 109 | color, q_number, completed_index); |
111 | 110 | ||
111 | completed_index_flags = le16_to_cpu(desc->completed_index_flags); | ||
112 | q_number_rss_type_flags = | ||
113 | le16_to_cpu(desc->q_number_rss_type_flags); | ||
114 | bytes_written_flags = le16_to_cpu(desc->bytes_written_flags); | ||
115 | |||
112 | *ingress_port = (completed_index_flags & | 116 | *ingress_port = (completed_index_flags & |
113 | CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT) ? 1 : 0; | 117 | CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT) ? 1 : 0; |
114 | *fcoe = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_FCOE) ? | 118 | *fcoe = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_FCOE) ? |
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index ee01f5a6d0d4..5fa56f1e5590 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -33,8 +33,8 @@ | |||
33 | #include "vnic_rss.h" | 33 | #include "vnic_rss.h" |
34 | 34 | ||
35 | #define DRV_NAME "enic" | 35 | #define DRV_NAME "enic" |
36 | #define DRV_DESCRIPTION "Cisco 10G Ethernet Driver" | 36 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" |
37 | #define DRV_VERSION "1.1.0.241a" | 37 | #define DRV_VERSION "1.3.1.1" |
38 | #define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc" | 38 | #define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc" |
39 | #define PFX DRV_NAME ": " | 39 | #define PFX DRV_NAME ": " |
40 | 40 | ||
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index cf098bb636b8..1232887c243d 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -822,14 +822,14 @@ static int enic_set_mac_addr(struct net_device *netdev, char *addr) | |||
822 | static void enic_set_multicast_list(struct net_device *netdev) | 822 | static void enic_set_multicast_list(struct net_device *netdev) |
823 | { | 823 | { |
824 | struct enic *enic = netdev_priv(netdev); | 824 | struct enic *enic = netdev_priv(netdev); |
825 | struct dev_mc_list *list; | 825 | struct netdev_hw_addr *ha; |
826 | int directed = 1; | 826 | int directed = 1; |
827 | int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0; | 827 | int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0; |
828 | int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0; | 828 | int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0; |
829 | int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0; | 829 | int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0; |
830 | unsigned int mc_count = netdev_mc_count(netdev); | 830 | unsigned int mc_count = netdev_mc_count(netdev); |
831 | int allmulti = (netdev->flags & IFF_ALLMULTI) || | 831 | int allmulti = (netdev->flags & IFF_ALLMULTI) || |
832 | mc_count > ENIC_MULTICAST_PERFECT_FILTERS; | 832 | mc_count > ENIC_MULTICAST_PERFECT_FILTERS; |
833 | unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0); | 833 | unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0); |
834 | u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; | 834 | u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; |
835 | unsigned int i, j; | 835 | unsigned int i, j; |
@@ -852,10 +852,10 @@ static void enic_set_multicast_list(struct net_device *netdev) | |||
852 | */ | 852 | */ |
853 | 853 | ||
854 | i = 0; | 854 | i = 0; |
855 | netdev_for_each_mc_addr(list, netdev) { | 855 | netdev_for_each_mc_addr(ha, netdev) { |
856 | if (i == mc_count) | 856 | if (i == mc_count) |
857 | break; | 857 | break; |
858 | memcpy(mc_addr[i++], list->dmi_addr, ETH_ALEN); | 858 | memcpy(mc_addr[i++], ha->addr, ETH_ALEN); |
859 | } | 859 | } |
860 | 860 | ||
861 | for (i = 0; i < enic->mc_count; i++) { | 861 | for (i = 0; i < enic->mc_count; i++) { |
@@ -2058,8 +2058,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, | |||
2058 | netdev->watchdog_timeo = 2 * HZ; | 2058 | netdev->watchdog_timeo = 2 * HZ; |
2059 | netdev->ethtool_ops = &enic_ethtool_ops; | 2059 | netdev->ethtool_ops = &enic_ethtool_ops; |
2060 | 2060 | ||
2061 | netdev->features |= NETIF_F_HW_VLAN_TX | | 2061 | netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
2062 | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; | ||
2063 | if (ENIC_SETTING(enic, TXCSUM)) | 2062 | if (ENIC_SETTING(enic, TXCSUM)) |
2064 | netdev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; | 2063 | netdev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; |
2065 | if (ENIC_SETTING(enic, TSO)) | 2064 | if (ENIC_SETTING(enic, TSO)) |
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index cf22de71014e..d43a9d43bbff 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c | |||
@@ -574,22 +574,18 @@ int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr) | |||
574 | return err; | 574 | return err; |
575 | } | 575 | } |
576 | 576 | ||
577 | int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) | 577 | int vnic_dev_notify_setcmd(struct vnic_dev *vdev, |
578 | void *notify_addr, dma_addr_t notify_pa, u16 intr) | ||
578 | { | 579 | { |
579 | u64 a0, a1; | 580 | u64 a0, a1; |
580 | int wait = 1000; | 581 | int wait = 1000; |
581 | int r; | 582 | int r; |
582 | 583 | ||
583 | if (!vdev->notify) { | 584 | memset(notify_addr, 0, sizeof(struct vnic_devcmd_notify)); |
584 | vdev->notify = pci_alloc_consistent(vdev->pdev, | 585 | vdev->notify = notify_addr; |
585 | sizeof(struct vnic_devcmd_notify), | 586 | vdev->notify_pa = notify_pa; |
586 | &vdev->notify_pa); | ||
587 | if (!vdev->notify) | ||
588 | return -ENOMEM; | ||
589 | memset(vdev->notify, 0, sizeof(struct vnic_devcmd_notify)); | ||
590 | } | ||
591 | 587 | ||
592 | a0 = vdev->notify_pa; | 588 | a0 = (u64)notify_pa; |
593 | a1 = ((u64)intr << 32) & 0x0000ffff00000000ULL; | 589 | a1 = ((u64)intr << 32) & 0x0000ffff00000000ULL; |
594 | a1 += sizeof(struct vnic_devcmd_notify); | 590 | a1 += sizeof(struct vnic_devcmd_notify); |
595 | 591 | ||
@@ -598,7 +594,27 @@ int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) | |||
598 | return r; | 594 | return r; |
599 | } | 595 | } |
600 | 596 | ||
601 | void vnic_dev_notify_unset(struct vnic_dev *vdev) | 597 | int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) |
598 | { | ||
599 | void *notify_addr; | ||
600 | dma_addr_t notify_pa; | ||
601 | |||
602 | if (vdev->notify || vdev->notify_pa) { | ||
603 | printk(KERN_ERR "notify block %p still allocated", | ||
604 | vdev->notify); | ||
605 | return -EINVAL; | ||
606 | } | ||
607 | |||
608 | notify_addr = pci_alloc_consistent(vdev->pdev, | ||
609 | sizeof(struct vnic_devcmd_notify), | ||
610 | ¬ify_pa); | ||
611 | if (!notify_addr) | ||
612 | return -ENOMEM; | ||
613 | |||
614 | return vnic_dev_notify_setcmd(vdev, notify_addr, notify_pa, intr); | ||
615 | } | ||
616 | |||
617 | void vnic_dev_notify_unsetcmd(struct vnic_dev *vdev) | ||
602 | { | 618 | { |
603 | u64 a0, a1; | 619 | u64 a0, a1; |
604 | int wait = 1000; | 620 | int wait = 1000; |
@@ -608,9 +624,23 @@ void vnic_dev_notify_unset(struct vnic_dev *vdev) | |||
608 | a1 += sizeof(struct vnic_devcmd_notify); | 624 | a1 += sizeof(struct vnic_devcmd_notify); |
609 | 625 | ||
610 | vnic_dev_cmd(vdev, CMD_NOTIFY, &a0, &a1, wait); | 626 | vnic_dev_cmd(vdev, CMD_NOTIFY, &a0, &a1, wait); |
627 | vdev->notify = NULL; | ||
628 | vdev->notify_pa = 0; | ||
611 | vdev->notify_sz = 0; | 629 | vdev->notify_sz = 0; |
612 | } | 630 | } |
613 | 631 | ||
632 | void vnic_dev_notify_unset(struct vnic_dev *vdev) | ||
633 | { | ||
634 | if (vdev->notify) { | ||
635 | pci_free_consistent(vdev->pdev, | ||
636 | sizeof(struct vnic_devcmd_notify), | ||
637 | vdev->notify, | ||
638 | vdev->notify_pa); | ||
639 | } | ||
640 | |||
641 | vnic_dev_notify_unsetcmd(vdev); | ||
642 | } | ||
643 | |||
614 | static int vnic_dev_notify_ready(struct vnic_dev *vdev) | 644 | static int vnic_dev_notify_ready(struct vnic_dev *vdev) |
615 | { | 645 | { |
616 | u32 *words; | 646 | u32 *words; |
diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h index fc5e3eb35a5e..f5be640b0b5c 100644 --- a/drivers/net/enic/vnic_dev.h +++ b/drivers/net/enic/vnic_dev.h | |||
@@ -107,7 +107,10 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr); | |||
107 | void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr); | 107 | void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr); |
108 | int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr); | 108 | int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr); |
109 | int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr); | 109 | int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr); |
110 | int vnic_dev_notify_setcmd(struct vnic_dev *vdev, | ||
111 | void *notify_addr, dma_addr_t notify_pa, u16 intr); | ||
110 | int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr); | 112 | int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr); |
113 | void vnic_dev_notify_unsetcmd(struct vnic_dev *vdev); | ||
111 | void vnic_dev_notify_unset(struct vnic_dev *vdev); | 114 | void vnic_dev_notify_unset(struct vnic_dev *vdev); |
112 | int vnic_dev_link_status(struct vnic_dev *vdev); | 115 | int vnic_dev_link_status(struct vnic_dev *vdev); |
113 | u32 vnic_dev_port_speed(struct vnic_dev *vdev); | 116 | u32 vnic_dev_port_speed(struct vnic_dev *vdev); |
diff --git a/drivers/net/enic/vnic_rq.c b/drivers/net/enic/vnic_rq.c index e186efaf9da1..cc580cfec41d 100644 --- a/drivers/net/enic/vnic_rq.c +++ b/drivers/net/enic/vnic_rq.c | |||
@@ -168,10 +168,10 @@ int vnic_rq_disable(struct vnic_rq *rq) | |||
168 | iowrite32(0, &rq->ctrl->enable); | 168 | iowrite32(0, &rq->ctrl->enable); |
169 | 169 | ||
170 | /* Wait for HW to ACK disable request */ | 170 | /* Wait for HW to ACK disable request */ |
171 | for (wait = 0; wait < 100; wait++) { | 171 | for (wait = 0; wait < 1000; wait++) { |
172 | if (!(ioread32(&rq->ctrl->running))) | 172 | if (!(ioread32(&rq->ctrl->running))) |
173 | return 0; | 173 | return 0; |
174 | udelay(1); | 174 | udelay(10); |
175 | } | 175 | } |
176 | 176 | ||
177 | printk(KERN_ERR "Failed to disable RQ[%d]\n", rq->index); | 177 | printk(KERN_ERR "Failed to disable RQ[%d]\n", rq->index); |
diff --git a/drivers/net/enic/vnic_wq.c b/drivers/net/enic/vnic_wq.c index d5f984357f5c..1378afbdfe67 100644 --- a/drivers/net/enic/vnic_wq.c +++ b/drivers/net/enic/vnic_wq.c | |||
@@ -161,10 +161,10 @@ int vnic_wq_disable(struct vnic_wq *wq) | |||
161 | iowrite32(0, &wq->ctrl->enable); | 161 | iowrite32(0, &wq->ctrl->enable); |
162 | 162 | ||
163 | /* Wait for HW to ACK disable request */ | 163 | /* Wait for HW to ACK disable request */ |
164 | for (wait = 0; wait < 100; wait++) { | 164 | for (wait = 0; wait < 1000; wait++) { |
165 | if (!(ioread32(&wq->ctrl->running))) | 165 | if (!(ioread32(&wq->ctrl->running))) |
166 | return 0; | 166 | return 0; |
167 | udelay(1); | 167 | udelay(10); |
168 | } | 168 | } |
169 | 169 | ||
170 | printk(KERN_ERR "Failed to disable WQ[%d]\n", wq->index); | 170 | printk(KERN_ERR "Failed to disable WQ[%d]\n", wq->index); |