Skip to content

Commit c169ac0

Browse files
maass-hamburgdkalowsk
authored andcommitted
drivers: ethernet: remove get configs that are unused
remove get configs that are unused by the ethernet mgmt api. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent 9965091 commit c169ac0

File tree

5 files changed

+0
-163
lines changed

5 files changed

+0
-163
lines changed

drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,51 +1667,6 @@ static int eth_dwc_xgmac_set_config(const struct device *dev, enum ethernet_conf
16671667

16681668
return retval;
16691669
}
1670-
/**
1671-
* @brief XGMAC get config function
1672-
* XGMAC get config function facilitates to read the existing MAC settings
1673-
*
1674-
* @param dev Pointer to the ethernet device
1675-
* @param type Type of configuration
1676-
* @param config Pointer to configuration data
1677-
* @retval 0 get configuration successful
1678-
* -ENOTSUP for invalid config type
1679-
*/
1680-
static int eth_dwc_xgmac_get_config(const struct device *dev, enum ethernet_config_type type,
1681-
struct ethernet_config *config)
1682-
{
1683-
struct eth_dwc_xgmac_dev_data *dev_data = (struct eth_dwc_xgmac_dev_data *)dev->data;
1684-
1685-
switch (type) {
1686-
case ETHERNET_CONFIG_TYPE_AUTO_NEG:
1687-
config->auto_negotiation = dev_data->auto_neg;
1688-
break;
1689-
case ETHERNET_CONFIG_TYPE_LINK:
1690-
if (dev_data->link_speed == LINK_1GBIT) {
1691-
config->l.link_1000bt = true;
1692-
} else if (dev_data->link_speed == LINK_100MBIT) {
1693-
config->l.link_100bt = true;
1694-
} else if (dev_data->link_speed == LINK_10MBIT) {
1695-
config->l.link_10bt = true;
1696-
}
1697-
break;
1698-
case ETHERNET_CONFIG_TYPE_DUPLEX:
1699-
config->full_duplex = dev_data->enable_full_duplex;
1700-
break;
1701-
case ETHERNET_CONFIG_TYPE_MAC_ADDRESS:
1702-
memcpy(config->mac_address.addr, dev_data->mac_addr, 6);
1703-
break;
1704-
#if (!CONFIG_ETH_DWC_XGMAC_PROMISCUOUS_EXCEPTION && CONFIG_NET_PROMISCUOUS_MODE)
1705-
case ETHERNET_CONFIG_TYPE_PROMISC_MODE:
1706-
config->promisc_mode = dev_data->promisc_mode;
1707-
break;
1708-
#endif
1709-
default:
1710-
return -ENOTSUP;
1711-
}
1712-
1713-
return 0;
1714-
}
17151670

17161671
/**
17171672
* @brief XGMAC capability request function

drivers/ethernet/eth_enc424j600.c

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -501,54 +501,6 @@ static void enc424j600_rx_thread(void *p1, void *p2, void *p3)
501501
}
502502
}
503503

504-
static int enc424j600_get_config(const struct device *dev,
505-
enum ethernet_config_type type,
506-
struct ethernet_config *config)
507-
{
508-
uint16_t tmp;
509-
int rc = 0;
510-
struct enc424j600_runtime *context = dev->data;
511-
512-
if (type != ETHERNET_CONFIG_TYPE_LINK &&
513-
type != ETHERNET_CONFIG_TYPE_DUPLEX) {
514-
/* Unsupported configuration query */
515-
return -ENOTSUP;
516-
}
517-
518-
k_sem_take(&context->tx_rx_sem, K_FOREVER);
519-
520-
if (type == ETHERNET_CONFIG_TYPE_LINK) {
521-
/* Query active link speed */
522-
enc424j600_read_phy(dev, ENC424J600_PSFR_PHSTAT3, &tmp);
523-
524-
if (tmp & ENC424J600_PHSTAT3_SPDDPX_100) {
525-
/* 100Mbps link speed */
526-
config->l.link_100bt = true;
527-
} else if (tmp & ENC424J600_PHSTAT3_SPDDPX_10) {
528-
/* 10Mbps link speed */
529-
config->l.link_10bt = true;
530-
} else {
531-
/* Unknown link speed */
532-
rc = -EINVAL;
533-
}
534-
} else if (type == ETHERNET_CONFIG_TYPE_DUPLEX) {
535-
/* Query if half or full duplex */
536-
enc424j600_read_phy(dev, ENC424J600_PSFR_PHSTAT3, &tmp);
537-
538-
/* Assume operating in half duplex mode */
539-
config->full_duplex = false;
540-
541-
if (tmp & ENC424J600_PHSTAT3_SPDDPX_FD) {
542-
/* Operating in full duplex mode */
543-
config->full_duplex = true;
544-
}
545-
}
546-
547-
k_sem_give(&context->tx_rx_sem);
548-
549-
return rc;
550-
}
551-
552504
static enum ethernet_hw_caps enc424j600_get_capabilities(const struct device *dev)
553505
{
554506
ARG_UNUSED(dev);
@@ -677,7 +629,6 @@ static int enc424j600_stop_device(const struct device *dev)
677629

678630
static const struct ethernet_api api_funcs = {
679631
.iface_api.init = enc424j600_iface_init,
680-
.get_config = enc424j600_get_config,
681632
.set_config = enc424j600_set_config,
682633
.get_capabilities = enc424j600_get_capabilities,
683634
.send = enc424j600_tx,

drivers/ethernet/eth_sensry_sy1xx_mac.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -352,30 +352,6 @@ static enum ethernet_hw_caps sy1xx_mac_get_caps(const struct device *dev)
352352
return supported;
353353
}
354354

355-
static int sy1xx_mac_get_config(const struct device *dev, enum ethernet_config_type type,
356-
struct ethernet_config *config)
357-
{
358-
struct sy1xx_mac_dev_data *data = (struct sy1xx_mac_dev_data *)dev->data;
359-
360-
/* we currently support only 1000mbit/s full duplex */
361-
switch (type) {
362-
case ETHERNET_CONFIG_TYPE_LINK:
363-
config->l.link_1000bt = true;
364-
break;
365-
366-
case ETHERNET_CONFIG_TYPE_DUPLEX:
367-
config->full_duplex = true;
368-
break;
369-
370-
case ETHERNET_CONFIG_TYPE_MAC_ADDRESS:
371-
memcpy(config->mac_address.addr, data->mac_addr, 6);
372-
break;
373-
default:
374-
return -ENOTSUP;
375-
}
376-
return 0;
377-
}
378-
379355
static int sy1xx_mac_set_config(const struct device *dev, enum ethernet_config_type type,
380356
const struct ethernet_config *config)
381357
{
@@ -588,7 +564,6 @@ const struct ethernet_api sy1xx_mac_driver_api = {
588564
.stop = sy1xx_mac_stop,
589565
.iface_api.init = sy1xx_mac_iface_init,
590566
.get_capabilities = sy1xx_mac_get_caps,
591-
.get_config = sy1xx_mac_get_config,
592567
.set_config = sy1xx_mac_set_config,
593568
.send = sy1xx_mac_send,
594569
.get_phy = sy1xx_mac_get_phy,

drivers/ethernet/eth_stm32_hal.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,41 +1230,6 @@ static enum ethernet_hw_caps eth_stm32_hal_get_capabilities(const struct device
12301230
;
12311231
}
12321232

1233-
static int eth_stm32_hal_get_config(const struct device *dev, enum ethernet_config_type type,
1234-
struct ethernet_config *config)
1235-
{
1236-
struct eth_stm32_hal_dev_data *dev_data = dev->data;
1237-
1238-
switch (type) {
1239-
case ETHERNET_CONFIG_TYPE_MAC_ADDRESS:
1240-
memcpy(config->mac_address.addr, dev_data->mac_addr,
1241-
sizeof(config->mac_address.addr));
1242-
return 0;
1243-
#if defined(CONFIG_NET_PROMISCUOUS_MODE)
1244-
case ETHERNET_CONFIG_TYPE_PROMISC_MODE:
1245-
ETH_HandleTypeDef *heth = &dev_data->heth;
1246-
#if defined(CONFIG_ETH_STM32_HAL_API_V2)
1247-
ETH_MACFilterConfigTypeDef MACFilterConf;
1248-
1249-
HAL_ETH_GetMACFilterConfig(heth, &MACFilterConf);
1250-
1251-
config->promisc_mode = (MACFilterConf.PromiscuousMode == ENABLE);
1252-
#else
1253-
if (heth->Instance->MACFFR & ETH_MACFFR_PM) {
1254-
config->promisc_mode = true;
1255-
} else {
1256-
config->promisc_mode = false;
1257-
}
1258-
#endif /* CONFIG_ETH_STM32_HAL_API_V2 */
1259-
return 0;
1260-
#endif /* CONFIG_NET_PROMISCUOUS_MODE */
1261-
default:
1262-
break;
1263-
}
1264-
1265-
return -ENOTSUP;
1266-
}
1267-
12681233
static int eth_stm32_hal_set_config(const struct device *dev,
12691234
enum ethernet_config_type type,
12701235
const struct ethernet_config *config)
@@ -1348,7 +1313,6 @@ static const struct ethernet_api eth_api = {
13481313
.get_capabilities = eth_stm32_hal_get_capabilities,
13491314
.set_config = eth_stm32_hal_set_config,
13501315
.get_phy = eth_stm32_hal_get_phy,
1351-
.get_config = eth_stm32_hal_get_config,
13521316
#if defined(CONFIG_NET_DSA_DEPRECATED)
13531317
.send = dsa_tx,
13541318
#else

subsys/usb/device_next/class/usbd_cdc_ecm.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,6 @@ static int cdc_ecm_set_config(const struct device *dev,
546546
return -ENOTSUP;
547547
}
548548

549-
static int cdc_ecm_get_config(const struct device *dev,
550-
enum ethernet_config_type type,
551-
struct ethernet_config *config)
552-
{
553-
return -ENOTSUP;
554-
}
555-
556549
static enum ethernet_hw_caps cdc_ecm_get_capabilities(const struct device *dev)
557550
{
558551
ARG_UNUSED(dev);
@@ -639,7 +632,6 @@ static struct usbd_class_api usbd_cdc_ecm_api = {
639632

640633
static const struct ethernet_api cdc_ecm_eth_api = {
641634
.iface_api.init = cdc_ecm_iface_init,
642-
.get_config = cdc_ecm_get_config,
643635
.set_config = cdc_ecm_set_config,
644636
.get_capabilities = cdc_ecm_get_capabilities,
645637
.send = cdc_ecm_send,

0 commit comments

Comments
 (0)