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

net: move 6lowpan compression code to separate module

IEEE 802.15.4 and Bluetooth networking stacks share 6lowpan compression
code. Instead of introducing Makefile/Kconfig hacks, build this code as
a separate module referenced from both ieee802154 and bluetooth modules.

This fixes the following build error observed in some kernel
configurations:

net/built-in.o: In function `header_create': 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
net/built-in.o: In function `bt_6lowpan_recv': (.text+0x166b3c): undefined reference to `lowpan_process_data'

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dmitry Eremin-Solenikov and committed by
David S. Miller
a53d34c3 89fc8632

+11 -2
+1 -1
net/Makefile
··· 57 57 ifneq ($(CONFIG_DCB),) 58 58 obj-y += dcb/ 59 59 endif 60 - obj-$(CONFIG_IEEE802154) += ieee802154/ 60 + obj-y += ieee802154/ 61 61 obj-$(CONFIG_MAC802154) += mac802154/ 62 62 63 63 ifeq ($(CONFIG_NET),y)
+1
net/bluetooth/Kconfig
··· 12 12 select CRYPTO_AES 13 13 select CRYPTO_ECB 14 14 select CRYPTO_SHA256 15 + select 6LOWPAN_IPHC 15 16 help 16 17 Bluetooth is low-cost, low-power, short-range wireless technology. 17 18 It was designed as a replacement for cables and other short-range
+7
net/ieee802154/Kconfig
··· 13 13 config IEEE802154_6LOWPAN 14 14 tristate "6lowpan support over IEEE 802.15.4" 15 15 depends on IEEE802154 && IPV6 16 + select 6LOWPAN_IPHC 16 17 ---help--- 17 18 IPv6 compression over IEEE 802.15.4. 19 + 20 + config 6LOWPAN_IPHC 21 + tristate 22 + ---help--- 23 + 6lowpan compression code which is shared between IEEE 802.15.4 and Bluetooth 24 + stacks.
+2 -1
net/ieee802154/Makefile
··· 1 1 obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o 2 - obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o 6lowpan_iphc.o 2 + obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o 3 + obj-$(CONFIG_6LOWPAN_IPHC) += 6lowpan_iphc.o 3 4 4 5 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o 5 6 af_802154-y := af_ieee802154.o raw.o dgram.o