netopt: introduced link type (wired or wireless)
This commit is contained in:
parent
07f24ffb38
commit
4dbd491097
@ -139,6 +139,17 @@ typedef enum {
|
|||||||
NETOPT_TX_END_IRQ,
|
NETOPT_TX_END_IRQ,
|
||||||
NETOPT_AUTOCCA, /**< en/disable to check automatically
|
NETOPT_AUTOCCA, /**< en/disable to check automatically
|
||||||
* before sending the channel is clear. */
|
* before sending the channel is clear. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief read-only check for a wired interface.
|
||||||
|
*
|
||||||
|
* If the interface is wireless this function will return -ENOTSUP, a
|
||||||
|
* positive value otherwise.
|
||||||
|
*
|
||||||
|
* @note Setting this option will always return -EONOTSUP.
|
||||||
|
*/
|
||||||
|
NETOPT_IS_WIRED,
|
||||||
|
|
||||||
/* add more options if needed */
|
/* add more options if needed */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -46,6 +46,7 @@ static const char *_netopt_strmap[] = {
|
|||||||
[NETOPT_TX_START_IRQ] = "NETOPT_TX_START_IRQ",
|
[NETOPT_TX_START_IRQ] = "NETOPT_TX_START_IRQ",
|
||||||
[NETOPT_TX_END_IRQ] = "NETOPT_TX_END_IRQ",
|
[NETOPT_TX_END_IRQ] = "NETOPT_TX_END_IRQ",
|
||||||
[NETOPT_AUTOCCA] = "NETOPT_AUTOCCA",
|
[NETOPT_AUTOCCA] = "NETOPT_AUTOCCA",
|
||||||
|
[NETOPT_IS_WIRED] = "NETOPT_IS_WIRED",
|
||||||
[NETOPT_NUMOF] = "NETOPT_NUMOF",
|
[NETOPT_NUMOF] = "NETOPT_NUMOF",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -273,6 +273,10 @@ static int _get(gnrc_netdev_t *dev, netopt_t opt, void *value, size_t max_len)
|
|||||||
DEBUG("promiscous mode\n");
|
DEBUG("promiscous mode\n");
|
||||||
return _get_promiscousmode((gnrc_netdev_eth_t *)dev, value, max_len);
|
return _get_promiscousmode((gnrc_netdev_eth_t *)dev, value, max_len);
|
||||||
|
|
||||||
|
case NETOPT_IS_WIRED:
|
||||||
|
DEBUG("is wired\n");
|
||||||
|
return 1;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DEBUG("[not supported: %d]\n", opt);
|
DEBUG("[not supported: %d]\n", opt);
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user