Under 2.6.38 using the plug as a wireless N AP using rt2800usb with WPA2 is working great now.
I haven't played around with it too much yet to know how much of this script I actually need to make it work and how much of it is unnecessary (like, hostapd probably brings up br0 by itself when setting bridge=br0 in config etc.)
Does anybody know why the wireless adapters activity light blinks constantly when hostapd is running even when there are no clients connected and no data being transferred? I thought it might be linked somehow to eth0 activity but even when I close all connections on eth0 it continues. It's slightly annoying since the only spot I have left to plug the adapter in is on a hub vertically right in front of the TV (and, it's just weird and makes me constantly question what's going on with the network).
Edit: Below seems to work as a daemon script fine for me... hurrah.
$this->bbcode_second_pass_code('', '
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/hostapd
case "$1" in
start)
stat_busy "Starting hostapd"
ifconfig eth0 0.0.0.0 #remove IP from eth0
ifconfig eth0 down #ensure the interface is up
ifconfig wlan0 0.0.0.0 #remove IP from wlan0
ifconfig wlan0 down #ensure the interface is up
brctl addbr br0 #create br0 node
brctl addif br0 eth0 #add eth0 to bridge br0
brctl setfd br0 0
/usr/bin/hostapd -B -P ${HOSTAPD_PID} ${HOSTAPD_CONF} &> /dev/null
sleep 5
#brctl addif br0 eth0 #add eth0 to bridge br0
#brctl addif br0 wlan0 #add wlan0 to bridge br0
ifconfig br0 192.168.1.150 netmask 255.255.255.0 #ip for bridge
ifconfig eth0 up
ifconfig br0 up #bring up interface
route add default gw 192.168.1.1 # gateway
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
add_daemon hostapd
fi
;;
stop)
stat_busy "Stopping hostapd"
[ -f ${HOSTAPD_PID} ] && kill `cat ${HOSTAPD_PID}` &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
rm_daemon hostapd
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
')