aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-05 14:51:13 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-05 15:53:03 -0500
commit9f3295b9ea8e54a6c65231d267f069edf420b64f (patch)
tree5207bdd6ae36ca051ccf5206a7d116216aaccef7 /net
parent53f9ee61b46d81a43d8c6694d136896e8f49a7b8 (diff)
ieee802154: remove nl802154 unused functions
The include/net/nl802154.h file contains a lot of prototypes which are not used inside of ieee802154 subsystem. This patch removes this file and make the only one used prototype "ieee802154_nl_start_confirm" as static declaration in ieee802154/nl-mac.c Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/ieee802154/nl-mac.c187
-rw-r--r--net/mac802154/mac_cmd.c6
2 files changed, 6 insertions, 187 deletions
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
index cc2919dbe5e0..91a1855e521c 100644
--- a/net/ieee802154/nl-mac.c
+++ b/net/ieee802154/nl-mac.c
@@ -29,7 +29,6 @@
29#include <linux/nl802154.h> 29#include <linux/nl802154.h>
30#include <linux/export.h> 30#include <linux/export.h>
31#include <net/af_ieee802154.h> 31#include <net/af_ieee802154.h>
32#include <net/nl802154.h>
33#include <net/ieee802154_netdev.h> 32#include <net/ieee802154_netdev.h>
34#include <net/cfg802154.h> 33#include <net/cfg802154.h>
35 34
@@ -55,186 +54,7 @@ static __le16 nla_get_shortaddr(const struct nlattr *nla)
55 return cpu_to_le16(nla_get_u16(nla)); 54 return cpu_to_le16(nla_get_u16(nla));
56} 55}
57 56
58int ieee802154_nl_assoc_indic(struct net_device *dev, 57static int ieee802154_nl_start_confirm(struct net_device *dev, u8 status)
59 struct ieee802154_addr *addr,
60 u8 cap)
61{
62 struct sk_buff *msg;
63
64 pr_debug("%s\n", __func__);
65
66 if (addr->mode != IEEE802154_ADDR_LONG) {
67 pr_err("%s: received non-long source address!\n", __func__);
68 return -EINVAL;
69 }
70
71 msg = ieee802154_nl_create(0, IEEE802154_ASSOCIATE_INDIC);
72 if (!msg)
73 return -ENOBUFS;
74
75 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) ||
76 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) ||
77 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN,
78 dev->dev_addr) ||
79 nla_put_hwaddr(msg, IEEE802154_ATTR_SRC_HW_ADDR,
80 addr->extended_addr) ||
81 nla_put_u8(msg, IEEE802154_ATTR_CAPABILITY, cap))
82 goto nla_put_failure;
83
84 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP);
85
86nla_put_failure:
87 nlmsg_free(msg);
88 return -ENOBUFS;
89}
90EXPORT_SYMBOL(ieee802154_nl_assoc_indic);
91
92int ieee802154_nl_assoc_confirm(struct net_device *dev, __le16 short_addr,
93 u8 status)
94{
95 struct sk_buff *msg;
96
97 pr_debug("%s\n", __func__);
98
99 msg = ieee802154_nl_create(0, IEEE802154_ASSOCIATE_CONF);
100 if (!msg)
101 return -ENOBUFS;
102
103 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) ||
104 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) ||
105 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN,
106 dev->dev_addr) ||
107 nla_put_shortaddr(msg, IEEE802154_ATTR_SHORT_ADDR, short_addr) ||
108 nla_put_u8(msg, IEEE802154_ATTR_STATUS, status))
109 goto nla_put_failure;
110 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP);
111
112nla_put_failure:
113 nlmsg_free(msg);
114 return -ENOBUFS;
115}
116EXPORT_SYMBOL(ieee802154_nl_assoc_confirm);
117
118int ieee802154_nl_disassoc_indic(struct net_device *dev,
119 struct ieee802154_addr *addr,
120 u8 reason)
121{
122 struct sk_buff *msg;
123
124 pr_debug("%s\n", __func__);
125
126 msg = ieee802154_nl_create(0, IEEE802154_DISASSOCIATE_INDIC);
127 if (!msg)
128 return -ENOBUFS;
129
130 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) ||
131 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) ||
132 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN,
133 dev->dev_addr))
134 goto nla_put_failure;
135 if (addr->mode == IEEE802154_ADDR_LONG) {
136 if (nla_put_hwaddr(msg, IEEE802154_ATTR_SRC_HW_ADDR,
137 addr->extended_addr))
138 goto nla_put_failure;
139 } else {
140 if (nla_put_shortaddr(msg, IEEE802154_ATTR_SRC_SHORT_ADDR,
141 addr->short_addr))
142 goto nla_put_failure;
143 }
144 if (nla_put_u8(msg, IEEE802154_ATTR_REASON, reason))
145 goto nla_put_failure;
146 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP);
147
148nla_put_failure:
149 nlmsg_free(msg);
150 return -ENOBUFS;
151}
152EXPORT_SYMBOL(ieee802154_nl_disassoc_indic);
153
154int ieee802154_nl_disassoc_confirm(struct net_device *dev, u8 status)
155{
156 struct sk_buff *msg;
157
158 pr_debug("%s\n", __func__);
159
160 msg = ieee802154_nl_create(0, IEEE802154_DISASSOCIATE_CONF);
161 if (!msg)
162 return -ENOBUFS;
163
164 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) ||
165 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) ||
166 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN,
167 dev->dev_addr) ||
168 nla_put_u8(msg, IEEE802154_ATTR_STATUS, status))
169 goto nla_put_failure;
170 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP);
171
172nla_put_failure:
173 nlmsg_free(msg);
174 return -ENOBUFS;
175}
176EXPORT_SYMBOL(ieee802154_nl_disassoc_confirm);
177
178int ieee802154_nl_beacon_indic(struct net_device *dev, __le16 panid,
179 __le16 coord_addr)
180{
181 struct sk_buff *msg;
182
183 pr_debug("%s\n", __func__);
184
185 msg = ieee802154_nl_create(0, IEEE802154_BEACON_NOTIFY_INDIC);
186 if (!msg)
187 return -ENOBUFS;
188
189 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) ||
190 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) ||
191 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN,
192 dev->dev_addr) ||
193 nla_put_shortaddr(msg, IEEE802154_ATTR_COORD_SHORT_ADDR,
194 coord_addr) ||
195 nla_put_shortaddr(msg, IEEE802154_ATTR_COORD_PAN_ID, panid))
196 goto nla_put_failure;
197 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP);
198
199nla_put_failure:
200 nlmsg_free(msg);
201 return -ENOBUFS;
202}
203EXPORT_SYMBOL(ieee802154_nl_beacon_indic);
204
205int ieee802154_nl_scan_confirm(struct net_device *dev,
206 u8 status, u8 scan_type,
207 u32 unscanned, u8 page,
208 u8 *edl/* , struct list_head *pan_desc_list */)
209{
210 struct sk_buff *msg;
211
212 pr_debug("%s\n", __func__);
213
214 msg = ieee802154_nl_create(0, IEEE802154_SCAN_CONF);
215 if (!msg)
216 return -ENOBUFS;
217
218 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) ||
219 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) ||
220 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN,
221 dev->dev_addr) ||
222 nla_put_u8(msg, IEEE802154_ATTR_STATUS, status) ||
223 nla_put_u8(msg, IEEE802154_ATTR_SCAN_TYPE, scan_type) ||
224 nla_put_u32(msg, IEEE802154_ATTR_CHANNELS, unscanned) ||
225 nla_put_u8(msg, IEEE802154_ATTR_PAGE, page) ||
226 (edl &&
227 nla_put(msg, IEEE802154_ATTR_ED_LIST, 27, edl)))
228 goto nla_put_failure;
229 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP);
230
231nla_put_failure:
232 nlmsg_free(msg);
233 return -ENOBUFS;
234}
235EXPORT_SYMBOL(ieee802154_nl_scan_confirm);
236
237int ieee802154_nl_start_confirm(struct net_device *dev, u8 status)
238{ 58{
239 struct sk_buff *msg; 59 struct sk_buff *msg;
240 60
@@ -530,6 +350,11 @@ int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info)
530 ret = ieee802154_mlme_ops(dev)->start_req(dev, &addr, channel, page, 350 ret = ieee802154_mlme_ops(dev)->start_req(dev, &addr, channel, page,
531 bcn_ord, sf_ord, pan_coord, blx, coord_realign); 351 bcn_ord, sf_ord, pan_coord, blx, coord_realign);
532 352
353 /* FIXME: add validation for unused parameters to be sane
354 * for SoftMAC
355 */
356 ieee802154_nl_start_confirm(dev, IEEE802154_SUCCESS);
357
533out: 358out:
534 dev_put(dev); 359 dev_put(dev);
535 return ret; 360 return ret;
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c
index 9c2d6f61f194..e1ad83e35899 100644
--- a/net/mac802154/mac_cmd.c
+++ b/net/mac802154/mac_cmd.c
@@ -25,7 +25,6 @@
25#include <net/ieee802154_netdev.h> 25#include <net/ieee802154_netdev.h>
26#include <net/cfg802154.h> 26#include <net/cfg802154.h>
27#include <net/mac802154.h> 27#include <net/mac802154.h>
28#include <net/nl802154.h>
29 28
30#include "ieee802154_i.h" 29#include "ieee802154_i.h"
31#include "driver-ops.h" 30#include "driver-ops.h"
@@ -65,11 +64,6 @@ static int mac802154_mlme_start_req(struct net_device *dev,
65 rc = ops->llsec->set_params(dev, &params, changed); 64 rc = ops->llsec->set_params(dev, &params, changed);
66 } 65 }
67 66
68 /* FIXME: add validation for unused parameters to be sane
69 * for SoftMAC
70 */
71 ieee802154_nl_start_confirm(dev, IEEE802154_SUCCESS);
72
73 return rc; 67 return rc;
74} 68}
75 69