13047f90bd515b38e62094eff90b299f379ab7243Greg Rose/******************************************************************************* 23047f90bd515b38e62094eff90b299f379ab7243Greg Rose 33047f90bd515b38e62094eff90b299f379ab7243Greg Rose Intel 82599 Virtual Function driver 45c47a2b6211316ee9cd8740db453af7c5c01d0d6Greg Rose Copyright(c) 1999 - 2012 Intel Corporation. 53047f90bd515b38e62094eff90b299f379ab7243Greg Rose 63047f90bd515b38e62094eff90b299f379ab7243Greg Rose This program is free software; you can redistribute it and/or modify it 73047f90bd515b38e62094eff90b299f379ab7243Greg Rose under the terms and conditions of the GNU General Public License, 83047f90bd515b38e62094eff90b299f379ab7243Greg Rose version 2, as published by the Free Software Foundation. 93047f90bd515b38e62094eff90b299f379ab7243Greg Rose 103047f90bd515b38e62094eff90b299f379ab7243Greg Rose This program is distributed in the hope it will be useful, but WITHOUT 113047f90bd515b38e62094eff90b299f379ab7243Greg Rose ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 123047f90bd515b38e62094eff90b299f379ab7243Greg Rose FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 133047f90bd515b38e62094eff90b299f379ab7243Greg Rose more details. 143047f90bd515b38e62094eff90b299f379ab7243Greg Rose 153047f90bd515b38e62094eff90b299f379ab7243Greg Rose You should have received a copy of the GNU General Public License along with 163047f90bd515b38e62094eff90b299f379ab7243Greg Rose this program; if not, write to the Free Software Foundation, Inc., 173047f90bd515b38e62094eff90b299f379ab7243Greg Rose 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 183047f90bd515b38e62094eff90b299f379ab7243Greg Rose 193047f90bd515b38e62094eff90b299f379ab7243Greg Rose The full GNU General Public License is included in this distribution in 203047f90bd515b38e62094eff90b299f379ab7243Greg Rose the file called "COPYING". 213047f90bd515b38e62094eff90b299f379ab7243Greg Rose 223047f90bd515b38e62094eff90b299f379ab7243Greg Rose Contact Information: 233047f90bd515b38e62094eff90b299f379ab7243Greg Rose e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 243047f90bd515b38e62094eff90b299f379ab7243Greg Rose Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 253047f90bd515b38e62094eff90b299f379ab7243Greg Rose 263047f90bd515b38e62094eff90b299f379ab7243Greg Rose*******************************************************************************/ 273047f90bd515b38e62094eff90b299f379ab7243Greg Rose 283047f90bd515b38e62094eff90b299f379ab7243Greg Rose#ifndef __IXGBE_VF_H__ 293047f90bd515b38e62094eff90b299f379ab7243Greg Rose#define __IXGBE_VF_H__ 303047f90bd515b38e62094eff90b299f379ab7243Greg Rose 313047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include <linux/pci.h> 323047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include <linux/delay.h> 333047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include <linux/interrupt.h> 343047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include <linux/if_ether.h> 355c58c47a4f3758c81594402451d8fe0d8accb4e8Jiri Pirko#include <linux/netdevice.h> 363047f90bd515b38e62094eff90b299f379ab7243Greg Rose 373047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include "defines.h" 383047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include "regs.h" 393047f90bd515b38e62094eff90b299f379ab7243Greg Rose#include "mbx.h" 403047f90bd515b38e62094eff90b299f379ab7243Greg Rose 413047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_hw; 423047f90bd515b38e62094eff90b299f379ab7243Greg Rose 433047f90bd515b38e62094eff90b299f379ab7243Greg Rose/* iterator type for walking multicast address lists */ 443047f90bd515b38e62094eff90b299f379ab7243Greg Rosetypedef u8* (*ixgbe_mc_addr_itr) (struct ixgbe_hw *hw, u8 **mc_addr_ptr, 453047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 *vmdq); 463047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_mac_operations { 473047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*init_hw)(struct ixgbe_hw *); 483047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*reset_hw)(struct ixgbe_hw *); 493047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*start_hw)(struct ixgbe_hw *); 503047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*clear_hw_cntrs)(struct ixgbe_hw *); 513047f90bd515b38e62094eff90b299f379ab7243Greg Rose enum ixgbe_media_type (*get_media_type)(struct ixgbe_hw *); 523047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 (*get_supported_physical_layer)(struct ixgbe_hw *); 533047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*get_mac_addr)(struct ixgbe_hw *, u8 *); 543047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*stop_adapter)(struct ixgbe_hw *); 553047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*get_bus_info)(struct ixgbe_hw *); 563047f90bd515b38e62094eff90b299f379ab7243Greg Rose 573047f90bd515b38e62094eff90b299f379ab7243Greg Rose /* Link */ 583047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool); 593047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool); 603047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*get_link_capabilities)(struct ixgbe_hw *, ixgbe_link_speed *, 613047f90bd515b38e62094eff90b299f379ab7243Greg Rose bool *); 623047f90bd515b38e62094eff90b299f379ab7243Greg Rose 633047f90bd515b38e62094eff90b299f379ab7243Greg Rose /* RAR, Multicast, VLAN */ 643047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*set_rar)(struct ixgbe_hw *, u32, u8 *, u32); 6546ec20ff7d6f9f011e06d58e4e87153ed8c893edGreg Rose s32 (*set_uc_addr)(struct ixgbe_hw *, u32, u8 *); 663047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*init_rx_addrs)(struct ixgbe_hw *); 675c58c47a4f3758c81594402451d8fe0d8accb4e8Jiri Pirko s32 (*update_mc_addr_list)(struct ixgbe_hw *, struct net_device *); 683047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*enable_mc)(struct ixgbe_hw *); 693047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*disable_mc)(struct ixgbe_hw *); 703047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*clear_vfta)(struct ixgbe_hw *); 713047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool); 723047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 733047f90bd515b38e62094eff90b299f379ab7243Greg Rose 743047f90bd515b38e62094eff90b299f379ab7243Greg Roseenum ixgbe_mac_type { 753047f90bd515b38e62094eff90b299f379ab7243Greg Rose ixgbe_mac_unknown = 0, 763047f90bd515b38e62094eff90b299f379ab7243Greg Rose ixgbe_mac_82599_vf, 772316aa2aee254c126e688b53a3a105b82bc3f368Greg Rose ixgbe_mac_X540_vf, 783047f90bd515b38e62094eff90b299f379ab7243Greg Rose ixgbe_num_macs 793047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 803047f90bd515b38e62094eff90b299f379ab7243Greg Rose 813047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_mac_info { 823047f90bd515b38e62094eff90b299f379ab7243Greg Rose struct ixgbe_mac_operations ops; 833047f90bd515b38e62094eff90b299f379ab7243Greg Rose u8 addr[6]; 843047f90bd515b38e62094eff90b299f379ab7243Greg Rose u8 perm_addr[6]; 853047f90bd515b38e62094eff90b299f379ab7243Greg Rose 863047f90bd515b38e62094eff90b299f379ab7243Greg Rose enum ixgbe_mac_type type; 873047f90bd515b38e62094eff90b299f379ab7243Greg Rose 883047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 mc_filter_type; 893047f90bd515b38e62094eff90b299f379ab7243Greg Rose 903047f90bd515b38e62094eff90b299f379ab7243Greg Rose bool get_link_status; 913047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 max_tx_queues; 923047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 max_rx_queues; 933047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 max_msix_vectors; 943047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 953047f90bd515b38e62094eff90b299f379ab7243Greg Rose 963047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_mbx_operations { 973047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*init_params)(struct ixgbe_hw *hw); 983047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*read)(struct ixgbe_hw *, u32 *, u16); 993047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*write)(struct ixgbe_hw *, u32 *, u16); 1003047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*read_posted)(struct ixgbe_hw *, u32 *, u16); 1013047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*write_posted)(struct ixgbe_hw *, u32 *, u16); 1023047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*check_for_msg)(struct ixgbe_hw *); 1033047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*check_for_ack)(struct ixgbe_hw *); 1043047f90bd515b38e62094eff90b299f379ab7243Greg Rose s32 (*check_for_rst)(struct ixgbe_hw *); 1053047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 1063047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1073047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_mbx_stats { 1083047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 msgs_tx; 1093047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 msgs_rx; 1103047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1113047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 acks; 1123047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 reqs; 1133047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 rsts; 1143047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 1153047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1163047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_mbx_info { 1173047f90bd515b38e62094eff90b299f379ab7243Greg Rose struct ixgbe_mbx_operations ops; 1183047f90bd515b38e62094eff90b299f379ab7243Greg Rose struct ixgbe_mbx_stats stats; 1193047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 timeout; 1203047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 udelay; 1213047f90bd515b38e62094eff90b299f379ab7243Greg Rose u32 v2p_mailbox; 1223047f90bd515b38e62094eff90b299f379ab7243Greg Rose u16 size; 1233047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 1243047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1253047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbe_hw { 1263047f90bd515b38e62094eff90b299f379ab7243Greg Rose void *back; 1273047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1283047f90bd515b38e62094eff90b299f379ab7243Greg Rose u8 __iomem *hw_addr; 1293047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1303047f90bd515b38e62094eff90b299f379ab7243Greg Rose struct ixgbe_mac_info mac; 1313047f90bd515b38e62094eff90b299f379ab7243Greg Rose struct ixgbe_mbx_info mbx; 1323047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1333047f90bd515b38e62094eff90b299f379ab7243Greg Rose u16 device_id; 1343047f90bd515b38e62094eff90b299f379ab7243Greg Rose u16 subsystem_vendor_id; 1353047f90bd515b38e62094eff90b299f379ab7243Greg Rose u16 subsystem_device_id; 1363047f90bd515b38e62094eff90b299f379ab7243Greg Rose u16 vendor_id; 1373047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1383047f90bd515b38e62094eff90b299f379ab7243Greg Rose u8 revision_id; 1393047f90bd515b38e62094eff90b299f379ab7243Greg Rose bool adapter_stopped; 1403047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 1413047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1423047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbevf_hw_stats { 1433047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 base_vfgprc; 1443047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 base_vfgptc; 1453047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 base_vfgorc; 1463047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 base_vfgotc; 1473047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 base_vfmprc; 1483047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1493047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 last_vfgprc; 1503047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 last_vfgptc; 1513047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 last_vfgorc; 1523047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 last_vfgotc; 1533047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 last_vfmprc; 1543047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1553047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 vfgprc; 1563047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 vfgptc; 1573047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 vfgorc; 1583047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 vfgotc; 1593047f90bd515b38e62094eff90b299f379ab7243Greg Rose u64 vfmprc; 16033bd9f601ea21c4389870e425ae4eaf210d49b95Greg Rose 16133bd9f601ea21c4389870e425ae4eaf210d49b95Greg Rose u64 saved_reset_vfgprc; 16233bd9f601ea21c4389870e425ae4eaf210d49b95Greg Rose u64 saved_reset_vfgptc; 16333bd9f601ea21c4389870e425ae4eaf210d49b95Greg Rose u64 saved_reset_vfgorc; 16433bd9f601ea21c4389870e425ae4eaf210d49b95Greg Rose u64 saved_reset_vfgotc; 16533bd9f601ea21c4389870e425ae4eaf210d49b95Greg Rose u64 saved_reset_vfmprc; 1663047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 1673047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1683047f90bd515b38e62094eff90b299f379ab7243Greg Rosestruct ixgbevf_info { 1693047f90bd515b38e62094eff90b299f379ab7243Greg Rose enum ixgbe_mac_type mac; 1703d8fe98f8d5cb303d907d8f94ea6dc1f9a1d8b7aStephen Hemminger const struct ixgbe_mac_operations *mac_ops; 1713047f90bd515b38e62094eff90b299f379ab7243Greg Rose}; 1723047f90bd515b38e62094eff90b299f379ab7243Greg Rose 1733047f90bd515b38e62094eff90b299f379ab7243Greg Rose#endif /* __IXGBE_VF_H__ */ 1743047f90bd515b38e62094eff90b299f379ab7243Greg Rose 175