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 /net/ieee802154 | |
| 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>
Diffstat (limited to 'net/ieee802154')
| -rw-r--r-- | net/ieee802154/nl-mac.c | 187 |
1 files changed, 6 insertions, 181 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 | ||
| 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; |
