net: mgmt: Use layer codes defined in net_mgmt.h
Instead of hard coding some random value to layer code, use the code that is registered in net_mgmt.h This way it is easier to keep track of used layer codes in the future, and we also allow out-of-tree components a way to avoid allocating same layer code to in-tree-source code. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
702776bd1f
commit
259d41f1e0
10 changed files with 13 additions and 13 deletions
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
|
||||
/* CoAP events */
|
||||
#define NET_COAP_LAYER NET_MGMT_LAYER_L4
|
||||
#define NET_COAP_CODE 0x1c0
|
||||
#define NET_COAP_CODE NET_MGMT_LAYER_CODE_COAP
|
||||
#define NET_COAP_IF_BASE (NET_MGMT_EVENT_BIT | \
|
||||
NET_MGMT_LAYER(NET_COAP_LAYER) | \
|
||||
NET_MGMT_LAYER_CODE(NET_COAP_CODE))
|
||||
|
|
|
@ -36,7 +36,7 @@ extern "C" {
|
|||
|
||||
/* Connectivity Events */
|
||||
#define NET_MGMT_CONN_LAYER NET_MGMT_LAYER(NET_MGMT_LAYER_L2)
|
||||
#define NET_MGMT_CONN_CODE NET_MGMT_LAYER_CODE(0x207)
|
||||
#define NET_MGMT_CONN_CODE NET_MGMT_LAYER_CODE(NET_MGMT_LAYER_CODE_CONN)
|
||||
#define NET_MGMT_CONN_BASE (NET_MGMT_CONN_LAYER | NET_MGMT_CONN_CODE | \
|
||||
NET_MGMT_EVENT_BIT)
|
||||
#define NET_MGMT_CONN_IF_EVENT (NET_MGMT_IFACE_BIT | NET_MGMT_CONN_BASE)
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
/** @cond INTERNAL_HIDDEN */
|
||||
|
||||
#define NET_ETHERNET_LAYER NET_MGMT_LAYER_L2
|
||||
#define NET_ETHERNET_CODE 0x208
|
||||
#define NET_ETHERNET_CODE NET_MGMT_LAYER_CODE_ETHERNET
|
||||
#define NET_ETHERNET_BASE (NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_ETHERNET_LAYER) | \
|
||||
NET_MGMT_LAYER_CODE(NET_ETHERNET_CODE))
|
||||
|
|
|
@ -46,7 +46,7 @@ extern "C" {
|
|||
*/
|
||||
|
||||
#define NET_IEEE802154_LAYER NET_MGMT_LAYER_L2
|
||||
#define NET_IEEE802154_CODE 0x154
|
||||
#define NET_IEEE802154_CODE NET_MGMT_LAYER_CODE_IEEE802514
|
||||
#define NET_IEEE802154_BASE (NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_IEEE802154_LAYER) |\
|
||||
NET_MGMT_LAYER_CODE(NET_IEEE802154_CODE))
|
||||
|
|
|
@ -28,7 +28,7 @@ extern "C" {
|
|||
|
||||
/* Network Interface events */
|
||||
#define NET_IF_LAYER NET_MGMT_LAYER_L2
|
||||
#define NET_IF_CORE_CODE 0x001
|
||||
#define NET_IF_CORE_CODE NET_MGMT_LAYER_CODE_IFACE
|
||||
#define NET_EVENT_IF_BASE (NET_MGMT_EVENT_BIT | \
|
||||
NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_IF_LAYER) | \
|
||||
|
@ -43,7 +43,7 @@ enum net_event_if_cmd {
|
|||
|
||||
/* IPv6 Events */
|
||||
#define NET_IPV6_LAYER NET_MGMT_LAYER_L3
|
||||
#define NET_IPV6_CORE_CODE 0x060
|
||||
#define NET_IPV6_CORE_CODE NET_MGMT_LAYER_CODE_IPV6
|
||||
#define NET_EVENT_IPV6_BASE (NET_MGMT_EVENT_BIT | \
|
||||
NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_IPV6_LAYER) | \
|
||||
|
@ -79,7 +79,7 @@ enum net_event_ipv6_cmd {
|
|||
|
||||
/* IPv4 Events*/
|
||||
#define NET_IPV4_LAYER NET_MGMT_LAYER_L3
|
||||
#define NET_IPV4_CORE_CODE 0x004
|
||||
#define NET_IPV4_CORE_CODE NET_MGMT_LAYER_CODE_IPV4
|
||||
#define NET_EVENT_IPV4_BASE (NET_MGMT_EVENT_BIT | \
|
||||
NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_IPV4_LAYER) | \
|
||||
|
@ -104,7 +104,7 @@ enum net_event_ipv4_cmd {
|
|||
};
|
||||
|
||||
/* L4 network events */
|
||||
#define NET_L4_LAYER 0x114
|
||||
#define NET_L4_LAYER NET_MGMT_LAYER_L4
|
||||
#define NET_L4_CORE_CODE NET_MGMT_LAYER_CODE_L4
|
||||
#define NET_EVENT_L4_BASE (NET_MGMT_EVENT_BIT | \
|
||||
NET_MGMT_IFACE_BIT | \
|
||||
|
|
|
@ -734,7 +734,7 @@ struct net_stats_wifi {
|
|||
/** @cond INTERNAL_HIDDEN */
|
||||
|
||||
#define NET_STATS_LAYER NET_MGMT_LAYER_L3
|
||||
#define NET_STATS_CODE 0x101
|
||||
#define NET_STATS_CODE NET_MGMT_LAYER_CODE_STATS
|
||||
#define NET_STATS_BASE (NET_MGMT_LAYER(NET_STATS_LAYER) | \
|
||||
NET_MGMT_LAYER_CODE(NET_STATS_CODE))
|
||||
|
||||
|
|
|
@ -562,7 +562,7 @@ void net_ppp_init(struct net_if *iface);
|
|||
#define PPP_L2_CTX_TYPE struct ppp_context
|
||||
|
||||
#define NET_PPP_LAYER NET_MGMT_LAYER_L2
|
||||
#define NET_PPP_CODE 0x209
|
||||
#define NET_PPP_CODE NET_MGMT_LAYER_CODE_PPP
|
||||
#define NET_PPP_BASE (NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_PPP_LAYER) | \
|
||||
NET_MGMT_LAYER_CODE(NET_PPP_CODE))
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
/** @cond INTERNAL_HIDDEN */
|
||||
|
||||
#define NET_VIRTUAL_INTERFACE_LAYER NET_MGMT_LAYER_L2
|
||||
#define NET_VIRTUAL_INTERFACE_CODE 0x209
|
||||
#define NET_VIRTUAL_INTERFACE_CODE NET_MGMT_LAYER_CODE_VIRTUAL
|
||||
#define NET_VIRTUAL_INTERFACE_BASE \
|
||||
(NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_VIRTUAL_INTERFACE_LAYER) | \
|
||||
|
|
|
@ -33,7 +33,7 @@ extern "C" {
|
|||
/** @cond INTERNAL_HIDDEN */
|
||||
|
||||
#define NET_WIFI_LAYER NET_MGMT_LAYER_L2
|
||||
#define NET_WIFI_CODE 0x156
|
||||
#define NET_WIFI_CODE NET_MGMT_LAYER_CODE_WIFI
|
||||
#define NET_WIFI_BASE (NET_MGMT_IFACE_BIT | \
|
||||
NET_MGMT_LAYER(NET_WIFI_LAYER) | \
|
||||
NET_MGMT_LAYER_CODE(NET_WIFI_CODE))
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
/* Connectivity Events */
|
||||
#define NET_MGMT_SUPPLICANT_LAYER NET_MGMT_LAYER_L3
|
||||
#define NET_MGMT_SUPPLICANT_CODE 0x157
|
||||
#define NET_MGMT_SUPPLICANT_CODE NET_MGMT_LAYER_CODE_HOSTAP
|
||||
#define NET_MGMT_SUPPLICANT_BASE (NET_MGMT_LAYER(NET_MGMT_SUPPLICANT_LAYER) | \
|
||||
NET_MGMT_LAYER_CODE(NET_MGMT_SUPPLICANT_CODE) | \
|
||||
NET_MGMT_IFACE_BIT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue