ieee802154_netdev.h (c3a6114f31600b94ee10ebf62e4d493b401ade87) ieee802154_netdev.h (32edc40ae65cf84e1ab69f6f8316ce81559e115d)
1/*
2 * An interface between IEEE802.15.4 device and rest of the kernel.
3 *
4 * Copyright (C) 2007-2012 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.

--- 208 unchanged lines hidden (view full) ---

217}
218
219/*
220 * A control block of skb passed between the ARPHRD_IEEE802154 device
221 * and other stack parts.
222 */
223struct ieee802154_mac_cb {
224 u8 lqi;
1/*
2 * An interface between IEEE802.15.4 device and rest of the kernel.
3 *
4 * Copyright (C) 2007-2012 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.

--- 208 unchanged lines hidden (view full) ---

217}
218
219/*
220 * A control block of skb passed between the ARPHRD_IEEE802154 device
221 * and other stack parts.
222 */
223struct ieee802154_mac_cb {
224 u8 lqi;
225 u8 flags;
226 u8 seq;
225 u8 type;
226 bool ackreq;
227 bool secen;
227 struct ieee802154_addr source;
228 struct ieee802154_addr dest;
229};
230
231static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
232{
233 return (struct ieee802154_mac_cb *)skb->cb;
234}
235
228 struct ieee802154_addr source;
229 struct ieee802154_addr dest;
230};
231
232static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
233{
234 return (struct ieee802154_mac_cb *)skb->cb;
235}
236
236#define MAC_CB_FLAG_TYPEMASK ((1 << 3) - 1)
237
238#define MAC_CB_FLAG_ACKREQ (1 << 3)
239#define MAC_CB_FLAG_SECEN (1 << 4)
240
241static inline bool mac_cb_is_ackreq(struct sk_buff *skb)
237static inline struct ieee802154_mac_cb *mac_cb_init(struct sk_buff *skb)
242{
238{
243 return mac_cb(skb)->flags & MAC_CB_FLAG_ACKREQ;
244}
239 BUILD_BUG_ON(sizeof(struct ieee802154_mac_cb) > sizeof(skb->cb));
245
240
246static inline bool mac_cb_is_secen(struct sk_buff *skb)
247{
248 return mac_cb(skb)->flags & MAC_CB_FLAG_SECEN;
241 memset(skb->cb, 0, sizeof(struct ieee802154_mac_cb));
242 return mac_cb(skb);
249}
250
243}
244
251static inline int mac_cb_type(struct sk_buff *skb)
252{
253 return mac_cb(skb)->flags & MAC_CB_FLAG_TYPEMASK;
254}
255
256#define IEEE802154_MAC_SCAN_ED 0
257#define IEEE802154_MAC_SCAN_ACTIVE 1
258#define IEEE802154_MAC_SCAN_PASSIVE 2
259#define IEEE802154_MAC_SCAN_ORPHAN 3
260
261struct ieee802154_mac_params {
262 s8 transmit_power;
263 u8 min_be;

--- 76 unchanged lines hidden ---
245#define IEEE802154_MAC_SCAN_ED 0
246#define IEEE802154_MAC_SCAN_ACTIVE 1
247#define IEEE802154_MAC_SCAN_PASSIVE 2
248#define IEEE802154_MAC_SCAN_ORPHAN 3
249
250struct ieee802154_mac_params {
251 s8 transmit_power;
252 u8 min_be;

--- 76 unchanged lines hidden ---