eth.h
1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* 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.
*/
/**
* @ingroup drivers_netdev_netdev2
* @{
*
* @file
* @brief Definitions for netdev2 common ethernet code
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef NETDEV2_ETH_H
#define NETDEV2_ETH_H
#include <stdint.h>
#include "net/netdev2.h"
#include "net/netopt.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Fallback function for netdev2 ethernet devices' _get function
*
* Supposed to be used by netdev2 drivers as default case.
*
* @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
*/
int netdev2_eth_get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len);
/**
* @brief Fallback function for netdev2 ethernet devices' _set function
*
* @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
*/
int netdev2_eth_set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len);
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* NETDEV2_ETH_H */