3 DL_DIR
=/tmp
/acx100_driver_download
4 ACX100_FILE_LOCATIONS
="
5 ftp://ftp.dlink.com/Wireless/dwl520+/Driver/dwl520+_drivers_307.zip
6 ftp://ftp.dlink.co.uk/wireless/dwl-520+/dwl-520+_drv_v3.06_1007_inc_utility.zip
7 ftp://ftp.dlink.de/dwl-products/dwl-520PLUS/Treiber_Firmware/dwl520+_driver_eng_3.07.zip
9 ACX111_FILE_LOCATIONS
="
10 ftp://ftp.dlink.co.uk/wireless/dwl-g650+_rev_Ax/dwl-g650+_drv_v1.0.zip
11 ftp://ftp.dlink.de/dwl-products/dwl-g650PLUS/Treiber_Firmware/dwlg650plus_WPA-utility-driver_2.02.zip
12 ftp://ftp.dlink.co.uk/wireless/dwl-g650+_rev_Ax/dwl-g650+_rev_ax_drv_v204.zip
13 " # v204 untested (may not work), thus at end of list
18 [ -f $ACXDIR/scripts
/start_nets.sh
] && return
19 if [ -f $ACXDIR/..
/scripts
/start_net.sh
]; then
23 echo "Couldn't determine base directory of ACX1xx driver, ABORTING!"
24 echo "Please restart this script from the driver's root directory!"
31 IDS_ACX100
="104c:8400 104c:8401"
32 IDS_ACX111
="104c:9066"
35 echo "Searching for ACX1xx cards on this system..."
37 if [ -z "$LSPCI" ]; then
38 echo "lspci not found! (package pciutils): Cannot determine wireless card type!"
42 LSPCI_OUT
=`${LSPCI} -n`
43 for card
in $IDS_ACX100; do
44 if [ -n "`echo $LSPCI_OUT|grep $card`" ]; then
45 echo "DETECTED ACX100-based wireless card!"
49 for card
in $IDS_ACX111; do
50 if [ -n "`echo $LSPCI_OUT|grep $card`" ]; then
51 echo "DETECTED ACX111-based wireless card!"
55 if [ $CARD_TYPE -eq 0 ]; then
56 echo "COULD NOT DETECT any ACX100- or ACX111-based wireless cards on this system."
63 echo "Locating a suitable download tool..."
65 if test -n $WGET; then
66 DL_STRING
="$WGET -c -t 3 -T 20 --passive-ftp"
70 if test -n $CURL; then
71 DL_STRING
="$CURL -0 --connect-timeout 20"
75 if test -n $SNARF; then
79 echo "None of the download tools wget, curl or snarf found on the system:"
80 echo "Cannot download a driver package containing firmware files, ABORTING!"
81 echo "Please report!!!"
88 echo Which firmware files package would you like to download?
90 echo "a) for ACX100 (TNETW1100) chipset based cards"
91 echo "b) for ACX111 (TNETW1130/1230) chipset based cards"
92 echo "c) for both chipsets"
110 echo "Invalid choice, ABORTING!"
119 echo "Please let me know immediately when a download link doesn't exist any more! (in the latest version of this driver) andi@lisas.de"
120 pushd $DL_DIR 1>/dev
/null
121 if [ $CARD_TYPE -lt 2 ]; then # 0 or 1
122 echo "Downloading ACX100 firmware package..."
123 for site
in $ACX100_FILE_LOCATIONS; do
124 FILE
="`basename $site`"
126 [ -f "$FILE" ] && break
129 if [ $CARD_TYPE -eq 0 -o $CARD_TYPE -eq 2 ]; then
130 echo "Downloading ACX111 firmware package..."
131 for site
in $ACX111_FILE_LOCATIONS; do
132 FILE
="`basename $site`"
134 [ -f "$FILE" ] && break
143 if [ -z "$UNZIP" ]; then
144 # FIXME: gzip is rumoured to be semi-compatible with .zip. Usable?
145 echo "COULD NOT LOCATE required utility unzip: unable to extract firmware files, ABORTING unpacking (files left in $DL_DIR)!"
148 pushd $DL_DIR 1>/dev
/null
149 for file in `find . -iname "*.zip"`; do
150 echo -n "Extracting driver file $file..."
154 mkdir
-p "$ACXDIR/firmware"
155 if [ $CARD_TYPE -lt 2 ]; then
156 for files
in RADIO0d.BIN RADIO11.BIN RADIO15.BIN WLANGEN.bin
; do
157 FILE
="`find . -name "$files"|tail -n 1`"
158 # need to convert to uppercase
159 if [ -n "`echo "$FILE"|grep WLANGEN.bin`" ]; then
160 cp "$FILE" "$ACXDIR"/firmware
/WLANGEN.BIN
162 cp "$FILE" "$ACXDIR"/firmware
/
166 if [ $CARD_TYPE -ne 1 ]; then
167 for files
in TIACX111.BIN
; do
168 FILE
="`find . -name "$files"|tail -n 1`"
169 cp "$FILE" "$ACXDIR"/firmware
/
189 echo "FINISHED! (hopefully!) If something failed, then please report it!"
191 echo "Please also note that these firmware files may not work with your"
192 echo "particular card! In this case try getting different firmware files for"
193 echo "your chipset (preferrably ones provided by the vendor of your card)."