 --- mac80211.sh.orig	2013-05-17 15:00:14.427035173 -0400
-+++ mac80211.sh	2013-05-17 14:22:02.683650553 -0400
++++ mac80211.sh	2013-05-17 16:16:20.820470694 -0400
 @@ -1,6 +1,8 @@
  #!/bin/sh
  append DRIVERS "mac80211"

+				uci_set wireless "$vif" encryption "psk2"
+				config_set "$vif" key "$key"
+				uci_set wireless "$vif" key "$key"
+			fi
+			export channel
+			iw dev "$ifname" set channel "$channel"

 mac80211_hostapd_setup_base() {
 	local phy="$1"
 	local ifname="$2"
@@ -340,10 +342,45 @@
 		[ -n "$ifname" ] || {
 			[ $i -gt 0 ] && ifname="wlan${phy#phy}-$i" || ifname="wlan${phy#phy}"
 		}
