diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/qlcnic/qlcnic.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/qlcnic/qlcnic.h')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 649 |
1 files changed, 428 insertions, 221 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 970389331bbc..480ef5cb6ef9 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -1,25 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2009 - QLogic Corporation. | 2 | * QLogic qlcnic NIC Driver |
3 | * All rights reserved. | 3 | * Copyright (c) 2009-2010 QLogic Corporation |
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, | ||
18 | * MA 02111-1307, USA. | ||
19 | * | ||
20 | * The full GNU General Public License is included in this distribution | ||
21 | * in the file called "COPYING". | ||
22 | * | 4 | * |
5 | * See LICENSE.qlcnic for copyright and licensing details. | ||
23 | */ | 6 | */ |
24 | 7 | ||
25 | #ifndef _QLCNIC_H_ | 8 | #ifndef _QLCNIC_H_ |
@@ -46,14 +29,18 @@ | |||
46 | 29 | ||
47 | #include <linux/io.h> | 30 | #include <linux/io.h> |
48 | #include <asm/byteorder.h> | 31 | #include <asm/byteorder.h> |
32 | #include <linux/bitops.h> | ||
33 | #include <linux/if_vlan.h> | ||
49 | 34 | ||
50 | #include "qlcnic_hdr.h" | 35 | #include "qlcnic_hdr.h" |
51 | 36 | ||
52 | #define _QLCNIC_LINUX_MAJOR 5 | 37 | #define _QLCNIC_LINUX_MAJOR 5 |
53 | #define _QLCNIC_LINUX_MINOR 0 | 38 | #define _QLCNIC_LINUX_MINOR 0 |
54 | #define _QLCNIC_LINUX_SUBVERSION 7 | 39 | #define _QLCNIC_LINUX_SUBVERSION 18 |
55 | #define QLCNIC_LINUX_VERSIONID "5.0.7" | 40 | #define QLCNIC_LINUX_VERSIONID "5.0.18" |
56 | #define QLCNIC_DRV_IDC_VER 0x01 | 41 | #define QLCNIC_DRV_IDC_VER 0x01 |
42 | #define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ | ||
43 | (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) | ||
57 | 44 | ||
58 | #define QLCNIC_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c)) | 45 | #define QLCNIC_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c)) |
59 | #define _major(v) (((v) >> 24) & 0xff) | 46 | #define _major(v) (((v) >> 24) & 0xff) |
@@ -92,11 +79,12 @@ | |||
92 | #define FIRST_PAGE_GROUP_START 0 | 79 | #define FIRST_PAGE_GROUP_START 0 |
93 | #define FIRST_PAGE_GROUP_END 0x100000 | 80 | #define FIRST_PAGE_GROUP_END 0x100000 |
94 | 81 | ||
95 | #define P3_MAX_MTU (9600) | 82 | #define P3P_MAX_MTU (9600) |
83 | #define P3P_MIN_MTU (68) | ||
96 | #define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */ | 84 | #define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */ |
97 | 85 | ||
98 | #define QLCNIC_P3_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN) | 86 | #define QLCNIC_P3P_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN) |
99 | #define QLCNIC_P3_RX_JUMBO_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + P3_MAX_MTU) | 87 | #define QLCNIC_P3P_RX_JUMBO_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + P3P_MAX_MTU) |
100 | #define QLCNIC_CT_DEFAULT_RX_BUF_LEN 2048 | 88 | #define QLCNIC_CT_DEFAULT_RX_BUF_LEN 2048 |
101 | #define QLCNIC_LRO_BUFFER_EXTRA 2048 | 89 | #define QLCNIC_LRO_BUFFER_EXTRA 2048 |
102 | 90 | ||
@@ -107,12 +95,11 @@ | |||
107 | #define TX_IP_PKT 0x04 | 95 | #define TX_IP_PKT 0x04 |
108 | #define TX_TCP_LSO 0x05 | 96 | #define TX_TCP_LSO 0x05 |
109 | #define TX_TCP_LSO6 0x06 | 97 | #define TX_TCP_LSO6 0x06 |
110 | #define TX_IPSEC 0x07 | ||
111 | #define TX_IPSEC_CMD 0x0a | ||
112 | #define TX_TCPV6_PKT 0x0b | 98 | #define TX_TCPV6_PKT 0x0b |
113 | #define TX_UDPV6_PKT 0x0c | 99 | #define TX_UDPV6_PKT 0x0c |
114 | 100 | ||
115 | /* Tx defines */ | 101 | /* Tx defines */ |
102 | #define QLCNIC_MAX_FRAGS_PER_TX 14 | ||
116 | #define MAX_TSO_HEADER_DESC 2 | 103 | #define MAX_TSO_HEADER_DESC 2 |
117 | #define MGMT_CMD_DESC_RESV 4 | 104 | #define MGMT_CMD_DESC_RESV 4 |
118 | #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ | 105 | #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ |
@@ -131,7 +118,6 @@ | |||
131 | #define PHAN_PEG_RCV_INITIALIZED 0xff01 | 118 | #define PHAN_PEG_RCV_INITIALIZED 0xff01 |
132 | 119 | ||
133 | #define NUM_RCV_DESC_RINGS 3 | 120 | #define NUM_RCV_DESC_RINGS 3 |
134 | #define NUM_STS_DESC_RINGS 4 | ||
135 | 121 | ||
136 | #define RCV_RING_NORMAL 0 | 122 | #define RCV_RING_NORMAL 0 |
137 | #define RCV_RING_JUMBO 1 | 123 | #define RCV_RING_JUMBO 1 |
@@ -143,11 +129,14 @@ | |||
143 | #define MAX_CMD_DESCRIPTORS 1024 | 129 | #define MAX_CMD_DESCRIPTORS 1024 |
144 | #define MAX_RCV_DESCRIPTORS_1G 4096 | 130 | #define MAX_RCV_DESCRIPTORS_1G 4096 |
145 | #define MAX_RCV_DESCRIPTORS_10G 8192 | 131 | #define MAX_RCV_DESCRIPTORS_10G 8192 |
132 | #define MAX_RCV_DESCRIPTORS_VF 2048 | ||
146 | #define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 | 133 | #define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 |
147 | #define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 | 134 | #define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 |
148 | 135 | ||
149 | #define DEFAULT_RCV_DESCRIPTORS_1G 2048 | 136 | #define DEFAULT_RCV_DESCRIPTORS_1G 2048 |
150 | #define DEFAULT_RCV_DESCRIPTORS_10G 4096 | 137 | #define DEFAULT_RCV_DESCRIPTORS_10G 4096 |
138 | #define DEFAULT_RCV_DESCRIPTORS_VF 1024 | ||
139 | #define MAX_RDS_RINGS 2 | ||
151 | 140 | ||
152 | #define get_next_index(index, length) \ | 141 | #define get_next_index(index, length) \ |
153 | (((index) + 1) & ((length) - 1)) | 142 | (((index) + 1) & ((length) - 1)) |
@@ -172,7 +161,7 @@ | |||
172 | ((_desc)->port_ctxid = ((_port) & 0xf) | (((_port) << 4) & 0xf0)) | 161 | ((_desc)->port_ctxid = ((_port) & 0xf) | (((_port) << 4) & 0xf0)) |
173 | 162 | ||
174 | #define qlcnic_set_tx_flags_opcode(_desc, _flags, _opcode) \ | 163 | #define qlcnic_set_tx_flags_opcode(_desc, _flags, _opcode) \ |
175 | ((_desc)->flags_opcode = \ | 164 | ((_desc)->flags_opcode |= \ |
176 | cpu_to_le16(((_flags) & 0x7f) | (((_opcode) & 0x3f) << 7))) | 165 | cpu_to_le16(((_flags) & 0x7f) | (((_opcode) & 0x3f) << 7))) |
177 | 166 | ||
178 | #define qlcnic_set_tx_frags_len(_desc, _frags, _len) \ | 167 | #define qlcnic_set_tx_frags_len(_desc, _frags, _len) \ |
@@ -211,7 +200,7 @@ struct rcv_desc { | |||
211 | __le16 reserved; | 200 | __le16 reserved; |
212 | __le32 buffer_length; /* allocated buffer length (usually 2K) */ | 201 | __le32 buffer_length; /* allocated buffer length (usually 2K) */ |
213 | __le64 addr_buffer; | 202 | __le64 addr_buffer; |
214 | }; | 203 | } __packed; |
215 | 204 | ||
216 | /* opcode field in status_desc */ | 205 | /* opcode field in status_desc */ |
217 | #define QLCNIC_SYN_OFFLOAD 0x03 | 206 | #define QLCNIC_SYN_OFFLOAD 0x03 |
@@ -221,7 +210,8 @@ struct rcv_desc { | |||
221 | #define QLCNIC_LRO_DESC 0x12 | 210 | #define QLCNIC_LRO_DESC 0x12 |
222 | 211 | ||
223 | /* for status field in status_desc */ | 212 | /* for status field in status_desc */ |
224 | #define STATUS_CKSUM_OK (2) | 213 | #define STATUS_CKSUM_LOOP 0 |
214 | #define STATUS_CKSUM_OK 2 | ||
225 | 215 | ||
226 | /* owner bits of status_desc */ | 216 | /* owner bits of status_desc */ |
227 | #define STATUS_OWNER_HOST (0x1ULL << 56) | 217 | #define STATUS_OWNER_HOST (0x1ULL << 56) |
@@ -299,23 +289,44 @@ struct uni_data_desc{ | |||
299 | u32 reserved[5]; | 289 | u32 reserved[5]; |
300 | }; | 290 | }; |
301 | 291 | ||
292 | /* Flash Defines and Structures */ | ||
293 | #define QLCNIC_FLT_LOCATION 0x3F1000 | ||
294 | #define QLCNIC_FW_IMAGE_REGION 0x74 | ||
295 | #define QLCNIC_BOOTLD_REGION 0X72 | ||
296 | struct qlcnic_flt_header { | ||
297 | u16 version; | ||
298 | u16 len; | ||
299 | u16 checksum; | ||
300 | u16 reserved; | ||
301 | }; | ||
302 | |||
303 | struct qlcnic_flt_entry { | ||
304 | u8 region; | ||
305 | u8 reserved0; | ||
306 | u8 attrib; | ||
307 | u8 reserved1; | ||
308 | u32 size; | ||
309 | u32 start_addr; | ||
310 | u32 end_addr; | ||
311 | }; | ||
312 | |||
302 | /* Magic number to let user know flash is programmed */ | 313 | /* Magic number to let user know flash is programmed */ |
303 | #define QLCNIC_BDINFO_MAGIC 0x12345678 | 314 | #define QLCNIC_BDINFO_MAGIC 0x12345678 |
304 | 315 | ||
305 | #define QLCNIC_BRDTYPE_P3_REF_QG 0x0021 | 316 | #define QLCNIC_BRDTYPE_P3P_REF_QG 0x0021 |
306 | #define QLCNIC_BRDTYPE_P3_HMEZ 0x0022 | 317 | #define QLCNIC_BRDTYPE_P3P_HMEZ 0x0022 |
307 | #define QLCNIC_BRDTYPE_P3_10G_CX4_LP 0x0023 | 318 | #define QLCNIC_BRDTYPE_P3P_10G_CX4_LP 0x0023 |
308 | #define QLCNIC_BRDTYPE_P3_4_GB 0x0024 | 319 | #define QLCNIC_BRDTYPE_P3P_4_GB 0x0024 |
309 | #define QLCNIC_BRDTYPE_P3_IMEZ 0x0025 | 320 | #define QLCNIC_BRDTYPE_P3P_IMEZ 0x0025 |
310 | #define QLCNIC_BRDTYPE_P3_10G_SFP_PLUS 0x0026 | 321 | #define QLCNIC_BRDTYPE_P3P_10G_SFP_PLUS 0x0026 |
311 | #define QLCNIC_BRDTYPE_P3_10000_BASE_T 0x0027 | 322 | #define QLCNIC_BRDTYPE_P3P_10000_BASE_T 0x0027 |
312 | #define QLCNIC_BRDTYPE_P3_XG_LOM 0x0028 | 323 | #define QLCNIC_BRDTYPE_P3P_XG_LOM 0x0028 |
313 | #define QLCNIC_BRDTYPE_P3_4_GB_MM 0x0029 | 324 | #define QLCNIC_BRDTYPE_P3P_4_GB_MM 0x0029 |
314 | #define QLCNIC_BRDTYPE_P3_10G_SFP_CT 0x002a | 325 | #define QLCNIC_BRDTYPE_P3P_10G_SFP_CT 0x002a |
315 | #define QLCNIC_BRDTYPE_P3_10G_SFP_QT 0x002b | 326 | #define QLCNIC_BRDTYPE_P3P_10G_SFP_QT 0x002b |
316 | #define QLCNIC_BRDTYPE_P3_10G_CX4 0x0031 | 327 | #define QLCNIC_BRDTYPE_P3P_10G_CX4 0x0031 |
317 | #define QLCNIC_BRDTYPE_P3_10G_XFP 0x0032 | 328 | #define QLCNIC_BRDTYPE_P3P_10G_XFP 0x0032 |
318 | #define QLCNIC_BRDTYPE_P3_10G_TP 0x0080 | 329 | #define QLCNIC_BRDTYPE_P3P_10G_TP 0x0080 |
319 | 330 | ||
320 | #define QLCNIC_MSIX_TABLE_OFFSET 0x44 | 331 | #define QLCNIC_MSIX_TABLE_OFFSET 0x44 |
321 | 332 | ||
@@ -355,12 +366,6 @@ struct qlcnic_skb_frag { | |||
355 | u64 length; | 366 | u64 length; |
356 | }; | 367 | }; |
357 | 368 | ||
358 | struct qlcnic_recv_crb { | ||
359 | u32 crb_rcv_producer[NUM_RCV_DESC_RINGS]; | ||
360 | u32 crb_sts_consumer[NUM_STS_DESC_RINGS]; | ||
361 | u32 sw_int_mask[NUM_STS_DESC_RINGS]; | ||
362 | }; | ||
363 | |||
364 | /* Following defines are for the state of the buffers */ | 369 | /* Following defines are for the state of the buffers */ |
365 | #define QLCNIC_BUFFER_FREE 0 | 370 | #define QLCNIC_BUFFER_FREE 0 |
366 | #define QLCNIC_BUFFER_BUSY 1 | 371 | #define QLCNIC_BUFFER_BUSY 1 |
@@ -377,10 +382,10 @@ struct qlcnic_cmd_buffer { | |||
377 | 382 | ||
378 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ | 383 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ |
379 | struct qlcnic_rx_buffer { | 384 | struct qlcnic_rx_buffer { |
380 | struct list_head list; | 385 | u16 ref_handle; |
381 | struct sk_buff *skb; | 386 | struct sk_buff *skb; |
387 | struct list_head list; | ||
382 | u64 dma; | 388 | u64 dma; |
383 | u16 ref_handle; | ||
384 | }; | 389 | }; |
385 | 390 | ||
386 | /* Board types */ | 391 | /* Board types */ |
@@ -388,6 +393,48 @@ struct qlcnic_rx_buffer { | |||
388 | #define QLCNIC_XGBE 0x02 | 393 | #define QLCNIC_XGBE 0x02 |
389 | 394 | ||
390 | /* | 395 | /* |
396 | * Interrupt coalescing defaults. The defaults are for 1500 MTU. It is | ||
397 | * adjusted based on configured MTU. | ||
398 | */ | ||
399 | #define QLCNIC_DEFAULT_INTR_COALESCE_RX_TIME_US 3 | ||
400 | #define QLCNIC_DEFAULT_INTR_COALESCE_RX_PACKETS 256 | ||
401 | |||
402 | #define QLCNIC_INTR_DEFAULT 0x04 | ||
403 | #define QLCNIC_CONFIG_INTR_COALESCE 3 | ||
404 | |||
405 | struct qlcnic_nic_intr_coalesce { | ||
406 | u8 type; | ||
407 | u8 sts_ring_mask; | ||
408 | u16 rx_packets; | ||
409 | u16 rx_time_us; | ||
410 | u16 flag; | ||
411 | u32 timer_out; | ||
412 | }; | ||
413 | |||
414 | struct qlcnic_dump_template_hdr { | ||
415 | __le32 type; | ||
416 | __le32 offset; | ||
417 | __le32 size; | ||
418 | __le32 cap_mask; | ||
419 | __le32 num_entries; | ||
420 | __le32 version; | ||
421 | __le32 timestamp; | ||
422 | __le32 checksum; | ||
423 | __le32 drv_cap_mask; | ||
424 | __le32 sys_info[3]; | ||
425 | __le32 saved_state[16]; | ||
426 | __le32 cap_sizes[8]; | ||
427 | __le32 rsvd[0]; | ||
428 | }; | ||
429 | |||
430 | struct qlcnic_fw_dump { | ||
431 | u8 clr; /* flag to indicate if dump is cleared */ | ||
432 | u32 size; /* total size of the dump */ | ||
433 | void *data; /* dump data area */ | ||
434 | struct qlcnic_dump_template_hdr *tmpl_hdr; | ||
435 | }; | ||
436 | |||
437 | /* | ||
391 | * One hardware_context{} per adapter | 438 | * One hardware_context{} per adapter |
392 | * contains interrupt info as well shared hardware info. | 439 | * contains interrupt info as well shared hardware info. |
393 | */ | 440 | */ |
@@ -405,6 +452,9 @@ struct qlcnic_hardware_context { | |||
405 | u8 linkup; | 452 | u8 linkup; |
406 | u16 port_type; | 453 | u16 port_type; |
407 | u16 board_type; | 454 | u16 board_type; |
455 | |||
456 | struct qlcnic_nic_intr_coalesce coal; | ||
457 | struct qlcnic_fw_dump fw_dump; | ||
408 | }; | 458 | }; |
409 | 459 | ||
410 | struct qlcnic_adapter_stats { | 460 | struct qlcnic_adapter_stats { |
@@ -432,50 +482,49 @@ struct qlcnic_adapter_stats { | |||
432 | * be one Rcv Descriptor for normal packets, one for jumbo and may be others. | 482 | * be one Rcv Descriptor for normal packets, one for jumbo and may be others. |
433 | */ | 483 | */ |
434 | struct qlcnic_host_rds_ring { | 484 | struct qlcnic_host_rds_ring { |
435 | u32 producer; | 485 | void __iomem *crb_rcv_producer; |
486 | struct rcv_desc *desc_head; | ||
487 | struct qlcnic_rx_buffer *rx_buf_arr; | ||
436 | u32 num_desc; | 488 | u32 num_desc; |
489 | u32 producer; | ||
437 | u32 dma_size; | 490 | u32 dma_size; |
438 | u32 skb_size; | 491 | u32 skb_size; |
439 | u32 flags; | 492 | u32 flags; |
440 | void __iomem *crb_rcv_producer; | ||
441 | struct rcv_desc *desc_head; | ||
442 | struct qlcnic_rx_buffer *rx_buf_arr; | ||
443 | struct list_head free_list; | 493 | struct list_head free_list; |
444 | spinlock_t lock; | 494 | spinlock_t lock; |
445 | dma_addr_t phys_addr; | 495 | dma_addr_t phys_addr; |
446 | }; | 496 | } ____cacheline_internodealigned_in_smp; |
447 | 497 | ||
448 | struct qlcnic_host_sds_ring { | 498 | struct qlcnic_host_sds_ring { |
449 | u32 consumer; | 499 | u32 consumer; |
450 | u32 num_desc; | 500 | u32 num_desc; |
451 | void __iomem *crb_sts_consumer; | 501 | void __iomem *crb_sts_consumer; |
452 | void __iomem *crb_intr_mask; | ||
453 | 502 | ||
454 | struct status_desc *desc_head; | 503 | struct status_desc *desc_head; |
455 | struct qlcnic_adapter *adapter; | 504 | struct qlcnic_adapter *adapter; |
456 | struct napi_struct napi; | 505 | struct napi_struct napi; |
457 | struct list_head free_list[NUM_RCV_DESC_RINGS]; | 506 | struct list_head free_list[NUM_RCV_DESC_RINGS]; |
458 | 507 | ||
508 | void __iomem *crb_intr_mask; | ||
459 | int irq; | 509 | int irq; |
460 | 510 | ||
461 | dma_addr_t phys_addr; | 511 | dma_addr_t phys_addr; |
462 | char name[IFNAMSIZ+4]; | 512 | char name[IFNAMSIZ+4]; |
463 | }; | 513 | } ____cacheline_internodealigned_in_smp; |
464 | 514 | ||
465 | struct qlcnic_host_tx_ring { | 515 | struct qlcnic_host_tx_ring { |
466 | u32 producer; | 516 | u32 producer; |
467 | __le32 *hw_consumer; | ||
468 | u32 sw_consumer; | 517 | u32 sw_consumer; |
469 | void __iomem *crb_cmd_producer; | ||
470 | u32 num_desc; | 518 | u32 num_desc; |
471 | 519 | void __iomem *crb_cmd_producer; | |
472 | struct netdev_queue *txq; | ||
473 | |||
474 | struct qlcnic_cmd_buffer *cmd_buf_arr; | ||
475 | struct cmd_desc_type0 *desc_head; | 520 | struct cmd_desc_type0 *desc_head; |
521 | struct qlcnic_cmd_buffer *cmd_buf_arr; | ||
522 | __le32 *hw_consumer; | ||
523 | |||
476 | dma_addr_t phys_addr; | 524 | dma_addr_t phys_addr; |
477 | dma_addr_t hw_cons_phys_addr; | 525 | dma_addr_t hw_cons_phys_addr; |
478 | }; | 526 | struct netdev_queue *txq; |
527 | } ____cacheline_internodealigned_in_smp; | ||
479 | 528 | ||
480 | /* | 529 | /* |
481 | * Receive context. There is one such structure per instance of the | 530 | * Receive context. There is one such structure per instance of the |
@@ -484,12 +533,12 @@ struct qlcnic_host_tx_ring { | |||
484 | * present elsewhere. | 533 | * present elsewhere. |
485 | */ | 534 | */ |
486 | struct qlcnic_recv_context { | 535 | struct qlcnic_recv_context { |
536 | struct qlcnic_host_rds_ring *rds_rings; | ||
537 | struct qlcnic_host_sds_ring *sds_rings; | ||
487 | u32 state; | 538 | u32 state; |
488 | u16 context_id; | 539 | u16 context_id; |
489 | u16 virt_port; | 540 | u16 virt_port; |
490 | 541 | ||
491 | struct qlcnic_host_rds_ring *rds_rings; | ||
492 | struct qlcnic_host_sds_ring *sds_rings; | ||
493 | }; | 542 | }; |
494 | 543 | ||
495 | /* HW context creation */ | 544 | /* HW context creation */ |
@@ -528,9 +577,6 @@ struct qlcnic_recv_context { | |||
528 | #define QLCNIC_CDRP_CMD_DESTROY_RX_CTX 0x00000008 | 577 | #define QLCNIC_CDRP_CMD_DESTROY_RX_CTX 0x00000008 |
529 | #define QLCNIC_CDRP_CMD_CREATE_TX_CTX 0x00000009 | 578 | #define QLCNIC_CDRP_CMD_CREATE_TX_CTX 0x00000009 |
530 | #define QLCNIC_CDRP_CMD_DESTROY_TX_CTX 0x0000000a | 579 | #define QLCNIC_CDRP_CMD_DESTROY_TX_CTX 0x0000000a |
531 | #define QLCNIC_CDRP_CMD_SETUP_STATISTICS 0x0000000e | ||
532 | #define QLCNIC_CDRP_CMD_GET_STATISTICS 0x0000000f | ||
533 | #define QLCNIC_CDRP_CMD_DELETE_STATISTICS 0x00000010 | ||
534 | #define QLCNIC_CDRP_CMD_SET_MTU 0x00000012 | 580 | #define QLCNIC_CDRP_CMD_SET_MTU 0x00000012 |
535 | #define QLCNIC_CDRP_CMD_READ_PHY 0x00000013 | 581 | #define QLCNIC_CDRP_CMD_READ_PHY 0x00000013 |
536 | #define QLCNIC_CDRP_CMD_WRITE_PHY 0x00000014 | 582 | #define QLCNIC_CDRP_CMD_WRITE_PHY 0x00000014 |
@@ -539,24 +585,24 @@ struct qlcnic_recv_context { | |||
539 | #define QLCNIC_CDRP_CMD_SET_FLOW_CTL 0x00000017 | 585 | #define QLCNIC_CDRP_CMD_SET_FLOW_CTL 0x00000017 |
540 | #define QLCNIC_CDRP_CMD_READ_MAX_MTU 0x00000018 | 586 | #define QLCNIC_CDRP_CMD_READ_MAX_MTU 0x00000018 |
541 | #define QLCNIC_CDRP_CMD_READ_MAX_LRO 0x00000019 | 587 | #define QLCNIC_CDRP_CMD_READ_MAX_LRO 0x00000019 |
542 | #define QLCNIC_CDRP_CMD_CONFIGURE_TOE 0x0000001a | ||
543 | #define QLCNIC_CDRP_CMD_FUNC_ATTRIB 0x0000001b | ||
544 | #define QLCNIC_CDRP_CMD_READ_PEXQ_PARAMETERS 0x0000001c | ||
545 | #define QLCNIC_CDRP_CMD_GET_LIC_CAPABILITIES 0x0000001d | ||
546 | #define QLCNIC_CDRP_CMD_READ_MAX_LRO_PER_BOARD 0x0000001e | ||
547 | #define QLCNIC_CDRP_CMD_MAC_ADDRESS 0x0000001f | 588 | #define QLCNIC_CDRP_CMD_MAC_ADDRESS 0x0000001f |
548 | 589 | ||
549 | #define QLCNIC_CDRP_CMD_GET_PCI_INFO 0x00000020 | 590 | #define QLCNIC_CDRP_CMD_GET_PCI_INFO 0x00000020 |
550 | #define QLCNIC_CDRP_CMD_GET_NIC_INFO 0x00000021 | 591 | #define QLCNIC_CDRP_CMD_GET_NIC_INFO 0x00000021 |
551 | #define QLCNIC_CDRP_CMD_SET_NIC_INFO 0x00000022 | 592 | #define QLCNIC_CDRP_CMD_SET_NIC_INFO 0x00000022 |
552 | #define QLCNIC_CDRP_CMD_RESET_NPAR 0x00000023 | ||
553 | #define QLCNIC_CDRP_CMD_GET_ESWITCH_CAPABILITY 0x00000024 | 593 | #define QLCNIC_CDRP_CMD_GET_ESWITCH_CAPABILITY 0x00000024 |
554 | #define QLCNIC_CDRP_CMD_TOGGLE_ESWITCH 0x00000025 | 594 | #define QLCNIC_CDRP_CMD_TOGGLE_ESWITCH 0x00000025 |
555 | #define QLCNIC_CDRP_CMD_GET_ESWITCH_STATUS 0x00000026 | 595 | #define QLCNIC_CDRP_CMD_GET_ESWITCH_STATUS 0x00000026 |
556 | #define QLCNIC_CDRP_CMD_SET_PORTMIRRORING 0x00000027 | 596 | #define QLCNIC_CDRP_CMD_SET_PORTMIRRORING 0x00000027 |
557 | #define QLCNIC_CDRP_CMD_CONFIGURE_ESWITCH 0x00000028 | 597 | #define QLCNIC_CDRP_CMD_CONFIGURE_ESWITCH 0x00000028 |
598 | #define QLCNIC_CDRP_CMD_GET_ESWITCH_PORT_CONFIG 0x00000029 | ||
599 | #define QLCNIC_CDRP_CMD_GET_ESWITCH_STATS 0x0000002a | ||
600 | #define QLCNIC_CDRP_CMD_CONFIG_PORT 0x0000002E | ||
601 | #define QLCNIC_CDRP_CMD_TEMP_SIZE 0x0000002f | ||
602 | #define QLCNIC_CDRP_CMD_GET_TEMP_HDR 0x00000030 | ||
558 | 603 | ||
559 | #define QLCNIC_RCODE_SUCCESS 0 | 604 | #define QLCNIC_RCODE_SUCCESS 0 |
605 | #define QLCNIC_RCODE_NOT_SUPPORTED 9 | ||
560 | #define QLCNIC_RCODE_TIMEOUT 17 | 606 | #define QLCNIC_RCODE_TIMEOUT 17 |
561 | #define QLCNIC_DESTROY_CTX_RESET 0 | 607 | #define QLCNIC_DESTROY_CTX_RESET 0 |
562 | 608 | ||
@@ -585,14 +631,14 @@ struct qlcnic_hostrq_sds_ring { | |||
585 | __le32 ring_size; /* Ring entries */ | 631 | __le32 ring_size; /* Ring entries */ |
586 | __le16 msi_index; | 632 | __le16 msi_index; |
587 | __le16 rsvd; /* Padding */ | 633 | __le16 rsvd; /* Padding */ |
588 | }; | 634 | } __packed; |
589 | 635 | ||
590 | struct qlcnic_hostrq_rds_ring { | 636 | struct qlcnic_hostrq_rds_ring { |
591 | __le64 host_phys_addr; /* Ring base addr */ | 637 | __le64 host_phys_addr; /* Ring base addr */ |
592 | __le64 buff_size; /* Packet buffer size */ | 638 | __le64 buff_size; /* Packet buffer size */ |
593 | __le32 ring_size; /* Ring entries */ | 639 | __le32 ring_size; /* Ring entries */ |
594 | __le32 ring_kind; /* Class of ring */ | 640 | __le32 ring_kind; /* Class of ring */ |
595 | }; | 641 | } __packed; |
596 | 642 | ||
597 | struct qlcnic_hostrq_rx_ctx { | 643 | struct qlcnic_hostrq_rx_ctx { |
598 | __le64 host_rsp_dma_addr; /* Response dma'd here */ | 644 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
@@ -613,17 +659,17 @@ struct qlcnic_hostrq_rx_ctx { | |||
613 | - N hostrq_rds_rings | 659 | - N hostrq_rds_rings |
614 | - N hostrq_sds_rings */ | 660 | - N hostrq_sds_rings */ |
615 | char data[0]; | 661 | char data[0]; |
616 | }; | 662 | } __packed; |
617 | 663 | ||
618 | struct qlcnic_cardrsp_rds_ring{ | 664 | struct qlcnic_cardrsp_rds_ring{ |
619 | __le32 host_producer_crb; /* Crb to use */ | 665 | __le32 host_producer_crb; /* Crb to use */ |
620 | __le32 rsvd1; /* Padding */ | 666 | __le32 rsvd1; /* Padding */ |
621 | }; | 667 | } __packed; |
622 | 668 | ||
623 | struct qlcnic_cardrsp_sds_ring { | 669 | struct qlcnic_cardrsp_sds_ring { |
624 | __le32 host_consumer_crb; /* Crb to use */ | 670 | __le32 host_consumer_crb; /* Crb to use */ |
625 | __le32 interrupt_crb; /* Crb to use */ | 671 | __le32 interrupt_crb; /* Crb to use */ |
626 | }; | 672 | } __packed; |
627 | 673 | ||
628 | struct qlcnic_cardrsp_rx_ctx { | 674 | struct qlcnic_cardrsp_rx_ctx { |
629 | /* These ring offsets are relative to data[0] below */ | 675 | /* These ring offsets are relative to data[0] below */ |
@@ -642,7 +688,7 @@ struct qlcnic_cardrsp_rx_ctx { | |||
642 | - N cardrsp_rds_rings | 688 | - N cardrsp_rds_rings |
643 | - N cardrs_sds_rings */ | 689 | - N cardrs_sds_rings */ |
644 | char data[0]; | 690 | char data[0]; |
645 | }; | 691 | } __packed; |
646 | 692 | ||
647 | #define SIZEOF_HOSTRQ_RX(HOSTRQ_RX, rds_rings, sds_rings) \ | 693 | #define SIZEOF_HOSTRQ_RX(HOSTRQ_RX, rds_rings, sds_rings) \ |
648 | (sizeof(HOSTRQ_RX) + \ | 694 | (sizeof(HOSTRQ_RX) + \ |
@@ -662,7 +708,7 @@ struct qlcnic_hostrq_cds_ring { | |||
662 | __le64 host_phys_addr; /* Ring base addr */ | 708 | __le64 host_phys_addr; /* Ring base addr */ |
663 | __le32 ring_size; /* Ring entries */ | 709 | __le32 ring_size; /* Ring entries */ |
664 | __le32 rsvd; /* Padding */ | 710 | __le32 rsvd; /* Padding */ |
665 | }; | 711 | } __packed; |
666 | 712 | ||
667 | struct qlcnic_hostrq_tx_ctx { | 713 | struct qlcnic_hostrq_tx_ctx { |
668 | __le64 host_rsp_dma_addr; /* Response dma'd here */ | 714 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
@@ -677,12 +723,12 @@ struct qlcnic_hostrq_tx_ctx { | |||
677 | __le16 rsvd3; /* Padding */ | 723 | __le16 rsvd3; /* Padding */ |
678 | struct qlcnic_hostrq_cds_ring cds_ring; /* Desc of cds ring */ | 724 | struct qlcnic_hostrq_cds_ring cds_ring; /* Desc of cds ring */ |
679 | u8 reserved[128]; /* future expansion */ | 725 | u8 reserved[128]; /* future expansion */ |
680 | }; | 726 | } __packed; |
681 | 727 | ||
682 | struct qlcnic_cardrsp_cds_ring { | 728 | struct qlcnic_cardrsp_cds_ring { |
683 | __le32 host_producer_crb; /* Crb to use */ | 729 | __le32 host_producer_crb; /* Crb to use */ |
684 | __le32 interrupt_crb; /* Crb to use */ | 730 | __le32 interrupt_crb; /* Crb to use */ |
685 | }; | 731 | } __packed; |
686 | 732 | ||
687 | struct qlcnic_cardrsp_tx_ctx { | 733 | struct qlcnic_cardrsp_tx_ctx { |
688 | __le32 host_ctx_state; /* Starting state */ | 734 | __le32 host_ctx_state; /* Starting state */ |
@@ -691,7 +737,7 @@ struct qlcnic_cardrsp_tx_ctx { | |||
691 | u8 virt_port; /* Virtual/Logical id of port */ | 737 | u8 virt_port; /* Virtual/Logical id of port */ |
692 | struct qlcnic_cardrsp_cds_ring cds_ring; /* Card cds settings */ | 738 | struct qlcnic_cardrsp_cds_ring cds_ring; /* Card cds settings */ |
693 | u8 reserved[128]; /* future expansion */ | 739 | u8 reserved[128]; /* future expansion */ |
694 | }; | 740 | } __packed; |
695 | 741 | ||
696 | #define SIZEOF_HOSTRQ_TX(HOSTRQ_TX) (sizeof(HOSTRQ_TX)) | 742 | #define SIZEOF_HOSTRQ_TX(HOSTRQ_TX) (sizeof(HOSTRQ_TX)) |
697 | #define SIZEOF_CARDRSP_TX(CARDRSP_TX) (sizeof(CARDRSP_TX)) | 743 | #define SIZEOF_CARDRSP_TX(CARDRSP_TX) (sizeof(CARDRSP_TX)) |
@@ -712,51 +758,19 @@ struct qlcnic_cardrsp_tx_ctx { | |||
712 | 758 | ||
713 | /* MAC */ | 759 | /* MAC */ |
714 | 760 | ||
715 | #define MC_COUNT_P3 38 | 761 | #define MC_COUNT_P3P 38 |
716 | 762 | ||
717 | #define QLCNIC_MAC_NOOP 0 | 763 | #define QLCNIC_MAC_NOOP 0 |
718 | #define QLCNIC_MAC_ADD 1 | 764 | #define QLCNIC_MAC_ADD 1 |
719 | #define QLCNIC_MAC_DEL 2 | 765 | #define QLCNIC_MAC_DEL 2 |
766 | #define QLCNIC_MAC_VLAN_ADD 3 | ||
767 | #define QLCNIC_MAC_VLAN_DEL 4 | ||
720 | 768 | ||
721 | struct qlcnic_mac_list_s { | 769 | struct qlcnic_mac_list_s { |
722 | struct list_head list; | 770 | struct list_head list; |
723 | uint8_t mac_addr[ETH_ALEN+2]; | 771 | uint8_t mac_addr[ETH_ALEN+2]; |
724 | }; | 772 | }; |
725 | 773 | ||
726 | /* | ||
727 | * Interrupt coalescing defaults. The defaults are for 1500 MTU. It is | ||
728 | * adjusted based on configured MTU. | ||
729 | */ | ||
730 | #define QLCNIC_DEFAULT_INTR_COALESCE_RX_TIME_US 3 | ||
731 | #define QLCNIC_DEFAULT_INTR_COALESCE_RX_PACKETS 256 | ||
732 | #define QLCNIC_DEFAULT_INTR_COALESCE_TX_PACKETS 64 | ||
733 | #define QLCNIC_DEFAULT_INTR_COALESCE_TX_TIME_US 4 | ||
734 | |||
735 | #define QLCNIC_INTR_DEFAULT 0x04 | ||
736 | |||
737 | union qlcnic_nic_intr_coalesce_data { | ||
738 | struct { | ||
739 | u16 rx_packets; | ||
740 | u16 rx_time_us; | ||
741 | u16 tx_packets; | ||
742 | u16 tx_time_us; | ||
743 | } data; | ||
744 | u64 word; | ||
745 | }; | ||
746 | |||
747 | struct qlcnic_nic_intr_coalesce { | ||
748 | u16 stats_time_us; | ||
749 | u16 rate_sample_time; | ||
750 | u16 flags; | ||
751 | u16 rsvd_1; | ||
752 | u32 low_threshold; | ||
753 | u32 high_threshold; | ||
754 | union qlcnic_nic_intr_coalesce_data normal; | ||
755 | union qlcnic_nic_intr_coalesce_data low; | ||
756 | union qlcnic_nic_intr_coalesce_data high; | ||
757 | union qlcnic_nic_intr_coalesce_data irq; | ||
758 | }; | ||
759 | |||
760 | #define QLCNIC_HOST_REQUEST 0x13 | 774 | #define QLCNIC_HOST_REQUEST 0x13 |
761 | #define QLCNIC_REQUEST 0x14 | 775 | #define QLCNIC_REQUEST 0x14 |
762 | 776 | ||
@@ -768,51 +782,20 @@ struct qlcnic_nic_intr_coalesce { | |||
768 | /* | 782 | /* |
769 | * Driver --> Firmware | 783 | * Driver --> Firmware |
770 | */ | 784 | */ |
771 | #define QLCNIC_H2C_OPCODE_START 0 | 785 | #define QLCNIC_H2C_OPCODE_CONFIG_RSS 0x1 |
772 | #define QLCNIC_H2C_OPCODE_CONFIG_RSS 1 | 786 | #define QLCNIC_H2C_OPCODE_CONFIG_INTR_COALESCE 0x3 |
773 | #define QLCNIC_H2C_OPCODE_CONFIG_RSS_TBL 2 | 787 | #define QLCNIC_H2C_OPCODE_CONFIG_LED 0x4 |
774 | #define QLCNIC_H2C_OPCODE_CONFIG_INTR_COALESCE 3 | 788 | #define QLCNIC_H2C_OPCODE_LRO_REQUEST 0x7 |
775 | #define QLCNIC_H2C_OPCODE_CONFIG_LED 4 | 789 | #define QLCNIC_H2C_OPCODE_SET_MAC_RECEIVE_MODE 0xc |
776 | #define QLCNIC_H2C_OPCODE_CONFIG_PROMISCUOUS 5 | 790 | #define QLCNIC_H2C_OPCODE_CONFIG_IPADDR 0x12 |
777 | #define QLCNIC_H2C_OPCODE_CONFIG_L2_MAC 6 | 791 | #define QLCNIC_H2C_OPCODE_GET_LINKEVENT 0x15 |
778 | #define QLCNIC_H2C_OPCODE_LRO_REQUEST 7 | 792 | #define QLCNIC_H2C_OPCODE_CONFIG_BRIDGING 0x17 |
779 | #define QLCNIC_H2C_OPCODE_GET_SNMP_STATS 8 | 793 | #define QLCNIC_H2C_OPCODE_CONFIG_HW_LRO 0x18 |
780 | #define QLCNIC_H2C_OPCODE_PROXY_START_REQUEST 9 | ||
781 | #define QLCNIC_H2C_OPCODE_PROXY_STOP_REQUEST 10 | ||
782 | #define QLCNIC_H2C_OPCODE_PROXY_SET_MTU 11 | ||
783 | #define QLCNIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE 12 | ||
784 | #define QLCNIC_H2C_OPCODE_GET_FINGER_PRINT_REQUEST 13 | ||
785 | #define QLCNIC_H2C_OPCODE_INSTALL_LICENSE_REQUEST 14 | ||
786 | #define QLCNIC_H2C_OPCODE_GET_LICENSE_CAPABILITY_REQUEST 15 | ||
787 | #define QLCNIC_H2C_OPCODE_GET_NET_STATS 16 | ||
788 | #define QLCNIC_H2C_OPCODE_PROXY_UPDATE_P2V 17 | ||
789 | #define QLCNIC_H2C_OPCODE_CONFIG_IPADDR 18 | ||
790 | #define QLCNIC_H2C_OPCODE_CONFIG_LOOPBACK 19 | ||
791 | #define QLCNIC_H2C_OPCODE_PROXY_STOP_DONE 20 | ||
792 | #define QLCNIC_H2C_OPCODE_GET_LINKEVENT 21 | ||
793 | #define QLCNIC_C2C_OPCODE 22 | ||
794 | #define QLCNIC_H2C_OPCODE_CONFIG_BRIDGING 23 | ||
795 | #define QLCNIC_H2C_OPCODE_CONFIG_HW_LRO 24 | ||
796 | #define QLCNIC_H2C_OPCODE_LAST 25 | ||
797 | /* | 794 | /* |
798 | * Firmware --> Driver | 795 | * Firmware --> Driver |
799 | */ | 796 | */ |
800 | 797 | ||
801 | #define QLCNIC_C2H_OPCODE_START 128 | ||
802 | #define QLCNIC_C2H_OPCODE_CONFIG_RSS_RESPONSE 129 | ||
803 | #define QLCNIC_C2H_OPCODE_CONFIG_RSS_TBL_RESPONSE 130 | ||
804 | #define QLCNIC_C2H_OPCODE_CONFIG_MAC_RESPONSE 131 | ||
805 | #define QLCNIC_C2H_OPCODE_CONFIG_PROMISCUOUS_RESPONSE 132 | ||
806 | #define QLCNIC_C2H_OPCODE_CONFIG_L2_MAC_RESPONSE 133 | ||
807 | #define QLCNIC_C2H_OPCODE_LRO_DELETE_RESPONSE 134 | ||
808 | #define QLCNIC_C2H_OPCODE_LRO_ADD_FAILURE_RESPONSE 135 | ||
809 | #define QLCNIC_C2H_OPCODE_GET_SNMP_STATS 136 | ||
810 | #define QLCNIC_C2H_OPCODE_GET_FINGER_PRINT_REPLY 137 | ||
811 | #define QLCNIC_C2H_OPCODE_INSTALL_LICENSE_REPLY 138 | ||
812 | #define QLCNIC_C2H_OPCODE_GET_LICENSE_CAPABILITIES_REPLY 139 | ||
813 | #define QLCNIC_C2H_OPCODE_GET_NET_STATS_RESPONSE 140 | ||
814 | #define QLCNIC_C2H_OPCODE_GET_LINKEVENT_RESPONSE 141 | 798 | #define QLCNIC_C2H_OPCODE_GET_LINKEVENT_RESPONSE 141 |
815 | #define QLCNIC_C2H_OPCODE_LAST 142 | ||
816 | 799 | ||
817 | #define VPORT_MISS_MODE_DROP 0 /* drop all unmatched */ | 800 | #define VPORT_MISS_MODE_DROP 0 /* drop all unmatched */ |
818 | #define VPORT_MISS_MODE_ACCEPT_ALL 1 /* accept all packets */ | 801 | #define VPORT_MISS_MODE_ACCEPT_ALL 1 /* accept all packets */ |
@@ -854,7 +837,6 @@ struct qlcnic_nic_intr_coalesce { | |||
854 | #define LINKEVENT_LINKSPEED_MBPS 0 | 837 | #define LINKEVENT_LINKSPEED_MBPS 0 |
855 | #define LINKEVENT_LINKSPEED_ENCODED 1 | 838 | #define LINKEVENT_LINKSPEED_ENCODED 1 |
856 | 839 | ||
857 | #define AUTO_FW_RESET_ENABLED 0x01 | ||
858 | /* firmware response header: | 840 | /* firmware response header: |
859 | * 63:58 - message type | 841 | * 63:58 - message type |
860 | * 57:56 - owner | 842 | * 57:56 - owner |
@@ -882,7 +864,7 @@ struct qlcnic_nic_req { | |||
882 | __le64 qhdr; | 864 | __le64 qhdr; |
883 | __le64 req_hdr; | 865 | __le64 req_hdr; |
884 | __le64 words[6]; | 866 | __le64 words[6]; |
885 | }; | 867 | } __packed; |
886 | 868 | ||
887 | struct qlcnic_mac_req { | 869 | struct qlcnic_mac_req { |
888 | u8 op; | 870 | u8 op; |
@@ -890,16 +872,34 @@ struct qlcnic_mac_req { | |||
890 | u8 mac_addr[6]; | 872 | u8 mac_addr[6]; |
891 | }; | 873 | }; |
892 | 874 | ||
875 | struct qlcnic_vlan_req { | ||
876 | __le16 vlan_id; | ||
877 | __le16 rsvd[3]; | ||
878 | } __packed; | ||
879 | |||
880 | struct qlcnic_ipaddr { | ||
881 | __be32 ipv4; | ||
882 | __be32 ipv6[4]; | ||
883 | }; | ||
884 | |||
893 | #define QLCNIC_MSI_ENABLED 0x02 | 885 | #define QLCNIC_MSI_ENABLED 0x02 |
894 | #define QLCNIC_MSIX_ENABLED 0x04 | 886 | #define QLCNIC_MSIX_ENABLED 0x04 |
895 | #define QLCNIC_LRO_ENABLED 0x08 | 887 | #define QLCNIC_LRO_ENABLED 0x08 |
888 | #define QLCNIC_LRO_DISABLED 0x00 | ||
896 | #define QLCNIC_BRIDGE_ENABLED 0X10 | 889 | #define QLCNIC_BRIDGE_ENABLED 0X10 |
897 | #define QLCNIC_DIAG_ENABLED 0x20 | 890 | #define QLCNIC_DIAG_ENABLED 0x20 |
898 | #define QLCNIC_ESWITCH_ENABLED 0x40 | 891 | #define QLCNIC_ESWITCH_ENABLED 0x40 |
892 | #define QLCNIC_ADAPTER_INITIALIZED 0x80 | ||
893 | #define QLCNIC_TAGGING_ENABLED 0x100 | ||
894 | #define QLCNIC_MACSPOOF 0x200 | ||
895 | #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 | ||
896 | #define QLCNIC_PROMISC_DISABLED 0x800 | ||
897 | #define QLCNIC_NEED_FLR 0x1000 | ||
899 | #define QLCNIC_IS_MSI_FAMILY(adapter) \ | 898 | #define QLCNIC_IS_MSI_FAMILY(adapter) \ |
900 | ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) | 899 | ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) |
901 | 900 | ||
902 | #define MSIX_ENTRIES_PER_ADAPTER NUM_STS_DESC_RINGS | 901 | #define QLCNIC_DEF_NUM_STS_DESC_RINGS 4 |
902 | #define QLCNIC_MIN_NUM_RSS_RINGS 2 | ||
903 | #define QLCNIC_MSIX_TBL_SPACE 8192 | 903 | #define QLCNIC_MSIX_TBL_SPACE 8192 |
904 | #define QLCNIC_PCI_REG_MSIX_TBL 0x44 | 904 | #define QLCNIC_PCI_REG_MSIX_TBL 0x44 |
905 | #define QLCNIC_MSIX_TBL_PGSIZE 4096 | 905 | #define QLCNIC_MSIX_TBL_PGSIZE 4096 |
@@ -912,35 +912,54 @@ struct qlcnic_mac_req { | |||
912 | #define __QLCNIC_RESETTING 2 | 912 | #define __QLCNIC_RESETTING 2 |
913 | #define __QLCNIC_START_FW 4 | 913 | #define __QLCNIC_START_FW 4 |
914 | #define __QLCNIC_AER 5 | 914 | #define __QLCNIC_AER 5 |
915 | #define __QLCNIC_DIAG_RES_ALLOC 6 | ||
915 | 916 | ||
916 | #define QLCNIC_INTERRUPT_TEST 1 | 917 | #define QLCNIC_INTERRUPT_TEST 1 |
917 | #define QLCNIC_LOOPBACK_TEST 2 | 918 | #define QLCNIC_LOOPBACK_TEST 2 |
919 | #define QLCNIC_LED_TEST 3 | ||
918 | 920 | ||
919 | struct qlcnic_adapter { | 921 | #define QLCNIC_FILTER_AGE 80 |
920 | struct qlcnic_hardware_context ahw; | 922 | #define QLCNIC_READD_AGE 20 |
923 | #define QLCNIC_LB_MAX_FILTERS 64 | ||
924 | |||
925 | struct qlcnic_filter { | ||
926 | struct hlist_node fnode; | ||
927 | u8 faddr[ETH_ALEN]; | ||
928 | __le16 vlan_id; | ||
929 | unsigned long ftime; | ||
930 | }; | ||
931 | |||
932 | struct qlcnic_filter_hash { | ||
933 | struct hlist_head *fhead; | ||
934 | u8 fnum; | ||
935 | u8 fmax; | ||
936 | }; | ||
921 | 937 | ||
938 | struct qlcnic_adapter { | ||
939 | struct qlcnic_hardware_context *ahw; | ||
940 | struct qlcnic_recv_context *recv_ctx; | ||
941 | struct qlcnic_host_tx_ring *tx_ring; | ||
922 | struct net_device *netdev; | 942 | struct net_device *netdev; |
923 | struct pci_dev *pdev; | 943 | struct pci_dev *pdev; |
924 | struct list_head mac_list; | ||
925 | 944 | ||
926 | spinlock_t tx_clean_lock; | 945 | unsigned long state; |
946 | u32 flags; | ||
927 | 947 | ||
928 | u16 num_txd; | 948 | u16 num_txd; |
929 | u16 num_rxd; | 949 | u16 num_rxd; |
930 | u16 num_jumbo_rxd; | 950 | u16 num_jumbo_rxd; |
951 | u16 max_rxd; | ||
952 | u16 max_jumbo_rxd; | ||
931 | 953 | ||
932 | u8 max_rds_rings; | 954 | u8 max_rds_rings; |
933 | u8 max_sds_rings; | 955 | u8 max_sds_rings; |
934 | u8 driver_mismatch; | ||
935 | u8 msix_supported; | 956 | u8 msix_supported; |
936 | u8 rx_csum; | ||
937 | u8 portnum; | 957 | u8 portnum; |
938 | u8 physical_port; | 958 | u8 physical_port; |
939 | u8 reset_context; | 959 | u8 reset_context; |
940 | 960 | ||
941 | u8 mc_enabled; | 961 | u8 mc_enabled; |
942 | u8 max_mc_count; | 962 | u8 max_mc_count; |
943 | u8 rss_supported; | ||
944 | u8 fw_wait_cnt; | 963 | u8 fw_wait_cnt; |
945 | u8 fw_fail_cnt; | 964 | u8 fw_fail_cnt; |
946 | u8 tx_timeo_cnt; | 965 | u8 tx_timeo_cnt; |
@@ -961,15 +980,15 @@ struct qlcnic_adapter { | |||
961 | u16 max_tx_ques; | 980 | u16 max_tx_ques; |
962 | u16 max_rx_ques; | 981 | u16 max_rx_ques; |
963 | u16 max_mtu; | 982 | u16 max_mtu; |
983 | u16 pvid; | ||
964 | 984 | ||
965 | u32 fw_hal_version; | 985 | u32 fw_hal_version; |
966 | u32 capabilities; | 986 | u32 capabilities; |
967 | u32 flags; | ||
968 | u32 irq; | 987 | u32 irq; |
969 | u32 temp; | 988 | u32 temp; |
970 | 989 | ||
971 | u32 int_vec_bit; | 990 | u32 int_vec_bit; |
972 | u32 heartbit; | 991 | u32 heartbeat; |
973 | 992 | ||
974 | u8 max_mac_filters; | 993 | u8 max_mac_filters; |
975 | u8 dev_state; | 994 | u8 dev_state; |
@@ -982,28 +1001,29 @@ struct qlcnic_adapter { | |||
982 | u8 mac_addr[ETH_ALEN]; | 1001 | u8 mac_addr[ETH_ALEN]; |
983 | 1002 | ||
984 | u64 dev_rst_time; | 1003 | u64 dev_rst_time; |
1004 | unsigned long vlans[BITS_TO_LONGS(VLAN_N_VID)]; | ||
985 | 1005 | ||
986 | struct qlcnic_npar_info *npars; | 1006 | struct qlcnic_npar_info *npars; |
987 | struct qlcnic_eswitch *eswitch; | 1007 | struct qlcnic_eswitch *eswitch; |
988 | struct qlcnic_nic_template *nic_ops; | 1008 | struct qlcnic_nic_template *nic_ops; |
989 | 1009 | ||
990 | struct qlcnic_adapter_stats stats; | 1010 | struct qlcnic_adapter_stats stats; |
991 | 1011 | struct list_head mac_list; | |
992 | struct qlcnic_recv_context recv_ctx; | ||
993 | struct qlcnic_host_tx_ring *tx_ring; | ||
994 | 1012 | ||
995 | void __iomem *tgt_mask_reg; | 1013 | void __iomem *tgt_mask_reg; |
996 | void __iomem *tgt_status_reg; | 1014 | void __iomem *tgt_status_reg; |
997 | void __iomem *crb_int_state_reg; | 1015 | void __iomem *crb_int_state_reg; |
998 | void __iomem *isr_int_vec; | 1016 | void __iomem *isr_int_vec; |
999 | 1017 | ||
1000 | struct msix_entry msix_entries[MSIX_ENTRIES_PER_ADAPTER]; | 1018 | struct msix_entry *msix_entries; |
1001 | 1019 | ||
1002 | struct delayed_work fw_work; | 1020 | struct delayed_work fw_work; |
1003 | 1021 | ||
1004 | struct qlcnic_nic_intr_coalesce coal; | ||
1005 | 1022 | ||
1006 | unsigned long state; | 1023 | struct qlcnic_filter_hash fhash; |
1024 | |||
1025 | spinlock_t tx_clean_lock; | ||
1026 | spinlock_t mac_learn_lock; | ||
1007 | __le32 file_prd_off; /*File fw product offset*/ | 1027 | __le32 file_prd_off; /*File fw product offset*/ |
1008 | u32 fw_version; | 1028 | u32 fw_version; |
1009 | const struct firmware *fw; | 1029 | const struct firmware *fw; |
@@ -1025,7 +1045,7 @@ struct qlcnic_info { | |||
1025 | __le16 min_tx_bw; | 1045 | __le16 min_tx_bw; |
1026 | __le16 max_tx_bw; | 1046 | __le16 max_tx_bw; |
1027 | u8 reserved2[104]; | 1047 | u8 reserved2[104]; |
1028 | }; | 1048 | } __packed; |
1029 | 1049 | ||
1030 | struct qlcnic_pci_info { | 1050 | struct qlcnic_pci_info { |
1031 | __le16 id; /* pci function id */ | 1051 | __le16 id; /* pci function id */ |
@@ -1039,10 +1059,10 @@ struct qlcnic_pci_info { | |||
1039 | 1059 | ||
1040 | u8 mac[ETH_ALEN]; | 1060 | u8 mac[ETH_ALEN]; |
1041 | u8 reserved2[106]; | 1061 | u8 reserved2[106]; |
1042 | }; | 1062 | } __packed; |
1043 | 1063 | ||
1044 | struct qlcnic_npar_info { | 1064 | struct qlcnic_npar_info { |
1045 | u16 vlan_id; | 1065 | u16 pvid; |
1046 | u16 min_bw; | 1066 | u16 min_bw; |
1047 | u16 max_bw; | 1067 | u16 max_bw; |
1048 | u8 phy_port; | 1068 | u8 phy_port; |
@@ -1050,11 +1070,13 @@ struct qlcnic_npar_info { | |||
1050 | u8 active; | 1070 | u8 active; |
1051 | u8 enable_pm; | 1071 | u8 enable_pm; |
1052 | u8 dest_npar; | 1072 | u8 dest_npar; |
1053 | u8 host_vlan_tag; | ||
1054 | u8 promisc_mode; | ||
1055 | u8 discard_tagged; | 1073 | u8 discard_tagged; |
1056 | u8 mac_learning; | 1074 | u8 mac_override; |
1075 | u8 mac_anti_spoof; | ||
1076 | u8 promisc_mode; | ||
1077 | u8 offload_flags; | ||
1057 | }; | 1078 | }; |
1079 | |||
1058 | struct qlcnic_eswitch { | 1080 | struct qlcnic_eswitch { |
1059 | u8 port; | 1081 | u8 port; |
1060 | u8 active_vports; | 1082 | u8 active_vports; |
@@ -1074,19 +1096,13 @@ struct qlcnic_eswitch { | |||
1074 | /* Return codes for Error handling */ | 1096 | /* Return codes for Error handling */ |
1075 | #define QL_STATUS_INVALID_PARAM -1 | 1097 | #define QL_STATUS_INVALID_PARAM -1 |
1076 | 1098 | ||
1077 | #define MAX_BW 100 | 1099 | #define MAX_BW 100 /* % of link speed */ |
1078 | #define MIN_BW 1 | ||
1079 | #define MAX_VLAN_ID 4095 | 1100 | #define MAX_VLAN_ID 4095 |
1080 | #define MIN_VLAN_ID 2 | 1101 | #define MIN_VLAN_ID 2 |
1081 | #define MAX_TX_QUEUES 1 | ||
1082 | #define MAX_RX_QUEUES 4 | ||
1083 | #define DEFAULT_MAC_LEARN 1 | 1102 | #define DEFAULT_MAC_LEARN 1 |
1084 | 1103 | ||
1085 | #define IS_VALID_VLAN(vlan) (vlan >= MIN_VLAN_ID && vlan <= MAX_VLAN_ID) | 1104 | #define IS_VALID_VLAN(vlan) (vlan >= MIN_VLAN_ID && vlan < MAX_VLAN_ID) |
1086 | #define IS_VALID_BW(bw) (bw >= MIN_BW && bw <= MAX_BW) | 1105 | #define IS_VALID_BW(bw) (bw <= MAX_BW) |
1087 | #define IS_VALID_TX_QUEUES(que) (que > 0 && que <= MAX_TX_QUEUES) | ||
1088 | #define IS_VALID_RX_QUEUES(que) (que > 0 && que <= MAX_RX_QUEUES) | ||
1089 | #define IS_VALID_MODE(mode) (mode == 0 || mode == 1) | ||
1090 | 1106 | ||
1091 | struct qlcnic_pci_func_cfg { | 1107 | struct qlcnic_pci_func_cfg { |
1092 | u16 func_type; | 1108 | u16 func_type; |
@@ -1118,16 +1134,202 @@ struct qlcnic_pm_func_cfg { | |||
1118 | 1134 | ||
1119 | struct qlcnic_esw_func_cfg { | 1135 | struct qlcnic_esw_func_cfg { |
1120 | u16 vlan_id; | 1136 | u16 vlan_id; |
1137 | u8 op_mode; | ||
1138 | u8 op_type; | ||
1121 | u8 pci_func; | 1139 | u8 pci_func; |
1122 | u8 host_vlan_tag; | 1140 | u8 host_vlan_tag; |
1123 | u8 promisc_mode; | 1141 | u8 promisc_mode; |
1124 | u8 discard_tagged; | 1142 | u8 discard_tagged; |
1125 | u8 mac_learning; | 1143 | u8 mac_override; |
1126 | u8 reserved; | 1144 | u8 mac_anti_spoof; |
1145 | u8 offload_flags; | ||
1146 | u8 reserved[5]; | ||
1147 | }; | ||
1148 | |||
1149 | #define QLCNIC_STATS_VERSION 1 | ||
1150 | #define QLCNIC_STATS_PORT 1 | ||
1151 | #define QLCNIC_STATS_ESWITCH 2 | ||
1152 | #define QLCNIC_QUERY_RX_COUNTER 0 | ||
1153 | #define QLCNIC_QUERY_TX_COUNTER 1 | ||
1154 | #define QLCNIC_ESW_STATS_NOT_AVAIL 0xffffffffffffffffULL | ||
1155 | |||
1156 | #define QLCNIC_ADD_ESW_STATS(VAL1, VAL2)\ | ||
1157 | do { \ | ||
1158 | if (((VAL1) == QLCNIC_ESW_STATS_NOT_AVAIL) && \ | ||
1159 | ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \ | ||
1160 | (VAL1) = (VAL2); \ | ||
1161 | else if (((VAL1) != QLCNIC_ESW_STATS_NOT_AVAIL) && \ | ||
1162 | ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \ | ||
1163 | (VAL1) += (VAL2); \ | ||
1164 | } while (0) | ||
1165 | |||
1166 | struct __qlcnic_esw_statistics { | ||
1167 | __le16 context_id; | ||
1168 | __le16 version; | ||
1169 | __le16 size; | ||
1170 | __le16 unused; | ||
1171 | __le64 unicast_frames; | ||
1172 | __le64 multicast_frames; | ||
1173 | __le64 broadcast_frames; | ||
1174 | __le64 dropped_frames; | ||
1175 | __le64 errors; | ||
1176 | __le64 local_frames; | ||
1177 | __le64 numbytes; | ||
1178 | __le64 rsvd[3]; | ||
1179 | } __packed; | ||
1180 | |||
1181 | struct qlcnic_esw_statistics { | ||
1182 | struct __qlcnic_esw_statistics rx; | ||
1183 | struct __qlcnic_esw_statistics tx; | ||
1184 | }; | ||
1185 | |||
1186 | struct qlcnic_common_entry_hdr { | ||
1187 | __le32 type; | ||
1188 | __le32 offset; | ||
1189 | __le32 cap_size; | ||
1190 | u8 mask; | ||
1191 | u8 rsvd[2]; | ||
1192 | u8 flags; | ||
1193 | } __packed; | ||
1194 | |||
1195 | struct __crb { | ||
1196 | __le32 addr; | ||
1197 | u8 stride; | ||
1198 | u8 rsvd1[3]; | ||
1199 | __le32 data_size; | ||
1200 | __le32 no_ops; | ||
1201 | __le32 rsvd2[4]; | ||
1202 | } __packed; | ||
1203 | |||
1204 | struct __ctrl { | ||
1205 | __le32 addr; | ||
1206 | u8 stride; | ||
1207 | u8 index_a; | ||
1208 | __le16 timeout; | ||
1209 | __le32 data_size; | ||
1210 | __le32 no_ops; | ||
1211 | u8 opcode; | ||
1212 | u8 index_v; | ||
1213 | u8 shl_val; | ||
1214 | u8 shr_val; | ||
1215 | __le32 val1; | ||
1216 | __le32 val2; | ||
1217 | __le32 val3; | ||
1218 | } __packed; | ||
1219 | |||
1220 | struct __cache { | ||
1221 | __le32 addr; | ||
1222 | u8 stride; | ||
1223 | u8 rsvd; | ||
1224 | __le16 init_tag_val; | ||
1225 | __le32 size; | ||
1226 | __le32 no_ops; | ||
1227 | __le32 ctrl_addr; | ||
1228 | __le32 ctrl_val; | ||
1229 | __le32 read_addr; | ||
1230 | u8 read_addr_stride; | ||
1231 | u8 read_addr_num; | ||
1232 | u8 rsvd1[2]; | ||
1233 | } __packed; | ||
1234 | |||
1235 | struct __ocm { | ||
1236 | u8 rsvd[8]; | ||
1237 | __le32 size; | ||
1238 | __le32 no_ops; | ||
1239 | u8 rsvd1[8]; | ||
1240 | __le32 read_addr; | ||
1241 | __le32 read_addr_stride; | ||
1242 | } __packed; | ||
1243 | |||
1244 | struct __mem { | ||
1245 | u8 rsvd[24]; | ||
1246 | __le32 addr; | ||
1247 | __le32 size; | ||
1248 | } __packed; | ||
1249 | |||
1250 | struct __mux { | ||
1251 | __le32 addr; | ||
1252 | u8 rsvd[4]; | ||
1253 | __le32 size; | ||
1254 | __le32 no_ops; | ||
1255 | __le32 val; | ||
1256 | __le32 val_stride; | ||
1257 | __le32 read_addr; | ||
1258 | u8 rsvd2[4]; | ||
1259 | } __packed; | ||
1260 | |||
1261 | struct __queue { | ||
1262 | __le32 sel_addr; | ||
1263 | __le16 stride; | ||
1264 | u8 rsvd[2]; | ||
1265 | __le32 size; | ||
1266 | __le32 no_ops; | ||
1267 | u8 rsvd2[8]; | ||
1268 | __le32 read_addr; | ||
1269 | u8 read_addr_stride; | ||
1270 | u8 read_addr_cnt; | ||
1271 | u8 rsvd3[2]; | ||
1272 | } __packed; | ||
1273 | |||
1274 | struct qlcnic_dump_entry { | ||
1275 | struct qlcnic_common_entry_hdr hdr; | ||
1276 | union { | ||
1277 | struct __crb crb; | ||
1278 | struct __cache cache; | ||
1279 | struct __ocm ocm; | ||
1280 | struct __mem mem; | ||
1281 | struct __mux mux; | ||
1282 | struct __queue que; | ||
1283 | struct __ctrl ctrl; | ||
1284 | } region; | ||
1285 | } __packed; | ||
1286 | |||
1287 | enum op_codes { | ||
1288 | QLCNIC_DUMP_NOP = 0, | ||
1289 | QLCNIC_DUMP_READ_CRB = 1, | ||
1290 | QLCNIC_DUMP_READ_MUX = 2, | ||
1291 | QLCNIC_DUMP_QUEUE = 3, | ||
1292 | QLCNIC_DUMP_BRD_CONFIG = 4, | ||
1293 | QLCNIC_DUMP_READ_OCM = 6, | ||
1294 | QLCNIC_DUMP_PEG_REG = 7, | ||
1295 | QLCNIC_DUMP_L1_DTAG = 8, | ||
1296 | QLCNIC_DUMP_L1_ITAG = 9, | ||
1297 | QLCNIC_DUMP_L1_DATA = 11, | ||
1298 | QLCNIC_DUMP_L1_INST = 12, | ||
1299 | QLCNIC_DUMP_L2_DTAG = 21, | ||
1300 | QLCNIC_DUMP_L2_ITAG = 22, | ||
1301 | QLCNIC_DUMP_L2_DATA = 23, | ||
1302 | QLCNIC_DUMP_L2_INST = 24, | ||
1303 | QLCNIC_DUMP_READ_ROM = 71, | ||
1304 | QLCNIC_DUMP_READ_MEM = 72, | ||
1305 | QLCNIC_DUMP_READ_CTRL = 98, | ||
1306 | QLCNIC_DUMP_TLHDR = 99, | ||
1307 | QLCNIC_DUMP_RDEND = 255 | ||
1308 | }; | ||
1309 | |||
1310 | #define QLCNIC_DUMP_WCRB BIT_0 | ||
1311 | #define QLCNIC_DUMP_RWCRB BIT_1 | ||
1312 | #define QLCNIC_DUMP_ANDCRB BIT_2 | ||
1313 | #define QLCNIC_DUMP_ORCRB BIT_3 | ||
1314 | #define QLCNIC_DUMP_POLLCRB BIT_4 | ||
1315 | #define QLCNIC_DUMP_RD_SAVE BIT_5 | ||
1316 | #define QLCNIC_DUMP_WRT_SAVED BIT_6 | ||
1317 | #define QLCNIC_DUMP_MOD_SAVE_ST BIT_7 | ||
1318 | #define QLCNIC_DUMP_SKIP BIT_7 | ||
1319 | |||
1320 | #define QLCNIC_DUMP_MASK_MIN 3 | ||
1321 | #define QLCNIC_DUMP_MASK_DEF 0x0f | ||
1322 | #define QLCNIC_DUMP_MASK_MAX 0xff | ||
1323 | #define QLCNIC_FORCE_FW_DUMP_KEY 0xdeadfeed | ||
1324 | |||
1325 | struct qlcnic_dump_operations { | ||
1326 | enum op_codes opcode; | ||
1327 | u32 (*handler)(struct qlcnic_adapter *, | ||
1328 | struct qlcnic_dump_entry *, u32 *); | ||
1127 | }; | 1329 | }; |
1128 | 1330 | ||
1129 | int qlcnic_fw_cmd_query_phy(struct qlcnic_adapter *adapter, u32 reg, u32 *val); | 1331 | int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter); |
1130 | int qlcnic_fw_cmd_set_phy(struct qlcnic_adapter *adapter, u32 reg, u32 val); | 1332 | int qlcnic_fw_cmd_set_port(struct qlcnic_adapter *adapter, u32 config); |
1131 | 1333 | ||
1132 | u32 qlcnic_hw_read_wx_2M(struct qlcnic_adapter *adapter, ulong off); | 1334 | u32 qlcnic_hw_read_wx_2M(struct qlcnic_adapter *adapter, ulong off); |
1133 | int qlcnic_hw_write_wx_2M(struct qlcnic_adapter *, ulong off, u32 data); | 1335 | int qlcnic_hw_write_wx_2M(struct qlcnic_adapter *, ulong off, u32 data); |
@@ -1171,6 +1373,9 @@ void qlcnic_pcie_sem_unlock(struct qlcnic_adapter *, int); | |||
1171 | int qlcnic_get_board_info(struct qlcnic_adapter *adapter); | 1373 | int qlcnic_get_board_info(struct qlcnic_adapter *adapter); |
1172 | int qlcnic_wol_supported(struct qlcnic_adapter *adapter); | 1374 | int qlcnic_wol_supported(struct qlcnic_adapter *adapter); |
1173 | int qlcnic_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate); | 1375 | int qlcnic_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate); |
1376 | void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter); | ||
1377 | void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter); | ||
1378 | int qlcnic_dump_fw(struct qlcnic_adapter *); | ||
1174 | 1379 | ||
1175 | /* Functions from qlcnic_init.c */ | 1380 | /* Functions from qlcnic_init.c */ |
1176 | int qlcnic_load_firmware(struct qlcnic_adapter *adapter); | 1381 | int qlcnic_load_firmware(struct qlcnic_adapter *adapter); |
@@ -1181,7 +1386,7 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter); | |||
1181 | int qlcnic_setup_idc_param(struct qlcnic_adapter *adapter); | 1386 | int qlcnic_setup_idc_param(struct qlcnic_adapter *adapter); |
1182 | int qlcnic_check_flash_fw_ver(struct qlcnic_adapter *adapter); | 1387 | int qlcnic_check_flash_fw_ver(struct qlcnic_adapter *adapter); |
1183 | 1388 | ||
1184 | int qlcnic_rom_fast_read(struct qlcnic_adapter *adapter, int addr, int *valp); | 1389 | int qlcnic_rom_fast_read(struct qlcnic_adapter *adapter, u32 addr, u32 *valp); |
1185 | int qlcnic_rom_fast_read_words(struct qlcnic_adapter *adapter, int addr, | 1390 | int qlcnic_rom_fast_read_words(struct qlcnic_adapter *adapter, int addr, |
1186 | u8 *bytes, size_t size); | 1391 | u8 *bytes, size_t size); |
1187 | int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter); | 1392 | int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter); |
@@ -1199,9 +1404,9 @@ void qlcnic_reset_rx_buffers_list(struct qlcnic_adapter *adapter); | |||
1199 | void qlcnic_release_rx_buffers(struct qlcnic_adapter *adapter); | 1404 | void qlcnic_release_rx_buffers(struct qlcnic_adapter *adapter); |
1200 | void qlcnic_release_tx_buffers(struct qlcnic_adapter *adapter); | 1405 | void qlcnic_release_tx_buffers(struct qlcnic_adapter *adapter); |
1201 | 1406 | ||
1202 | int qlcnic_init_firmware(struct qlcnic_adapter *adapter); | 1407 | int qlcnic_check_fw_status(struct qlcnic_adapter *adapter); |
1203 | void qlcnic_watchdog_task(struct work_struct *work); | 1408 | void qlcnic_watchdog_task(struct work_struct *work); |
1204 | void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, u32 ringid, | 1409 | void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, |
1205 | struct qlcnic_host_rds_ring *rds_ring); | 1410 | struct qlcnic_host_rds_ring *rds_ring); |
1206 | int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max); | 1411 | int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max); |
1207 | void qlcnic_set_multi(struct net_device *netdev); | 1412 | void qlcnic_set_multi(struct net_device *netdev); |
@@ -1209,20 +1414,19 @@ void qlcnic_free_mac_list(struct qlcnic_adapter *adapter); | |||
1209 | int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter, u32); | 1414 | int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter, u32); |
1210 | int qlcnic_config_intr_coalesce(struct qlcnic_adapter *adapter); | 1415 | int qlcnic_config_intr_coalesce(struct qlcnic_adapter *adapter); |
1211 | int qlcnic_config_rss(struct qlcnic_adapter *adapter, int enable); | 1416 | int qlcnic_config_rss(struct qlcnic_adapter *adapter, int enable); |
1212 | int qlcnic_config_ipaddr(struct qlcnic_adapter *adapter, u32 ip, int cmd); | 1417 | int qlcnic_config_ipaddr(struct qlcnic_adapter *adapter, __be32 ip, int cmd); |
1213 | int qlcnic_linkevent_request(struct qlcnic_adapter *adapter, int enable); | 1418 | int qlcnic_linkevent_request(struct qlcnic_adapter *adapter, int enable); |
1214 | void qlcnic_advert_link_change(struct qlcnic_adapter *adapter, int linkup); | 1419 | void qlcnic_advert_link_change(struct qlcnic_adapter *adapter, int linkup); |
1215 | 1420 | ||
1216 | int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu); | 1421 | int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu); |
1217 | int qlcnic_change_mtu(struct net_device *netdev, int new_mtu); | 1422 | int qlcnic_change_mtu(struct net_device *netdev, int new_mtu); |
1423 | u32 qlcnic_fix_features(struct net_device *netdev, u32 features); | ||
1424 | int qlcnic_set_features(struct net_device *netdev, u32 features); | ||
1218 | int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable); | 1425 | int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable); |
1219 | int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable); | 1426 | int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable); |
1220 | int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter); | 1427 | int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter); |
1221 | void qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter, | 1428 | void qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter, |
1222 | struct qlcnic_host_tx_ring *tx_ring); | 1429 | struct qlcnic_host_tx_ring *tx_ring); |
1223 | int qlcnic_get_mac_addr(struct qlcnic_adapter *adapter, u8 *mac); | ||
1224 | void qlcnic_clear_ilb_mode(struct qlcnic_adapter *adapter); | ||
1225 | int qlcnic_set_ilb_mode(struct qlcnic_adapter *adapter); | ||
1226 | void qlcnic_fetch_mac(struct qlcnic_adapter *, u32, u32, u8, u8 *); | 1430 | void qlcnic_fetch_mac(struct qlcnic_adapter *, u32, u32, u8, u8 *); |
1227 | 1431 | ||
1228 | /* Functions from qlcnic_main.c */ | 1432 | /* Functions from qlcnic_main.c */ |
@@ -1231,27 +1435,28 @@ u32 qlcnic_issue_cmd(struct qlcnic_adapter *adapter, | |||
1231 | u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd); | 1435 | u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd); |
1232 | void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings); | 1436 | void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings); |
1233 | int qlcnic_diag_alloc_res(struct net_device *netdev, int test); | 1437 | int qlcnic_diag_alloc_res(struct net_device *netdev, int test); |
1234 | int qlcnic_check_loopback_buff(unsigned char *data); | ||
1235 | netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev); | 1438 | netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev); |
1236 | void qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring); | 1439 | int qlcnic_validate_max_rss(struct net_device *netdev, u8 max_hw, u8 val); |
1440 | int qlcnic_set_max_rss(struct qlcnic_adapter *adapter, u8 data); | ||
1441 | void qlcnic_dev_request_reset(struct qlcnic_adapter *); | ||
1237 | 1442 | ||
1238 | /* Management functions */ | 1443 | /* Management functions */ |
1239 | int qlcnic_set_mac_address(struct qlcnic_adapter *, u8*); | ||
1240 | int qlcnic_get_mac_address(struct qlcnic_adapter *, u8*); | 1444 | int qlcnic_get_mac_address(struct qlcnic_adapter *, u8*); |
1241 | int qlcnic_get_nic_info(struct qlcnic_adapter *, struct qlcnic_info *, u8); | 1445 | int qlcnic_get_nic_info(struct qlcnic_adapter *, struct qlcnic_info *, u8); |
1242 | int qlcnic_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *); | 1446 | int qlcnic_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *); |
1243 | int qlcnic_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info*); | 1447 | int qlcnic_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info*); |
1244 | int qlcnic_reset_partition(struct qlcnic_adapter *, u8); | ||
1245 | 1448 | ||
1246 | /* eSwitch management functions */ | 1449 | /* eSwitch management functions */ |
1247 | int qlcnic_get_eswitch_capabilities(struct qlcnic_adapter *, u8, | 1450 | int qlcnic_config_switch_port(struct qlcnic_adapter *, |
1248 | struct qlcnic_eswitch *); | 1451 | struct qlcnic_esw_func_cfg *); |
1249 | int qlcnic_get_eswitch_status(struct qlcnic_adapter *, u8, | 1452 | int qlcnic_get_eswitch_port_config(struct qlcnic_adapter *, |
1250 | struct qlcnic_eswitch *); | 1453 | struct qlcnic_esw_func_cfg *); |
1251 | int qlcnic_toggle_eswitch(struct qlcnic_adapter *, u8, u8); | ||
1252 | int qlcnic_config_switch_port(struct qlcnic_adapter *, u8, int, u8, u8, | ||
1253 | u8, u8, u16); | ||
1254 | int qlcnic_config_port_mirroring(struct qlcnic_adapter *, u8, u8, u8); | 1454 | int qlcnic_config_port_mirroring(struct qlcnic_adapter *, u8, u8, u8); |
1455 | int qlcnic_get_port_stats(struct qlcnic_adapter *, const u8, const u8, | ||
1456 | struct __qlcnic_esw_statistics *); | ||
1457 | int qlcnic_get_eswitch_stats(struct qlcnic_adapter *, const u8, u8, | ||
1458 | struct __qlcnic_esw_statistics *); | ||
1459 | int qlcnic_clear_esw_stats(struct qlcnic_adapter *adapter, u8, u8, u8); | ||
1255 | extern int qlcnic_config_tso; | 1460 | extern int qlcnic_config_tso; |
1256 | 1461 | ||
1257 | /* | 1462 | /* |
@@ -1280,6 +1485,10 @@ static const struct qlcnic_brdinfo qlcnic_boards[] = { | |||
1280 | "3200 Series Quad Port 1Gb Intelligent Ethernet Adapter"}, | 1485 | "3200 Series Quad Port 1Gb Intelligent Ethernet Adapter"}, |
1281 | {0x1077, 0x8020, 0x1077, 0x20f, | 1486 | {0x1077, 0x8020, 0x1077, 0x20f, |
1282 | "3200 Series Single Port 10Gb Intelligent Ethernet Adapter"}, | 1487 | "3200 Series Single Port 10Gb Intelligent Ethernet Adapter"}, |
1488 | {0x1077, 0x8020, 0x103c, 0x3733, | ||
1489 | "NC523SFP 10Gb 2-port Server Adapter"}, | ||
1490 | {0x1077, 0x8020, 0x103c, 0x3346, | ||
1491 | "CN1000Q Dual Port Converged Network Adapter"}, | ||
1283 | {0x1077, 0x8020, 0x0, 0x0, "cLOM8214 1/10GbE Controller"}, | 1492 | {0x1077, 0x8020, 0x0, 0x0, "cLOM8214 1/10GbE Controller"}, |
1284 | }; | 1493 | }; |
1285 | 1494 | ||
@@ -1287,8 +1496,7 @@ static const struct qlcnic_brdinfo qlcnic_boards[] = { | |||
1287 | 1496 | ||
1288 | static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring) | 1497 | static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring) |
1289 | { | 1498 | { |
1290 | smp_mb(); | 1499 | if (likely(tx_ring->producer < tx_ring->sw_consumer)) |
1291 | if (tx_ring->producer < tx_ring->sw_consumer) | ||
1292 | return tx_ring->sw_consumer - tx_ring->producer; | 1500 | return tx_ring->sw_consumer - tx_ring->producer; |
1293 | else | 1501 | else |
1294 | return tx_ring->sw_consumer + tx_ring->num_desc - | 1502 | return tx_ring->sw_consumer + tx_ring->num_desc - |
@@ -1298,7 +1506,6 @@ static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring) | |||
1298 | extern const struct ethtool_ops qlcnic_ethtool_ops; | 1506 | extern const struct ethtool_ops qlcnic_ethtool_ops; |
1299 | 1507 | ||
1300 | struct qlcnic_nic_template { | 1508 | struct qlcnic_nic_template { |
1301 | int (*get_mac_addr) (struct qlcnic_adapter *, u8*); | ||
1302 | int (*config_bridged_mode) (struct qlcnic_adapter *, u32); | 1509 | int (*config_bridged_mode) (struct qlcnic_adapter *, u32); |
1303 | int (*config_led) (struct qlcnic_adapter *, u32, u32); | 1510 | int (*config_led) (struct qlcnic_adapter *, u32, u32); |
1304 | int (*start_firmware) (struct qlcnic_adapter *); | 1511 | int (*start_firmware) (struct qlcnic_adapter *); |