aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-05-12 23:07:46 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-14 06:08:00 -0400
commit251a84c9272b88eac4888d610c44c821b277c6c9 (patch)
treef5b401d901040740368190aa053db3e848e2c4f7
parent1bb09fb9c9333c97dc58524b05d4ee35b02b4216 (diff)
qlcnic: cleanup unused code
LRO ring, cut-thru mode and specific fw version are not valid to Qlogic CNA device. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/qlcnic/qlcnic.h6
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c1
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c31
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c33
4 files changed, 10 insertions, 61 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 189453fc5047..ed9df150c20f 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -98,8 +98,6 @@
98#define QLCNIC_CT_DEFAULT_RX_BUF_LEN 2048 98#define QLCNIC_CT_DEFAULT_RX_BUF_LEN 2048
99#define QLCNIC_LRO_BUFFER_EXTRA 2048 99#define QLCNIC_LRO_BUFFER_EXTRA 2048
100 100
101#define QLCNIC_RX_LRO_BUFFER_LENGTH (8060)
102
103/* Opcodes to be used with the commands */ 101/* Opcodes to be used with the commands */
104#define TX_ETHER_PKT 0x01 102#define TX_ETHER_PKT 0x01
105#define TX_TCP_PKT 0x02 103#define TX_TCP_PKT 0x02
@@ -133,7 +131,6 @@
133 131
134#define RCV_RING_NORMAL 0 132#define RCV_RING_NORMAL 0
135#define RCV_RING_JUMBO 1 133#define RCV_RING_JUMBO 1
136#define RCV_RING_LRO 2
137 134
138#define MIN_CMD_DESCRIPTORS 64 135#define MIN_CMD_DESCRIPTORS 64
139#define MIN_RCV_DESCRIPTORS 64 136#define MIN_RCV_DESCRIPTORS 64
@@ -144,7 +141,6 @@
144#define MAX_RCV_DESCRIPTORS_10G 8192 141#define MAX_RCV_DESCRIPTORS_10G 8192
145#define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 142#define MAX_JUMBO_RCV_DESCRIPTORS_1G 512
146#define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 143#define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024
147#define MAX_LRO_RCV_DESCRIPTORS 8
148 144
149#define DEFAULT_RCV_DESCRIPTORS_1G 2048 145#define DEFAULT_RCV_DESCRIPTORS_1G 2048
150#define DEFAULT_RCV_DESCRIPTORS_10G 4096 146#define DEFAULT_RCV_DESCRIPTORS_10G 4096
@@ -402,7 +398,6 @@ struct qlcnic_hardware_context {
402 rwlock_t crb_lock; 398 rwlock_t crb_lock;
403 struct mutex mem_lock; 399 struct mutex mem_lock;
404 400
405 u8 cut_through;
406 u8 revision_id; 401 u8 revision_id;
407 u8 pci_func; 402 u8 pci_func;
408 u8 linkup; 403 u8 linkup;
@@ -917,7 +912,6 @@ struct qlcnic_adapter {
917 u16 num_txd; 912 u16 num_txd;
918 u16 num_rxd; 913 u16 num_rxd;
919 u16 num_jumbo_rxd; 914 u16 num_jumbo_rxd;
920 u16 num_lro_rxd;
921 915
922 u8 max_rds_rings; 916 u8 max_rds_rings;
923 u8 max_sds_rings; 917 u8 max_sds_rings;
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index e494cccf8a93..3bd514ec7e8f 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -412,7 +412,6 @@ qlcnic_get_ringparam(struct net_device *dev,
412 412
413 ring->rx_pending = adapter->num_rxd; 413 ring->rx_pending = adapter->num_rxd;
414 ring->rx_jumbo_pending = adapter->num_jumbo_rxd; 414 ring->rx_jumbo_pending = adapter->num_jumbo_rxd;
415 ring->rx_jumbo_pending += adapter->num_lro_rxd;
416 ring->tx_pending = adapter->num_txd; 415 ring->tx_pending = adapter->num_txd;
417 416
418 if (adapter->ahw.port_type == QLCNIC_GBE) { 417 if (adapter->ahw.port_type == QLCNIC_GBE) {
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 9b010422e9a6..c4bef57b9cd0 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -230,17 +230,8 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
230 switch (ring) { 230 switch (ring) {
231 case RCV_RING_NORMAL: 231 case RCV_RING_NORMAL:
232 rds_ring->num_desc = adapter->num_rxd; 232 rds_ring->num_desc = adapter->num_rxd;
233 if (adapter->ahw.cut_through) { 233 rds_ring->dma_size = QLCNIC_P3_RX_BUF_MAX_LEN;
234 rds_ring->dma_size = 234 rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN;
235 QLCNIC_CT_DEFAULT_RX_BUF_LEN;
236 rds_ring->skb_size =
237 QLCNIC_CT_DEFAULT_RX_BUF_LEN;
238 } else {
239 rds_ring->dma_size =
240 QLCNIC_P3_RX_BUF_MAX_LEN;
241 rds_ring->skb_size =
242 rds_ring->dma_size + NET_IP_ALIGN;
243 }
244 break; 235 break;
245 236
246 case RCV_RING_JUMBO: 237 case RCV_RING_JUMBO:
@@ -254,13 +245,6 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
254 rds_ring->skb_size = 245 rds_ring->skb_size =
255 rds_ring->dma_size + NET_IP_ALIGN; 246 rds_ring->dma_size + NET_IP_ALIGN;
256 break; 247 break;
257
258 case RCV_RING_LRO:
259 rds_ring->num_desc = adapter->num_lro_rxd;
260 rds_ring->dma_size = QLCNIC_RX_LRO_BUFFER_LENGTH;
261 rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN;
262 break;
263
264 } 248 }
265 rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *) 249 rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
266 vmalloc(RCV_BUFF_RINGSIZE(rds_ring)); 250 vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
@@ -556,12 +540,10 @@ qlcnic_has_mn(struct qlcnic_adapter *adapter)
556 QLCNIC_FW_VERSION_OFFSET, (int *)&flashed_ver); 540 QLCNIC_FW_VERSION_OFFSET, (int *)&flashed_ver);
557 flashed_ver = QLCNIC_DECODE_VERSION(flashed_ver); 541 flashed_ver = QLCNIC_DECODE_VERSION(flashed_ver);
558 542
559 if (flashed_ver >= QLCNIC_VERSION_CODE(4, 0, 220)) { 543 capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY);
544 if (capability & QLCNIC_PEG_TUNE_MN_PRESENT)
545 return 1;
560 546
561 capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY);
562 if (capability & QLCNIC_PEG_TUNE_MN_PRESENT)
563 return 1;
564 }
565 return 0; 547 return 0;
566} 548}
567 549
@@ -1279,8 +1261,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
1279 1261
1280 skb = buffer->skb; 1262 skb = buffer->skb;
1281 1263
1282 if (!adapter->ahw.cut_through) 1264 skb_reserve(skb, 2);
1283 skb_reserve(skb, 2);
1284 1265
1285 dma = pci_map_single(pdev, skb->data, 1266 dma = pci_map_single(pdev, skb->data,
1286 rds_ring->dma_size, PCI_DMA_FROMDEVICE); 1267 rds_ring->dma_size, PCI_DMA_FROMDEVICE);
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index a3d010a24747..50be833c3767 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -543,22 +543,10 @@ qlcnic_check_options(struct qlcnic_adapter *adapter)
543 brd_name, adapter->ahw.revision_id); 543 brd_name, adapter->ahw.revision_id);
544 } 544 }
545 545
546 if (adapter->fw_version < QLCNIC_VERSION_CODE(3, 4, 216)) { 546 dev_info(&pdev->dev, "firmware v%d.%d.%d\n",
547 adapter->driver_mismatch = 1; 547 fw_major, fw_minor, fw_build);
548 dev_warn(&pdev->dev, "firmware version %d.%d.%d unsupported\n",
549 fw_major, fw_minor, fw_build);
550 return;
551 }
552
553 i = QLCRD32(adapter, QLCNIC_SRE_MISC);
554 adapter->ahw.cut_through = (i & 0x8000) ? 1 : 0;
555
556 dev_info(&pdev->dev, "firmware v%d.%d.%d [%s]\n",
557 fw_major, fw_minor, fw_build,
558 adapter->ahw.cut_through ? "cut-through" : "legacy");
559 548
560 if (adapter->fw_version >= QLCNIC_VERSION_CODE(4, 0, 222)) 549 adapter->capabilities = QLCRD32(adapter, CRB_FW_CAPABILITIES_1);
561 adapter->capabilities = QLCRD32(adapter, CRB_FW_CAPABILITIES_1);
562 550
563 adapter->flags &= ~QLCNIC_LRO_ENABLED; 551 adapter->flags &= ~QLCNIC_LRO_ENABLED;
564 552
@@ -575,7 +563,6 @@ qlcnic_check_options(struct qlcnic_adapter *adapter)
575 563
576 adapter->num_txd = MAX_CMD_DESCRIPTORS; 564 adapter->num_txd = MAX_CMD_DESCRIPTORS;
577 565
578 adapter->num_lro_rxd = 0;
579 adapter->max_rds_rings = 2; 566 adapter->max_rds_rings = 2;
580} 567}
581 568
@@ -2566,24 +2553,12 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
2566 2553
2567#define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops) 2554#define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops)
2568 2555
2569static int
2570qlcnic_destip_supported(struct qlcnic_adapter *adapter)
2571{
2572 if (adapter->ahw.cut_through)
2573 return 0;
2574
2575 return 1;
2576}
2577
2578static void 2556static void
2579qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) 2557qlcnic_config_indev_addr(struct net_device *dev, unsigned long event)
2580{ 2558{
2581 struct in_device *indev; 2559 struct in_device *indev;
2582 struct qlcnic_adapter *adapter = netdev_priv(dev); 2560 struct qlcnic_adapter *adapter = netdev_priv(dev);
2583 2561
2584 if (!qlcnic_destip_supported(adapter))
2585 return;
2586
2587 indev = in_dev_get(dev); 2562 indev = in_dev_get(dev);
2588 if (!indev) 2563 if (!indev)
2589 return; 2564 return;
@@ -2662,7 +2637,7 @@ recheck:
2662 2637
2663 adapter = netdev_priv(dev); 2638 adapter = netdev_priv(dev);
2664 2639
2665 if (!adapter || !qlcnic_destip_supported(adapter)) 2640 if (!adapter)
2666 goto done; 2641 goto done;
2667 2642
2668 if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC) 2643 if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC)