drivers: ethernet: lan865x: fix style issue using clang-format
Fix the style formatting of eth_lan865x.c and eth_lan865x_priv.h files using clang-format utility. Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
This commit is contained in:
parent
3bd39c2d1b
commit
25edf1b46e
2 changed files with 100 additions and 131 deletions
|
|
@ -38,8 +38,7 @@ static void lan865x_iface_init(struct net_if *iface)
|
|||
const struct device *dev = net_if_get_device(iface);
|
||||
struct lan865x_data *ctx = dev->data;
|
||||
|
||||
net_if_set_link_addr(iface, ctx->mac_address, sizeof(ctx->mac_address),
|
||||
NET_LINK_ETHERNET);
|
||||
net_if_set_link_addr(iface, ctx->mac_address, sizeof(ctx->mac_address), NET_LINK_ETHERNET);
|
||||
|
||||
if (ctx->iface == NULL) {
|
||||
ctx->iface = iface;
|
||||
|
|
@ -67,19 +66,16 @@ static int lan865x_set_config(const struct device *dev, enum ethernet_config_typ
|
|||
int ret = -ENOTSUP;
|
||||
|
||||
if (type == ETHERNET_CONFIG_TYPE_PROMISC_MODE) {
|
||||
return oa_tc6_reg_write(ctx->tc6, LAN865x_MAC_NCFGR,
|
||||
LAN865x_MAC_NCFGR_CAF);
|
||||
return oa_tc6_reg_write(ctx->tc6, LAN865x_MAC_NCFGR, LAN865x_MAC_NCFGR_CAF);
|
||||
}
|
||||
|
||||
if (type == ETHERNET_CONFIG_TYPE_MAC_ADDRESS) {
|
||||
memcpy(ctx->mac_address, config->mac_address.addr,
|
||||
sizeof(ctx->mac_address));
|
||||
memcpy(ctx->mac_address, config->mac_address.addr, sizeof(ctx->mac_address));
|
||||
|
||||
lan865x_write_macaddress(dev);
|
||||
|
||||
return net_if_set_link_addr(ctx->iface, ctx->mac_address,
|
||||
sizeof(ctx->mac_address),
|
||||
NET_LINK_ETHERNET);
|
||||
return net_if_set_link_addr(ctx->iface, ctx->mac_address, sizeof(ctx->mac_address),
|
||||
NET_LINK_ETHERNET);
|
||||
}
|
||||
|
||||
if (type == ETHERNET_CONFIG_TYPE_T1S_PARAM) {
|
||||
|
|
@ -165,8 +161,7 @@ static int lan865x_check_spi(const struct device *dev)
|
|||
}
|
||||
|
||||
/* Implementation of pseudo code from AN1760 */
|
||||
static uint8_t lan865x_read_indirect_reg(const struct device *dev, uint8_t addr,
|
||||
uint8_t mask)
|
||||
static uint8_t lan865x_read_indirect_reg(const struct device *dev, uint8_t addr, uint8_t mask)
|
||||
{
|
||||
struct lan865x_data *ctx = dev->data;
|
||||
uint32_t val;
|
||||
|
|
@ -176,7 +171,7 @@ static uint8_t lan865x_read_indirect_reg(const struct device *dev, uint8_t addr,
|
|||
|
||||
oa_tc6_reg_read(ctx->tc6, 0x000400D9, &val);
|
||||
|
||||
return (uint8_t) val & mask;
|
||||
return (uint8_t)val & mask;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -184,43 +179,43 @@ static uint8_t lan865x_read_indirect_reg(const struct device *dev, uint8_t addr,
|
|||
* holders for cfgparamX.
|
||||
*/
|
||||
static oa_mem_map_t lan865x_conf[] = {
|
||||
{ .mms = 0x1, .address = 0x00, .value = 0x0000 },
|
||||
{ .mms = 0x4, .address = 0xD0, .value = 0x3F31 },
|
||||
{ .mms = 0x4, .address = 0xE0, .value = 0xC000 },
|
||||
{ .mms = 0x4, .address = 0x84, .value = 0x0000 }, /* cfgparam1 */
|
||||
{ .mms = 0x4, .address = 0x8A, .value = 0x0000 }, /* cfgparam2 */
|
||||
{ .mms = 0x4, .address = 0xE9, .value = 0x9E50 },
|
||||
{ .mms = 0x4, .address = 0xF5, .value = 0x1CF8 },
|
||||
{ .mms = 0x4, .address = 0xF4, .value = 0xC020 },
|
||||
{ .mms = 0x4, .address = 0xF8, .value = 0xB900 },
|
||||
{ .mms = 0x4, .address = 0xF9, .value = 0x4E53 },
|
||||
{ .mms = 0x4, .address = 0x91, .value = 0x9660 },
|
||||
{ .mms = 0x4, .address = 0x77, .value = 0x0028 },
|
||||
{ .mms = 0x4, .address = 0x43, .value = 0x00FF },
|
||||
{ .mms = 0x4, .address = 0x44, .value = 0xFFFF },
|
||||
{ .mms = 0x4, .address = 0x45, .value = 0x0000 },
|
||||
{ .mms = 0x4, .address = 0x53, .value = 0x00FF },
|
||||
{ .mms = 0x4, .address = 0x54, .value = 0xFFFF },
|
||||
{ .mms = 0x4, .address = 0x55, .value = 0x0000 },
|
||||
{ .mms = 0x4, .address = 0x40, .value = 0x0002 },
|
||||
{ .mms = 0x4, .address = 0x50, .value = 0x0002 },
|
||||
{ .mms = 0x4, .address = 0xAD, .value = 0x0000 }, /* cfgparam3 */
|
||||
{ .mms = 0x4, .address = 0xAE, .value = 0x0000 }, /* cfgparam4 */
|
||||
{ .mms = 0x4, .address = 0xAF, .value = 0x0000 }, /* cfgparam5 */
|
||||
{ .mms = 0x4, .address = 0xB0, .value = 0x0103 },
|
||||
{ .mms = 0x4, .address = 0xB1, .value = 0x0910 },
|
||||
{ .mms = 0x4, .address = 0xB2, .value = 0x1D26 },
|
||||
{ .mms = 0x4, .address = 0xB3, .value = 0x002A },
|
||||
{ .mms = 0x4, .address = 0xB4, .value = 0x0103 },
|
||||
{ .mms = 0x4, .address = 0xB5, .value = 0x070D },
|
||||
{ .mms = 0x4, .address = 0xB6, .value = 0x1720 },
|
||||
{ .mms = 0x4, .address = 0xB7, .value = 0x0027 },
|
||||
{ .mms = 0x4, .address = 0xB8, .value = 0x0509 },
|
||||
{ .mms = 0x4, .address = 0xB9, .value = 0x0E13 },
|
||||
{ .mms = 0x4, .address = 0xBA, .value = 0x1C25 },
|
||||
{ .mms = 0x4, .address = 0xBB, .value = 0x002B },
|
||||
{ .mms = 0x4, .address = 0x0C, .value = 0x0100 },
|
||||
{ .mms = 0x4, .address = 0x81, .value = 0x00E0 },
|
||||
{.mms = 0x1, .address = 0x00, .value = 0x0000},
|
||||
{.mms = 0x4, .address = 0xD0, .value = 0x3F31},
|
||||
{.mms = 0x4, .address = 0xE0, .value = 0xC000},
|
||||
{.mms = 0x4, .address = 0x84, .value = 0x0000}, /* cfgparam1 */
|
||||
{.mms = 0x4, .address = 0x8A, .value = 0x0000}, /* cfgparam2 */
|
||||
{.mms = 0x4, .address = 0xE9, .value = 0x9E50},
|
||||
{.mms = 0x4, .address = 0xF5, .value = 0x1CF8},
|
||||
{.mms = 0x4, .address = 0xF4, .value = 0xC020},
|
||||
{.mms = 0x4, .address = 0xF8, .value = 0xB900},
|
||||
{.mms = 0x4, .address = 0xF9, .value = 0x4E53},
|
||||
{.mms = 0x4, .address = 0x91, .value = 0x9660},
|
||||
{.mms = 0x4, .address = 0x77, .value = 0x0028},
|
||||
{.mms = 0x4, .address = 0x43, .value = 0x00FF},
|
||||
{.mms = 0x4, .address = 0x44, .value = 0xFFFF},
|
||||
{.mms = 0x4, .address = 0x45, .value = 0x0000},
|
||||
{.mms = 0x4, .address = 0x53, .value = 0x00FF},
|
||||
{.mms = 0x4, .address = 0x54, .value = 0xFFFF},
|
||||
{.mms = 0x4, .address = 0x55, .value = 0x0000},
|
||||
{.mms = 0x4, .address = 0x40, .value = 0x0002},
|
||||
{.mms = 0x4, .address = 0x50, .value = 0x0002},
|
||||
{.mms = 0x4, .address = 0xAD, .value = 0x0000}, /* cfgparam3 */
|
||||
{.mms = 0x4, .address = 0xAE, .value = 0x0000}, /* cfgparam4 */
|
||||
{.mms = 0x4, .address = 0xAF, .value = 0x0000}, /* cfgparam5 */
|
||||
{.mms = 0x4, .address = 0xB0, .value = 0x0103},
|
||||
{.mms = 0x4, .address = 0xB1, .value = 0x0910},
|
||||
{.mms = 0x4, .address = 0xB2, .value = 0x1D26},
|
||||
{.mms = 0x4, .address = 0xB3, .value = 0x002A},
|
||||
{.mms = 0x4, .address = 0xB4, .value = 0x0103},
|
||||
{.mms = 0x4, .address = 0xB5, .value = 0x070D},
|
||||
{.mms = 0x4, .address = 0xB6, .value = 0x1720},
|
||||
{.mms = 0x4, .address = 0xB7, .value = 0x0027},
|
||||
{.mms = 0x4, .address = 0xB8, .value = 0x0509},
|
||||
{.mms = 0x4, .address = 0xB9, .value = 0x0E13},
|
||||
{.mms = 0x4, .address = 0xBA, .value = 0x1C25},
|
||||
{.mms = 0x4, .address = 0xBB, .value = 0x002B},
|
||||
{.mms = 0x4, .address = 0x0C, .value = 0x0100},
|
||||
{.mms = 0x4, .address = 0x81, .value = 0x00E0},
|
||||
};
|
||||
|
||||
/* Based on AN1760 DS60001760G pseudo code */
|
||||
|
|
@ -249,37 +244,27 @@ static int lan865x_init_chip(const struct device *dev, uint8_t silicon_rev)
|
|||
offset2 = (int8_t)value2;
|
||||
}
|
||||
|
||||
cfgparam1 = (uint16_t) (((9 + offset1) & 0x3F) << 10) |
|
||||
(uint16_t) (((14 + offset1) & 0x3F) << 4) | 0x03;
|
||||
cfgparam2 = (uint16_t) (((40 + offset2) & 0x3F) << 10);
|
||||
cfgparam3 = (uint16_t) (((5 + offset1) & 0x3F) << 8) |
|
||||
(uint16_t) ((9 + offset1) & 0x3F);
|
||||
cfgparam4 = (uint16_t) (((9 + offset1) & 0x3F) << 8) |
|
||||
(uint16_t) ((14 + offset1) & 0x3F);
|
||||
cfgparam5 = (uint16_t) (((17 + offset1) & 0x3F) << 8) |
|
||||
(uint16_t) ((22 + offset1) & 0x3F);
|
||||
cfgparam1 = (uint16_t)(((9 + offset1) & 0x3F) << 10) |
|
||||
(uint16_t)(((14 + offset1) & 0x3F) << 4) | 0x03;
|
||||
cfgparam2 = (uint16_t)(((40 + offset2) & 0x3F) << 10);
|
||||
cfgparam3 = (uint16_t)(((5 + offset1) & 0x3F) << 8) | (uint16_t)((9 + offset1) & 0x3F);
|
||||
cfgparam4 = (uint16_t)(((9 + offset1) & 0x3F) << 8) | (uint16_t)((14 + offset1) & 0x3F);
|
||||
cfgparam5 = (uint16_t)(((17 + offset1) & 0x3F) << 8) | (uint16_t)((22 + offset1) & 0x3F);
|
||||
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size,
|
||||
MMS_REG(0x4, 0x84), cfgparam1);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size,
|
||||
MMS_REG(0x4, 0x8A), cfgparam2);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size,
|
||||
MMS_REG(0x4, 0xAD), cfgparam3);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size,
|
||||
MMS_REG(0x4, 0xAE), cfgparam4);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size,
|
||||
MMS_REG(0x4, 0xAF), cfgparam5);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size, MMS_REG(0x4, 0x84), cfgparam1);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size, MMS_REG(0x4, 0x8A), cfgparam2);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size, MMS_REG(0x4, 0xAD), cfgparam3);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size, MMS_REG(0x4, 0xAE), cfgparam4);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size, MMS_REG(0x4, 0xAF), cfgparam5);
|
||||
|
||||
if (silicon_rev == 1) {
|
||||
/* For silicon rev 1 (B0): (bit [3..0] from 0x0A0084 */
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size,
|
||||
MMS_REG(0x4, 0xD0), 0x5F21);
|
||||
lan865x_update_dev_cfg_array(lan865x_conf, size, MMS_REG(0x4, 0xD0), 0x5F21);
|
||||
}
|
||||
|
||||
/* Write LAN865x config with correct order */
|
||||
for (i = 0; i < size; i++) {
|
||||
oa_tc6_reg_write(ctx->tc6, MMS_REG(lan865x_conf[i].mms,
|
||||
lan865x_conf[i].address),
|
||||
oa_tc6_reg_write(ctx->tc6, MMS_REG(lan865x_conf[i].mms, lan865x_conf[i].address),
|
||||
(uint32_t)lan865x_conf[i].value);
|
||||
}
|
||||
|
||||
|
|
@ -287,8 +272,8 @@ static int lan865x_init_chip(const struct device *dev, uint8_t silicon_rev)
|
|||
}
|
||||
/* Implementation of pseudo code from AN1760 - END */
|
||||
|
||||
static int lan865x_config_plca(const struct device *dev, uint8_t node_id,
|
||||
uint8_t node_cnt, uint8_t burst_cnt, uint8_t burst_timer)
|
||||
static int lan865x_config_plca(const struct device *dev, uint8_t node_id, uint8_t node_cnt,
|
||||
uint8_t burst_cnt, uint8_t burst_timer)
|
||||
{
|
||||
struct lan865x_data *ctx = dev->data;
|
||||
uint32_t val;
|
||||
|
|
@ -354,8 +339,7 @@ static int lan865x_set_specific_multicast_addr(const struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
return oa_tc6_reg_write(ctx->tc6, LAN865x_MAC_NCFGR,
|
||||
LAN865x_MAC_NCFGR_MTIHEN);
|
||||
return oa_tc6_reg_write(ctx->tc6, LAN865x_MAC_NCFGR, LAN865x_MAC_NCFGR_MTIHEN);
|
||||
}
|
||||
|
||||
static int lan865x_default_config(const struct device *dev, uint8_t silicon_rev)
|
||||
|
|
@ -372,10 +356,8 @@ static int lan865x_default_config(const struct device *dev, uint8_t silicon_rev)
|
|||
}
|
||||
|
||||
if (cfg->plca->enable) {
|
||||
ret = lan865x_config_plca(dev, cfg->plca->node_id,
|
||||
cfg->plca->node_count,
|
||||
cfg->plca->burst_count,
|
||||
cfg->plca->burst_timer);
|
||||
ret = lan865x_config_plca(dev, cfg->plca->node_id, cfg->plca->node_count,
|
||||
cfg->plca->burst_count, cfg->plca->burst_timer);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -383,15 +365,12 @@ static int lan865x_default_config(const struct device *dev, uint8_t silicon_rev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void lan865x_int_callback(const struct device *dev,
|
||||
struct gpio_callback *cb,
|
||||
uint32_t pins)
|
||||
static void lan865x_int_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
ARG_UNUSED(pins);
|
||||
|
||||
struct lan865x_data *ctx =
|
||||
CONTAINER_OF(cb, struct lan865x_data, gpio_int_callback);
|
||||
struct lan865x_data *ctx = CONTAINER_OF(cb, struct lan865x_data, gpio_int_callback);
|
||||
|
||||
k_sem_give(&ctx->int_sem);
|
||||
}
|
||||
|
|
@ -490,8 +469,7 @@ static int lan865x_init(const struct device *dev)
|
|||
}
|
||||
|
||||
if (!gpio_is_ready_dt(&cfg->interrupt)) {
|
||||
LOG_ERR("Interrupt GPIO device %s is not ready",
|
||||
cfg->interrupt.port->name);
|
||||
LOG_ERR("Interrupt GPIO device %s is not ready", cfg->interrupt.port->name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -523,19 +501,15 @@ static int lan865x_init(const struct device *dev)
|
|||
gpio_pin_interrupt_configure_dt(&cfg->interrupt, GPIO_INT_EDGE_TO_ACTIVE);
|
||||
|
||||
/* Start interruption-poll thread */
|
||||
ctx->tid_int =
|
||||
k_thread_create(&ctx->thread, ctx->thread_stack,
|
||||
CONFIG_ETH_LAN865X_IRQ_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)lan865x_int_thread,
|
||||
(void *)dev, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_ETH_LAN865X_IRQ_THREAD_PRIO),
|
||||
0, K_NO_WAIT);
|
||||
ctx->tid_int = k_thread_create(
|
||||
&ctx->thread, ctx->thread_stack, CONFIG_ETH_LAN865X_IRQ_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)lan865x_int_thread, (void *)dev, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_ETH_LAN865X_IRQ_THREAD_PRIO), 0, K_NO_WAIT);
|
||||
k_thread_name_set(ctx->tid_int, "lan865x_interrupt");
|
||||
|
||||
/* Perform HW reset - 'rst-gpios' required property set in DT */
|
||||
if (!gpio_is_ready_dt(&cfg->reset)) {
|
||||
LOG_ERR("Reset GPIO device %s is not ready",
|
||||
cfg->reset.port->name);
|
||||
LOG_ERR("Reset GPIO device %s is not ready", cfg->reset.port->name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -588,7 +562,7 @@ static const struct ethernet_api lan865x_api_func = {
|
|||
.to_timer = DT_INST_PROP(inst, plca_to_timer), \
|
||||
.enable = DT_INST_PROP(inst, plca_enable), \
|
||||
}; \
|
||||
\
|
||||
\
|
||||
static const struct lan865x_config lan865x_config_##inst = { \
|
||||
.spi = SPI_DT_SPEC_INST_GET(inst, SPI_WORD_SET(8), 0), \
|
||||
.interrupt = GPIO_DT_SPEC_INST_GET(inst, int_gpios), \
|
||||
|
|
@ -596,20 +570,15 @@ static const struct ethernet_api lan865x_api_func = {
|
|||
.timeout = CONFIG_ETH_LAN865X_TIMEOUT, \
|
||||
.plca = &lan865x_config_plca_##inst, \
|
||||
}; \
|
||||
\
|
||||
\
|
||||
struct oa_tc6 oa_tc6_##inst = { \
|
||||
.cps = 64, \
|
||||
.protected = 0, \
|
||||
.spi = &lan865x_config_##inst.spi \
|
||||
}; \
|
||||
.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), \
|
||||
.tx_rx_sem = \
|
||||
Z_SEM_INITIALIZER((lan865x_data_##inst).tx_rx_sem, 1, 1), \
|
||||
.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 \
|
||||
}; \
|
||||
\
|
||||
.tc6 = &oa_tc6_##inst}; \
|
||||
\
|
||||
ETH_NET_DEVICE_DT_INST_DEFINE(inst, lan865x_init, NULL, &lan865x_data_##inst, \
|
||||
&lan865x_config_##inst, CONFIG_ETH_INIT_PRIORITY, \
|
||||
&lan865x_api_func, NET_ETH_MTU);
|
||||
|
|
|
|||
|
|
@ -15,39 +15,39 @@
|
|||
#include <ethernet/eth_stats.h>
|
||||
#include "oa_tc6.h"
|
||||
|
||||
#define LAN865X_SPI_MAX_FREQUENCY 25000000U
|
||||
#define LAN865X_HW_BOOT_DELAY_MS 7
|
||||
#define LAN8650_DEVID 0x8650
|
||||
#define LAN8651_DEVID 0x8651
|
||||
#define LAN865X_REV_MASK GENMASK(3, 0)
|
||||
#define LAN865X_RESET_TIMEOUT 10
|
||||
#define LAN865X_SPI_MAX_FREQUENCY 25000000U
|
||||
#define LAN865X_HW_BOOT_DELAY_MS 7
|
||||
#define LAN8650_DEVID 0x8650
|
||||
#define LAN8651_DEVID 0x8651
|
||||
#define LAN865X_REV_MASK GENMASK(3, 0)
|
||||
#define LAN865X_RESET_TIMEOUT 10
|
||||
|
||||
/* Memory Map Sector (MMS) 1 (0x1) */
|
||||
#define LAN865x_MAC_NCR MMS_REG(0x1, 0x000)
|
||||
#define LAN865x_MAC_NCR_TXEN BIT(3)
|
||||
#define LAN865x_MAC_NCR_RXEN BIT(2)
|
||||
#define LAN865x_MAC_NCFGR MMS_REG(0x1, 0x001)
|
||||
#define LAN865x_MAC_NCFGR_CAF BIT(4)
|
||||
#define LAN865x_MAC_NCFGR_MTIHEN BIT(6)
|
||||
#define LAN865x_MAC_HRB MMS_REG(0x1, 0x020)
|
||||
#define LAN865x_MAC_HRT MMS_REG(0x1, 0x021)
|
||||
#define LAN865x_MAC_SAB1 MMS_REG(0x1, 0x022)
|
||||
#define LAN865x_MAC_SAB2 MMS_REG(0x1, 0x024)
|
||||
#define LAN865x_MAC_SAT2 MMS_REG(0x1, 0x025)
|
||||
#define LAN865x_MAC_NCR MMS_REG(0x1, 0x000)
|
||||
#define LAN865x_MAC_NCR_TXEN BIT(3)
|
||||
#define LAN865x_MAC_NCR_RXEN BIT(2)
|
||||
#define LAN865x_MAC_NCFGR MMS_REG(0x1, 0x001)
|
||||
#define LAN865x_MAC_NCFGR_CAF BIT(4)
|
||||
#define LAN865x_MAC_NCFGR_MTIHEN BIT(6)
|
||||
#define LAN865x_MAC_HRB MMS_REG(0x1, 0x020)
|
||||
#define LAN865x_MAC_HRT MMS_REG(0x1, 0x021)
|
||||
#define LAN865x_MAC_SAB1 MMS_REG(0x1, 0x022)
|
||||
#define LAN865x_MAC_SAB2 MMS_REG(0x1, 0x024)
|
||||
#define LAN865x_MAC_SAT2 MMS_REG(0x1, 0x025)
|
||||
|
||||
#define LAN865x_MAC_TXRX_ON 1
|
||||
#define LAN865x_MAC_TXRX_OFF 0
|
||||
#define LAN865x_MAC_TXRX_ON 1
|
||||
#define LAN865x_MAC_TXRX_OFF 0
|
||||
|
||||
/* Memory Map Sector (MMS) 10 (0xA) */
|
||||
#define LAN865x_DEVID MMS_REG(0xA, 0x094)
|
||||
|
||||
struct lan865x_config_plca {
|
||||
bool enable : 1; /* 1 - PLCA enable, 0 - CSMA/CD enable */
|
||||
uint8_t node_id /* PLCA node id range: 0 to 254 */;
|
||||
bool enable: 1; /* 1 - PLCA enable, 0 - CSMA/CD enable */
|
||||
uint8_t node_id /* PLCA node id range: 0 to 254 */;
|
||||
uint8_t node_count; /* PLCA node count range: 1 to 255 */
|
||||
uint8_t burst_count; /* PLCA burst count range: 0x0 to 0xFF */
|
||||
uint8_t burst_timer; /* PLCA burst timer */
|
||||
uint8_t to_timer; /* PLCA TO value */
|
||||
uint8_t burst_count; /* PLCA burst count range: 0x0 to 0xFF */
|
||||
uint8_t burst_timer; /* PLCA burst timer */
|
||||
uint8_t to_timer; /* PLCA TO value */
|
||||
};
|
||||
|
||||
struct lan865x_config {
|
||||
|
|
|
|||
Loading…
Reference in a new issue