4 * Copyright (c) 2015-2017 Atomic Rules LLC
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 #include <rte_ethdev.h>
40 * This is the template file for users who which to define a dynamic
41 * extension to the Arkville PMD. User's who create an extension
42 * should include this file and define the necessary and desired
44 * Only 1 function is required for an extension, dev_init(); all other
45 * functions prototyped in this file are optional.
49 * Called post PMD init.
50 * The implementation returns its private data that gets passed into
51 * all other functions as user_data
52 * The ARK extension implementation MUST implement this function
54 void *dev_init(struct rte_eth_dev *dev, void *a_bar, int port_id);
56 /* Called during device shutdown */
57 void dev_uninit(struct rte_eth_dev *dev, void *user_data);
59 /* This call is optional and allows the
60 * extension to specify the number of supported ports.
62 uint8_t dev_get_port_count(struct rte_eth_dev *dev,
66 * The following functions are optional and are directly mapped
67 * from the DPDK PMD ops structure.
68 * Each function if implemented is called after the ARK PMD
69 * implementation executes.
72 int dev_configure(struct rte_eth_dev *dev,
75 int dev_start(struct rte_eth_dev *dev,
78 void dev_stop(struct rte_eth_dev *dev,
81 void dev_close(struct rte_eth_dev *dev,
84 int link_update(struct rte_eth_dev *dev,
88 int dev_set_link_up(struct rte_eth_dev *dev,
91 int dev_set_link_down(struct rte_eth_dev *dev,
94 void stats_get(struct rte_eth_dev *dev,
95 struct rte_eth_stats *stats,
98 void stats_reset(struct rte_eth_dev *dev,
101 void mac_addr_add(struct rte_eth_dev *dev,
102 struct ether_addr *macadr,
107 void mac_addr_remove(struct rte_eth_dev *dev,
111 void mac_addr_set(struct rte_eth_dev *dev,
112 struct ether_addr *mac_addr,