1 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
3 * Copyright (C) 2018 Netronome Systems, Inc.
5 * This software is dual licensed under the GNU General License Version 2,
6 * June 1991 as shown in the file COPYING in the top-level directory of this
7 * source tree or the BSD 2-Clause License provided below. You have the
8 * option to license this software under the complete terms of either license.
10 * The BSD 2-Clause License:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * 1. Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
20 * 2. Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36 #define __NFP_ABM_H__ 1
38 #include <net/devlink.h>
43 #define NFP_ABM_PORTID_TYPE GENMASK(23, 16)
44 #define NFP_ABM_PORTID_ID GENMASK(7, 0)
47 * struct nfp_abm - ABM NIC app structure
48 * @app: back pointer to nfp_app
49 * @pf_id: ID of our PF link
50 * @eswitch_mode: devlink eswitch mode, advanced functions only visible
56 enum devlink_eswitch_mode eswitch_mode;
60 * struct nfp_abm_link - port tuple of a ABM NIC
61 * @abm: back pointer to nfp_abm
63 * @id: id of the data vNIC
64 * @queue_base: id of base to host queue within PCIe (not QC idx)
70 unsigned int queue_base;
73 void nfp_abm_ctrl_read_params(struct nfp_abm_link *alink);
74 int nfp_abm_ctrl_find_addrs(struct nfp_abm *abm);