mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/netdev_ieee802154: drop NETOPT_MAX_PKT_SIZE
This commit is contained in:
parent
2728065be4
commit
5b0152f4f7
@ -31,8 +31,6 @@
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
|
||||
#define _MAX_MHR_OVERHEAD (25)
|
||||
|
||||
/* Reference pointer for the IRQ handler */
|
||||
static netdev_t *_dev;
|
||||
|
||||
@ -88,13 +86,6 @@ static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
|
||||
case NETOPT_IS_WIRED:
|
||||
return -ENOTSUP;
|
||||
|
||||
case NETOPT_MAX_PACKET_SIZE:
|
||||
if (max_len < sizeof(int16_t)) {
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
*((uint16_t *)value) = CC2538_RF_MAX_DATA_LEN - _MAX_MHR_OVERHEAD;
|
||||
return sizeof(uint16_t);
|
||||
|
||||
case NETOPT_PROMISCUOUSMODE:
|
||||
if (cc2538_get_monitor()) {
|
||||
*((netopt_enable_t *)value) = NETOPT_ENABLE;
|
||||
|
@ -31,9 +31,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* 127 - 25 as in at86rf2xx */
|
||||
#define SOCKET_ZEP_FRAME_PAYLOAD_LEN (102) /**< maximum possible payload size */
|
||||
|
||||
/**
|
||||
* @brief ZEP device state
|
||||
*/
|
||||
|
@ -304,21 +304,8 @@ static int _init(netdev_t *netdev)
|
||||
|
||||
static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
|
||||
{
|
||||
socket_zep_t *dev = (socket_zep_t *)netdev;
|
||||
uint16_t *v = value;
|
||||
|
||||
assert((dev != NULL));
|
||||
switch (opt) {
|
||||
case NETOPT_MAX_PACKET_SIZE:
|
||||
assert(value != NULL);
|
||||
if (max_len != sizeof(uint16_t)) {
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
*v = SOCKET_ZEP_FRAME_PAYLOAD_LEN;
|
||||
return sizeof(uint16_t);
|
||||
default:
|
||||
return netdev_ieee802154_get(&dev->netdev, opt, value, max_len);
|
||||
}
|
||||
assert(netdev != NULL);
|
||||
return netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt, value, max_len);
|
||||
}
|
||||
|
||||
static int _set(netdev_t *netdev, netopt_t opt, const void *value,
|
||||
|
@ -42,8 +42,6 @@
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
|
||||
#define _MAX_MHR_OVERHEAD (25)
|
||||
|
||||
static int _send(netdev_t *netdev, const iolist_t *iolist);
|
||||
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
|
||||
static int _init(netdev_t *netdev);
|
||||
@ -284,11 +282,6 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
|
||||
((uint8_t *)val)[0] = at86rf2xx_get_page(dev);
|
||||
return sizeof(uint16_t);
|
||||
|
||||
case NETOPT_MAX_PACKET_SIZE:
|
||||
assert(max_len >= sizeof(int16_t));
|
||||
*((uint16_t *)val) = AT86RF2XX_MAX_PKT_LENGTH - _MAX_MHR_OVERHEAD;
|
||||
return sizeof(uint16_t);
|
||||
|
||||
case NETOPT_STATE:
|
||||
assert(max_len >= sizeof(netopt_state_t));
|
||||
*((netopt_state_t *)val) = _get_state(dev);
|
||||
|
@ -38,8 +38,6 @@
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
|
||||
#define _MAX_MHR_OVERHEAD (25)
|
||||
|
||||
static int _send(netdev_t *netdev, const iolist_t *iolist);
|
||||
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
|
||||
static int _init(netdev_t *netdev);
|
||||
@ -188,11 +186,6 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
|
||||
cc2420_get_addr_long(dev, val);
|
||||
return 8;
|
||||
|
||||
case NETOPT_MAX_PACKET_SIZE:
|
||||
assert(max_len >= sizeof(int16_t));
|
||||
*((uint16_t *)val) = CC2420_PKT_MAXLEN - _MAX_MHR_OVERHEAD;
|
||||
return sizeof(int16_t);
|
||||
|
||||
case NETOPT_NID:
|
||||
assert(max_len >= sizeof(uint16_t));
|
||||
return w_u16(val, cc2420_get_pan(dev));
|
||||
|
@ -42,8 +42,6 @@
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
|
||||
#define _MAX_MHR_OVERHEAD (25)
|
||||
|
||||
#define _MACACKWAITDURATION (864 / 16) /* 864us * 62500Hz */
|
||||
|
||||
#define KW2XRF_THREAD_FLAG_ISR (1 << 8)
|
||||
@ -260,14 +258,6 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
|
||||
}
|
||||
|
||||
switch (opt) {
|
||||
case NETOPT_MAX_PACKET_SIZE:
|
||||
if (len < sizeof(int16_t)) {
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
|
||||
*((uint16_t *)value) = KW2XRF_MAX_PKT_LENGTH - _MAX_MHR_OVERHEAD;
|
||||
return sizeof(uint16_t);
|
||||
|
||||
case NETOPT_STATE:
|
||||
if (len < sizeof(netopt_state_t)) {
|
||||
return -EOVERFLOW;
|
||||
|
@ -37,8 +37,6 @@
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
|
||||
#define _MAX_MHR_OVERHEAD (25)
|
||||
|
||||
static void _irq_handler(void *arg)
|
||||
{
|
||||
netdev_t *dev = (netdev_t *) arg;
|
||||
@ -187,16 +185,6 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
|
||||
}
|
||||
break;
|
||||
|
||||
case NETOPT_MAX_PACKET_SIZE:
|
||||
if (max_len < sizeof(int16_t)) {
|
||||
res = -EOVERFLOW;
|
||||
}
|
||||
else {
|
||||
*((uint16_t *)val) = IEEE802154_FRAME_LEN_MAX - _MAX_MHR_OVERHEAD;
|
||||
res = sizeof(uint16_t);
|
||||
}
|
||||
break;
|
||||
|
||||
case NETOPT_STATE:
|
||||
if (max_len < sizeof(netopt_state_t)) {
|
||||
res = -EOVERFLOW;
|
||||
|
Loading…
Reference in New Issue
Block a user