diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-11-05 14:51:13 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-05 15:53:03 -0500 |
commit | 9f3295b9ea8e54a6c65231d267f069edf420b64f (patch) | |
tree | 5207bdd6ae36ca051ccf5206a7d116216aaccef7 | |
parent | 53f9ee61b46d81a43d8c6694d136896e8f49a7b8 (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>
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | include/net/nl802154.h | 122 | ||||
-rw-r--r-- | net/ieee802154/nl-mac.c | 187 | ||||
-rw-r--r-- | net/mac802154/mac_cmd.c | 6 |
4 files changed, 6 insertions, 310 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 7ec37a396ffe..b42eb50b7426 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4699,7 +4699,6 @@ F: net/mac802154/ | |||
4699 | F: drivers/net/ieee802154/ | 4699 | F: drivers/net/ieee802154/ |
4700 | F: include/linux/nl802154.h | 4700 | F: include/linux/nl802154.h |
4701 | F: include/linux/ieee802154.h | 4701 | F: include/linux/ieee802154.h |
4702 | F: include/net/nl802154.h | ||
4703 | F: include/net/mac802154.h | 4702 | F: include/net/mac802154.h |
4704 | F: include/net/af_ieee802154.h | 4703 | F: include/net/af_ieee802154.h |
4705 | F: include/net/cfg802154.h | 4704 | F: include/net/cfg802154.h |
diff --git a/include/net/nl802154.h b/include/net/nl802154.h deleted file mode 100644 index b5cdea29d9d9..000000000000 --- a/include/net/nl802154.h +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
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 | */ | ||
16 | |||
17 | #ifndef IEEE802154_NL_H | ||
18 | #define IEEE802154_NL_H | ||
19 | |||
20 | struct net_device; | ||
21 | struct ieee802154_addr; | ||
22 | |||
23 | /** | ||
24 | * ieee802154_nl_assoc_indic - Notify userland of an association request. | ||
25 | * @dev: The network device on which this association request was | ||
26 | * received. | ||
27 | * @addr: The address of the device requesting association. | ||
28 | * @cap: The capability information field from the device. | ||
29 | * | ||
30 | * This informs a userland coordinator of a device requesting to | ||
31 | * associate with the PAN controlled by the coordinator. | ||
32 | * | ||
33 | * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document. | ||
34 | */ | ||
35 | int ieee802154_nl_assoc_indic(struct net_device *dev, | ||
36 | struct ieee802154_addr *addr, u8 cap); | ||
37 | |||
38 | /** | ||
39 | * ieee802154_nl_assoc_confirm - Notify userland of association. | ||
40 | * @dev: The device which has completed association. | ||
41 | * @short_addr: The short address assigned to the device. | ||
42 | * @status: The status of the association. | ||
43 | * | ||
44 | * Inform userland of the result of an association request. If the | ||
45 | * association request included asking the coordinator to allocate | ||
46 | * a short address then it is returned in @short_addr. | ||
47 | * | ||
48 | * Note: This is in section 7.3.2 of the IEEE 802.15.4 document. | ||
49 | */ | ||
50 | int ieee802154_nl_assoc_confirm(struct net_device *dev, | ||
51 | __le16 short_addr, u8 status); | ||
52 | |||
53 | /** | ||
54 | * ieee802154_nl_disassoc_indic - Notify userland of disassociation. | ||
55 | * @dev: The device on which disassociation was indicated. | ||
56 | * @addr: The device which is disassociating. | ||
57 | * @reason: The reason for the disassociation. | ||
58 | * | ||
59 | * Inform userland that a device has disassociated from the network. | ||
60 | * | ||
61 | * Note: This is in section 7.3.3 of the IEEE 802.15.4 document. | ||
62 | */ | ||
63 | int ieee802154_nl_disassoc_indic(struct net_device *dev, | ||
64 | struct ieee802154_addr *addr, u8 reason); | ||
65 | |||
66 | /** | ||
67 | * ieee802154_nl_disassoc_confirm - Notify userland of disassociation | ||
68 | * completion. | ||
69 | * @dev: The device on which disassociation was ordered. | ||
70 | * @status: The result of the disassociation. | ||
71 | * | ||
72 | * Inform userland of the result of requesting that a device | ||
73 | * disassociate, or the result of requesting that we disassociate from | ||
74 | * a PAN managed by another coordinator. | ||
75 | * | ||
76 | * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document. | ||
77 | */ | ||
78 | int ieee802154_nl_disassoc_confirm(struct net_device *dev, | ||
79 | u8 status); | ||
80 | |||
81 | /** | ||
82 | * ieee802154_nl_scan_confirm - Notify userland of completion of scan. | ||
83 | * @dev: The device which was instructed to scan. | ||
84 | * @status: The status of the scan operation. | ||
85 | * @scan_type: What type of scan was performed. | ||
86 | * @unscanned: Any channels that the device was unable to scan. | ||
87 | * @edl: The energy levels (if a passive scan). | ||
88 | * | ||
89 | * | ||
90 | * Note: This is in section 7.1.11 of the IEEE 802.15.4 document. | ||
91 | * Note: This API does not permit the return of an active scan result. | ||
92 | */ | ||
93 | int ieee802154_nl_scan_confirm(struct net_device *dev, | ||
94 | u8 status, u8 scan_type, u32 unscanned, u8 page, | ||
95 | u8 *edl/*, struct list_head *pan_desc_list */); | ||
96 | |||
97 | /** | ||
98 | * ieee802154_nl_beacon_indic - Notify userland of a received beacon. | ||
99 | * @dev: The device on which a beacon was received. | ||
100 | * @panid: The PAN of the coordinator. | ||
101 | * @coord_addr: The short address of the coordinator on that PAN. | ||
102 | * | ||
103 | * Note: This is in section 7.1.5 of the IEEE 802.15.4 document. | ||
104 | * Note: This API does not provide extended information such as what | ||
105 | * channel the PAN is on or what the LQI of the beacon frame was on | ||
106 | * receipt. | ||
107 | * Note: This API cannot indicate a beacon frame for a coordinator | ||
108 | * operating in long addressing mode. | ||
109 | */ | ||
110 | int ieee802154_nl_beacon_indic(struct net_device *dev, __le16 panid, | ||
111 | __le16 coord_addr); | ||
112 | |||
113 | /** | ||
114 | * ieee802154_nl_start_confirm - Notify userland of completion of start. | ||
115 | * @dev: The device which was instructed to scan. | ||
116 | * @status: The status of the scan operation. | ||
117 | * | ||
118 | * Note: This is in section 7.1.14 of the IEEE 802.15.4 document. | ||
119 | */ | ||
120 | int ieee802154_nl_start_confirm(struct net_device *dev, u8 status); | ||
121 | |||
122 | #endif | ||
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 | ||
58 | int ieee802154_nl_assoc_indic(struct net_device *dev, | 57 | static 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 | |||
86 | nla_put_failure: | ||
87 | nlmsg_free(msg); | ||
88 | return -ENOBUFS; | ||
89 | } | ||
90 | EXPORT_SYMBOL(ieee802154_nl_assoc_indic); | ||
91 | |||
92 | int 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 | |||
112 | nla_put_failure: | ||
113 | nlmsg_free(msg); | ||
114 | return -ENOBUFS; | ||
115 | } | ||
116 | EXPORT_SYMBOL(ieee802154_nl_assoc_confirm); | ||
117 | |||
118 | int 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 | |||
148 | nla_put_failure: | ||
149 | nlmsg_free(msg); | ||
150 | return -ENOBUFS; | ||
151 | } | ||
152 | EXPORT_SYMBOL(ieee802154_nl_disassoc_indic); | ||
153 | |||
154 | int 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 | |||
172 | nla_put_failure: | ||
173 | nlmsg_free(msg); | ||
174 | return -ENOBUFS; | ||
175 | } | ||
176 | EXPORT_SYMBOL(ieee802154_nl_disassoc_confirm); | ||
177 | |||
178 | int 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 | |||
199 | nla_put_failure: | ||
200 | nlmsg_free(msg); | ||
201 | return -ENOBUFS; | ||
202 | } | ||
203 | EXPORT_SYMBOL(ieee802154_nl_beacon_indic); | ||
204 | |||
205 | int 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 | |||
231 | nla_put_failure: | ||
232 | nlmsg_free(msg); | ||
233 | return -ENOBUFS; | ||
234 | } | ||
235 | EXPORT_SYMBOL(ieee802154_nl_scan_confirm); | ||
236 | |||
237 | int 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 | |||
533 | out: | 358 | out: |
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, ¶ms, changed); | 64 | rc = ops->llsec->set_params(dev, ¶ms, 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 | ||