aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-28 13:21:16 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-10-28 18:19:06 -0400
commitb9ff77e50c6e469db63dfc8fcc62586522649cd3 (patch)
treefbb60275d4b9b847a609329dd97817ea345a0e3a /net/mac802154
parent0b1db38ca26b322296cbd141f3080eccfe1cc3e1 (diff)
mac802154: monitor: merge into iface implementation
This patch removes the monitor implementation file and put all monitor stuff into iface file. It's now small enough to put all necessary handling into iface. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/Makefile2
-rw-r--r--net/mac802154/iface.c30
-rw-r--r--net/mac802154/monitor.c59
3 files changed, 31 insertions, 60 deletions
diff --git a/net/mac802154/Makefile b/net/mac802154/Makefile
index e68debaf2a59..2e497d0c829a 100644
--- a/net/mac802154/Makefile
+++ b/net/mac802154/Makefile
@@ -1,5 +1,5 @@
1obj-$(CONFIG_MAC802154) += mac802154.o 1obj-$(CONFIG_MAC802154) += mac802154.o
2mac802154-objs := main.o rx.o tx.o mac_cmd.o mib.o \ 2mac802154-objs := main.o rx.o tx.o mac_cmd.o mib.o \
3 monitor.o iface.o llsec.o util.o 3 iface.o llsec.o util.o
4 4
5ccflags-y += -D__CHECK_ENDIAN__ 5ccflags-y += -D__CHECK_ENDIAN__
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 7e4bffcbcd4d..dafb2c3ac109 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -320,6 +320,12 @@ static const struct net_device_ops mac802154_wpan_ops = {
320 .ndo_set_mac_address = mac802154_wpan_mac_addr, 320 .ndo_set_mac_address = mac802154_wpan_mac_addr,
321}; 321};
322 322
323static const struct net_device_ops mac802154_monitor_ops = {
324 .ndo_open = mac802154_slave_open,
325 .ndo_stop = mac802154_slave_close,
326 .ndo_start_xmit = ieee802154_monitor_start_xmit,
327};
328
323static void mac802154_wpan_free(struct net_device *dev) 329static void mac802154_wpan_free(struct net_device *dev)
324{ 330{
325 struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); 331 struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
@@ -373,3 +379,27 @@ void mac802154_wpan_setup(struct net_device *dev)
373 379
374 mac802154_llsec_init(&sdata->sec); 380 mac802154_llsec_init(&sdata->sec);
375} 381}
382
383void mac802154_monitor_setup(struct net_device *dev)
384{
385 struct ieee802154_sub_if_data *sdata;
386
387 dev->addr_len = 0;
388 dev->hard_header_len = 0;
389 dev->needed_tailroom = 2; /* room for FCS */
390 dev->mtu = IEEE802154_MTU;
391 dev->tx_queue_len = 10;
392 dev->type = ARPHRD_IEEE802154_MONITOR;
393 dev->flags = IFF_NOARP | IFF_BROADCAST;
394 dev->watchdog_timeo = 0;
395
396 dev->destructor = free_netdev;
397 dev->netdev_ops = &mac802154_monitor_ops;
398 dev->ml_priv = &mac802154_mlme_reduced;
399
400 sdata = IEEE802154_DEV_TO_SUB_IF(dev);
401 sdata->type = IEEE802154_DEV_MONITOR;
402
403 sdata->chan = MAC802154_CHAN_NONE; /* not initialized */
404 sdata->page = 0;
405}
diff --git a/net/mac802154/monitor.c b/net/mac802154/monitor.c
deleted file mode 100644
index dfdedc206c6a..000000000000
--- a/net/mac802154/monitor.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Copyright 2007, 2008, 2009 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 *
13 * Written by:
14 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
15 * Sergey Lapin <slapin@ossfans.org>
16 * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
17 * Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
18 */
19
20#include <linux/netdevice.h>
21#include <linux/if_arp.h>
22#include <linux/ieee802154.h>
23
24#include <net/mac802154.h>
25#include <net/netlink.h>
26#include <net/cfg802154.h>
27#include <linux/nl802154.h>
28
29#include "ieee802154_i.h"
30
31static const struct net_device_ops mac802154_monitor_ops = {
32 .ndo_open = mac802154_slave_open,
33 .ndo_stop = mac802154_slave_close,
34 .ndo_start_xmit = ieee802154_monitor_start_xmit,
35};
36
37void mac802154_monitor_setup(struct net_device *dev)
38{
39 struct ieee802154_sub_if_data *sdata;
40
41 dev->addr_len = 0;
42 dev->hard_header_len = 0;
43 dev->needed_tailroom = 2; /* room for FCS */
44 dev->mtu = IEEE802154_MTU;
45 dev->tx_queue_len = 10;
46 dev->type = ARPHRD_IEEE802154_MONITOR;
47 dev->flags = IFF_NOARP | IFF_BROADCAST;
48 dev->watchdog_timeo = 0;
49
50 dev->destructor = free_netdev;
51 dev->netdev_ops = &mac802154_monitor_ops;
52 dev->ml_priv = &mac802154_mlme_reduced;
53
54 sdata = IEEE802154_DEV_TO_SUB_IF(dev);
55 sdata->type = IEEE802154_DEV_MONITOR;
56
57 sdata->chan = MAC802154_CHAN_NONE; /* not initialized */
58 sdata->page = 0;
59}