diff options
author | Vasanthy Kolluri <vkolluri@cisco.com> | 2011-02-04 11:17:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-07 14:49:04 -0500 |
commit | 0eb2602238e5aa33e0571a76aaf51a30bf32c3c2 (patch) | |
tree | 4fc83e6651059553691155a274fbcaae4890e618 /drivers/net | |
parent | 69161425800ac6cc28ac448bef5f21d09cb4f92a (diff) |
enic: Clean up: Remove support for an older version of hardware
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/enic/enic.h | 3 | ||||
-rw-r--r-- | drivers/net/enic/enic_dev.c | 11 | ||||
-rw-r--r-- | drivers/net/enic/enic_dev.h | 1 | ||||
-rw-r--r-- | drivers/net/enic/enic_main.c | 56 | ||||
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 19 | ||||
-rw-r--r-- | drivers/net/enic/vnic_dev.h | 8 | ||||
-rw-r--r-- | drivers/net/enic/vnic_rq.h | 5 |
7 files changed, 4 insertions, 99 deletions
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 7316267e3ade..57fcaeea94f7 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define DRV_NAME "enic" | 33 | #define DRV_NAME "enic" |
34 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" | 34 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" |
35 | #define DRV_VERSION "2.1.1.5" | 35 | #define DRV_VERSION "2.1.1.6" |
36 | #define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc" | 36 | #define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc" |
37 | 37 | ||
38 | #define ENIC_BARS_MAX 6 | 38 | #define ENIC_BARS_MAX 6 |
@@ -101,7 +101,6 @@ struct enic { | |||
101 | /* receive queue cache line section */ | 101 | /* receive queue cache line section */ |
102 | ____cacheline_aligned struct vnic_rq rq[ENIC_RQ_MAX]; | 102 | ____cacheline_aligned struct vnic_rq rq[ENIC_RQ_MAX]; |
103 | unsigned int rq_count; | 103 | unsigned int rq_count; |
104 | int (*rq_alloc_buf)(struct vnic_rq *rq); | ||
105 | u64 rq_truncated_pkts; | 104 | u64 rq_truncated_pkts; |
106 | u64 rq_bad_fcs; | 105 | u64 rq_bad_fcs; |
107 | struct napi_struct napi[ENIC_RQ_MAX]; | 106 | struct napi_struct napi[ENIC_RQ_MAX]; |
diff --git a/drivers/net/enic/enic_dev.c b/drivers/net/enic/enic_dev.c index 382626628b1b..37ad3a1c82ee 100644 --- a/drivers/net/enic/enic_dev.c +++ b/drivers/net/enic/enic_dev.c | |||
@@ -110,17 +110,6 @@ int enic_dev_del_addr(struct enic *enic, u8 *addr) | |||
110 | return err; | 110 | return err; |
111 | } | 111 | } |
112 | 112 | ||
113 | int enic_dev_hw_version(struct enic *enic, enum vnic_dev_hw_version *hw_ver) | ||
114 | { | ||
115 | int err; | ||
116 | |||
117 | spin_lock(&enic->devcmd_lock); | ||
118 | err = vnic_dev_hw_version(enic->vdev, hw_ver); | ||
119 | spin_unlock(&enic->devcmd_lock); | ||
120 | |||
121 | return err; | ||
122 | } | ||
123 | |||
124 | int enic_dev_notify_unset(struct enic *enic) | 113 | int enic_dev_notify_unset(struct enic *enic) |
125 | { | 114 | { |
126 | int err; | 115 | int err; |
diff --git a/drivers/net/enic/enic_dev.h b/drivers/net/enic/enic_dev.h index 3ac6ba1db25b..495f57fcb887 100644 --- a/drivers/net/enic/enic_dev.h +++ b/drivers/net/enic/enic_dev.h | |||
@@ -29,7 +29,6 @@ int enic_dev_add_addr(struct enic *enic, u8 *addr); | |||
29 | int enic_dev_del_addr(struct enic *enic, u8 *addr); | 29 | int enic_dev_del_addr(struct enic *enic, u8 *addr); |
30 | void enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid); | 30 | void enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid); |
31 | void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); | 31 | void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); |
32 | int enic_dev_hw_version(struct enic *enic, enum vnic_dev_hw_version *hw_ver); | ||
33 | int enic_dev_notify_unset(struct enic *enic); | 32 | int enic_dev_notify_unset(struct enic *enic); |
34 | int enic_dev_hang_notify(struct enic *enic); | 33 | int enic_dev_hang_notify(struct enic *enic); |
35 | int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic); | 34 | int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic); |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index d6cdecc7d1e6..0c243704ca40 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1348,50 +1348,6 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq) | |||
1348 | return 0; | 1348 | return 0; |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | static int enic_rq_alloc_buf_a1(struct vnic_rq *rq) | ||
1352 | { | ||
1353 | struct rq_enet_desc *desc = vnic_rq_next_desc(rq); | ||
1354 | |||
1355 | if (vnic_rq_posting_soon(rq)) { | ||
1356 | |||
1357 | /* SW workaround for A0 HW erratum: if we're just about | ||
1358 | * to write posted_index, insert a dummy desc | ||
1359 | * of type resvd | ||
1360 | */ | ||
1361 | |||
1362 | rq_enet_desc_enc(desc, 0, RQ_ENET_TYPE_RESV2, 0); | ||
1363 | vnic_rq_post(rq, 0, 0, 0, 0); | ||
1364 | } else { | ||
1365 | return enic_rq_alloc_buf(rq); | ||
1366 | } | ||
1367 | |||
1368 | return 0; | ||
1369 | } | ||
1370 | |||
1371 | static int enic_set_rq_alloc_buf(struct enic *enic) | ||
1372 | { | ||
1373 | enum vnic_dev_hw_version hw_ver; | ||
1374 | int err; | ||
1375 | |||
1376 | err = enic_dev_hw_version(enic, &hw_ver); | ||
1377 | if (err) | ||
1378 | return err; | ||
1379 | |||
1380 | switch (hw_ver) { | ||
1381 | case VNIC_DEV_HW_VER_A1: | ||
1382 | enic->rq_alloc_buf = enic_rq_alloc_buf_a1; | ||
1383 | break; | ||
1384 | case VNIC_DEV_HW_VER_A2: | ||
1385 | case VNIC_DEV_HW_VER_UNKNOWN: | ||
1386 | enic->rq_alloc_buf = enic_rq_alloc_buf; | ||
1387 | break; | ||
1388 | default: | ||
1389 | return -ENODEV; | ||
1390 | } | ||
1391 | |||
1392 | return 0; | ||
1393 | } | ||
1394 | |||
1395 | static void enic_rq_indicate_buf(struct vnic_rq *rq, | 1351 | static void enic_rq_indicate_buf(struct vnic_rq *rq, |
1396 | struct cq_desc *cq_desc, struct vnic_rq_buf *buf, | 1352 | struct cq_desc *cq_desc, struct vnic_rq_buf *buf, |
1397 | int skipped, void *opaque) | 1353 | int skipped, void *opaque) |
@@ -1528,7 +1484,7 @@ static int enic_poll(struct napi_struct *napi, int budget) | |||
1528 | 0 /* don't unmask intr */, | 1484 | 0 /* don't unmask intr */, |
1529 | 0 /* don't reset intr timer */); | 1485 | 0 /* don't reset intr timer */); |
1530 | 1486 | ||
1531 | err = vnic_rq_fill(&enic->rq[0], enic->rq_alloc_buf); | 1487 | err = vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf); |
1532 | 1488 | ||
1533 | /* Buffer allocation failed. Stay in polling | 1489 | /* Buffer allocation failed. Stay in polling |
1534 | * mode so we can try to fill the ring again. | 1490 | * 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) | |||
1578 | 0 /* don't unmask intr */, | 1534 | 0 /* don't unmask intr */, |
1579 | 0 /* don't reset intr timer */); | 1535 | 0 /* don't reset intr timer */); |
1580 | 1536 | ||
1581 | err = vnic_rq_fill(&enic->rq[rq], enic->rq_alloc_buf); | 1537 | err = vnic_rq_fill(&enic->rq[rq], enic_rq_alloc_buf); |
1582 | 1538 | ||
1583 | /* Buffer allocation failed. Stay in polling mode | 1539 | /* Buffer allocation failed. Stay in polling mode |
1584 | * so we can try to fill the ring again. | 1540 | * so we can try to fill the ring again. |
@@ -1781,7 +1737,7 @@ static int enic_open(struct net_device *netdev) | |||
1781 | } | 1737 | } |
1782 | 1738 | ||
1783 | for (i = 0; i < enic->rq_count; i++) { | 1739 | for (i = 0; i < enic->rq_count; i++) { |
1784 | vnic_rq_fill(&enic->rq[i], enic->rq_alloc_buf); | 1740 | vnic_rq_fill(&enic->rq[i], enic_rq_alloc_buf); |
1785 | /* Need at least one buffer on ring to get going */ | 1741 | /* Need at least one buffer on ring to get going */ |
1786 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { | 1742 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { |
1787 | netdev_err(netdev, "Unable to alloc receive buffers\n"); | 1743 | netdev_err(netdev, "Unable to alloc receive buffers\n"); |
@@ -2347,12 +2303,6 @@ static int enic_dev_init(struct enic *enic) | |||
2347 | 2303 | ||
2348 | enic_init_vnic_resources(enic); | 2304 | enic_init_vnic_resources(enic); |
2349 | 2305 | ||
2350 | err = enic_set_rq_alloc_buf(enic); | ||
2351 | if (err) { | ||
2352 | dev_err(dev, "Failed to set RQ buffer allocator, aborting\n"); | ||
2353 | goto err_out_free_vnic_resources; | ||
2354 | } | ||
2355 | |||
2356 | err = enic_set_rss_nic_cfg(enic); | 2306 | err = enic_set_rss_nic_cfg(enic); |
2357 | if (err) { | 2307 | if (err) { |
2358 | dev_err(dev, "Failed to config nic, aborting\n"); | 2308 | dev_err(dev, "Failed to config nic, aborting\n"); |
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index fb35d8b17668..c489e72107de 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c | |||
@@ -419,25 +419,6 @@ int vnic_dev_fw_info(struct vnic_dev *vdev, | |||
419 | return err; | 419 | return err; |
420 | } | 420 | } |
421 | 421 | ||
422 | int vnic_dev_hw_version(struct vnic_dev *vdev, enum vnic_dev_hw_version *hw_ver) | ||
423 | { | ||
424 | struct vnic_devcmd_fw_info *fw_info; | ||
425 | int err; | ||
426 | |||
427 | err = vnic_dev_fw_info(vdev, &fw_info); | ||
428 | if (err) | ||
429 | return err; | ||
430 | |||
431 | if (strncmp(fw_info->hw_version, "A1", sizeof("A1")) == 0) | ||
432 | *hw_ver = VNIC_DEV_HW_VER_A1; | ||
433 | else if (strncmp(fw_info->hw_version, "A2", sizeof("A2")) == 0) | ||
434 | *hw_ver = VNIC_DEV_HW_VER_A2; | ||
435 | else | ||
436 | *hw_ver = VNIC_DEV_HW_VER_UNKNOWN; | ||
437 | |||
438 | return 0; | ||
439 | } | ||
440 | |||
441 | int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size, | 422 | int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size, |
442 | void *value) | 423 | void *value) |
443 | { | 424 | { |
diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h index 05f9a24cd459..e837546213a8 100644 --- a/drivers/net/enic/vnic_dev.h +++ b/drivers/net/enic/vnic_dev.h | |||
@@ -44,12 +44,6 @@ static inline void writeq(u64 val, void __iomem *reg) | |||
44 | #undef pr_fmt | 44 | #undef pr_fmt |
45 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 45 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
46 | 46 | ||
47 | enum vnic_dev_hw_version { | ||
48 | VNIC_DEV_HW_VER_UNKNOWN, | ||
49 | VNIC_DEV_HW_VER_A1, | ||
50 | VNIC_DEV_HW_VER_A2, | ||
51 | }; | ||
52 | |||
53 | enum vnic_dev_intr_mode { | 47 | enum vnic_dev_intr_mode { |
54 | VNIC_DEV_INTR_MODE_UNKNOWN, | 48 | VNIC_DEV_INTR_MODE_UNKNOWN, |
55 | VNIC_DEV_INTR_MODE_INTX, | 49 | VNIC_DEV_INTR_MODE_INTX, |
@@ -93,8 +87,6 @@ int vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, | |||
93 | u64 *a0, u64 *a1, int wait); | 87 | u64 *a0, u64 *a1, int wait); |
94 | int vnic_dev_fw_info(struct vnic_dev *vdev, | 88 | int vnic_dev_fw_info(struct vnic_dev *vdev, |
95 | struct vnic_devcmd_fw_info **fw_info); | 89 | struct vnic_devcmd_fw_info **fw_info); |
96 | int vnic_dev_hw_version(struct vnic_dev *vdev, | ||
97 | enum vnic_dev_hw_version *hw_ver); | ||
98 | int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size, | 90 | int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size, |
99 | void *value); | 91 | void *value); |
100 | int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats); | 92 | int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats); |
diff --git a/drivers/net/enic/vnic_rq.h b/drivers/net/enic/vnic_rq.h index 37f08de2454a..2056586f4d4b 100644 --- a/drivers/net/enic/vnic_rq.h +++ b/drivers/net/enic/vnic_rq.h | |||
@@ -141,11 +141,6 @@ static inline void vnic_rq_post(struct vnic_rq *rq, | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | static inline int vnic_rq_posting_soon(struct vnic_rq *rq) | ||
145 | { | ||
146 | return (rq->to_use->index & VNIC_RQ_RETURN_RATE) == 0; | ||
147 | } | ||
148 | |||
149 | static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count) | 144 | static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count) |
150 | { | 145 | { |
151 | rq->ring.desc_avail += count; | 146 | rq->ring.desc_avail += count; |