enic: Clean up: Remove support for an older version of hardware
authorVasanthy Kolluri <vkolluri@cisco.com>
Fri, 4 Feb 2011 16:17:21 +0000 (16:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Feb 2011 19:49:04 +0000 (11:49 -0800)
Remove support for an older version (A1) of hardware

Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/enic/enic.h
drivers/net/enic/enic_dev.c
drivers/net/enic/enic_dev.h
drivers/net/enic/enic_main.c
drivers/net/enic/vnic_dev.c
drivers/net/enic/vnic_dev.h
drivers/net/enic/vnic_rq.h

index 7316267e3ade2834da5d224564cb3e9e1fae904d..57fcaeea94f731e6372cde3e19d355d8de443157 100644 (file)
@@ -32,7 +32,7 @@
 
 #define DRV_NAME               "enic"
 #define DRV_DESCRIPTION                "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION            "2.1.1.5"
+#define DRV_VERSION            "2.1.1.6"
 #define DRV_COPYRIGHT          "Copyright 2008-2011 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX          6
@@ -101,7 +101,6 @@ struct enic {
        /* receive queue cache line section */
        ____cacheline_aligned struct vnic_rq rq[ENIC_RQ_MAX];
        unsigned int rq_count;
-       int (*rq_alloc_buf)(struct vnic_rq *rq);
        u64 rq_truncated_pkts;
        u64 rq_bad_fcs;
        struct napi_struct napi[ENIC_RQ_MAX];
index 382626628b1b02813d36cff6466711743b08f3b0..37ad3a1c82eee76c136d8c3c6c8ac5f57bd07ba8 100644 (file)
@@ -110,17 +110,6 @@ int enic_dev_del_addr(struct enic *enic, u8 *addr)
        return err;
 }
 
-int enic_dev_hw_version(struct enic *enic, enum vnic_dev_hw_version *hw_ver)
-{
-       int err;
-
-       spin_lock(&enic->devcmd_lock);
-       err = vnic_dev_hw_version(enic->vdev, hw_ver);
-       spin_unlock(&enic->devcmd_lock);
-
-       return err;
-}
-
 int enic_dev_notify_unset(struct enic *enic)
 {
        int err;
index 3ac6ba1db25bbaa8c220dd6a3fbe2884c51d7c3e..495f57fcb887798373bdfb0fa207a5009d8a4cf3 100644 (file)
@@ -29,7 +29,6 @@ int enic_dev_add_addr(struct enic *enic, u8 *addr);
 int enic_dev_del_addr(struct enic *enic, u8 *addr);
 void enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
 void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
-int enic_dev_hw_version(struct enic *enic, enum vnic_dev_hw_version *hw_ver);
 int enic_dev_notify_unset(struct enic *enic);
 int enic_dev_hang_notify(struct enic *enic);
 int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
index d6cdecc7d1e6627f7b16bc4cc55409a0c0bf9f92..0c243704ca401110e71fd48d3c45304145da2022 100644 (file)
@@ -1348,50 +1348,6 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq)
        return 0;
 }
 
-static int enic_rq_alloc_buf_a1(struct vnic_rq *rq)
-{
-       struct rq_enet_desc *desc = vnic_rq_next_desc(rq);
-
-       if (vnic_rq_posting_soon(rq)) {
-
-               /* SW workaround for A0 HW erratum: if we're just about
-                * to write posted_index, insert a dummy desc
-                * of type resvd
-                */
-
-               rq_enet_desc_enc(desc, 0, RQ_ENET_TYPE_RESV2, 0);
-               vnic_rq_post(rq, 0, 0, 0, 0);
-       } else {
-               return enic_rq_alloc_buf(rq);
-       }
-
-       return 0;
-}
-
-static int enic_set_rq_alloc_buf(struct enic *enic)
-{
-       enum vnic_dev_hw_version hw_ver;
-       int err;
-
-       err = enic_dev_hw_version(enic, &hw_ver);
-       if (err)
-               return err;
-
-       switch (hw_ver) {
-       case VNIC_DEV_HW_VER_A1:
-               enic->rq_alloc_buf = enic_rq_alloc_buf_a1;
-               break;
-       case VNIC_DEV_HW_VER_A2:
-       case VNIC_DEV_HW_VER_UNKNOWN:
-               enic->rq_alloc_buf = enic_rq_alloc_buf;
-               break;
-       default:
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
 static void enic_rq_indicate_buf(struct vnic_rq *rq,
        struct cq_desc *cq_desc, struct vnic_rq_buf *buf,
        int skipped, void *opaque)
@@ -1528,7 +1484,7 @@ static int enic_poll(struct napi_struct *napi, int budget)
                        0 /* don't unmask intr */,
                        0 /* don't reset intr timer */);
 
-       err = vnic_rq_fill(&enic->rq[0], enic->rq_alloc_buf);
+       err = vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf);
 
        /* Buffer allocation failed. Stay in polling
         * mode so we can try to fill the ring again.
@@ -1578,7 +1534,7 @@ static int enic_poll_msix(struct napi_struct *napi, int budget)
                        0 /* don't unmask intr */,
                        0 /* don't reset intr timer */);
 
-       err = vnic_rq_fill(&enic->rq[rq], enic->rq_alloc_buf);
+       err = vnic_rq_fill(&enic->rq[rq], enic_rq_alloc_buf);
 
        /* Buffer allocation failed. Stay in polling mode
         * so we can try to fill the ring again.
@@ -1781,7 +1737,7 @@ static int enic_open(struct net_device *netdev)
        }
 
        for (i = 0; i < enic->rq_count; i++) {
-               vnic_rq_fill(&enic->rq[i], enic->rq_alloc_buf);
+               vnic_rq_fill(&enic->rq[i], enic_rq_alloc_buf);
                /* Need at least one buffer on ring to get going */
                if (vnic_rq_desc_used(&enic->rq[i]) == 0) {
                        netdev_err(netdev, "Unable to alloc receive buffers\n");
@@ -2347,12 +2303,6 @@ static int enic_dev_init(struct enic *enic)
 
        enic_init_vnic_resources(enic);
 
-       err = enic_set_rq_alloc_buf(enic);
-       if (err) {
-               dev_err(dev, "Failed to set RQ buffer allocator, aborting\n");
-               goto err_out_free_vnic_resources;
-       }
-
        err = enic_set_rss_nic_cfg(enic);
        if (err) {
                dev_err(dev, "Failed to config nic, aborting\n");
index fb35d8b176686b75a62856d1a1da539a6113d568..c489e72107de636439fc0f0182da8346b83a3797 100644 (file)
@@ -419,25 +419,6 @@ int vnic_dev_fw_info(struct vnic_dev *vdev,
        return err;
 }
 
-int vnic_dev_hw_version(struct vnic_dev *vdev, enum vnic_dev_hw_version *hw_ver)
-{
-       struct vnic_devcmd_fw_info *fw_info;
-       int err;
-
-       err = vnic_dev_fw_info(vdev, &fw_info);
-       if (err)
-               return err;
-
-       if (strncmp(fw_info->hw_version, "A1", sizeof("A1")) == 0)
-               *hw_ver = VNIC_DEV_HW_VER_A1;
-       else if (strncmp(fw_info->hw_version, "A2", sizeof("A2")) == 0)
-               *hw_ver = VNIC_DEV_HW_VER_A2;
-       else
-               *hw_ver = VNIC_DEV_HW_VER_UNKNOWN;
-
-       return 0;
-}
-
 int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size,
        void *value)
 {
index 05f9a24cd45974e6463891af6b154facc0b24e0d..e837546213a8432b7a6520807a8cfaea47ba8cfa 100644 (file)
@@ -44,12 +44,6 @@ static inline void writeq(u64 val, void __iomem *reg)
 #undef pr_fmt
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-enum vnic_dev_hw_version {
-       VNIC_DEV_HW_VER_UNKNOWN,
-       VNIC_DEV_HW_VER_A1,
-       VNIC_DEV_HW_VER_A2,
-};
-
 enum vnic_dev_intr_mode {
        VNIC_DEV_INTR_MODE_UNKNOWN,
        VNIC_DEV_INTR_MODE_INTX,
@@ -93,8 +87,6 @@ int vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
        u64 *a0, u64 *a1, int wait);
 int vnic_dev_fw_info(struct vnic_dev *vdev,
        struct vnic_devcmd_fw_info **fw_info);
-int vnic_dev_hw_version(struct vnic_dev *vdev,
-       enum vnic_dev_hw_version *hw_ver);
 int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size,
        void *value);
 int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats);
index 37f08de2454ada35c39ae681b04e10a607d11633..2056586f4d4b02641ec9609e3858b3c0368822ff 100644 (file)
@@ -141,11 +141,6 @@ static inline void vnic_rq_post(struct vnic_rq *rq,
        }
 }
 
-static inline int vnic_rq_posting_soon(struct vnic_rq *rq)
-{
-       return (rq->to_use->index & VNIC_RQ_RETURN_RATE) == 0;
-}
-
 static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count)
 {
        rq->ring.desc_avail += count;