linux/include/net/ieee802154_netdev.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * An interface between IEEE802.15.4 device and rest of the kernel.
 *
 * Copyright (C) 2007-2012 Siemens AG
 *
 * Written by:
 * Pavel Smolenskiy <[email protected]>
 * Maxim Gorbachyov <[email protected]>
 * Maxim Osipov <[email protected]>
 * Dmitry Eremin-Solenikov <[email protected]>
 * Alexander Smirnov <[email protected]>
 */

#ifndef IEEE802154_NETDEVICE_H
#define IEEE802154_NETDEVICE_H

#define IEEE802154_REQUIRED_SIZE(struct_type, member)

#define IEEE802154_ADDR_OFFSET

#define IEEE802154_MIN_NAMELEN

#define IEEE802154_NAMELEN_SHORT

#define IEEE802154_NAMELEN_LONG

#include <net/af_ieee802154.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/ieee802154.h>

#include <net/cfg802154.h>

struct ieee802154_beacon_hdr {} __packed;

struct ieee802154_mac_cmd_pl {} __packed;

struct ieee802154_sechdr {};

struct ieee802154_hdr_fc {};

struct ieee802154_assoc_req_pl {} __packed;

struct ieee802154_assoc_resp_pl {} __packed;

enum ieee802154_frame_version {};

enum ieee802154_addressing_mode {};

enum ieee802154_association_status {};

enum ieee802154_disassociation_reason {};

struct ieee802154_hdr {};

struct ieee802154_beacon_frame {};

struct ieee802154_mac_cmd_frame {};

struct ieee802154_beacon_req_frame {};

struct ieee802154_association_req_frame {};

struct ieee802154_association_resp_frame {};

struct ieee802154_disassociation_notif_frame {};

/* pushes hdr onto the skb. fields of hdr->fc that can be calculated from
 * the contents of hdr will be, and the actual value of those bits in
 * hdr->fc will be ignored. this includes the INTRA_PAN bit and the frame
 * version, if SECEN is set.
 */
int ieee802154_hdr_push(struct sk_buff *skb, struct ieee802154_hdr *hdr);

/* pulls the entire 802.15.4 header off of the skb, including the security
 * header, and performs pan id decompression
 */
int ieee802154_hdr_pull(struct sk_buff *skb, struct ieee802154_hdr *hdr);

/* parses the frame control, sequence number of address fields in a given skb
 * and stores them into hdr, performing pan id decompression and length checks
 * to be suitable for use in header_ops.parse
 */
int ieee802154_hdr_peek_addrs(const struct sk_buff *skb,
			      struct ieee802154_hdr *hdr);

/* parses the full 802.15.4 header a given skb and stores them into hdr,
 * performing pan id decompression and length checks to be suitable for use in
 * header_ops.parse
 */
int ieee802154_hdr_peek(const struct sk_buff *skb, struct ieee802154_hdr *hdr);

/* pushes/pulls various frame types into/from an skb */
int ieee802154_beacon_push(struct sk_buff *skb,
			   struct ieee802154_beacon_frame *beacon);
int ieee802154_mac_cmd_push(struct sk_buff *skb, void *frame,
			    const void *pl, unsigned int pl_len);
int ieee802154_mac_cmd_pl_pull(struct sk_buff *skb,
			       struct ieee802154_mac_cmd_pl *mac_pl);

int ieee802154_max_payload(const struct ieee802154_hdr *hdr);

static inline int
ieee802154_sechdr_authtag_len(const struct ieee802154_sechdr *sec)
{}

static inline int ieee802154_hdr_length(struct sk_buff *skb)
{}

static inline bool ieee802154_addr_equal(const struct ieee802154_addr *a1,
					 const struct ieee802154_addr *a2)
{}

static inline __le64 ieee802154_devaddr_from_raw(const void *raw)
{}

static inline void ieee802154_devaddr_to_raw(void *raw, __le64 addr)
{}

static inline int
ieee802154_sockaddr_check_size(struct sockaddr_ieee802154 *daddr, int len)
{}

static inline void ieee802154_addr_from_sa(struct ieee802154_addr *a,
					   const struct ieee802154_addr_sa *sa)
{}

static inline void ieee802154_addr_to_sa(struct ieee802154_addr_sa *sa,
					 const struct ieee802154_addr *a)
{}

/*
 * A control block of skb passed between the ARPHRD_IEEE802154 device
 * and other stack parts.
 */
struct ieee802154_mac_cb {};

static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
{}

static inline struct ieee802154_mac_cb *mac_cb_init(struct sk_buff *skb)
{}

enum {};

#define IEEE802154_MAC_SCAN_ED
#define IEEE802154_MAC_SCAN_ACTIVE
#define IEEE802154_MAC_SCAN_PASSIVE
#define IEEE802154_MAC_SCAN_ORPHAN

struct ieee802154_mac_params {};

struct wpan_phy;

enum {};

struct ieee802154_llsec_ops {};
/*
 * This should be located at net_device->ml_priv
 *
 * get_phy should increment the reference counting on returned phy.
 * Use wpan_wpy_put to put that reference.
 */
struct ieee802154_mlme_ops {};

static inline struct ieee802154_mlme_ops *
ieee802154_mlme_ops(const struct net_device *dev)
{}

#endif