diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-11-05 14:24:38 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-11-07 12:01:07 -0500 |
commit | 28656a111af70116027fb0a0931df4b46d7375b1 (patch) | |
tree | 8990c91598413f68d8885f11a3a48757433ece40 /net/mac80211/debugfs_netdev.c | |
parent | b84e7a05f619faec58bff24dfeeb2406f8dab584 (diff) |
mac80211: use mac_pton
Instead of implementing practically the same
function (hwaddr_aton) use mac_pton.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 07c5721323ca..4b68ec770bdd 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/if.h> | 12 | #include <linux/if.h> |
13 | #include <linux/if_ether.h> | ||
13 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
14 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
15 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
@@ -248,27 +249,6 @@ static ssize_t ieee80211_if_fmt_tkip_mic_test( | |||
248 | return -EOPNOTSUPP; | 249 | return -EOPNOTSUPP; |
249 | } | 250 | } |
250 | 251 | ||
251 | static int hwaddr_aton(const char *txt, u8 *addr) | ||
252 | { | ||
253 | int i; | ||
254 | |||
255 | for (i = 0; i < ETH_ALEN; i++) { | ||
256 | int a, b; | ||
257 | |||
258 | a = hex_to_bin(*txt++); | ||
259 | if (a < 0) | ||
260 | return -1; | ||
261 | b = hex_to_bin(*txt++); | ||
262 | if (b < 0) | ||
263 | return -1; | ||
264 | *addr++ = (a << 4) | b; | ||
265 | if (i < 5 && *txt++ != ':') | ||
266 | return -1; | ||
267 | } | ||
268 | |||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | static ssize_t ieee80211_if_parse_tkip_mic_test( | 252 | static ssize_t ieee80211_if_parse_tkip_mic_test( |
273 | struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) | 253 | struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) |
274 | { | 254 | { |
@@ -278,13 +258,7 @@ static ssize_t ieee80211_if_parse_tkip_mic_test( | |||
278 | struct ieee80211_hdr *hdr; | 258 | struct ieee80211_hdr *hdr; |
279 | __le16 fc; | 259 | __le16 fc; |
280 | 260 | ||
281 | /* | 261 | if (!mac_pton(buf, addr)) |
282 | * Assume colon-delimited MAC address with possible white space | ||
283 | * following. | ||
284 | */ | ||
285 | if (buflen < 3 * ETH_ALEN - 1) | ||
286 | return -EINVAL; | ||
287 | if (hwaddr_aton(buf, addr) < 0) | ||
288 | return -EINVAL; | 262 | return -EINVAL; |
289 | 263 | ||
290 | if (!ieee80211_sdata_running(sdata)) | 264 | if (!ieee80211_sdata_running(sdata)) |