From dc083385fe7398d50a1a4b703e878939417ee7e3 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 4 Aug 2009 18:39:08 -0700 Subject: [PATCH] Add new drivers-select to let users select their drivers Only adds atheros drivers for now. Patches welcomed for other drivers. Signed-off-by: Luis R. Rodriguez --- Makefile | 1 - README | 111 ++++++++------------------- scripts/driver-select | 170 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+), 80 deletions(-) create mode 100755 scripts/driver-select diff --git a/Makefile b/Makefile index 4bf23f8ece0a..eecba715c74d 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ NOSTDINC_FLAGS := -I$(M)/include/ -include $(M)/include/net/compat.h $(CFLAGS) obj-y := net/wireless/ net/mac80211/ net/rfkill/ ifeq ($(ONLY_CORE),) -obj-$(CONFIG_B44) += drivers/net/b44.o obj-y += drivers/ssb/ \ drivers/misc/eeprom/ \ drivers/net/usb/ \ diff --git a/README b/README index f0b4f86867b2..7c6c2cd10b81 100644 --- a/README +++ b/README @@ -3,11 +3,9 @@ Linux Wireless compatibility package ===================================== This is a Linux wireless compatibility package which provides the latest -Linux wireless subsystem enhancements for kernels 2.6.22 and above. We provide -compatibility support since 2.6.22 as that is when mac80211 was introduced -onto the stock kernel. This adds mac80211, mac80211 drivers, and any new -full MAC driver which has had fairly recent updates worth getting such as -libertas, ipw2100 and ipw2200. +Linux wireless subsystem enhancements for kernels 2.6.25 and above. +It is technically possible to support kernels < 2.6.25 but more +work is required for that. If you'd like to keep the wireless-testing git repository local as well, please read out git-guide which explains how to achieve this: @@ -26,6 +24,8 @@ and not rely on this README: http://wireless.kernel.org/en/users/Download +Subscribe to the wiki page to get updates on the documentation. + Where to get the latest ----------------------- @@ -34,7 +34,17 @@ checkout of wireless-testing.git. However since not many users are expected to k a local git repository of wireless-testing we provide daily snapshots of this package + the wireless subsystem code. You can find the latest snapshot at: -http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 +http://wireless.kernel.org/en/users/Download + +Selecting your driver +--------------------- + +If you know the driver you want you can select it with our +helper script: + +./scripts/driver-select + +Run that script to see more information. Building, and installing ------------------------ @@ -58,23 +68,7 @@ distribution's supported drivers. Load: -If you know what module you need you can simply load the module using modprobe. -Note that if you are loading a mac80211 driver you must unload your current -mac80211 drivers as you have a new one to replace it with. Note also that -broadcom, zydas, and atheros devices have old legacy drivers which -you need to be sure are removed first. We provide a mechanism to unload all -old drivers and also load all new drivers if you are not sure what you are -doing. - -So, if you simply are not sure you can use: - - sudo make load - -This unloads your old wireless subsystem drivers and loads the new -shiny ones. For example if ipw3945 and its proprietary daemon are found -it'll be stopped and the module unloaded and then iwl3945 will be loaded. -If you are simply upgrading a mac80211 driver this will unload -the old one and the old mac80211 drivers and load the new ones. +Reboot unless you know what you are doing. Drivers ------- @@ -86,10 +80,12 @@ be interested in. Driver adm8211 ath5k +ath9h +ar9170 b43 b43legacy iwl3945 -iwl4965 +iwlagn ipw2100 ipw2200 libertas_cs (Libertas) @@ -105,58 +101,22 @@ rtl8180 (Realtek) rtl8187 (Realtek) zd1211rw -Known issues ------------- - -* Strange wireless device names: - -On Ubuntu and Fedora you may end up with strange network device names, -for example, wlan0_rename. This is a known issue and will be worked on. - -* nl80211: - -Kernels <= 2.6.22 now get nl80211 support, however, genl_multicast_group -won't work. This compatibility cannot be extended to older -kernels as the struct genl_family was extended on 2.6.23 to add -the struct list_head mcast_groups. +This package also provides more drivers which may be documented here -* b43: +For a complete list see: -b43 and b43legacy now loads. Since there was an old softmac broadcom driver -we provide a load script for this driver. To load the new generation -drivers (b43 and b43legacy) you can run: - - sudo b43load b43 - -To revert back to bcm43xx you can run: - - sudo b43load bcm43xx - -* MadWifi: - -If MadWifi is present the build system will detect this and disable it. It -does this by simply renaming ath_pci.ko to ath_pci.ko.ignore. This lets us -disable the MadWifi driver without blacklisting it which could cause issues -with users later. If you would like to enable MadWifi at a later time and -disable ath5k you can run: - - sudo athload madwifi - -To revert back to ath5k you can run: - - sudo athload ath5k - -* prism54, p54pci, p54usb? +http://wireless.kernel.org/en/users/Download -We don't provide prism54 in this package because distributions already provide -it. p54 is its replacement. prism54 works only with full MAC cards. p54 works -with both full MAC and soft MAC cards. +Non-wireless drivers +-------------------- -* What about net/ieee80211/softmac/ and their drivers? +To support b43 ssb is also provided, and since ssb is also provided +we provide b44 (the ethernet driverl). -This stuff is long gone. +The new rfkill drivers also provided and backported. -* Firmware: +Firmware: +--------- If your driver needs firmware please be sure to check the driver page for that driver here: @@ -174,12 +134,6 @@ will encourage vendors and developers to post patches upstream first rather than forking or maintaining their own mac80211 releases with their own patches for their own drivers. -How about compatibility work for kernels < 2.6.22 ? ---------------------------------------------------- - -Sure, feel free to send patches. The main work was designed to support -kernels >= 2.6.22 as that was when mac80211 was introduced. - Building for external kernels ---------------------------------- @@ -235,7 +189,6 @@ TODO ---- * Compatibilty work for 2.6.18 --> 2.6.21 -* Dialog (make menuconfig) option for this package Patches for compatibility work ------------------------------ @@ -245,8 +198,8 @@ Please send patches against: git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat-wireless-2.6.git To: Luis R. Rodriguez -CC: compat-masters@lists.madwifi.org -Subject: [PATCH] compat-2.6: add driver foo +CC: linux-wireless@vger.kernel.org +Subject: [PATCH] compat-2.6: backport foo Patches for drivers ------------------- diff --git a/scripts/driver-select b/scripts/driver-select new file mode 100755 index 000000000000..ef72ad28b1cb --- /dev/null +++ b/scripts/driver-select @@ -0,0 +1,170 @@ +#!/bin/bash +# Copyright 2009 Luis R. Rodriguez +# +# This this to select your compat-wireless driver and +# reduce compilation time. + +DRIVERS_MAKEFILE="drivers/net/wireless/Makefile" +ATH_MAKEFILE="drivers/net/wireless/ath/Makefile" +NET_WIRELESS_MAKEFILE="net/wireless/Makefile" +EEPROM_MAKEFILE="drivers/misc/eeprom/Makefile" +DRIVERS_NET_USB_MAKEFILE="drivers/net/usb/Makefile" +SSB_MAKEFILE="drivers/ssb/Makefile" + +# used to backup files from foo to foo.${BACKUP_EXT} +# If you change this also modify restore_compat() and +# restore_file() below I couldn't find a way to use +# the $BACKUP_EXT there. +BACKUP_EXT="bk" + +# Pretty colors +GREEN="\033[01;32m" +YELLOW="\033[01;33m" +NORMAL="\033[00m" +BLUE="\033[34m" +RED="\033[31m" +PURPLE="\033[35m" +CYAN="\033[36m" +UNDERLINE="\033[02m" + +SUPPORTED_DRIVERS="ath5k ath9k ar9170 zd1211rw" + +function usage { + echo -e "${GREEN}Usage${NORMAL}: ${CYAN}$0${NORMAL} [ ${PURPLE}${NORMAL} | ${PURPLE}${NORMAL} | ${GREEN}restore${NORMAL} ]" + + echo -e "Supported drivers:" + for i in $SUPPORTED_DRIVERS; do + echo -e "\t${PURPLE}${i}${NORMAL}" + done + + echo -e "Supported group drivers:" + echo -e "\t${CYAN}ath${NORMAL} < ${PURPLE} ath5k ath9k ar9170 zd1211rw ${NORMAL}>" + #echo -e "\t${CYAN}iwlwifi${NORMAL} < ${PURPLE} iwl3945 iwlagn${NORMAL}>" + + echo -e "Restoring compat-wireless:" + echo -e "\t${GREEN}restore${NORMAL}: you can use this option to restore compat-wireless to the original state" +} + +if [ $# -ne 1 ]; then + usage + exit +fi + +if [ ! -f compat-release ]; then + echo "Must run $0 from the compat-wireless top level directory" + exit +fi + +function backup_file { + if [ -f $1.${BACKUP_EXT} ]; then + echo -e "Backup exists: ${CYAN}${1}.${BACKUP_EXT}${NORMAL}" + return + fi + echo -e "Backing up makefile: ${CYAN}${1}.${BACKUP_EXT}${NORMAL}" + cp $1 $1.bk +} + +function disable_makefile +{ + backup_file $1 + echo > $1 +} + +function select_driver +{ + backup_file $DRIVERS_MAKEFILE + perl -i -ne 'print if /'$1'/ ' $DRIVERS_MAKEFILE +} + +function disable_lib80211 +{ + backup_file $NET_WIRELESS_MAKEFILE + perl -i -ne 'print if ! /LIB80211/ ' $NET_WIRELESS_MAKEFILE +} + +function disable_b44 { + backup_file Makefile + perl -i -ne 'print if ! /CONFIG_B44/ ' Makefile +} + +function disable_ssb +{ + disable_b44 + disable_makefile ${SSB_MAKEFILE} +} + +function disable_eeprom +{ + disable_makefile ${EEPROM_MAKEFILE} +} + +function disable_usbnet +{ + disable_makefile ${DRIVERS_NET_USB_MAKEFILE} +} + +function disable_var_01 { + disable_lib80211 + disable_ssb + disable_usbnet + disable_eeprom +} + +function select_ath_driver +{ + backup_file $ATH_MAKEFILE + perl -i -ne 'print if /'$1'/ || /CONFIG_ATH_COMMON/ || /ath-objs/ ' $ATH_MAKEFILE + disable_var_01 +} + +# iwlwifi stuff needs more work +function select_iwl_driver +{ + perl -i -ne 'print if /'$1'/ || /CONFIG_BLEH/ ' drivers/net/wireless/iwlwifi/Makefile + disable_var_01 +} + +function restore_file { + #ORIG=$(shell ${1%%.${BACKUP_EXT}}) + ORIG=${1%%.bk} + cp $1 $ORIG + echo -e "Restored makefile: ${CYAN}${ORIG}${NORMAL}" +} + +function restore_compat { + #FILES=$(find ./ -type f -name *.$BACKUP_EXT) + FILES=$(find ./ -type f -name *.bk) + for i in $FILES; do + restore_file $i + done +} + +case $1 in + restore) + restore_compat + ;; + ath) + select_driver CONFIG_ATH_COMMON + disable_var_01 + ;; + ath5k) + select_driver CONFIG_ATH_COMMON + select_ath_driver CONFIG_ATH5K + ;; + ath9k) + select_driver CONFIG_ATH_COMMON + select_ath_driver CONFIG_ATH9K + ;; + ar9170) + select_driver CONFIG_ATH_COMMON + select_ath_driver CONFIG_AR9170_USB + ;; + zd1211rw) + select_driver CONFIG_ZD1211RW + disable_var_01 + ;; + *) + echo "Unsupported driver" + exit + ;; +esac -- 2.30.2