blob: b2d96b45ca3ccadc936170557b4a32f337f7396c [file] [log] [blame]
Alexander Duyckb6fec182014-09-20 19:47:46 -04001/* Intel Ethernet Switch Host Interface Driver
Bruce Allanbb269e82015-10-28 17:19:51 -07002 * Copyright(c) 2013 - 2015 Intel Corporation.
Alexander Duyckb6fec182014-09-20 19:47:46 -04003 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * The full GNU General Public License is included in this distribution in
14 * the file called "COPYING".
15 *
16 * Contact Information:
17 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
18 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
19 */
20
21#ifndef _FM10K_PF_H_
22#define _FM10K_PF_H_
23
24#include "fm10k_type.h"
25#include "fm10k_common.h"
26
Alexander Duyck401b5382014-09-20 19:47:58 -040027bool fm10k_glort_valid_pf(struct fm10k_hw *hw, u16 glort);
Alexander Duyckc2653862014-09-20 19:51:57 -040028u16 fm10k_queues_per_pool(struct fm10k_hw *hw);
29u16 fm10k_vf_queue_index(struct fm10k_hw *hw, u16 vf_idx);
Alexander Duyck401b5382014-09-20 19:47:58 -040030
31enum fm10k_pf_tlv_msg_id_v1 {
32 FM10K_PF_MSG_ID_TEST = 0x000, /* msg ID reserved */
33 FM10K_PF_MSG_ID_XCAST_MODES = 0x001,
34 FM10K_PF_MSG_ID_UPDATE_MAC_FWD_RULE = 0x002,
35 FM10K_PF_MSG_ID_LPORT_MAP = 0x100,
36 FM10K_PF_MSG_ID_LPORT_CREATE = 0x200,
37 FM10K_PF_MSG_ID_LPORT_DELETE = 0x201,
38 FM10K_PF_MSG_ID_CONFIG = 0x300,
39 FM10K_PF_MSG_ID_UPDATE_PVID = 0x400,
40 FM10K_PF_MSG_ID_CREATE_FLOW_TABLE = 0x501,
41 FM10K_PF_MSG_ID_DELETE_FLOW_TABLE = 0x502,
42 FM10K_PF_MSG_ID_UPDATE_FLOW = 0x503,
43 FM10K_PF_MSG_ID_DELETE_FLOW = 0x504,
44 FM10K_PF_MSG_ID_SET_FLOW_STATE = 0x505,
45 FM10K_PF_MSG_ID_GET_1588_INFO = 0x506,
46 FM10K_PF_MSG_ID_1588_TIMESTAMP = 0x701,
47};
48
49enum fm10k_pf_tlv_attr_id_v1 {
50 FM10K_PF_ATTR_ID_ERR = 0x00,
51 FM10K_PF_ATTR_ID_LPORT_MAP = 0x01,
52 FM10K_PF_ATTR_ID_XCAST_MODE = 0x02,
53 FM10K_PF_ATTR_ID_MAC_UPDATE = 0x03,
54 FM10K_PF_ATTR_ID_VLAN_UPDATE = 0x04,
55 FM10K_PF_ATTR_ID_CONFIG = 0x05,
56 FM10K_PF_ATTR_ID_CREATE_FLOW_TABLE = 0x06,
57 FM10K_PF_ATTR_ID_DELETE_FLOW_TABLE = 0x07,
58 FM10K_PF_ATTR_ID_UPDATE_FLOW = 0x08,
59 FM10K_PF_ATTR_ID_FLOW_STATE = 0x09,
60 FM10K_PF_ATTR_ID_FLOW_HANDLE = 0x0A,
61 FM10K_PF_ATTR_ID_DELETE_FLOW = 0x0B,
62 FM10K_PF_ATTR_ID_PORT = 0x0C,
63 FM10K_PF_ATTR_ID_UPDATE_PVID = 0x0D,
64 FM10K_PF_ATTR_ID_1588_TIMESTAMP = 0x10,
65};
66
67#define FM10K_MSG_LPORT_MAP_GLORT_SHIFT 0
68#define FM10K_MSG_LPORT_MAP_GLORT_SIZE 16
69#define FM10K_MSG_LPORT_MAP_MASK_SHIFT 16
70#define FM10K_MSG_LPORT_MAP_MASK_SIZE 16
71
72#define FM10K_MSG_UPDATE_PVID_GLORT_SHIFT 0
73#define FM10K_MSG_UPDATE_PVID_GLORT_SIZE 16
74#define FM10K_MSG_UPDATE_PVID_PVID_SHIFT 16
75#define FM10K_MSG_UPDATE_PVID_PVID_SIZE 16
76
Jacob Keller8c2a0292015-11-09 14:04:08 -080077/* The following data structures are overlayed directly onto TLV mailbox
78 * messages, and must not break 4 byte alignment. Ensure the structures line
79 * up correctly as per their TLV definition.
80 */
81
Alexander Duyck401b5382014-09-20 19:47:58 -040082struct fm10k_mac_update {
83 __le32 mac_lower;
84 __le16 mac_upper;
85 __le16 vlan;
86 __le16 glort;
87 u8 flags;
88 u8 action;
Jacob Keller8c2a0292015-11-09 14:04:08 -080089} __aligned(4) __packed;
Alexander Duyck401b5382014-09-20 19:47:58 -040090
91struct fm10k_global_table_data {
92 __le32 used;
93 __le32 avail;
Jacob Keller8c2a0292015-11-09 14:04:08 -080094} __aligned(4) __packed;
Alexander Duyck401b5382014-09-20 19:47:58 -040095
96struct fm10k_swapi_error {
97 __le32 status;
98 struct fm10k_global_table_data mac;
99 struct fm10k_global_table_data nexthop;
100 struct fm10k_global_table_data ffu;
Jacob Keller8c2a0292015-11-09 14:04:08 -0800101} __aligned(4) __packed;
Alexander Duyck401b5382014-09-20 19:47:58 -0400102
103struct fm10k_swapi_1588_timestamp {
104 __le64 egress;
105 __le64 ingress;
106 __le16 dglort;
107 __le16 sglort;
Jacob Keller8c2a0292015-11-09 14:04:08 -0800108} __aligned(4) __packed;
Alexander Duyck401b5382014-09-20 19:47:58 -0400109
110s32 fm10k_msg_lport_map_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
111extern const struct fm10k_tlv_attr fm10k_lport_map_msg_attr[];
112#define FM10K_PF_MSG_LPORT_MAP_HANDLER(func) \
113 FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_MAP, \
114 fm10k_lport_map_msg_attr, func)
Alexander Duyck401b5382014-09-20 19:47:58 -0400115extern const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[];
116#define FM10K_PF_MSG_UPDATE_PVID_HANDLER(func) \
117 FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_UPDATE_PVID, \
118 fm10k_update_pvid_msg_attr, func)
119
120s32 fm10k_msg_err_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
121extern const struct fm10k_tlv_attr fm10k_err_msg_attr[];
122#define FM10K_PF_MSG_ERR_HANDLER(msg, func) \
123 FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_##msg, fm10k_err_msg_attr, func)
124
125extern const struct fm10k_tlv_attr fm10k_1588_timestamp_msg_attr[];
126#define FM10K_PF_MSG_1588_TIMESTAMP_HANDLER(func) \
127 FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_1588_TIMESTAMP, \
128 fm10k_1588_timestamp_msg_attr, func)
129
Alexander Duyckc2653862014-09-20 19:51:57 -0400130s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
131s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **,
132 struct fm10k_mbx_info *);
133s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *, u32 **,
134 struct fm10k_mbx_info *);
Alexander Duyckc2653862014-09-20 19:51:57 -0400135
Bruce Allanf329ad72015-12-08 15:50:39 -0800136extern const struct fm10k_info fm10k_pf_info;
Alexander Duyckb6fec182014-09-20 19:47:46 -0400137#endif /* _FM10K_PF_H */