X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fethtool%2Flib%2Frte_ethtool.h;h=f17709663644b357eb92a6766e4dcb9681fd1d6a;hb=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;hp=2e79d4535c9f504d3001071e25b974319ac6b53e;hpb=bda68ab9d1e73bda4d500fa6977e3d713f483de8;p=dpdk.git diff --git a/examples/ethtool/lib/rte_ethtool.h b/examples/ethtool/lib/rte_ethtool.h index 2e79d4535c..f177096636 100644 --- a/examples/ethtool/lib/rte_ethtool.h +++ b/examples/ethtool/lib/rte_ethtool.h @@ -1,34 +1,5 @@ -/*- - * BSD LICENSE - * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2015 Intel Corporation */ #ifndef _RTE_ETHTOOL_H_ @@ -38,7 +9,7 @@ * This new interface is designed to provide a user-space shim layer for * Ethtool and Netdevice op API. * - * rte_ethtool_get_driver: ethtool_ops::get_driverinfo + * rte_ethtool_get_driver: ethtool_ops::get_drvinfo * rte_ethtool_get_link: ethtool_ops::get_link * rte_ethtool_get_regs_len: ethtool_ops::get_regs_len * rte_ethtool_get_regs: ethtool_ops::get_regs @@ -52,7 +23,7 @@ * rte_ethtool_net_stop: net_device_ops::ndo_stop * rte_ethtool_net_set_mac_addr: net_device_ops::ndo_set_mac_address * rte_ethtool_net_validate_addr: net_device_ops::ndo_validate_addr - * rte_ethtool_net_change_mtu: net_device_ops::rte_net_change_mtu + * rte_ethtool_net_change_mtu: net_device_ops::ndo_change_mtu * rte_ethtool_net_get_stats64: net_device_ops::ndo_get_stats64 * rte_ethtool_net_vlan_rx_add_vid net_device_ops::ndo_vlan_rx_add_vid * rte_ethtool_net_vlan_rx_kill_vid net_device_ops::ndo_vlan_rx_kill_vid @@ -79,7 +50,7 @@ extern "C" { * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo); +int rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo); /** * Retrieve the Ethernet device register length in bytes. @@ -93,7 +64,7 @@ int rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_get_regs_len(uint8_t port_id); +int rte_ethtool_get_regs_len(uint16_t port_id); /** * Retrieve the Ethernet device register information according to @@ -111,7 +82,7 @@ int rte_ethtool_get_regs_len(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs, +int rte_ethtool_get_regs(uint16_t port_id, struct ethtool_regs *regs, void *data); /** @@ -127,7 +98,7 @@ int rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs, * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_get_link(uint8_t port_id); +int rte_ethtool_get_link(uint16_t port_id); /** * Retrieve the Ethernet device EEPROM size @@ -141,7 +112,7 @@ int rte_ethtool_get_link(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_get_eeprom_len(uint8_t port_id); +int rte_ethtool_get_eeprom_len(uint16_t port_id); /** * Retrieve EEPROM content based upon eeprom range described in ethtool @@ -159,7 +130,7 @@ int rte_ethtool_get_eeprom_len(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom, +int rte_ethtool_get_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom, void *words); /** @@ -179,9 +150,43 @@ int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom, * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom, +int rte_ethtool_set_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom, void *words); +/** + * Retrieve the type and size of plugin module EEPROM + * + * @param port_id + * The port identifier of the Ethernet device. + * @param modinfo + * The pointer that provides the type and size of plugin module EEPROM. + * @return + * - (0) if successful. + * - (-ENOTSUP) if hardware doesn't support. + * - (-ENODEV) if *port_id* invalid. + * - others depends on the specific operations implementation. + */ +int rte_ethtool_get_module_info(uint16_t port_id, uint32_t *modinfo); + +/** + * Retrieve the data of plugin module EEPROM + * + * @param port_id + * The port identifier of the Ethernet device. + * @param eeprom + * The pointer of ethtool_eeprom that provides plugin module eeprom + * offset and length + * @param words + * A buffer that holds data read from plugin module eeprom + * @return + * - (0) if successful. + * - (-ENOTSUP) if hardware doesn't support. + * - (-ENODEV) if *port_id* invalid. + * - others depends on the specific operations implementation. + */ +int rte_ethtool_get_module_eeprom(uint16_t port_id, + struct ethtool_eeprom *eeprom, void *words); + /** * Retrieve the Ethernet device pause frame configuration according to * parameter attributes desribed by ethtool data structure, @@ -199,7 +204,7 @@ int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom, * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_get_pauseparam(uint8_t port_id, +int rte_ethtool_get_pauseparam(uint16_t port_id, struct ethtool_pauseparam *pause_param); /** @@ -217,7 +222,7 @@ int rte_ethtool_get_pauseparam(uint8_t port_id, * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_set_pauseparam(uint8_t port_id, +int rte_ethtool_set_pauseparam(uint16_t port_id, struct ethtool_pauseparam *param); /** @@ -231,7 +236,7 @@ int rte_ethtool_set_pauseparam(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_open(uint8_t port_id); +int rte_ethtool_net_open(uint16_t port_id); /** * Stop the Ethernet device. @@ -242,7 +247,7 @@ int rte_ethtool_net_open(uint8_t port_id); * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_ethtool_net_stop(uint8_t port_id); +int rte_ethtool_net_stop(uint16_t port_id); /** * Get the Ethernet device MAC address. @@ -255,7 +260,7 @@ int rte_ethtool_net_stop(uint8_t port_id); * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr); +int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr); /** * Setting the Ethernet device MAC address. @@ -271,7 +276,7 @@ int rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr); * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr); +int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr); /** * Validate if the provided MAC address is valid unicast address @@ -287,7 +292,8 @@ int rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr); * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_validate_addr(uint8_t port_id, struct ether_addr *addr); +int rte_ethtool_net_validate_addr(uint16_t port_id, + struct rte_ether_addr *addr); /** * Setting the Ethernet device maximum Tx unit. @@ -303,7 +309,7 @@ int rte_ethtool_net_validate_addr(uint8_t port_id, struct ether_addr *addr); * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_change_mtu(uint8_t port_id, int mtu); +int rte_ethtool_net_change_mtu(uint16_t port_id, int mtu); /** * Retrieve the Ethernet device traffic statistics @@ -319,7 +325,7 @@ int rte_ethtool_net_change_mtu(uint8_t port_id, int mtu); * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats); +int rte_ethtool_net_get_stats64(uint16_t port_id, struct rte_eth_stats *stats); /** * Update the Ethernet device VLAN filter with new vid @@ -334,7 +340,7 @@ int rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_vlan_rx_add_vid(uint8_t port_id, uint16_t vid); +int rte_ethtool_net_vlan_rx_add_vid(uint16_t port_id, uint16_t vid); /** * Remove VLAN id from Ethernet device. @@ -349,7 +355,7 @@ int rte_ethtool_net_vlan_rx_add_vid(uint8_t port_id, uint16_t vid); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_vlan_rx_kill_vid(uint8_t port_id, uint16_t vid); +int rte_ethtool_net_vlan_rx_kill_vid(uint16_t port_id, uint16_t vid); /** * Setting the Ethernet device rx mode. @@ -362,10 +368,10 @@ int rte_ethtool_net_vlan_rx_kill_vid(uint8_t port_id, uint16_t vid); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_set_rx_mode(uint8_t port_id); +int rte_ethtool_net_set_rx_mode(uint16_t port_id); /** - * Getting ring paramaters for Ethernet device. + * Getting ring parameters for Ethernet device. * * @param port_id * The port identifier of the Ethernet device. @@ -380,11 +386,11 @@ int rte_ethtool_net_set_rx_mode(uint8_t port_id); * Only the tx_pending and rx_pending fields of struct ethtool_ringparam * are used, and the function only gets parameters for queue 0. */ -int rte_ethtool_get_ringparam(uint8_t port_id, +int rte_ethtool_get_ringparam(uint16_t port_id, struct ethtool_ringparam *ring_param); /** - * Setting ring paramaters for Ethernet device. + * Setting ring parameters for Ethernet device. * * @param port_id * The port identifier of the Ethernet device. @@ -399,7 +405,7 @@ int rte_ethtool_get_ringparam(uint8_t port_id, * Only the tx_pending and rx_pending fields of struct ethtool_ringparam * are used, and the function only sets parameters for queue 0. */ -int rte_ethtool_set_ringparam(uint8_t port_id, +int rte_ethtool_set_ringparam(uint16_t port_id, struct ethtool_ringparam *ring_param);