1 /**************************************************************************/
3 /* IBM System i and System p Virtual NIC Device Driver */
4 /* Copyright (C) 2014 IBM Corp. */
5 /* Santiago Leon (santi_leon@yahoo.com) */
6 /* Thomas Falcon (tlfalcon@linux.vnet.ibm.com) */
7 /* John Allen (jallen@linux.vnet.ibm.com) */
9 /* This program is free software; you can redistribute it and/or modify */
10 /* it under the terms of the GNU General Public License as published by */
11 /* the Free Software Foundation; either version 2 of the License, or */
12 /* (at your option) any later version. */
14 /* This program is distributed in the hope that it will be useful, */
15 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
16 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
17 /* GNU General Public License for more details. */
19 /* You should have received a copy of the GNU General Public License */
20 /* along with this program. */
22 /* This module contains the implementation of a virtual ethernet device */
23 /* for use with IBM i/pSeries LPAR Linux. It utilizes the logical LAN */
24 /* option of the RS/6000 Platform Architecture to interface with virtual */
25 /* ethernet NICs that are presented to the partition by the hypervisor. */
27 /**************************************************************************/
29 #define IBMVNIC_NAME "ibmvnic"
30 #define IBMVNIC_DRIVER_VERSION "1.0"
31 #define IBMVNIC_INVALID_MAP -1
32 #define IBMVNIC_STATS_TIMEOUT 1
33 /* basic structures plus 100 2k buffers */
34 #define IBMVNIC_IO_ENTITLEMENT_DEFAULT 610305
36 /* Initial module_parameters */
37 #define IBMVNIC_RX_WEIGHT 16
38 /* when changing this, update IBMVNIC_IO_ENTITLEMENT_DEFAULT */
39 #define IBMVNIC_BUFFS_PER_POOL 100
40 #define IBMVNIC_MAX_TX_QUEUES 5
42 struct ibmvnic_login_buffer
{
45 #define INITIAL_VERSION_LB 1
46 __be32 num_txcomp_subcrqs
;
47 __be32 off_txcomp_subcrqs
;
48 __be32 num_rxcomp_subcrqs
;
49 __be32 off_rxcomp_subcrqs
;
50 __be32 login_rsp_ioba
;
52 } __packed
__aligned(8);
54 struct ibmvnic_login_rsp_buffer
{
57 #define INITIAL_VERSION_LRB 1
58 __be32 num_txsubm_subcrqs
;
59 __be32 off_txsubm_subcrqs
;
60 __be32 num_rxadd_subcrqs
;
61 __be32 off_rxadd_subcrqs
;
62 __be32 off_rxadd_buff_size
;
63 __be32 num_supp_tx_desc
;
64 __be32 off_supp_tx_desc
;
65 } __packed
__aligned(8);
67 struct ibmvnic_query_ip_offload_buffer
{
70 #define INITIAL_VERSION_IOB 1
82 __be16 max_ipv4_header_size
;
83 __be16 max_ipv6_header_size
;
84 __be16 max_tcp_header_size
;
85 __be16 max_udp_header_size
;
86 __be32 max_large_tx_size
;
87 __be32 max_large_rx_size
;
89 u8 ipv6_extension_header
;
90 #define IPV6_EH_NOT_SUPPORTED 0x00
91 #define IPV6_EH_SUPPORTED_LIM 0x01
92 #define IPV6_EH_SUPPORTED 0xFF
94 #define TCP_PS_NOT_REQUIRED 0x00
95 #define TCP_PS_REQUIRED 0x01
97 __be16 num_ipv6_ext_headers
;
98 __be32 off_ipv6_ext_headers
;
100 } __packed
__aligned(8);
102 struct ibmvnic_control_ip_offload_buffer
{
105 #define INITIAL_VERSION_IOB 1
118 } __packed
__aligned(8);
120 struct ibmvnic_fw_component
{
122 __be32 trace_buff_size
;
125 u8 parent_correlator
;
126 u8 error_check_level
;
130 } __packed
__aligned(8);
132 struct ibmvnic_fw_trace_entry
{
136 __be64 pmc_registers
;
138 __be64 trace_data
[5];
139 } __packed
__aligned(8);
141 struct ibmvnic_statistics
{
148 __be64 ucast_tx_packets
;
149 __be64 ucast_rx_packets
;
150 __be64 mcast_tx_packets
;
151 __be64 mcast_rx_packets
;
152 __be64 bcast_tx_packets
;
153 __be64 bcast_rx_packets
;
156 __be64 single_collision_frames
;
157 __be64 multi_collision_frames
;
158 __be64 sqe_test_errors
;
160 __be64 late_collisions
;
161 __be64 excess_collisions
;
162 __be64 internal_mac_tx_errors
;
163 __be64 carrier_sense
;
164 __be64 too_long_frames
;
165 __be64 internal_mac_rx_errors
;
167 } __packed
__aligned(8);
169 struct ibmvnic_acl_buffer
{
172 #define INITIAL_VERSION_IOB 1
173 u8 mac_acls_restrict
;
174 u8 vlan_acls_restrict
;
176 __be32 num_mac_addrs
;
177 __be32 offset_mac_addrs
;
179 __be32 offset_vlan_ids
;
181 } __packed
__aligned(8);
183 /* descriptors have been changed, how should this be defined? 1? 4? */
185 #define IBMVNIC_TX_DESC_VERSIONS 3
187 /* is this still needed? */
188 struct ibmvnic_tx_comp_desc
{
192 __be32 correlators
[5];
193 } __packed
__aligned(8);
195 /* some flags that included in v0 descriptor, which is gone
196 * only used for IBMVNIC_TCP_CHKSUM and IBMVNIC_UDP_CHKSUM
197 * and only in some offload_flags variable that doesn't seem
198 * to be used anywhere, can probably be removed?
201 #define IBMVNIC_TCP_CHKSUM 0x20
202 #define IBMVNIC_UDP_CHKSUM 0x08
204 #define IBMVNIC_MAX_FRAGS_PER_CRQ 3
206 struct ibmvnic_tx_desc
{
210 #define IBMVNIC_TX_DESC 0x10
214 #define IBMVNIC_TX_COMP_NEEDED 0x80
215 #define IBMVNIC_TX_CHKSUM_OFFLOAD 0x40
216 #define IBMVNIC_TX_LSO 0x20
217 #define IBMVNIC_TX_PROT_TCP 0x10
218 #define IBMVNIC_TX_PROT_UDP 0x08
219 #define IBMVNIC_TX_PROT_IPV4 0x04
220 #define IBMVNIC_TX_PROT_IPV6 0x02
221 #define IBMVNIC_TX_VLAN_PRESENT 0x01
223 #define IBMVNIC_TX_VLAN_INSERT 0x80
231 } __packed
__aligned(8);
233 struct ibmvnic_hdr_desc
{
236 #define IBMVNIC_HDR_DESC 0x11
243 } __packed
__aligned(8);
245 struct ibmvnic_hdr_ext_desc
{
248 #define IBMVNIC_HDR_EXT_DESC 0x12
251 } __packed
__aligned(8);
253 struct ibmvnic_sge_desc
{
256 #define IBMVNIC_SGE_DESC 0x30
264 } __packed
__aligned(8);
266 struct ibmvnic_rx_comp_desc
{
269 #define IBMVNIC_IP_CHKSUM_GOOD 0x80
270 #define IBMVNIC_TCP_UDP_CHKSUM_GOOD 0x40
271 #define IBMVNIC_END_FRAME 0x20
272 #define IBMVNIC_EXACT_MC 0x10
273 #define IBMVNIC_VLAN_STRIPPED 0x08
274 __be16 off_frame_data
;
280 } __packed
__aligned(8);
282 struct ibmvnic_generic_scrq
{
285 } __packed
__aligned(8);
287 struct ibmvnic_rx_buff_add_desc
{
295 } __packed
__aligned(8);
298 u8 code
; /* one of enum ibmvnic_rc_codes */
300 } __packed
__aligned(4);
302 struct ibmvnic_generic_crq
{
306 struct ibmvnic_rc rc
;
307 } __packed
__aligned(8);
309 struct ibmvnic_version_exchange
{
313 #define IBMVNIC_INITIAL_VERSION 1
315 struct ibmvnic_rc rc
;
316 } __packed
__aligned(8);
318 struct ibmvnic_capability
{
321 __be16 capability
; /* one of ibmvnic_capabilities */
323 struct ibmvnic_rc rc
;
324 } __packed
__aligned(8);
326 struct ibmvnic_login
{
332 } __packed
__aligned(8);
334 struct ibmvnic_phys_parms
{
338 #define IBMVNIC_EXTERNAL_LOOPBACK 0x80
339 #define IBMVNIC_INTERNAL_LOOPBACK 0x40
340 #define IBMVNIC_PROMISC 0x20
341 #define IBMVNIC_PHYS_LINK_ACTIVE 0x10
342 #define IBMVNIC_AUTONEG_DUPLEX 0x08
343 #define IBMVNIC_FULL_DUPLEX 0x04
344 #define IBMVNIC_HALF_DUPLEX 0x02
345 #define IBMVNIC_CAN_CHG_PHYS_PARMS 0x01
347 #define IBMVNIC_LOGICAL_LNK_ACTIVE 0x80
349 #define IBMVNIC_AUTONEG 0x80
350 #define IBMVNIC_10MBPS 0x40
351 #define IBMVNIC_100MBPS 0x20
352 #define IBMVNIC_1GBPS 0x10
353 #define IBMVNIC_10GBPS 0x08
355 struct ibmvnic_rc rc
;
356 } __packed
__aligned(8);
358 struct ibmvnic_logical_link_state
{
362 #define IBMVNIC_LOGICAL_LNK_DN 0x00
363 #define IBMVNIC_LOGICAL_LNK_UP 0x01
364 #define IBMVNIC_LOGICAL_LNK_QUERY 0xff
366 struct ibmvnic_rc rc
;
367 } __packed
__aligned(8);
369 struct ibmvnic_query_ip_offload
{
375 struct ibmvnic_rc rc
;
376 } __packed
__aligned(8);
378 struct ibmvnic_control_ip_offload
{
384 struct ibmvnic_rc rc
;
385 } __packed
__aligned(8);
387 struct ibmvnic_request_dump_size
{
392 struct ibmvnic_rc rc
;
393 } __packed
__aligned(8);
395 struct ibmvnic_request_dump
{
402 } __packed
__aligned(8);
404 struct ibmvnic_request_dump_rsp
{
409 struct ibmvnic_rc rc
;
410 } __packed
__aligned(8);
412 struct ibmvnic_request_ras_comp_num
{
416 __be32 num_components
;
418 struct ibmvnic_rc rc
;
419 } __packed
__aligned(8);
421 struct ibmvnic_request_ras_comps
{
427 struct ibmvnic_rc rc
;
428 } __packed
__aligned(8);
430 struct ibmvnic_control_ras
{
436 #define IBMVNIC_TRACE_LEVEL 1
437 #define IBMVNIC_ERROR_LEVEL 2
438 #define IBMVNIC_TRACE_PAUSE 3
439 #define IBMVNIC_TRACE_RESUME 4
440 #define IBMVNIC_TRACE_ON 5
441 #define IBMVNIC_TRACE_OFF 6
442 #define IBMVNIC_CHG_TRACE_BUFF_SZ 7
445 struct ibmvnic_rc rc
;
446 } __packed
__aligned(8);
448 struct ibmvnic_collect_fw_trace
{
455 struct ibmvnic_rc rc
;
456 } __packed
__aligned(8);
458 struct ibmvnic_request_statistics
{
462 #define IBMVNIC_PHYSICAL_PORT 0x80
467 } __packed
__aligned(8);
469 struct ibmvnic_request_debug_stats
{
475 struct ibmvnic_rc rc
;
476 } __packed
__aligned(8);
478 struct ibmvnic_error_indication
{
482 #define IBMVNIC_FATAL_ERROR 0x80
485 __be32 detail_error_sz
;
488 } __packed
__aligned(8);
490 struct ibmvnic_request_error_info
{
497 } __packed
__aligned(8);
499 struct ibmvnic_request_error_rsp
{
505 struct ibmvnic_rc rc
;
506 } __packed
__aligned(8);
508 struct ibmvnic_link_state_indication
{
513 u8 logical_link_state
;
515 } __packed
__aligned(8);
517 struct ibmvnic_change_mac_addr
{
521 struct ibmvnic_rc rc
;
523 } __packed
__aligned(8);
525 struct ibmvnic_multicast_ctrl
{
530 #define IBMVNIC_ENABLE_MC 0x80
531 #define IBMVNIC_DISABLE_MC 0x40
532 #define IBMVNIC_ENABLE_ALL 0x20
533 #define IBMVNIC_DISABLE_ALL 0x10
535 __be16 reserved2
; /* was num_enabled_mc_addr; */
536 struct ibmvnic_rc rc
;
537 } __packed
__aligned(8);
539 struct ibmvnic_get_vpd_size_rsp
{
544 struct ibmvnic_rc rc
;
545 } __packed
__aligned(8);
547 struct ibmvnic_get_vpd
{
554 } __packed
__aligned(8);
556 struct ibmvnic_acl_change_indication
{
560 #define IBMVNIC_MAC_ACL 0
561 #define IBMVNIC_VLAN_ACL 1
563 } __packed
__aligned(8);
565 struct ibmvnic_acl_query
{
572 } __packed
__aligned(8);
574 struct ibmvnic_tune
{
581 } __packed
__aligned(8);
583 struct ibmvnic_request_map
{
591 } __packed
__aligned(8);
593 struct ibmvnic_request_map_rsp
{
599 struct ibmvnic_rc rc
;
600 } __packed
__aligned(8);
602 struct ibmvnic_request_unmap
{
608 } __packed
__aligned(8);
610 struct ibmvnic_request_unmap_rsp
{
616 struct ibmvnic_rc rc
;
617 } __packed
__aligned(8);
619 struct ibmvnic_query_map
{
623 } __packed
__aligned(8);
625 struct ibmvnic_query_map_rsp
{
632 struct ibmvnic_rc rc
;
633 } __packed
__aligned(8);
636 struct ibmvnic_generic_crq generic
;
637 struct ibmvnic_version_exchange version_exchange
;
638 struct ibmvnic_version_exchange version_exchange_rsp
;
639 struct ibmvnic_capability query_capability
;
640 struct ibmvnic_capability query_capability_rsp
;
641 struct ibmvnic_capability request_capability
;
642 struct ibmvnic_capability request_capability_rsp
;
643 struct ibmvnic_login login
;
644 struct ibmvnic_generic_crq login_rsp
;
645 struct ibmvnic_phys_parms query_phys_parms
;
646 struct ibmvnic_phys_parms query_phys_parms_rsp
;
647 struct ibmvnic_phys_parms query_phys_capabilities
;
648 struct ibmvnic_phys_parms query_phys_capabilities_rsp
;
649 struct ibmvnic_phys_parms set_phys_parms
;
650 struct ibmvnic_phys_parms set_phys_parms_rsp
;
651 struct ibmvnic_logical_link_state logical_link_state
;
652 struct ibmvnic_logical_link_state logical_link_state_rsp
;
653 struct ibmvnic_query_ip_offload query_ip_offload
;
654 struct ibmvnic_query_ip_offload query_ip_offload_rsp
;
655 struct ibmvnic_control_ip_offload control_ip_offload
;
656 struct ibmvnic_control_ip_offload control_ip_offload_rsp
;
657 struct ibmvnic_request_dump_size request_dump_size
;
658 struct ibmvnic_request_dump_size request_dump_size_rsp
;
659 struct ibmvnic_request_dump request_dump
;
660 struct ibmvnic_request_dump_rsp request_dump_rsp
;
661 struct ibmvnic_request_ras_comp_num request_ras_comp_num
;
662 struct ibmvnic_request_ras_comp_num request_ras_comp_num_rsp
;
663 struct ibmvnic_request_ras_comps request_ras_comps
;
664 struct ibmvnic_request_ras_comps request_ras_comps_rsp
;
665 struct ibmvnic_control_ras control_ras
;
666 struct ibmvnic_control_ras control_ras_rsp
;
667 struct ibmvnic_collect_fw_trace collect_fw_trace
;
668 struct ibmvnic_collect_fw_trace collect_fw_trace_rsp
;
669 struct ibmvnic_request_statistics request_statistics
;
670 struct ibmvnic_generic_crq request_statistics_rsp
;
671 struct ibmvnic_request_debug_stats request_debug_stats
;
672 struct ibmvnic_request_debug_stats request_debug_stats_rsp
;
673 struct ibmvnic_error_indication error_indication
;
674 struct ibmvnic_request_error_info request_error_info
;
675 struct ibmvnic_request_error_rsp request_error_rsp
;
676 struct ibmvnic_link_state_indication link_state_indication
;
677 struct ibmvnic_change_mac_addr change_mac_addr
;
678 struct ibmvnic_change_mac_addr change_mac_addr_rsp
;
679 struct ibmvnic_multicast_ctrl multicast_ctrl
;
680 struct ibmvnic_multicast_ctrl multicast_ctrl_rsp
;
681 struct ibmvnic_generic_crq get_vpd_size
;
682 struct ibmvnic_get_vpd_size_rsp get_vpd_size_rsp
;
683 struct ibmvnic_get_vpd get_vpd
;
684 struct ibmvnic_generic_crq get_vpd_rsp
;
685 struct ibmvnic_acl_change_indication acl_change_indication
;
686 struct ibmvnic_acl_query acl_query
;
687 struct ibmvnic_generic_crq acl_query_rsp
;
688 struct ibmvnic_tune tune
;
689 struct ibmvnic_generic_crq tune_rsp
;
690 struct ibmvnic_request_map request_map
;
691 struct ibmvnic_request_map_rsp request_map_rsp
;
692 struct ibmvnic_request_unmap request_unmap
;
693 struct ibmvnic_request_unmap_rsp request_unmap_rsp
;
694 struct ibmvnic_query_map query_map
;
695 struct ibmvnic_query_map_rsp query_map_rsp
;
698 enum ibmvnic_rc_codes
{
709 UNSUPPORTEDOPTION
= 10,
712 enum ibmvnic_capabilities
{
715 MIN_RX_ADD_QUEUES
= 3,
718 MAX_RX_ADD_QUEUES
= 6,
721 REQ_RX_ADD_QUEUES
= 9,
722 MIN_TX_ENTRIES_PER_SUBCRQ
= 10,
723 MIN_RX_ADD_ENTRIES_PER_SUBCRQ
= 11,
724 MAX_TX_ENTRIES_PER_SUBCRQ
= 12,
725 MAX_RX_ADD_ENTRIES_PER_SUBCRQ
= 13,
726 REQ_TX_ENTRIES_PER_SUBCRQ
= 14,
727 REQ_RX_ADD_ENTRIES_PER_SUBCRQ
= 15,
729 PROMISC_REQUESTED
= 17,
730 PROMISC_SUPPORTED
= 18,
734 MAX_MULTICAST_FILTERS
= 22,
735 VLAN_HEADER_INSERTION
= 23,
736 MAX_TX_SG_ENTRIES
= 25,
737 RX_SG_SUPPORTED
= 26,
738 RX_SG_REQUESTED
= 27,
739 OPT_TX_COMP_SUB_QUEUES
= 28,
740 OPT_RX_COMP_QUEUES
= 29,
741 OPT_RX_BUFADD_Q_PER_RX_COMP_Q
= 30,
742 OPT_TX_ENTRIES_PER_SUBCRQ
= 31,
743 OPT_RXBA_ENTRIES_PER_SUBCRQ
= 32,
747 enum ibmvnic_error_cause
{
757 enum ibmvnic_commands
{
758 VERSION_EXCHANGE
= 0x01,
759 VERSION_EXCHANGE_RSP
= 0x81,
760 QUERY_CAPABILITY
= 0x02,
761 QUERY_CAPABILITY_RSP
= 0x82,
762 REQUEST_CAPABILITY
= 0x03,
763 REQUEST_CAPABILITY_RSP
= 0x83,
766 QUERY_PHYS_PARMS
= 0x05,
767 QUERY_PHYS_PARMS_RSP
= 0x85,
768 QUERY_PHYS_CAPABILITIES
= 0x06,
769 QUERY_PHYS_CAPABILITIES_RSP
= 0x86,
770 SET_PHYS_PARMS
= 0x07,
771 SET_PHYS_PARMS_RSP
= 0x87,
772 ERROR_INDICATION
= 0x08,
773 REQUEST_ERROR_INFO
= 0x09,
774 REQUEST_ERROR_RSP
= 0x89,
775 REQUEST_DUMP_SIZE
= 0x0A,
776 REQUEST_DUMP_SIZE_RSP
= 0x8A,
778 REQUEST_DUMP_RSP
= 0x8B,
779 LOGICAL_LINK_STATE
= 0x0C,
780 LOGICAL_LINK_STATE_RSP
= 0x8C,
781 REQUEST_STATISTICS
= 0x0D,
782 REQUEST_STATISTICS_RSP
= 0x8D,
783 REQUEST_RAS_COMP_NUM
= 0x0E,
784 REQUEST_RAS_COMP_NUM_RSP
= 0x8E,
785 REQUEST_RAS_COMPS
= 0x0F,
786 REQUEST_RAS_COMPS_RSP
= 0x8F,
788 CONTROL_RAS_RSP
= 0x90,
789 COLLECT_FW_TRACE
= 0x11,
790 COLLECT_FW_TRACE_RSP
= 0x91,
791 LINK_STATE_INDICATION
= 0x12,
792 CHANGE_MAC_ADDR
= 0x13,
793 CHANGE_MAC_ADDR_RSP
= 0x93,
794 MULTICAST_CTRL
= 0x14,
795 MULTICAST_CTRL_RSP
= 0x94,
797 GET_VPD_SIZE_RSP
= 0x95,
802 QUERY_IP_OFFLOAD
= 0x18,
803 QUERY_IP_OFFLOAD_RSP
= 0x98,
804 CONTROL_IP_OFFLOAD
= 0x19,
805 CONTROL_IP_OFFLOAD_RSP
= 0x99,
806 ACL_CHANGE_INDICATION
= 0x1A,
808 ACL_QUERY_RSP
= 0x9B,
809 REQUEST_DEBUG_STATS
= 0x1C,
810 REQUEST_DEBUG_STATS_RSP
= 0x9C,
812 QUERY_MAP_RSP
= 0x9D,
814 REQUEST_MAP_RSP
= 0x9E,
815 REQUEST_UNMAP
= 0x1F,
816 REQUEST_UNMAP_RSP
= 0x9F,
818 VLAN_CTRL_RSP
= 0xA0,
821 enum ibmvnic_crq_type
{
822 IBMVNIC_CRQ_CMD
= 0x80,
823 IBMVNIC_CRQ_CMD_RSP
= 0x80,
824 IBMVNIC_CRQ_INIT_CMD
= 0xC0,
825 IBMVNIC_CRQ_INIT_RSP
= 0xC0,
826 IBMVNIC_CRQ_XPORT_EVENT
= 0xFF,
829 enum ibmvfc_crq_format
{
830 IBMVNIC_CRQ_INIT
= 0x01,
831 IBMVNIC_CRQ_INIT_COMPLETE
= 0x02,
832 IBMVNIC_PARTITION_MIGRATED
= 0x06,
835 struct ibmvnic_crq_queue
{
836 union ibmvnic_crq
*msgs
;
838 dma_addr_t msg_token
;
843 struct ibmvnic_generic_scrq generic
;
844 struct ibmvnic_tx_comp_desc tx_comp
;
845 struct ibmvnic_tx_desc v1
;
846 struct ibmvnic_hdr_desc hdr
;
847 struct ibmvnic_hdr_ext_desc hdr_ext
;
848 struct ibmvnic_sge_desc sge
;
849 struct ibmvnic_rx_comp_desc rx_comp
;
850 struct ibmvnic_rx_buff_add_desc rx_add
;
853 struct ibmvnic_sub_crq_queue
{
856 dma_addr_t msg_token
;
857 unsigned long crq_num
;
858 unsigned long hw_irq
;
860 unsigned int pool_index
;
863 struct sk_buff
*rx_skb_top
;
864 struct ibmvnic_adapter
*adapter
;
867 struct ibmvnic_long_term_buff
{
874 struct ibmvnic_tx_buff
{
876 dma_addr_t data_dma
[IBMVNIC_MAX_FRAGS_PER_CRQ
];
877 unsigned int data_len
[IBMVNIC_MAX_FRAGS_PER_CRQ
];
882 union sub_crq indir_arr
[6];
884 dma_addr_t indir_dma
;
887 struct ibmvnic_tx_pool
{
888 struct ibmvnic_tx_buff
*tx_buff
;
892 wait_queue_head_t ibmvnic_tx_comp_q
;
893 struct task_struct
*work_thread
;
894 struct ibmvnic_long_term_buff long_term_buff
;
897 struct ibmvnic_rx_buff
{
905 struct ibmvnic_rx_pool
{
906 struct ibmvnic_rx_buff
*rx_buff
;
915 struct ibmvnic_long_term_buff long_term_buff
;
918 struct ibmvnic_error_buff
{
922 struct list_head list
;
926 struct ibmvnic_fw_comp_internal
{
927 struct ibmvnic_adapter
*adapter
;
929 struct debugfs_blob_wrapper desc_blob
;
933 struct ibmvnic_inflight_cmd
{
934 union ibmvnic_crq crq
;
935 struct list_head list
;
938 struct ibmvnic_adapter
{
939 struct vio_dev
*vdev
;
940 struct net_device
*netdev
;
941 struct ibmvnic_crq_queue crq
;
942 u8 mac_addr
[ETH_ALEN
];
943 struct ibmvnic_query_ip_offload_buffer ip_offload_buf
;
944 dma_addr_t ip_offload_tok
;
945 struct ibmvnic_control_ip_offload_buffer ip_offload_ctrl
;
946 dma_addr_t ip_offload_ctrl_tok
;
950 int bounce_buffer_size
;
951 dma_addr_t bounce_buffer_dma
;
954 struct net_device_stats net_stats
;
955 struct ibmvnic_statistics stats
;
956 dma_addr_t stats_token
;
957 struct completion stats_done
;
958 spinlock_t stats_lock
;
959 int replenish_no_mem
;
960 int replenish_add_buff_success
;
961 int replenish_add_buff_failure
;
962 int replenish_task_cycles
;
967 int logical_link_state
;
970 struct ibmvnic_login_buffer
*login_buf
;
971 dma_addr_t login_buf_token
;
974 struct ibmvnic_login_rsp_buffer
*login_rsp_buf
;
975 dma_addr_t login_rsp_buf_token
;
976 int login_rsp_buf_sz
;
978 atomic_t running_cap_queries
;
980 struct ibmvnic_sub_crq_queue
**tx_scrq
;
981 struct ibmvnic_sub_crq_queue
**rx_scrq
;
986 struct napi_struct
*napi
;
987 struct ibmvnic_rx_pool
*rx_pool
;
990 struct ibmvnic_tx_pool
*tx_pool
;
992 struct completion init_done
;
994 struct list_head errors
;
995 spinlock_t error_list_lock
;
998 struct dentry
*debugfs_dir
;
999 struct dentry
*debugfs_dump
;
1000 struct completion fw_done
;
1002 dma_addr_t dump_data_token
;
1005 struct ibmvnic_fw_component
*ras_comps
;
1006 struct ibmvnic_fw_comp_internal
*ras_comp_int
;
1007 dma_addr_t ras_comps_tok
;
1008 struct dentry
*ras_comps_ent
;
1010 /* in-flight commands that allocate and/or map memory*/
1011 struct list_head inflight
;
1012 spinlock_t inflight_lock
;
1014 /* partner capabilities */
1017 u64 min_rx_add_queues
;
1020 u64 max_rx_add_queues
;
1023 u64 req_rx_add_queues
;
1024 u64 min_tx_entries_per_subcrq
;
1025 u64 min_rx_add_entries_per_subcrq
;
1026 u64 max_tx_entries_per_subcrq
;
1027 u64 max_rx_add_entries_per_subcrq
;
1028 u64 req_tx_entries_per_subcrq
;
1029 u64 req_rx_add_entries_per_subcrq
;
1031 u64 promisc_requested
;
1032 u64 promisc_supported
;
1036 u64 max_multicast_filters
;
1037 u64 vlan_header_insertion
;
1038 u64 max_tx_sg_entries
;
1039 u64 rx_sg_supported
;
1040 u64 rx_sg_requested
;
1041 u64 opt_tx_comp_sub_queues
;
1042 u64 opt_rx_comp_queues
;
1043 u64 opt_rx_bufadd_q_per_rx_comp_q
;
1044 u64 opt_tx_entries_per_subcrq
;
1045 u64 opt_rxba_entries_per_subcrq
;
1046 __be64 tx_rx_desc_req
;
1049 struct work_struct vnic_crq_init
;