# # $Id: bcm43xx_confd_net.txt 518 2006-09-11 06:03:35Z tas $ # eth0 is always base 10/100/1000 Ethernet port # eth1 is always BCM43XX 4306 wireless card (Airport Extreme) # # APs and MACs were changed to generic names, and are not actually as listed modules=( "dhclient" ) config_eth0=( "dhcp" ) dhclient_eth0=("-q -cf /etc/dhcp/dhclient.conf") config_eth1=( "dhcp" ) dhclient_eth1=("-q -cf /etc/dhcp/dhclient.conf") preup() { # hack to init bcm43xx b/f scanning for ap case "$1" in ( eth1 ) /sbin/ifconfig eth1 up /sbin/iwconfig eth1 txpower 15 /sbin/iwconfig eth1 channel 2 /sbin/iwconfig eth1 rate 11M ;; esac return 0 } predown() { return 0 } postup() { # hack to refresh rate/power of bcm43xx case "$1" in ( eth1 ) /sbin/iwconfig eth1 txpower 15 /sbin/iwconfig eth1 rate 11M reset_channel eth1 & ;; esac return 0 } postdown() { # hack to ensure bcm43xx really turns off; sometimes it needs # calls to 'ifconfig eth1 down' case "$1" in ( eth1 ) /sbin/ifconfig eth1 down ;; esac return 0 } # a custom function to: # (1) apply rate over and over in case freq 'drifting' bug should show up # (2) apply different rates and ap MACs depending on essid # reset_channel() { essid=`/sbin/iwconfig $1 | sed -n 's/.*ESSID:"\([^"]*\)".*/\1/p'` chan=`/sbin/iwlist $1 scan | grep -A 6 ESSID:\"$essid\" | grep Channel | cut -d ':' -f 2` sleep 5 for n in 6 8 10; do sleep $n /sbin/iwconfig $1 channel $chan if [ "${essid}" = "homeap" ]; then /sbin/iwconfig $1 rate 18M; /sbin/iwconfig $1 ap 00:01:02:03:04:05 else /sbin/iwconfig $1 rate 11M; fi done }