Commit f0166e5e3cdab66d5a31f796ce18e21fd3ce99dc

Authored by Dmitry Eremin-Solenikov
1 parent 878fa89f97

ieee802154: move headers out of extra directory

include/net/ieee802154/af_ieee802154.h (and others) naming seems to be too long
and redundant. Drop one level of subdirectories.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

Showing 13 changed files with 465 additions and 465 deletions Side-by-side Diff

drivers/ieee802154/fakehard.c
... ... @@ -26,10 +26,10 @@
26 26 #include <linux/skbuff.h>
27 27 #include <linux/if_arp.h>
28 28  
29   -#include <net/ieee802154/af_ieee802154.h>
30   -#include <net/ieee802154/netdevice.h>
31   -#include <net/ieee802154/mac_def.h>
32   -#include <net/ieee802154/nl802154.h>
  29 +#include <net/af_ieee802154.h>
  30 +#include <net/ieee802154_netdev.h>
  31 +#include <net/ieee802154.h>
  32 +#include <net/nl802154.h>
33 33  
34 34 /**
35 35 * fake_get_pan_id - Retrieve the PAN ID of the device.
include/net/af_ieee802154.h
  1 +/*
  2 + * IEEE 802.15.4 inteface for userspace
  3 + *
  4 + * Copyright 2007, 2008 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.
  9 + *
  10 + * This program is distributed in the hope that it will be useful,
  11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13 + * GNU General Public License for more details.
  14 + *
  15 + * You should have received a copy of the GNU General Public License along
  16 + * with this program; if not, write to the Free Software Foundation, Inc.,
  17 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18 + *
  19 + * Written by:
  20 + * Sergey Lapin <slapin@ossfans.org>
  21 + * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
  22 + */
  23 +
  24 +#ifndef _AF_IEEE802154_H
  25 +#define _AF_IEEE802154_H
  26 +
  27 +#include <linux/socket.h> /* for sa_family_t */
  28 +
  29 +enum {
  30 + IEEE802154_ADDR_NONE = 0x0,
  31 + /* RESERVED = 0x01, */
  32 + IEEE802154_ADDR_SHORT = 0x2, /* 16-bit address + PANid */
  33 + IEEE802154_ADDR_LONG = 0x3, /* 64-bit address + PANid */
  34 +};
  35 +
  36 +/* address length, octets */
  37 +#define IEEE802154_ADDR_LEN 8
  38 +
  39 +struct ieee802154_addr {
  40 + int addr_type;
  41 + u16 pan_id;
  42 + union {
  43 + u8 hwaddr[IEEE802154_ADDR_LEN];
  44 + u16 short_addr;
  45 + };
  46 +};
  47 +
  48 +#define IEEE802154_PANID_BROADCAST 0xffff
  49 +#define IEEE802154_ADDR_BROADCAST 0xffff
  50 +#define IEEE802154_ADDR_UNDEF 0xfffe
  51 +
  52 +struct sockaddr_ieee802154 {
  53 + sa_family_t family; /* AF_IEEE802154 */
  54 + struct ieee802154_addr addr;
  55 +};
  56 +
  57 +/* master device */
  58 +#define IEEE802154_SIOC_ADD_SLAVE (SIOCDEVPRIVATE + 0)
  59 +
  60 +#endif
include/net/ieee802154.h
  1 +/*
  2 + * IEEE802.15.4-2003 specification
  3 + *
  4 + * Copyright (C) 2007, 2008 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.
  9 + *
  10 + * This program is distributed in the hope that it will be useful,
  11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13 + * GNU General Public License for more details.
  14 + *
  15 + * You should have received a copy of the GNU General Public License along
  16 + * with this program; if not, write to the Free Software Foundation, Inc.,
  17 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18 + *
  19 + * Written by:
  20 + * Pavel Smolenskiy <pavel.smolenskiy@gmail.com>
  21 + * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
  22 + * Maxim Osipov <maxim.osipov@siemens.com>
  23 + * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
  24 + */
  25 +
  26 +#ifndef NET_IEEE802154_H
  27 +#define NET_IEEE802154_H
  28 +
  29 +#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */
  30 +#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */
  31 +#define IEEE802154_FC_TYPE_ACK 0x2 /* Frame is acknowledgment */
  32 +#define IEEE802154_FC_TYPE_MAC_CMD 0x3 /* Frame is MAC command */
  33 +
  34 +#define IEEE802154_FC_TYPE_SHIFT 0
  35 +#define IEEE802154_FC_TYPE_MASK ((1 << 3) - 1)
  36 +#define IEEE802154_FC_TYPE(x) ((x & IEEE802154_FC_TYPE_MASK) >> IEEE802154_FC_TYPE_SHIFT)
  37 +#define IEEE802154_FC_SET_TYPE(v, x) do { \
  38 + v = (((v) & ~IEEE802154_FC_TYPE_MASK) | \
  39 + (((x) << IEEE802154_FC_TYPE_SHIFT) & IEEE802154_FC_TYPE_MASK)); \
  40 + } while (0)
  41 +
  42 +#define IEEE802154_FC_SECEN (1 << 3)
  43 +#define IEEE802154_FC_FRPEND (1 << 4)
  44 +#define IEEE802154_FC_ACK_REQ (1 << 5)
  45 +#define IEEE802154_FC_INTRA_PAN (1 << 6)
  46 +
  47 +#define IEEE802154_FC_SAMODE_SHIFT 14
  48 +#define IEEE802154_FC_SAMODE_MASK (3 << IEEE802154_FC_SAMODE_SHIFT)
  49 +#define IEEE802154_FC_DAMODE_SHIFT 10
  50 +#define IEEE802154_FC_DAMODE_MASK (3 << IEEE802154_FC_DAMODE_SHIFT)
  51 +
  52 +#define IEEE802154_FC_SAMODE(x) \
  53 + (((x) & IEEE802154_FC_SAMODE_MASK) >> IEEE802154_FC_SAMODE_SHIFT)
  54 +
  55 +#define IEEE802154_FC_DAMODE(x) \
  56 + (((x) & IEEE802154_FC_DAMODE_MASK) >> IEEE802154_FC_DAMODE_SHIFT)
  57 +
  58 +
  59 +/* MAC's Command Frames Identifiers */
  60 +#define IEEE802154_CMD_ASSOCIATION_REQ 0x01
  61 +#define IEEE802154_CMD_ASSOCIATION_RESP 0x02
  62 +#define IEEE802154_CMD_DISASSOCIATION_NOTIFY 0x03
  63 +#define IEEE802154_CMD_DATA_REQ 0x04
  64 +#define IEEE802154_CMD_PANID_CONFLICT_NOTIFY 0x05
  65 +#define IEEE802154_CMD_ORPHAN_NOTIFY 0x06
  66 +#define IEEE802154_CMD_BEACON_REQ 0x07
  67 +#define IEEE802154_CMD_COORD_REALIGN_NOTIFY 0x08
  68 +#define IEEE802154_CMD_GTS_REQ 0x09
  69 +
  70 +/*
  71 + * The return values of MAC operations
  72 + */
  73 +enum {
  74 + /*
  75 + * The requested operation was completed successfully.
  76 + * For a transmission request, this value indicates
  77 + * a successful transmission.
  78 + */
  79 + IEEE802154_SUCCESS = 0x0,
  80 +
  81 + /* The beacon was lost following a synchronization request. */
  82 + IEEE802154_BEACON_LOSS = 0xe0,
  83 + /*
  84 + * A transmission could not take place due to activity on the
  85 + * channel, i.e., the CSMA-CA mechanism has failed.
  86 + */
  87 + IEEE802154_CHNL_ACCESS_FAIL = 0xe1,
  88 + /* The GTS request has been denied by the PAN coordinator. */
  89 + IEEE802154_DENINED = 0xe2,
  90 + /* The attempt to disable the transceiver has failed. */
  91 + IEEE802154_DISABLE_TRX_FAIL = 0xe3,
  92 + /*
  93 + * The received frame induces a failed security check according to
  94 + * the security suite.
  95 + */
  96 + IEEE802154_FAILED_SECURITY_CHECK = 0xe4,
  97 + /*
  98 + * The frame resulting from secure processing has a length that is
  99 + * greater than aMACMaxFrameSize.
  100 + */
  101 + IEEE802154_FRAME_TOO_LONG = 0xe5,
  102 + /*
  103 + * The requested GTS transmission failed because the specified GTS
  104 + * either did not have a transmit GTS direction or was not defined.
  105 + */
  106 + IEEE802154_INVALID_GTS = 0xe6,
  107 + /*
  108 + * A request to purge an MSDU from the transaction queue was made using
  109 + * an MSDU handle that was not found in the transaction table.
  110 + */
  111 + IEEE802154_INVALID_HANDLE = 0xe7,
  112 + /* A parameter in the primitive is out of the valid range.*/
  113 + IEEE802154_INVALID_PARAMETER = 0xe8,
  114 + /* No acknowledgment was received after aMaxFrameRetries. */
  115 + IEEE802154_NO_ACK = 0xe9,
  116 + /* A scan operation failed to find any network beacons.*/
  117 + IEEE802154_NO_BEACON = 0xea,
  118 + /* No response data were available following a request. */
  119 + IEEE802154_NO_DATA = 0xeb,
  120 + /* The operation failed because a short address was not allocated. */
  121 + IEEE802154_NO_SHORT_ADDRESS = 0xec,
  122 + /*
  123 + * A receiver enable request was unsuccessful because it could not be
  124 + * completed within the CAP.
  125 + */
  126 + IEEE802154_OUT_OF_CAP = 0xed,
  127 + /*
  128 + * A PAN identifier conflict has been detected and communicated to the
  129 + * PAN coordinator.
  130 + */
  131 + IEEE802154_PANID_CONFLICT = 0xee,
  132 + /* A coordinator realignment command has been received. */
  133 + IEEE802154_REALIGMENT = 0xef,
  134 + /* The transaction has expired and its information discarded. */
  135 + IEEE802154_TRANSACTION_EXPIRED = 0xf0,
  136 + /* There is no capacity to store the transaction. */
  137 + IEEE802154_TRANSACTION_OVERFLOW = 0xf1,
  138 + /*
  139 + * The transceiver was in the transmitter enabled state when the
  140 + * receiver was requested to be enabled.
  141 + */
  142 + IEEE802154_TX_ACTIVE = 0xf2,
  143 + /* The appropriate key is not available in the ACL. */
  144 + IEEE802154_UNAVAILABLE_KEY = 0xf3,
  145 + /*
  146 + * A SET/GET request was issued with the identifier of a PIB attribute
  147 + * that is not supported.
  148 + */
  149 + IEEE802154_UNSUPPORTED_ATTR = 0xf4,
  150 + /*
  151 + * A request to perform a scan operation failed because the MLME was
  152 + * in the process of performing a previously initiated scan operation.
  153 + */
  154 + IEEE802154_SCAN_IN_PROGRESS = 0xfc,
  155 +};
  156 +
  157 +
  158 +#endif
include/net/ieee802154/af_ieee802154.h
1   -/*
2   - * IEEE 802.15.4 inteface for userspace
3   - *
4   - * Copyright 2007, 2008 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.
9   - *
10   - * This program is distributed in the hope that it will be useful,
11   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   - * GNU General Public License for more details.
14   - *
15   - * You should have received a copy of the GNU General Public License along
16   - * with this program; if not, write to the Free Software Foundation, Inc.,
17   - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18   - *
19   - * Written by:
20   - * Sergey Lapin <slapin@ossfans.org>
21   - * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
22   - */
23   -
24   -#ifndef _AF_IEEE802154_H
25   -#define _AF_IEEE802154_H
26   -
27   -#include <linux/socket.h> /* for sa_family_t */
28   -
29   -enum {
30   - IEEE802154_ADDR_NONE = 0x0,
31   - /* RESERVED = 0x01, */
32   - IEEE802154_ADDR_SHORT = 0x2, /* 16-bit address + PANid */
33   - IEEE802154_ADDR_LONG = 0x3, /* 64-bit address + PANid */
34   -};
35   -
36   -/* address length, octets */
37   -#define IEEE802154_ADDR_LEN 8
38   -
39   -struct ieee802154_addr {
40   - int addr_type;
41   - u16 pan_id;
42   - union {
43   - u8 hwaddr[IEEE802154_ADDR_LEN];
44   - u16 short_addr;
45   - };
46   -};
47   -
48   -#define IEEE802154_PANID_BROADCAST 0xffff
49   -#define IEEE802154_ADDR_BROADCAST 0xffff
50   -#define IEEE802154_ADDR_UNDEF 0xfffe
51   -
52   -struct sockaddr_ieee802154 {
53   - sa_family_t family; /* AF_IEEE802154 */
54   - struct ieee802154_addr addr;
55   -};
56   -
57   -/* master device */
58   -#define IEEE802154_SIOC_ADD_SLAVE (SIOCDEVPRIVATE + 0)
59   -
60   -#endif
include/net/ieee802154/mac_def.h
1   -/*
2   - * IEEE802.15.4-2003 specification
3   - *
4   - * Copyright (C) 2007, 2008 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.
9   - *
10   - * This program is distributed in the hope that it will be useful,
11   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   - * GNU General Public License for more details.
14   - *
15   - * You should have received a copy of the GNU General Public License along
16   - * with this program; if not, write to the Free Software Foundation, Inc.,
17   - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18   - *
19   - * Written by:
20   - * Pavel Smolenskiy <pavel.smolenskiy@gmail.com>
21   - * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
22   - * Maxim Osipov <maxim.osipov@siemens.com>
23   - * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
24   - */
25   -
26   -#ifndef IEEE802154_MAC_DEF_H
27   -#define IEEE802154_MAC_DEF_H
28   -
29   -#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */
30   -#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */
31   -#define IEEE802154_FC_TYPE_ACK 0x2 /* Frame is acknowledgment */
32   -#define IEEE802154_FC_TYPE_MAC_CMD 0x3 /* Frame is MAC command */
33   -
34   -#define IEEE802154_FC_TYPE_SHIFT 0
35   -#define IEEE802154_FC_TYPE_MASK ((1 << 3) - 1)
36   -#define IEEE802154_FC_TYPE(x) ((x & IEEE802154_FC_TYPE_MASK) >> IEEE802154_FC_TYPE_SHIFT)
37   -#define IEEE802154_FC_SET_TYPE(v, x) do { \
38   - v = (((v) & ~IEEE802154_FC_TYPE_MASK) | \
39   - (((x) << IEEE802154_FC_TYPE_SHIFT) & IEEE802154_FC_TYPE_MASK)); \
40   - } while (0)
41   -
42   -#define IEEE802154_FC_SECEN (1 << 3)
43   -#define IEEE802154_FC_FRPEND (1 << 4)
44   -#define IEEE802154_FC_ACK_REQ (1 << 5)
45   -#define IEEE802154_FC_INTRA_PAN (1 << 6)
46   -
47   -#define IEEE802154_FC_SAMODE_SHIFT 14
48   -#define IEEE802154_FC_SAMODE_MASK (3 << IEEE802154_FC_SAMODE_SHIFT)
49   -#define IEEE802154_FC_DAMODE_SHIFT 10
50   -#define IEEE802154_FC_DAMODE_MASK (3 << IEEE802154_FC_DAMODE_SHIFT)
51   -
52   -#define IEEE802154_FC_SAMODE(x) \
53   - (((x) & IEEE802154_FC_SAMODE_MASK) >> IEEE802154_FC_SAMODE_SHIFT)
54   -
55   -#define IEEE802154_FC_DAMODE(x) \
56   - (((x) & IEEE802154_FC_DAMODE_MASK) >> IEEE802154_FC_DAMODE_SHIFT)
57   -
58   -
59   -/* MAC's Command Frames Identifiers */
60   -#define IEEE802154_CMD_ASSOCIATION_REQ 0x01
61   -#define IEEE802154_CMD_ASSOCIATION_RESP 0x02
62   -#define IEEE802154_CMD_DISASSOCIATION_NOTIFY 0x03
63   -#define IEEE802154_CMD_DATA_REQ 0x04
64   -#define IEEE802154_CMD_PANID_CONFLICT_NOTIFY 0x05
65   -#define IEEE802154_CMD_ORPHAN_NOTIFY 0x06
66   -#define IEEE802154_CMD_BEACON_REQ 0x07
67   -#define IEEE802154_CMD_COORD_REALIGN_NOTIFY 0x08
68   -#define IEEE802154_CMD_GTS_REQ 0x09
69   -
70   -/*
71   - * The return values of MAC operations
72   - */
73   -enum {
74   - /*
75   - * The requested operation was completed successfully.
76   - * For a transmission request, this value indicates
77   - * a successful transmission.
78   - */
79   - IEEE802154_SUCCESS = 0x0,
80   -
81   - /* The beacon was lost following a synchronization request. */
82   - IEEE802154_BEACON_LOSS = 0xe0,
83   - /*
84   - * A transmission could not take place due to activity on the
85   - * channel, i.e., the CSMA-CA mechanism has failed.
86   - */
87   - IEEE802154_CHNL_ACCESS_FAIL = 0xe1,
88   - /* The GTS request has been denied by the PAN coordinator. */
89   - IEEE802154_DENINED = 0xe2,
90   - /* The attempt to disable the transceiver has failed. */
91   - IEEE802154_DISABLE_TRX_FAIL = 0xe3,
92   - /*
93   - * The received frame induces a failed security check according to
94   - * the security suite.
95   - */
96   - IEEE802154_FAILED_SECURITY_CHECK = 0xe4,
97   - /*
98   - * The frame resulting from secure processing has a length that is
99   - * greater than aMACMaxFrameSize.
100   - */
101   - IEEE802154_FRAME_TOO_LONG = 0xe5,
102   - /*
103   - * The requested GTS transmission failed because the specified GTS
104   - * either did not have a transmit GTS direction or was not defined.
105   - */
106   - IEEE802154_INVALID_GTS = 0xe6,
107   - /*
108   - * A request to purge an MSDU from the transaction queue was made using
109   - * an MSDU handle that was not found in the transaction table.
110   - */
111   - IEEE802154_INVALID_HANDLE = 0xe7,
112   - /* A parameter in the primitive is out of the valid range.*/
113   - IEEE802154_INVALID_PARAMETER = 0xe8,
114   - /* No acknowledgment was received after aMaxFrameRetries. */
115   - IEEE802154_NO_ACK = 0xe9,
116   - /* A scan operation failed to find any network beacons.*/
117   - IEEE802154_NO_BEACON = 0xea,
118   - /* No response data were available following a request. */
119   - IEEE802154_NO_DATA = 0xeb,
120   - /* The operation failed because a short address was not allocated. */
121   - IEEE802154_NO_SHORT_ADDRESS = 0xec,
122   - /*
123   - * A receiver enable request was unsuccessful because it could not be
124   - * completed within the CAP.
125   - */
126   - IEEE802154_OUT_OF_CAP = 0xed,
127   - /*
128   - * A PAN identifier conflict has been detected and communicated to the
129   - * PAN coordinator.
130   - */
131   - IEEE802154_PANID_CONFLICT = 0xee,
132   - /* A coordinator realignment command has been received. */
133   - IEEE802154_REALIGMENT = 0xef,
134   - /* The transaction has expired and its information discarded. */
135   - IEEE802154_TRANSACTION_EXPIRED = 0xf0,
136   - /* There is no capacity to store the transaction. */
137   - IEEE802154_TRANSACTION_OVERFLOW = 0xf1,
138   - /*
139   - * The transceiver was in the transmitter enabled state when the
140   - * receiver was requested to be enabled.
141   - */
142   - IEEE802154_TX_ACTIVE = 0xf2,
143   - /* The appropriate key is not available in the ACL. */
144   - IEEE802154_UNAVAILABLE_KEY = 0xf3,
145   - /*
146   - * A SET/GET request was issued with the identifier of a PIB attribute
147   - * that is not supported.
148   - */
149   - IEEE802154_UNSUPPORTED_ATTR = 0xf4,
150   - /*
151   - * A request to perform a scan operation failed because the MLME was
152   - * in the process of performing a previously initiated scan operation.
153   - */
154   - IEEE802154_SCAN_IN_PROGRESS = 0xfc,
155   -};
156   -
157   -
158   -#endif
include/net/ieee802154/netdevice.h
1   -/*
2   - * An interface between IEEE802.15.4 device and rest of the kernel.
3   - *
4   - * Copyright (C) 2007, 2008, 2009 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.
9   - *
10   - * This program is distributed in the hope that it will be useful,
11   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   - * GNU General Public License for more details.
14   - *
15   - * You should have received a copy of the GNU General Public License along
16   - * with this program; if not, write to the Free Software Foundation, Inc.,
17   - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18   - *
19   - * Written by:
20   - * Pavel Smolenskiy <pavel.smolenskiy@gmail.com>
21   - * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
22   - * Maxim Osipov <maxim.osipov@siemens.com>
23   - * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
24   - */
25   -
26   -#ifndef IEEE802154_NETDEVICE_H
27   -#define IEEE802154_NETDEVICE_H
28   -
29   -/*
30   - * A control block of skb passed between the ARPHRD_IEEE802154 device
31   - * and other stack parts.
32   - */
33   -struct ieee802154_mac_cb {
34   - u8 lqi;
35   - struct ieee802154_addr sa;
36   - struct ieee802154_addr da;
37   - u8 flags;
38   - u8 seq;
39   -};
40   -
41   -static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
42   -{
43   - return (struct ieee802154_mac_cb *)skb->cb;
44   -}
45   -
46   -#define MAC_CB_FLAG_TYPEMASK ((1 << 3) - 1)
47   -
48   -#define MAC_CB_FLAG_ACKREQ (1 << 3)
49   -#define MAC_CB_FLAG_SECEN (1 << 4)
50   -#define MAC_CB_FLAG_INTRAPAN (1 << 5)
51   -
52   -static inline int mac_cb_is_ackreq(struct sk_buff *skb)
53   -{
54   - return mac_cb(skb)->flags & MAC_CB_FLAG_ACKREQ;
55   -}
56   -
57   -static inline int mac_cb_is_secen(struct sk_buff *skb)
58   -{
59   - return mac_cb(skb)->flags & MAC_CB_FLAG_SECEN;
60   -}
61   -
62   -static inline int mac_cb_is_intrapan(struct sk_buff *skb)
63   -{
64   - return mac_cb(skb)->flags & MAC_CB_FLAG_INTRAPAN;
65   -}
66   -
67   -static inline int mac_cb_type(struct sk_buff *skb)
68   -{
69   - return mac_cb(skb)->flags & MAC_CB_FLAG_TYPEMASK;
70   -}
71   -
72   -#define IEEE802154_MAC_SCAN_ED 0
73   -#define IEEE802154_MAC_SCAN_ACTIVE 1
74   -#define IEEE802154_MAC_SCAN_PASSIVE 2
75   -#define IEEE802154_MAC_SCAN_ORPHAN 3
76   -
77   -/*
78   - * This should be located at net_device->ml_priv
79   - */
80   -struct ieee802154_mlme_ops {
81   - int (*assoc_req)(struct net_device *dev,
82   - struct ieee802154_addr *addr,
83   - u8 channel, u8 cap);
84   - int (*assoc_resp)(struct net_device *dev,
85   - struct ieee802154_addr *addr,
86   - u16 short_addr, u8 status);
87   - int (*disassoc_req)(struct net_device *dev,
88   - struct ieee802154_addr *addr,
89   - u8 reason);
90   - int (*start_req)(struct net_device *dev,
91   - struct ieee802154_addr *addr,
92   - u8 channel, u8 bcn_ord, u8 sf_ord,
93   - u8 pan_coord, u8 blx, u8 coord_realign);
94   - int (*scan_req)(struct net_device *dev,
95   - u8 type, u32 channels, u8 duration);
96   -
97   - /*
98   - * FIXME: these should become the part of PIB/MIB interface.
99   - * However we still don't have IB interface of any kind
100   - */
101   - u16 (*get_pan_id)(struct net_device *dev);
102   - u16 (*get_short_addr)(struct net_device *dev);
103   - u8 (*get_dsn)(struct net_device *dev);
104   - u8 (*get_bsn)(struct net_device *dev);
105   -};
106   -
107   -static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops(
108   - struct net_device *dev)
109   -{
110   - return dev->ml_priv;
111   -}
112   -
113   -#endif
include/net/ieee802154/nl802154.h
1   -/*
2   - * nl802154.h
3   - *
4   - * Copyright (C) 2007, 2008, 2009 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.
9   - *
10   - * This program is distributed in the hope that it will be useful,
11   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   - * GNU General Public License for more details.
14   - *
15   - * You should have received a copy of the GNU General Public License along
16   - * with this program; if not, write to the Free Software Foundation, Inc.,
17   - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18   - *
19   - */
20   -
21   -#ifndef IEEE802154_NL_H
22   -#define IEEE802154_NL_H
23   -
24   -struct net_device;
25   -struct ieee802154_addr;
26   -
27   -/**
28   - * ieee802154_nl_assoc_indic - Notify userland of an association request.
29   - * @dev: The network device on which this association request was
30   - * received.
31   - * @addr: The address of the device requesting association.
32   - * @cap: The capability information field from the device.
33   - *
34   - * This informs a userland coordinator of a device requesting to
35   - * associate with the PAN controlled by the coordinator.
36   - *
37   - * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
38   - */
39   -int ieee802154_nl_assoc_indic(struct net_device *dev,
40   - struct ieee802154_addr *addr, u8 cap);
41   -
42   -/**
43   - * ieee802154_nl_assoc_confirm - Notify userland of association.
44   - * @dev: The device which has completed association.
45   - * @short_addr: The short address assigned to the device.
46   - * @status: The status of the association.
47   - *
48   - * Inform userland of the result of an association request. If the
49   - * association request included asking the coordinator to allocate
50   - * a short address then it is returned in @short_addr.
51   - *
52   - * Note: This is in section 7.3.2 of the IEEE 802.15.4 document.
53   - */
54   -int ieee802154_nl_assoc_confirm(struct net_device *dev,
55   - u16 short_addr, u8 status);
56   -
57   -/**
58   - * ieee802154_nl_disassoc_indic - Notify userland of disassociation.
59   - * @dev: The device on which disassociation was indicated.
60   - * @addr: The device which is disassociating.
61   - * @reason: The reason for the disassociation.
62   - *
63   - * Inform userland that a device has disassociated from the network.
64   - *
65   - * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
66   - */
67   -int ieee802154_nl_disassoc_indic(struct net_device *dev,
68   - struct ieee802154_addr *addr, u8 reason);
69   -
70   -/**
71   - * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
72   - * completion.
73   - * @dev: The device on which disassociation was ordered.
74   - * @status: The result of the disassociation.
75   - *
76   - * Inform userland of the result of requesting that a device
77   - * disassociate, or the result of requesting that we disassociate from
78   - * a PAN managed by another coordinator.
79   - *
80   - * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document.
81   - */
82   -int ieee802154_nl_disassoc_confirm(struct net_device *dev,
83   - u8 status);
84   -
85   -/**
86   - * ieee802154_nl_scan_confirm - Notify userland of completion of scan.
87   - * @dev: The device which was instructed to scan.
88   - * @status: The status of the scan operation.
89   - * @scan_type: What type of scan was performed.
90   - * @unscanned: Any channels that the device was unable to scan.
91   - * @edl: The energy levels (if a passive scan).
92   - *
93   - *
94   - * Note: This is in section 7.1.11 of the IEEE 802.15.4 document.
95   - * Note: This API does not permit the return of an active scan result.
96   - */
97   -int ieee802154_nl_scan_confirm(struct net_device *dev,
98   - u8 status, u8 scan_type, u32 unscanned,
99   - u8 *edl/*, struct list_head *pan_desc_list */);
100   -
101   -/**
102   - * ieee802154_nl_beacon_indic - Notify userland of a received beacon.
103   - * @dev: The device on which a beacon was received.
104   - * @panid: The PAN of the coordinator.
105   - * @coord_addr: The short address of the coordinator on that PAN.
106   - *
107   - * Note: This is in section 7.1.5 of the IEEE 802.15.4 document.
108   - * Note: This API does not provide extended information such as what
109   - * channel the PAN is on or what the LQI of the beacon frame was on
110   - * receipt.
111   - * Note: This API cannot indicate a beacon frame for a coordinator
112   - * operating in long addressing mode.
113   - */
114   -int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
115   - u16 coord_addr);
116   -
117   -#endif
include/net/ieee802154_netdev.h
  1 +/*
  2 + * An interface between IEEE802.15.4 device and rest of the kernel.
  3 + *
  4 + * Copyright (C) 2007, 2008, 2009 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.
  9 + *
  10 + * This program is distributed in the hope that it will be useful,
  11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13 + * GNU General Public License for more details.
  14 + *
  15 + * You should have received a copy of the GNU General Public License along
  16 + * with this program; if not, write to the Free Software Foundation, Inc.,
  17 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18 + *
  19 + * Written by:
  20 + * Pavel Smolenskiy <pavel.smolenskiy@gmail.com>
  21 + * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
  22 + * Maxim Osipov <maxim.osipov@siemens.com>
  23 + * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
  24 + */
  25 +
  26 +#ifndef IEEE802154_NETDEVICE_H
  27 +#define IEEE802154_NETDEVICE_H
  28 +
  29 +/*
  30 + * A control block of skb passed between the ARPHRD_IEEE802154 device
  31 + * and other stack parts.
  32 + */
  33 +struct ieee802154_mac_cb {
  34 + u8 lqi;
  35 + struct ieee802154_addr sa;
  36 + struct ieee802154_addr da;
  37 + u8 flags;
  38 + u8 seq;
  39 +};
  40 +
  41 +static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
  42 +{
  43 + return (struct ieee802154_mac_cb *)skb->cb;
  44 +}
  45 +
  46 +#define MAC_CB_FLAG_TYPEMASK ((1 << 3) - 1)
  47 +
  48 +#define MAC_CB_FLAG_ACKREQ (1 << 3)
  49 +#define MAC_CB_FLAG_SECEN (1 << 4)
  50 +#define MAC_CB_FLAG_INTRAPAN (1 << 5)
  51 +
  52 +static inline int mac_cb_is_ackreq(struct sk_buff *skb)
  53 +{
  54 + return mac_cb(skb)->flags & MAC_CB_FLAG_ACKREQ;
  55 +}
  56 +
  57 +static inline int mac_cb_is_secen(struct sk_buff *skb)
  58 +{
  59 + return mac_cb(skb)->flags & MAC_CB_FLAG_SECEN;
  60 +}
  61 +
  62 +static inline int mac_cb_is_intrapan(struct sk_buff *skb)
  63 +{
  64 + return mac_cb(skb)->flags & MAC_CB_FLAG_INTRAPAN;
  65 +}
  66 +
  67 +static inline int mac_cb_type(struct sk_buff *skb)
  68 +{
  69 + return mac_cb(skb)->flags & MAC_CB_FLAG_TYPEMASK;
  70 +}
  71 +
  72 +#define IEEE802154_MAC_SCAN_ED 0
  73 +#define IEEE802154_MAC_SCAN_ACTIVE 1
  74 +#define IEEE802154_MAC_SCAN_PASSIVE 2
  75 +#define IEEE802154_MAC_SCAN_ORPHAN 3
  76 +
  77 +/*
  78 + * This should be located at net_device->ml_priv
  79 + */
  80 +struct ieee802154_mlme_ops {
  81 + int (*assoc_req)(struct net_device *dev,
  82 + struct ieee802154_addr *addr,
  83 + u8 channel, u8 cap);
  84 + int (*assoc_resp)(struct net_device *dev,
  85 + struct ieee802154_addr *addr,
  86 + u16 short_addr, u8 status);
  87 + int (*disassoc_req)(struct net_device *dev,
  88 + struct ieee802154_addr *addr,
  89 + u8 reason);
  90 + int (*start_req)(struct net_device *dev,
  91 + struct ieee802154_addr *addr,
  92 + u8 channel, u8 bcn_ord, u8 sf_ord,
  93 + u8 pan_coord, u8 blx, u8 coord_realign);
  94 + int (*scan_req)(struct net_device *dev,
  95 + u8 type, u32 channels, u8 duration);
  96 +
  97 + /*
  98 + * FIXME: these should become the part of PIB/MIB interface.
  99 + * However we still don't have IB interface of any kind
  100 + */
  101 + u16 (*get_pan_id)(struct net_device *dev);
  102 + u16 (*get_short_addr)(struct net_device *dev);
  103 + u8 (*get_dsn)(struct net_device *dev);
  104 + u8 (*get_bsn)(struct net_device *dev);
  105 +};
  106 +
  107 +static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops(
  108 + struct net_device *dev)
  109 +{
  110 + return dev->ml_priv;
  111 +}
  112 +
  113 +#endif
include/net/nl802154.h
  1 +/*
  2 + * nl802154.h
  3 + *
  4 + * Copyright (C) 2007, 2008, 2009 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.
  9 + *
  10 + * This program is distributed in the hope that it will be useful,
  11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13 + * GNU General Public License for more details.
  14 + *
  15 + * You should have received a copy of the GNU General Public License along
  16 + * with this program; if not, write to the Free Software Foundation, Inc.,
  17 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18 + *
  19 + */
  20 +
  21 +#ifndef IEEE802154_NL_H
  22 +#define IEEE802154_NL_H
  23 +
  24 +struct net_device;
  25 +struct ieee802154_addr;
  26 +
  27 +/**
  28 + * ieee802154_nl_assoc_indic - Notify userland of an association request.
  29 + * @dev: The network device on which this association request was
  30 + * received.
  31 + * @addr: The address of the device requesting association.
  32 + * @cap: The capability information field from the device.
  33 + *
  34 + * This informs a userland coordinator of a device requesting to
  35 + * associate with the PAN controlled by the coordinator.
  36 + *
  37 + * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
  38 + */
  39 +int ieee802154_nl_assoc_indic(struct net_device *dev,
  40 + struct ieee802154_addr *addr, u8 cap);
  41 +
  42 +/**
  43 + * ieee802154_nl_assoc_confirm - Notify userland of association.
  44 + * @dev: The device which has completed association.
  45 + * @short_addr: The short address assigned to the device.
  46 + * @status: The status of the association.
  47 + *
  48 + * Inform userland of the result of an association request. If the
  49 + * association request included asking the coordinator to allocate
  50 + * a short address then it is returned in @short_addr.
  51 + *
  52 + * Note: This is in section 7.3.2 of the IEEE 802.15.4 document.
  53 + */
  54 +int ieee802154_nl_assoc_confirm(struct net_device *dev,
  55 + u16 short_addr, u8 status);
  56 +
  57 +/**
  58 + * ieee802154_nl_disassoc_indic - Notify userland of disassociation.
  59 + * @dev: The device on which disassociation was indicated.
  60 + * @addr: The device which is disassociating.
  61 + * @reason: The reason for the disassociation.
  62 + *
  63 + * Inform userland that a device has disassociated from the network.
  64 + *
  65 + * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
  66 + */
  67 +int ieee802154_nl_disassoc_indic(struct net_device *dev,
  68 + struct ieee802154_addr *addr, u8 reason);
  69 +
  70 +/**
  71 + * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
  72 + * completion.
  73 + * @dev: The device on which disassociation was ordered.
  74 + * @status: The result of the disassociation.
  75 + *
  76 + * Inform userland of the result of requesting that a device
  77 + * disassociate, or the result of requesting that we disassociate from
  78 + * a PAN managed by another coordinator.
  79 + *
  80 + * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document.
  81 + */
  82 +int ieee802154_nl_disassoc_confirm(struct net_device *dev,
  83 + u8 status);
  84 +
  85 +/**
  86 + * ieee802154_nl_scan_confirm - Notify userland of completion of scan.
  87 + * @dev: The device which was instructed to scan.
  88 + * @status: The status of the scan operation.
  89 + * @scan_type: What type of scan was performed.
  90 + * @unscanned: Any channels that the device was unable to scan.
  91 + * @edl: The energy levels (if a passive scan).
  92 + *
  93 + *
  94 + * Note: This is in section 7.1.11 of the IEEE 802.15.4 document.
  95 + * Note: This API does not permit the return of an active scan result.
  96 + */
  97 +int ieee802154_nl_scan_confirm(struct net_device *dev,
  98 + u8 status, u8 scan_type, u32 unscanned,
  99 + u8 *edl/*, struct list_head *pan_desc_list */);
  100 +
  101 +/**
  102 + * ieee802154_nl_beacon_indic - Notify userland of a received beacon.
  103 + * @dev: The device on which a beacon was received.
  104 + * @panid: The PAN of the coordinator.
  105 + * @coord_addr: The short address of the coordinator on that PAN.
  106 + *
  107 + * Note: This is in section 7.1.5 of the IEEE 802.15.4 document.
  108 + * Note: This API does not provide extended information such as what
  109 + * channel the PAN is on or what the LQI of the beacon frame was on
  110 + * receipt.
  111 + * Note: This API cannot indicate a beacon frame for a coordinator
  112 + * operating in long addressing mode.
  113 + */
  114 +int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
  115 + u16 coord_addr);
  116 +
  117 +#endif
net/ieee802154/af_ieee802154.c
... ... @@ -34,8 +34,8 @@
34 34 #include <net/tcp_states.h>
35 35 #include <net/route.h>
36 36  
37   -#include <net/ieee802154/af_ieee802154.h>
38   -#include <net/ieee802154/netdevice.h>
  37 +#include <net/af_ieee802154.h>
  38 +#include <net/ieee802154_netdev.h>
39 39  
40 40 #include "af802154.h"
41 41  
net/ieee802154/dgram.c
... ... @@ -26,9 +26,9 @@
26 26 #include <linux/if_arp.h>
27 27 #include <linux/list.h>
28 28 #include <net/sock.h>
29   -#include <net/ieee802154/af_ieee802154.h>
30   -#include <net/ieee802154/mac_def.h>
31   -#include <net/ieee802154/netdevice.h>
  29 +#include <net/af_ieee802154.h>
  30 +#include <net/ieee802154.h>
  31 +#include <net/ieee802154_netdev.h>
32 32  
33 33 #include <asm/ioctls.h>
34 34  
net/ieee802154/netlink.c
... ... @@ -27,9 +27,9 @@
27 27 #include <net/netlink.h>
28 28 #include <net/genetlink.h>
29 29 #include <linux/nl802154.h>
30   -#include <net/ieee802154/af_ieee802154.h>
31   -#include <net/ieee802154/nl802154.h>
32   -#include <net/ieee802154/netdevice.h>
  30 +#include <net/af_ieee802154.h>
  31 +#include <net/nl802154.h>
  32 +#include <net/ieee802154_netdev.h>
33 33  
34 34 static unsigned int ieee802154_seq_num;
35 35  
net/ieee802154/raw.c
... ... @@ -26,7 +26,7 @@
26 26 #include <linux/if_arp.h>
27 27 #include <linux/list.h>
28 28 #include <net/sock.h>
29   -#include <net/ieee802154/af_ieee802154.h>
  29 +#include <net/af_ieee802154.h>
30 30  
31 31 #include "af802154.h"
32 32