From ba9ffebcadd6d58b57caf2724115b7751f76a28d Mon Sep 17 00:00:00 2001 From: Andrea Giammarchi Date: Sat, 14 Dec 2013 17:18:54 -0800 Subject: [PATCH 1/2] make hosted able to use rtl871xdrv or other drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit there are devices that are not supported as nl80211 … this change makes possible to specify `--driver rtl871xdrv` when/if needed --- create_ap | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/create_ap b/create_ap index c1edfa0..5cdbbf9 100755 --- a/create_ap +++ b/create_ap @@ -121,6 +121,7 @@ WPA_VERSION=1+2 ETC_HOSTS=0 HIDDEN=0 SHARE_METHOD=nat +DRIVER=nl80211 CONFDIR= VWIFI_IFACE= @@ -218,6 +219,11 @@ while :; do SHARE_METHOD="$1" shift ;; + --driver) + shift + DRIVER="$1" + shift + ;; --) shift break @@ -333,7 +339,7 @@ networkmanager_add_unmanaged ${VWIFI_IFACE} cat << EOF > $CONFDIR/hostapd.conf ssid=${SSID} interface=${VWIFI_IFACE} -driver=nl80211 +driver=${DRIVER} hw_mode=g channel=${CHANNEL} From 46723a968629d18e261350c7fc55211370d81445 Mon Sep 17 00:00:00 2001 From: oblique Date: Sun, 15 Dec 2013 12:38:06 +0200 Subject: [PATCH 2/2] Update patch for '--driver' argument --- README.md | 3 +++ create_ap | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58c3c8a..b32795b 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,9 @@ ### Internet sharing from the same WiFi interface: create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase +### Choose a different WiFi adapter driver + create_ap --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase + ### No passphrase (open network) using pipe: echo -e "MyAccessPoint" | create_ap wlan0 eth0 diff --git a/create_ap b/create_ap index 5cdbbf9..9d4aafa 100755 --- a/create_ap +++ b/create_ap @@ -30,6 +30,7 @@ usage() { echo " 'bridge' for bridging" echo " 'none' for no Internet sharing (equivalent to -n)" echo " --hidden Make the Access Point hidden (do not broadcast the SSID)" + echo " --driver Choose your WiFi adapter driver (default: nl80211)" echo echo "Non-Bridging Options:" echo " -g IPv4 Gateway for the Access Point (default: 192.168.12.1)" @@ -47,6 +48,7 @@ usage() { echo " $(basename $0) wlan0 wlan0 MyAccessPoint MyPassPhrase" echo " $(basename $0) -n wlan0 MyAccessPoint MyPassPhrase" echo " $(basename $0) -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase" + echo " $(basename $0) --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase" } get_macaddr() { @@ -177,7 +179,7 @@ die() { # if the user press ctrl+c then execute die() trap "die" SIGINT -ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden" -n $(basename $0) -- "$@") +ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden","driver:" -n $(basename $0) -- "$@") [[ $? -ne 0 ]] && exit 1 eval set -- "$ARGS"