Browse Source

drivers: ethernet: use DT_INST_PROP_OR for local-mac-address

use DT_INST_PROP_OR for local-mac-address, so
that it is not required to be set in dt, as there are
other ways to se the mac address.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
pull/92307/head
Fin Maaß 2 weeks ago committed by Benjamin Cabé
parent
commit
596cd64bb9
  1. 2
      drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c
  2. 2
      drivers/ethernet/eth_lan865x.c
  3. 2
      drivers/ethernet/eth_lan9250.c
  4. 3
      drivers/ethernet/eth_litex_liteeth.c
  5. 2
      drivers/ethernet/eth_xilinx_axienet.c
  6. 2
      drivers/ethernet/eth_xlnx_gem_priv.h

2
drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c

@ -1699,7 +1699,7 @@ static const struct ethernet_api eth_dwc_xgmac_apis = { @@ -1699,7 +1699,7 @@ static const struct ethernet_api eth_dwc_xgmac_apis = {
/* Device run-time data declaration macro */
#define ETH_DWC_XGMAC_DEV_DATA(port) \
static struct eth_dwc_xgmac_dev_data eth_dwc_xgmac##port##_dev_data = { \
.mac_addr = DT_INST_PROP(port, local_mac_address), \
.mac_addr = DT_INST_PROP_OR(port, local_mac_address, {0}), \
.link_speed = DT_INST_PROP(port, max_speed), \
.enable_full_duplex = DT_INST_PROP(port, full_duplex_mode_en), \
.dma_rx_desc = &eth_dwc_xgmac##port##_rx_desc[0u][0u], \

2
drivers/ethernet/eth_lan865x.c

@ -472,7 +472,7 @@ static const struct ethernet_api lan865x_api_func = { @@ -472,7 +472,7 @@ static const struct ethernet_api lan865x_api_func = {
struct oa_tc6 oa_tc6_##inst = { \
.cps = 64, .protected = 0, .spi = &lan865x_config_##inst.spi}; \
static struct lan865x_data lan865x_data_##inst = { \
.mac_address = DT_INST_PROP(inst, local_mac_address), \
.mac_address = DT_INST_PROP_OR(inst, local_mac_address, {0}), \
.tx_rx_sem = Z_SEM_INITIALIZER((lan865x_data_##inst).tx_rx_sem, 1, 1), \
.int_sem = Z_SEM_INITIALIZER((lan865x_data_##inst).int_sem, 0, 1), \
.tc6 = &oa_tc6_##inst}; \

2
drivers/ethernet/eth_lan9250.c

@ -702,7 +702,7 @@ static int lan9250_init(const struct device *dev) @@ -702,7 +702,7 @@ static int lan9250_init(const struct device *dev)
#define LAN9250_DEFINE(inst) \
static struct lan9250_runtime lan9250_##inst##_runtime = { \
.mac_address = DT_INST_PROP(inst, local_mac_address), \
.mac_address = DT_INST_PROP_OR(inst, local_mac_address, {0}), \
.tx_rx_sem = Z_SEM_INITIALIZER(lan9250_##inst##_runtime.tx_rx_sem, 1, UINT_MAX), \
.int_sem = Z_SEM_INITIALIZER(lan9250_##inst##_runtime.int_sem, 0, UINT_MAX), \
}; \

3
drivers/ethernet/eth_litex_liteeth.c

@ -331,7 +331,8 @@ static const struct ethernet_api eth_api = { @@ -331,7 +331,8 @@ static const struct ethernet_api eth_api = {
} \
\
static struct eth_litex_dev_data eth_data##n = { \
.mac_addr = DT_INST_PROP(n, local_mac_address)}; \
.mac_addr = DT_INST_PROP_OR(n, local_mac_address, {0}), \
}; \
\
static const struct eth_litex_config eth_config##n = { \
.phy_dev = DEVICE_DT_GET_OR_NULL(DT_INST_PHANDLE(n, phy_handle)), \

2
drivers/ethernet/eth_xilinx_axienet.c

@ -586,7 +586,7 @@ static const struct ethernet_api xilinx_axienet_api = { @@ -586,7 +586,7 @@ static const struct ethernet_api xilinx_axienet_api = {
} \
\
static struct xilinx_axienet_data data_##inst = { \
.mac_addr = DT_INST_PROP(inst, local_mac_address), \
.mac_addr = DT_INST_PROP_OR(inst, local_mac_address, {0}), \
.dma_is_configured_rx = false, \
.dma_is_configured_tx = false}; \
static const struct xilinx_axienet_config config_##inst = { \

2
drivers/ethernet/eth_xlnx_gem_priv.h

@ -476,7 +476,7 @@ static const struct eth_xlnx_gem_dev_cfg eth_xlnx_gem##port##_dev_cfg = {\ @@ -476,7 +476,7 @@ static const struct eth_xlnx_gem_dev_cfg eth_xlnx_gem##port##_dev_cfg = {\
/* Device run-time data declaration macro */
#define ETH_XLNX_GEM_DEV_DATA(port) \
static struct eth_xlnx_gem_dev_data eth_xlnx_gem##port##_dev_data = {\
.mac_addr = DT_INST_PROP(port, local_mac_address),\
.mac_addr = DT_INST_PROP_OR(port, local_mac_address, {0}),\
.started = 0,\
.eff_link_speed = LINK_DOWN,\
.phy_addr = 0,\

Loading…
Cancel
Save