2012-08-02 05:44:36

by Steven Luo

[permalink] [raw]
Subject: [PATCH 1/2] compat-wireless: driver-select: refactor select_drivers and eliminate redundant select_driver

These two functions are functionally identical when passed one argument,
and we'd also like to have the ability to modify Makefiles other than
drivers/net/wireless/Makefile the same way. Introduce a
select_drivers_from_makefile which takes a Makefile argument, and
implement select_drivers using it. Convert existing users of
select_driver to select_drivers, and remove the redundant function.

Signed-off-by: Steven Luo <[email protected]>
---
scripts/driver-select | 47 ++++++++++++++++++++++++-----------------------
1 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/scripts/driver-select b/scripts/driver-select
index 35e0eaf..48a43b7 100755
--- a/scripts/driver-select
+++ b/scripts/driver-select
@@ -88,15 +88,11 @@ function disable_makefile
echo > $1
}

-function select_driver
+function select_drivers_from_makefile
{
- backup_file $DRIVERS_MAKEFILE
- perl -i -ne 'print if /'$1'\)/ ' $DRIVERS_MAKEFILE
-}
-
-function select_drivers
-{
- backup_file $DRIVERS_MAKEFILE
+ MAKEFILE="$1"
+ shift
+ backup_file $MAKEFILE
CONFIGS=""
COUNT=0
for i in $@; do
@@ -106,8 +102,13 @@ function select_drivers
CONFIGS="${CONFIGS}|$i"
fi
done
- egrep "$CONFIGS" $DRIVERS_MAKEFILE > ${DRIVERS_MAKEFILE}.tmp
- mv ${DRIVERS_MAKEFILE}.tmp ${DRIVERS_MAKEFILE}
+ egrep "$CONFIGS" $MAKEFILE > ${MAKEFILE}.tmp
+ mv ${MAKEFILE}.tmp ${MAKEFILE}
+}
+
+function select_drivers
+{
+ select_drivers_from_makefile $DRIVERS_MAKEFILE $@
}

function disable_lib80211
@@ -333,7 +334,7 @@ case $1 in
disable_usbnet
;;
iwlwifi)
- select_driver CONFIG_IWLWIFI
+ select_drivers CONFIG_IWLWIFI
disable_staging
disable_var_01
disable_bt
@@ -341,7 +342,7 @@ case $1 in
disable_usbnet
;;
iwlegacy)
- select_driver CONFIG_IWLEGACY
+ select_drivers CONFIG_IWLEGACY
disable_staging
disable_var_01
disable_bt
@@ -379,44 +380,44 @@ case $1 in
ath5k)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath_driver CONFIG_ATH5K
#patch -p1 < enable-older-kernels/enable-2.6.23.patch
;;
ath9k)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath9k_driver
;;
ath9k_ap)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath9k_driver_ap
;;
carl9170)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath_driver CONFIG_CARL9170
;;
ath9k_htc)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath9k_driver
;;
ath6kl)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath_driver CONFIG_ATH6KL
;;
wil6210)
disable_staging
disable_bt_usb_ethernet_var
- select_driver CONFIG_ATH_COMMON
+ select_drivers CONFIG_ATH_COMMON
select_ath_driver CONFIG_WIL6210
;;
brcmsmac)
@@ -432,7 +433,7 @@ case $1 in
select_brcm80211_driver CONFIG_BRCMFMAC CONFIG_BRCMUTIL
;;
zd1211rw)
- select_driver CONFIG_COMPAT_ZD1211RW
+ select_drivers CONFIG_COMPAT_ZD1211RW
disable_staging
disable_var_01
;;
@@ -441,10 +442,10 @@ case $1 in
disable_bt_usb_ethernet
disable_eeprom
disable_lib80211
- select_driver CONFIG_B43
+ select_drivers CONFIG_B43
;;
rt2x00)
- select_driver CONFIG_RT2X00
+ select_drivers CONFIG_RT2X00
disable_staging
disable_bt_usb_ethernet
disable_var_02
@@ -492,7 +493,7 @@ case $1 in
disable_update-initramfs
;;
bt)
- select_driver CONFIG_BT
+ select_drivers CONFIG_BT
disable_var
disable_ethernet
disable_staging
--
1.7.2.5



2012-08-02 05:50:37

by Steven Luo

[permalink] [raw]
Subject: [PATCH 2/2] compat-wireless: driver-select: update after introduction of CONFIG_WL_TI

The introduction of CONFIG_WL_TI broke selecting the TI drivers using
driver-select. Fix this, and while we're at it, teach the script about
wl18xx as well.

Signed-off-by: Steven Luo <[email protected]>
---
scripts/driver-select | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/scripts/driver-select b/scripts/driver-select
index 48a43b7..03dd9d0 100755
--- a/scripts/driver-select
+++ b/scripts/driver-select
@@ -10,6 +10,7 @@ ATH_MAKEFILE="drivers/net/wireless/ath/Makefile"
ATH9K_MAKEFILE="drivers/net/wireless/ath/ath9k/Makefile"
BRCM80211_MAKEFILE="drivers/net/wireless/brcm80211/Makefile"
RT2X00_MAKEFILE="drivers/net/wireless/rt2x00/Makefile"
+TI_MAKEFILE="drivers/net/wireless/ti/Makefile"
NET_WIRELESS_MAKEFILE="net/wireless/Makefile"
EEPROM_MAKEFILE="drivers/misc/eeprom/Makefile"
DRIVERS_NET_ATHEROS="drivers/net/ethernet/atheros/Makefile"
@@ -252,6 +253,12 @@ function select_ath9k_driver_ap
perl -i -ne 'print if ! /CONFIG_COMPAT_ATH9K_RATE_CONTROL/ ' $COMPAT_CONFIG_CW
}

+function select_ti_drivers
+{
+ select_drivers CONFIG_WL_TI
+ select_drivers_from_makefile $TI_MAKEFILE $@
+}
+
function select_brcm80211_driver
{
backup_file $BRCM80211_MAKEFILE
@@ -364,8 +371,7 @@ case $1 in
disable_lib80211
;;
ti)
- select_drivers CONFIG_WL1251 \
- CONFIG_WL12XX
+ select_drivers CONFIG_WL_TI
disable_staging
disable_var_01
;;
@@ -451,12 +457,17 @@ case $1 in
disable_var_02
;;
wl1251)
- select_drivers CONFIG_WL1251
+ select_ti_drivers CONFIG_WL1251
disable_staging
disable_var_01
;;
wl12xx)
- select_drivers CONFIG_WL12XX
+ select_ti_drivers CONFIG_WL12XX
+ disable_staging
+ disable_var_01
+ ;;
+ wl18xx)
+ select_ti_drivers CONFIG_WL18XX
disable_staging
disable_var_01
;;
--
1.7.2.5


2012-08-06 17:53:41

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 2/2] compat-wireless: driver-select: update after introduction of CONFIG_WL_TI

On Wed, Aug 1, 2012 at 10:44 PM, Steven Luo <[email protected]> wrote:
> The introduction of CONFIG_WL_TI broke selecting the TI drivers using
> driver-select. Fix this, and while we're at it, teach the script about
> wl18xx as well.
>
> Signed-off-by: Steven Luo <[email protected]>

Applied and pushed these two, thanks!

Luis