mac802154: remove unused prototypes
[deliverable/linux.git] / net / mac802154 / ieee802154_i.h
CommitLineData
1010f540 1/*
2 * Copyright (C) 2007-2012 Siemens AG
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
1010f540 13 * Written by:
14 * Pavel Smolenskiy <pavel.smolenskiy@gmail.com>
15 * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
16 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
17 * Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
18 */
0f1556bc
AA
19#ifndef __IEEE802154_I_H
20#define __IEEE802154_I_H
1010f540 21
f30be4d5 22#include <linux/mutex.h>
61f2dcba 23#include <linux/hrtimer.h>
d5ae67ba 24#include <net/cfg802154.h>
5d637d5a 25#include <net/mac802154.h>
e462ded6
PB
26#include <net/ieee802154_netdev.h>
27
f30be4d5
PB
28#include "llsec.h"
29
1010f540 30/* mac802154 device private data */
a5e1ec53 31struct ieee802154_local {
5a504397 32 struct ieee802154_hw hw;
16301861 33 const struct ieee802154_ops *ops;
1010f540 34
35 /* ieee802154 phy */
36 struct wpan_phy *phy;
37
38 int open_count;
39
40 /* As in mac80211 slaves list is modified:
41 * 1) under the RTNL
42 * 2) protected by slaves_mtx;
43 * 3) in an RCU manner
44 *
45 * So atomic readers can use any of this protection methods.
46 */
d98be45b
AA
47 struct list_head interfaces;
48 struct mutex iflist_mtx;
1010f540 49
50 /* This one is used for scanning and other jobs not to be interfered
51 * with serial driver.
52 */
f7730542 53 struct workqueue_struct *workqueue;
1010f540 54
61f2dcba
AA
55 struct hrtimer ifs_timer;
56
5d65cae4 57 bool started;
c5c47e67
AA
58
59 struct tasklet_struct tasklet;
60 struct sk_buff_head skb_queue;
1010f540 61};
62
c5c47e67
AA
63enum {
64 IEEE802154_RX_MSG = 1,
65};
66
0ea3da64
AA
67enum ieee802154_sdata_state_bits {
68 SDATA_STATE_RUNNING,
69};
70
4d23c9cc 71/* Slave interface definition.
72 *
73 * Slaves represent typical network interfaces available from userspace.
74 * Each ieee802154 device/transceiver may have several slaves and able
75 * to be associated with several networks at the same time.
76 */
036562f9 77struct ieee802154_sub_if_data {
4d23c9cc 78 struct list_head list; /* the ieee802154_priv->slaves list */
79
d5ae67ba
AA
80 struct wpan_dev wpan_dev;
81
04e850fe 82 struct ieee802154_local *local;
4d23c9cc 83 struct net_device *dev;
84
0ea3da64 85 unsigned long state;
d5ae67ba 86 char name[IFNAMSIZ];
4d23c9cc 87
88 spinlock_t mib_lock;
89
f30be4d5
PB
90 /* protects sec from concurrent access by netlink. access by
91 * encrypt/decrypt/header_create safe without additional protection.
92 */
93 struct mutex sec_mtx;
94
95 struct mac802154_llsec sec;
7c118c1a
AA
96 /* must be last, dynamically sized area in this! */
97 struct ieee802154_vif vif;
4d23c9cc 98};
99
2c1bbbff 100#define MAC802154_CHAN_NONE 0xff /* No channel is assigned */
0606069d 101
6322d50d
AA
102/* utility functions/constants */
103extern const void *const mac802154_wpan_phy_privid; /* for wpan_phy privid */
104
60741361
AA
105static inline struct ieee802154_local *
106hw_to_local(struct ieee802154_hw *hw)
107{
108 return container_of(hw, struct ieee802154_local, hw);
109}
110
59d19cd7
AA
111static inline struct ieee802154_sub_if_data *
112IEEE802154_DEV_TO_SUB_IF(const struct net_device *dev)
113{
114 return netdev_priv(dev);
115}
116
0ea3da64
AA
117static inline bool
118ieee802154_sdata_running(struct ieee802154_sub_if_data *sdata)
119{
120 return test_bit(SDATA_STATE_RUNNING, &sdata->state);
121}
122
32bad7e3 123extern struct ieee802154_mlme_ops mac802154_mlme_wpan;
6e2128d4 124
e5e584fc
AA
125netdev_tx_t
126ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev);
e5e584fc
AA
127netdev_tx_t
128ieee802154_subif_start_xmit(struct sk_buff *skb, struct net_device *dev);
61f2dcba 129enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer);
5b641ebe 130
ef2486f5 131/* MIB callbacks */
b70ab2e8
PB
132void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val);
133__le16 mac802154_dev_get_short_addr(const struct net_device *dev);
b70ab2e8
PB
134__le16 mac802154_dev_get_pan_id(const struct net_device *dev);
135void mac802154_dev_set_pan_id(struct net_device *dev, __le16 val);
66b69d4d 136void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan);
0483546a 137u8 mac802154_dev_get_dsn(const struct net_device *dev);
ef2486f5 138
29e02374
PB
139int mac802154_get_params(struct net_device *dev,
140 struct ieee802154_llsec_params *params);
141int mac802154_set_params(struct net_device *dev,
142 const struct ieee802154_llsec_params *params,
143 int changed);
144
145int mac802154_add_key(struct net_device *dev,
146 const struct ieee802154_llsec_key_id *id,
147 const struct ieee802154_llsec_key *key);
148int mac802154_del_key(struct net_device *dev,
149 const struct ieee802154_llsec_key_id *id);
150
151int mac802154_add_dev(struct net_device *dev,
152 const struct ieee802154_llsec_device *llsec_dev);
153int mac802154_del_dev(struct net_device *dev, __le64 dev_addr);
154
155int mac802154_add_devkey(struct net_device *dev,
156 __le64 device_addr,
157 const struct ieee802154_llsec_device_key *key);
158int mac802154_del_devkey(struct net_device *dev,
159 __le64 device_addr,
160 const struct ieee802154_llsec_device_key *key);
161
162int mac802154_add_seclevel(struct net_device *dev,
163 const struct ieee802154_llsec_seclevel *sl);
164int mac802154_del_seclevel(struct net_device *dev,
165 const struct ieee802154_llsec_seclevel *sl);
166
167void mac802154_lock_table(struct net_device *dev);
168void mac802154_get_table(struct net_device *dev,
169 struct ieee802154_llsec_table **t);
170void mac802154_unlock_table(struct net_device *dev);
171
be4fd8e5
AA
172/* interface handling */
173int ieee802154_iface_init(void);
174void ieee802154_iface_exit(void);
b210b187 175void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata);
986a8abf
AA
176struct net_device *
177ieee802154_if_add(struct ieee802154_local *local, const char *name,
178 struct wpan_dev **new_wpan_dev, int type);
592dfbfc 179void ieee802154_remove_interfaces(struct ieee802154_local *local);
4a9a816a 180
0f1556bc 181#endif /* __IEEE802154_I_H */
This page took 0.154293 seconds and 5 git commands to generate.