Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:51085 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbZCXA0Q (ORCPT ); Mon, 23 Mar 2009 20:26:16 -0400 From: Christian Lamparter To: Johannes Berg Subject: Re: [PATCH 5/5] ar9170: update Makefile, Kconfig and MAINTAINERS Date: Tue, 24 Mar 2009 01:26:12 +0100 Cc: linux-wireless@vger.kernel.org, "John W. Linville" , "Luis R. Rodriguez" References: <200903212311.49348.chunkeey@web.de> <1237818551.6147.15.camel@johannes.local> In-Reply-To: <1237818551.6147.15.camel@johannes.local> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Message-Id: <200903240126.12692.chunkeey@web.de> (sfid-20090324_012618_809281_AA3303D9) Sender: linux-wireless-owner@vger.kernel.org List-ID: On Monday 23 March 2009 15:29:11 Johannes Berg wrote: > > I think it would make sense to link them into the same module as long as > we don't have a second user of the common code. I actually doubt we will > see a second user of the common code at all, even if it is in theory > possible with the hardware design. Shh, there's a secret plan, see ar9170/main.c /* * BIG FAT TODO: * * By the looks of things: these devices share a lot of things like * EEPROM layout/design and PHY code with other Atheros WIFI products. * So this driver/library will eventually become ath9k code... or vice versa ;-) */ And the ath5k<->ath9k merge could provide some "helper" function for this driver as well... (wishful thinking, but anyway...) Meanwhile, what about a config option that can be enabled to integrate everything into the front-end module (ar9170usb)? ( However, I don't think this config solution will stand a chance ;-) and we all come to the same "all-in-one works best" conclusion. ) --- diff --git a/drivers/net/wireless/ar9170/Kconfig b/drivers/net/wireless/ar9170/Kconfig index f661187..5272940 100644 --- a/drivers/net/wireless/ar9170/Kconfig +++ b/drivers/net/wireless/ar9170/Kconfig @@ -22,6 +22,16 @@ config AR9170_USB If you choose to build a module, it'll be called ar9170usb. +config AR9170_INTEGRATE_COMMON + bool "Integrate common code into front-end modules" + depends on AR9170_COMMON + help + If this option is set, the common code will be + integrated into the front-end modules instead + of being linked into a seperate module. + + If unsure, say N. + config AR9170_LEDS bool depends on AR9170_COMMON && MAC80211_LEDS && (LEDS_CLASS = y || LEDS_CLASS = AR9170_COMMON) diff --git a/drivers/net/wireless/ar9170/Makefile b/drivers/net/wireless/ar9170/Makefile index 59b174d..868a520 100644 --- a/drivers/net/wireless/ar9170/Makefile +++ b/drivers/net/wireless/ar9170/Makefile @@ -1,5 +1,15 @@ +ifdef CONFIG_AR9170_INTEGRATE_COMMON + +ar9170usb-objs += usb.o main.o cmd.o mac.o phy.o led.o + +obj-$(CONFIG_AR9170_USB) += ar9170usb.o + +else + ar9170common-objs += main.o cmd.o mac.o phy.o led.o ar9170usb-objs += usb.o obj-$(CONFIG_AR9170_COMMON) += ar9170common.o obj-$(CONFIG_AR9170_USB) += ar9170usb.o + +endif diff --git a/drivers/net/wireless/ar9170/main.c b/drivers/net/wireless/ar9170/main.c index f8c2357..ec03df6 100644 --- a/drivers/net/wireless/ar9170/main.c +++ b/drivers/net/wireless/ar9170/main.c @@ -57,8 +57,10 @@ static int modparam_nohwcrypt; module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); MODULE_AUTHOR("Johannes Berg "); +#ifndef CONFIG_AR9170_INTEGRATE_COMMON MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Atheros shared code for AR9170 wireless devices"); +#endif /* CONFIG_AR9170_INTEGRATE_COMMON */ #define RATE(_bitrate, _hw_rate, _txpidx, _flags) { \ .bitrate = (_bitrate), \ @@ -1693,6 +1695,7 @@ void ar9170_unregister(struct ar9170 *ar) } EXPORT_SYMBOL_GPL(ar9170_unregister); +#ifndef CONFIG_AR9170_INTEGRATE_COMMON static int __init ar9170_init(void) { if (modparam_nohwcrypt) @@ -1709,3 +1712,4 @@ static void __exit ar9170_exit(void) module_init(ar9170_init); module_exit(ar9170_exit); +#endif /* CONFIG_AR9170_INTEGRATE_COMMON */