net/ethernet: All types are prefixed with ethernet_

Aligning eth_hw_caps to the right prefix, so ethernet_hw_caps.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2018-04-06 10:57:13 +02:00 committed by Jukka Rissanen
commit 4bf1a9bd60
12 changed files with 38 additions and 35 deletions

View file

@ -329,11 +329,11 @@ static void eth_initialize(struct net_if *iface)
} }
} }
static enum eth_hw_caps eth_dw_get_capabilities(struct device *dev) static enum ethernet_hw_caps eth_dw_get_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_LINK_10BASE_T | ETH_LINK_100BASE_T; return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T;
} }
static const struct ethernet_api api_funcs = { static const struct ethernet_api api_funcs = {

View file

@ -764,11 +764,11 @@ static int eth_net_tx(struct net_if *iface, struct net_pkt *pkt)
return ret; return ret;
} }
static enum eth_hw_caps eth_enc28j60_get_capabilities(struct device *dev) static enum ethernet_hw_caps eth_enc28j60_get_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_LINK_10BASE_T; return ETHERNET_LINK_10BASE_T;
} }
#ifdef CONFIG_ETH_ENC28J60_0 #ifdef CONFIG_ETH_ENC28J60_0

View file

@ -664,11 +664,12 @@ static void eth_iface_init(struct net_if *iface)
ethernet_init(iface); ethernet_init(iface);
} }
static enum eth_hw_caps eth_mcux_get_capabilities(struct device *dev) static enum ethernet_hw_caps eth_mcux_get_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_HW_VLAN | ETH_LINK_10BASE_T | ETH_LINK_100BASE_T; return ETHERNET_HW_VLAN | ETHERNET_LINK_10BASE_T |
ETHERNET_LINK_100BASE_T;
} }
static const struct ethernet_api api_funcs = { static const struct ethernet_api api_funcs = {

View file

@ -269,11 +269,12 @@ static void eth_iface_init(struct net_if *iface)
} }
} }
static enum eth_hw_caps eth_posix_native_get_capabilities(struct device *dev) static
enum ethernet_hw_caps eth_posix_native_get_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_HW_VLAN; return ETHERNET_HW_VLAN;
} }
static const struct ethernet_api eth_if_api = { static const struct ethernet_api eth_if_api = {

View file

@ -899,11 +899,12 @@ static void eth0_iface_init(struct net_if *iface)
init_done = true; init_done = true;
} }
static enum eth_hw_caps eth_sam_gmac_get_capabilities(struct device *dev) static enum ethernet_hw_caps eth_sam_gmac_get_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_HW_VLAN | ETH_LINK_10BASE_T | ETH_LINK_100BASE_T; return ETHERNET_HW_VLAN | ETHERNET_LINK_10BASE_T |
ETHERNET_LINK_100BASE_T;
} }
static const struct ethernet_api eth_api = { static const struct ethernet_api eth_api = {

View file

@ -369,11 +369,11 @@ static void eth_iface_init(struct net_if *iface)
NET_LINK_ETHERNET); NET_LINK_ETHERNET);
} }
static enum eth_hw_caps eth_stm32_hal_get_capabilities(struct device *dev) static enum ethernet_hw_caps eth_stm32_hal_get_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_LINK_10BASE_T | ETH_LINK_100BASE_T; return ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T;
} }
static const struct ethernet_api eth_api = { static const struct ethernet_api eth_api = {

View file

@ -508,11 +508,11 @@ use_random_mac:
static struct slip_context slip_context_data; static struct slip_context slip_context_data;
static enum eth_hw_caps eth_capabilities(struct device *dev) static enum ethernet_hw_caps eth_capabilities(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
return ETH_HW_VLAN; return ETHERNET_HW_VLAN;
} }
#if defined(CONFIG_SLIP_TAP) && defined(CONFIG_NET_L2_ETHERNET) #if defined(CONFIG_SLIP_TAP) && defined(CONFIG_NET_L2_ETHERNET)

View file

@ -43,30 +43,30 @@ extern "C" {
#define NET_ETH_MINIMAL_FRAME_SIZE 60 #define NET_ETH_MINIMAL_FRAME_SIZE 60
enum eth_hw_caps { enum ethernet_hw_caps {
/** TX Checksum offloading supported */ /** TX Checksum offloading supported */
ETH_HW_TX_CHKSUM_OFFLOAD = BIT(0), ETHERNET_HW_TX_CHKSUM_OFFLOAD = BIT(0),
/** RX Checksum offloading supported */ /** RX Checksum offloading supported */
ETH_HW_RX_CHKSUM_OFFLOAD = BIT(1), ETHERNET_HW_RX_CHKSUM_OFFLOAD = BIT(1),
/** VLAN supported */ /** VLAN supported */
ETH_HW_VLAN = BIT(2), ETHERNET_HW_VLAN = BIT(2),
/** Enabling/disabling auto negotiation supported */ /** Enabling/disabling auto negotiation supported */
ETH_AUTO_NEGOTIATION_SET = BIT(3), ETHERNET_AUTO_NEGOTIATION_SET = BIT(3),
/** 10 Mbits link supported */ /** 10 Mbits link supported */
ETH_LINK_10BASE_T = BIT(4), ETHERNET_LINK_10BASE_T = BIT(4),
/** 100 Mbits link supported */ /** 100 Mbits link supported */
ETH_LINK_100BASE_T = BIT(5), ETHERNET_LINK_100BASE_T = BIT(5),
/** 1 Gbits link supported */ /** 1 Gbits link supported */
ETH_LINK_1000BASE_T = BIT(6), ETHERNET_LINK_1000BASE_T = BIT(6),
/** Changing duplex (half/full) supported */ /** Changing duplex (half/full) supported */
ETH_DUPLEX_SET = BIT(7), ETHERNET_DUPLEX_SET = BIT(7),
}; };
struct ethernet_api { struct ethernet_api {
@ -77,7 +77,7 @@ struct ethernet_api {
struct net_if_api iface_api; struct net_if_api iface_api;
/** Get the device capabilities */ /** Get the device capabilities */
enum eth_hw_caps (*get_capabilities)(struct device *dev); enum ethernet_hw_caps (*get_capabilities)(struct device *dev);
#if defined(CONFIG_NET_VLAN) #if defined(CONFIG_NET_VLAN)
/** The IP stack will call this function when a VLAN tag is enabled /** The IP stack will call this function when a VLAN tag is enabled
@ -217,7 +217,7 @@ void net_eth_ipv6_mcast_to_mac_addr(const struct in6_addr *ipv6_addr,
* @return Hardware capabilities * @return Hardware capabilities
*/ */
static inline static inline
enum eth_hw_caps net_eth_get_hw_capabilities(struct net_if *iface) enum ethernet_hw_caps net_eth_get_hw_capabilities(struct net_if *iface)
{ {
const struct ethernet_api *eth = const struct ethernet_api *eth =
net_if_get_device(iface)->driver_api; net_if_get_device(iface)->driver_api;

View file

@ -763,7 +763,7 @@ void ethernet_init(struct net_if *iface)
struct ethernet_context *ctx = net_if_l2_data(iface); struct ethernet_context *ctx = net_if_l2_data(iface);
int i; int i;
if (!(net_eth_get_hw_capabilities(iface) & ETH_HW_VLAN)) { if (!(net_eth_get_hw_capabilities(iface) & ETHERNET_HW_VLAN)) {
return; return;
} }

View file

@ -2010,7 +2010,7 @@ void net_if_call_link_cb(struct net_if *iface, struct net_linkaddr *lladdr,
} }
} }
static bool need_calc_checksum(struct net_if *iface, enum eth_hw_caps caps) static bool need_calc_checksum(struct net_if *iface, enum ethernet_hw_caps caps)
{ {
#if defined(CONFIG_NET_L2_ETHERNET) #if defined(CONFIG_NET_L2_ETHERNET)
if (net_if_l2(iface) != &NET_L2_GET_NAME(ETHERNET)) { if (net_if_l2(iface) != &NET_L2_GET_NAME(ETHERNET)) {
@ -2025,12 +2025,12 @@ static bool need_calc_checksum(struct net_if *iface, enum eth_hw_caps caps)
bool net_if_need_calc_tx_checksum(struct net_if *iface) bool net_if_need_calc_tx_checksum(struct net_if *iface)
{ {
return need_calc_checksum(iface, ETH_HW_TX_CHKSUM_OFFLOAD); return need_calc_checksum(iface, ETHERNET_HW_TX_CHKSUM_OFFLOAD);
} }
bool net_if_need_calc_rx_checksum(struct net_if *iface) bool net_if_need_calc_rx_checksum(struct net_if *iface)
{ {
return need_calc_checksum(iface, ETH_HW_RX_CHKSUM_OFFLOAD); return need_calc_checksum(iface, ETHERNET_HW_RX_CHKSUM_OFFLOAD);
} }
struct net_if *net_if_get_by_index(u8_t index) struct net_if *net_if_get_by_index(u8_t index)

View file

@ -214,13 +214,13 @@ static int eth_tx_offloading_enabled(struct net_if *iface, struct net_pkt *pkt)
return 0; return 0;
} }
static enum eth_hw_caps eth_offloading_enabled(struct device *dev) static enum ethernet_hw_caps eth_offloading_enabled(struct device *dev)
{ {
return ETH_HW_TX_CHKSUM_OFFLOAD | return ETHERNET_HW_TX_CHKSUM_OFFLOAD |
ETH_HW_RX_CHKSUM_OFFLOAD; ETHERNET_HW_RX_CHKSUM_OFFLOAD;
} }
static enum eth_hw_caps eth_offloading_disabled(struct device *dev) static enum ethernet_hw_caps eth_offloading_disabled(struct device *dev)
{ {
return 0; return 0;
} }

View file

@ -134,9 +134,9 @@ static int eth_tx(struct net_if *iface, struct net_pkt *pkt)
return 0; return 0;
} }
static enum eth_hw_caps eth_capabilities(struct device *dev) static enum ethernet_hw_caps eth_capabilities(struct device *dev)
{ {
return ETH_HW_VLAN; return ETHERNET_HW_VLAN;
} }
static struct ethernet_api api_funcs = { static struct ethernet_api api_funcs = {