Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Aring and committed by
Marcel Holtmann
1201cd22 a5dd1d72

+31 -2
+1 -1
net/mac802154/Makefile
··· 1 1 obj-$(CONFIG_MAC802154) += mac802154.o 2 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 5 ccflags-y += -D__CHECK_ENDIAN__
+19
net/mac802154/cfg.c
··· 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 + };
+9
net/mac802154/cfg.h
··· 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 */
+2 -1
net/mac802154/main.c
··· 28 28 #include <net/cfg802154.h> 29 29 30 30 #include "ieee802154_i.h" 31 + #include "cfg.h" 31 32 32 33 static int 33 34 mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) ··· 170 169 171 170 priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; 172 171 173 - phy = wpan_phy_alloc(NULL, priv_size); 172 + phy = wpan_phy_alloc(&mac802154_config_ops, priv_size); 174 173 if (!phy) { 175 174 pr_err("failure to allocate master IEEE802.15.4 device\n"); 176 175 return NULL;