2015-11-30 14:01:23 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
|
|
* Public License v2.1. See the file LICENSE in the top level directory for
|
|
|
|
* more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-06-01 12:09:01 +02:00
|
|
|
* @defgroup drivers_netdev_eth Ethernet drivers
|
2017-02-15 13:07:34 +01:00
|
|
|
* @ingroup drivers_netdev_api
|
2015-11-30 14:01:23 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2017-02-15 13:07:34 +01:00
|
|
|
* @brief Definitions for netdev common ethernet code
|
2015-11-30 14:01:23 +01:00
|
|
|
*
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*/
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef NET_NETDEV_ETH_H
|
|
|
|
#define NET_NETDEV_ETH_H
|
2015-11-30 14:01:23 +01:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-02-15 13:07:34 +01:00
|
|
|
#include "net/netdev.h"
|
2015-11-30 14:01:23 +01:00
|
|
|
#include "net/netopt.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2017-02-15 13:07:34 +01:00
|
|
|
* @brief Fallback function for netdev ethernet devices' _get function
|
2015-11-30 14:01:23 +01:00
|
|
|
*
|
2017-02-15 13:07:34 +01:00
|
|
|
* Supposed to be used by netdev drivers as default case.
|
2015-11-30 14:01:23 +01:00
|
|
|
*
|
|
|
|
* @warning Driver *MUST* implement NETOPT_ADDRESS case!
|
|
|
|
*
|
|
|
|
* @param[in] dev network device descriptor
|
|
|
|
* @param[in] opt option type
|
|
|
|
* @param[out] value pointer to store the option's value in
|
|
|
|
* @param[in] max_len maximal amount of byte that fit into @p value
|
|
|
|
*
|
|
|
|
* @return number of bytes written to @p value
|
|
|
|
* @return <0 on error
|
|
|
|
*/
|
2017-02-15 13:07:34 +01:00
|
|
|
int netdev_eth_get(netdev_t *dev, netopt_t opt, void *value, size_t max_len);
|
2015-11-30 14:01:23 +01:00
|
|
|
|
|
|
|
/**
|
2017-02-15 13:07:34 +01:00
|
|
|
* @brief Fallback function for netdev ethernet devices' _set function
|
2015-11-30 14:01:23 +01:00
|
|
|
*
|
|
|
|
* @param[in] dev network device descriptor
|
|
|
|
* @param[in] opt option type
|
|
|
|
* @param[in] value value to set
|
|
|
|
* @param[in] value_len the length of @p value
|
|
|
|
*
|
|
|
|
* @return number of bytes used from @p value
|
|
|
|
* @return <0 on error
|
|
|
|
*/
|
2017-08-25 07:34:03 +02:00
|
|
|
int netdev_eth_set(netdev_t *dev, netopt_t opt, const void *value, size_t value_len);
|
2015-11-30 14:01:23 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2017-08-29 18:00:46 +02:00
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* NET_NETDEV_ETH_H */
|
2017-08-29 18:00:46 +02:00
|
|
|
/** @} */
|