xref: /freebsd/tools/tools/net80211/scripts/setup.tsn (revision 61e21613)
1#! /bin/sh
2#
3# Script for testing TSN support.
4#
5#
6PATH=.:$PATH
7. config
8
9BRIDGE=bridge0
10SSID=$SSID-tsn
11WLAN=wlan0
12CONF=$TMPDIR/tsn-$WLAN.conf
13
14makeconf()
15{
16	conf=$1
17	rm -f $conf
18	cat >$1 <<EOF
19interface=$WLAN
20logger_syslog=-1
21logger_syslog_level=0
22logger_stdout=-1
23logger_stdout_level=0
24debug=4
25wpa=1
26wpa_pairwise=TKIP
27wpa_key_mgmt=WPA-PSK
28wpa_passphrase=$WPA_PASSPHRASE
29tsn=1
30wep_key0=0123456789
31EOF
32}
33
34trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \
35	rm -f $CONF" 0
36
37ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
38#wlandebug -i $WLAN assoc+crypto
39wlandebug -i $WLAN state+assoc+11n+crypto
40ifconfig $WLAN ssid $SSID
41ifconfig $WLAN channel $CHANNEL
42ifconfig $WLAN mtu 1500		# NB: if_bridge requires matching mtu's
43ifconfig $WLAN tsn
44
45ifconfig $BRIDGE create
46ifconfig $BRIDGE addm $WIRED addm $WLAN up
47ifconfig $WLAN up
48ifconfig $WIRED up
49
50ifconfig
51
52makeconf $CONF
53#mwldebug -i $WIRELESS keycache
54start_hostapd -K $CONF
55