2016-10-07 10:50:21 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation.
|
|
|
|
*
|
2017-01-19 02:01:01 +01:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-10-07 10:50:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2017-12-06 09:59:18 +01:00
|
|
|
* @brief IEEE 802.15.4 Private Management
|
2016-10-07 10:50:21 +02:00
|
|
|
*/
|
|
|
|
|
2017-12-06 09:59:18 +01:00
|
|
|
#ifndef __IEEE802154_MGMT_PRIV_H__
|
|
|
|
#define __IEEE802154_MGMT_PRIV_H__
|
2016-10-07 10:50:21 +02:00
|
|
|
|
2017-01-05 18:32:47 +01:00
|
|
|
#include "ieee802154_frame.h"
|
|
|
|
|
2016-10-07 10:50:21 +02:00
|
|
|
#ifdef CONFIG_NET_MGMT
|
|
|
|
|
|
|
|
static inline bool ieee802154_is_scanning(struct net_if *iface)
|
|
|
|
{
|
|
|
|
struct ieee802154_context *ctx = net_if_l2_data(iface);
|
|
|
|
|
|
|
|
return !(!ctx->scan_ctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void ieee802154_mgmt_init(struct net_if *iface)
|
|
|
|
{
|
|
|
|
struct ieee802154_context *ctx = net_if_l2_data(iface);
|
|
|
|
|
|
|
|
k_sem_init(&ctx->res_lock, 1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum net_verdict ieee802154_handle_beacon(struct net_if *iface,
|
2017-10-03 10:03:37 +02:00
|
|
|
struct ieee802154_mpdu *mpdu,
|
2020-05-27 18:26:57 +02:00
|
|
|
uint8_t lqi);
|
2016-10-07 10:50:21 +02:00
|
|
|
|
2016-10-19 13:18:44 +02:00
|
|
|
enum net_verdict ieee802154_handle_mac_command(struct net_if *iface,
|
|
|
|
struct ieee802154_mpdu *mpdu);
|
|
|
|
|
2016-10-07 10:50:21 +02:00
|
|
|
#else /* CONFIG_NET_MGMT */
|
|
|
|
|
|
|
|
#define ieee802154_is_scanning(...) false
|
|
|
|
#define ieee802154_mgmt_init(...)
|
|
|
|
#define ieee802154_handle_beacon(...) NET_DROP
|
2016-10-19 13:18:44 +02:00
|
|
|
#define ieee802154_handle_mac_command(...) NET_DROP
|
2016-10-07 10:50:21 +02:00
|
|
|
|
|
|
|
#endif /* CONFIG_NET_MGMT */
|
|
|
|
|
2017-12-06 09:59:18 +01:00
|
|
|
#endif /* __IEEE802154_MGMT_PRIV_H__ */
|