diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-11-01 23:18:36 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-01 23:51:06 -0400 |
commit | 1201cd22fd1f4579a888c0f7abc65627d5962f29 (patch) | |
tree | 1a11f0f5543e16f1dd8cee59cf0fb62b402a8705 /net | |
parent | a5dd1d72d868ec9c8f44d60ca29900b6a38321b4 (diff) |
mac802154: introduce mac802154_config_ops
This patch introduces mac802154_config_ops struct. Like wireless this
struct should be the only one interface between ieee802154 to mac802154
or possible HardMAC drivers.
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/mac802154/Makefile | 2 | ||||
-rw-r--r-- | net/mac802154/cfg.c | 19 | ||||
-rw-r--r-- | net/mac802154/cfg.h | 9 | ||||
-rw-r--r-- | net/mac802154/main.c | 3 |
4 files changed, 31 insertions, 2 deletions
diff --git a/net/mac802154/Makefile b/net/mac802154/Makefile index 2e497d0c829a..702d8b466317 100644 --- a/net/mac802154/Makefile +++ b/net/mac802154/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-$(CONFIG_MAC802154) += mac802154.o | 1 | obj-$(CONFIG_MAC802154) += mac802154.o |
2 | mac802154-objs := main.o rx.o tx.o mac_cmd.o mib.o \ | 2 | mac802154-objs := main.o rx.o tx.o mac_cmd.o mib.o \ |
3 | iface.o llsec.o util.o | 3 | iface.o llsec.o util.o cfg.o |
4 | 4 | ||
5 | ccflags-y += -D__CHECK_ENDIAN__ | 5 | ccflags-y += -D__CHECK_ENDIAN__ |
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c new file mode 100644 index 000000000000..105468ec8f26 --- /dev/null +++ b/net/mac802154/cfg.c | |||
@@ -0,0 +1,19 @@ | |||
1 | /* This program is free software; you can redistribute it and/or modify | ||
2 | * it under the terms of the GNU General Public License version 2 | ||
3 | * as published by the Free Software Foundation. | ||
4 | * | ||
5 | * This program is distributed in the hope that it will be useful, | ||
6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
8 | * GNU General Public License for more details. | ||
9 | * | ||
10 | * Authors: | ||
11 | * Alexander Aring <aar@pengutronix.de> | ||
12 | * | ||
13 | * Based on: net/mac80211/cfg.c | ||
14 | */ | ||
15 | |||
16 | #include <net/cfg802154.h> | ||
17 | |||
18 | const struct cfg802154_ops mac802154_config_ops = { | ||
19 | }; | ||
diff --git a/net/mac802154/cfg.h b/net/mac802154/cfg.h new file mode 100644 index 000000000000..e2718f981e82 --- /dev/null +++ b/net/mac802154/cfg.h | |||
@@ -0,0 +1,9 @@ | |||
1 | /* mac802154 configuration hooks for cfg802154 | ||
2 | */ | ||
3 | |||
4 | #ifndef __CFG_H | ||
5 | #define __CFG_H | ||
6 | |||
7 | extern const struct cfg802154_ops mac802154_config_ops; | ||
8 | |||
9 | #endif /* __CFG_H */ | ||
diff --git a/net/mac802154/main.c b/net/mac802154/main.c index ebc2bb123cfe..785abb1aafb4 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <net/cfg802154.h> | 28 | #include <net/cfg802154.h> |
29 | 29 | ||
30 | #include "ieee802154_i.h" | 30 | #include "ieee802154_i.h" |
31 | #include "cfg.h" | ||
31 | 32 | ||
32 | static int | 33 | static int |
33 | mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) | 34 | mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) |
@@ -169,7 +170,7 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops) | |||
169 | 170 | ||
170 | priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; | 171 | priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; |
171 | 172 | ||
172 | phy = wpan_phy_alloc(NULL, priv_size); | 173 | phy = wpan_phy_alloc(&mac802154_config_ops, priv_size); |
173 | if (!phy) { | 174 | if (!phy) { |
174 | pr_err("failure to allocate master IEEE802.15.4 device\n"); | 175 | pr_err("failure to allocate master IEEE802.15.4 device\n"); |
175 | return NULL; | 176 | return NULL; |