summaryrefslogtreecommitdiff
path: root/test/README
blob: 5766d9854ec49f5895b040a87a0804c594465bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
1. Files for test:

	a. 88W8864.bin,88W8897.bin: F/W binary. Please put this file under directory '/lib/firmware/mwlwifi'.
	b. mwlwifi.ko: 88W8864/88W8897 mac80211 driver kernel module.
	c. hostapd.conf: configuration file used to configure hostapd.
	d. wpa_supplicant.conf: configuration file used to configure wpa_supplicant.
	e. openwrt-mvebu-armada-xp-mamba-squashfs-factory.img: OpenWRT download image (built with kernel cfg80211/mac80211, iw, hostapd and wpa_supplicant).
	
2. Bring up driver:

	a. iw reg set US
		--> set regulatory domain (Note: cfg80211 will disable DFS channels).
	b. insmod mwlwifi.ko
		--> After module is inserted, physical interfaces phy0 and phy1 and network device wlan0 and wlan1
				will be created. You can issue "iw dev" to check them.
	c. hostapd -B ./hostapd.conf
		--> There are few sample configuration files under this directory. Please use them to do test.
	d. brctl addif br-lan wlan1
		--> Make sure wlan1 is the interface specified in hostapd.conf.
		
	Note: you can run script file 'setup.sh' instead of issuing these commands one by one.
	
3. Change configuration:

	After hostapd and driver is running, the way to change configuration:
	1. Change configuration file hostapd.conf
	2. Run "killall hostapd" then "hostapd -B ./hostapd.conf" to run hostapd with new configuration.
	
4. The way to change channel via hostpad.conf for 80 MHz:

	a. You must check regulatory domain first to see if the channel you setting is allowable for 80 MHz.
		You can use ��iw reg get�� and ��iw reg set�� to get and set regulatory domain. For script file ��setup.sh��,
		it sets the regulatory domain to US.
		If you use ��iw reg get�� to check setting regulatory domain:
				country US: DFS-UNSET
					(2402 - 2472 @ 40), (30, 0)
					(5170 - 5250 @ 80), (17, 0)
					(5250 - 5330 @ 80), (23, 0)
					(5735 - 5835 @ 80), (30, 0)
					(57240 - 63720 @ 2160), (40, 0)
		It allows you to use three ranges to do 80 MHz operation (36 ~ 48), (52 ~ 64) and (149 ~ 161).
		If you use ��iw reg set TW�� to set regulatory domain to TW:
				country TW: DFS-UNSET
					(2402 - 2472 @ 40), (30, 0)
					(5270 - 5330 @ 40), (17, 0)
					(5490 - 5590 @ 80), (30, 0)
					(5650 - 5710 @ 40), (30, 0)
					(5735 - 5835 @ 80), (30, 0)
		It allows you to use two ranges to do 80 MHz operation (100 ~ 116) and (149 ~ 161).
		
	b. After regulatory is set and make sure the channel range you want to use is allowable by the 
		setting regulatory, you can modify hostapd.conf to run 80 Mhz as:
		
		channel=36 -> decide active primary channel.
		ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40] -> decide primary 40 MHz.
		vht_oper_centr_freq_seg0_idx=42 -> center channel for this 80 MHz.

		Test sample:
		
			a. 149 to 161:
				channel=149
				ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40]
				vht_oper_centr_freq_seg0_idx=155

				channel=153
				ht_capab=[LDPC][HT40-][SHORT-GI-20][SHORT-GI-40]
				vht_oper_centr_freq_seg0_idx=155

			b. 100 to 112:
				Use ��iw reg set TW�� to change regulatory domain to allow to use this range for 80 Mhz.
				channel=100
				ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40]
				vht_oper_centr_freq_seg0_idx=106

				channel=104
				ht_capab=[LDPC][HT40-][SHORT-GI-20][SHORT-GI-40]
				vht_oper_centr_freq_seg0_idx=106

5. Station mode:

	a. Use iw utlity to set correct regulatory domain.
	
	b. Make sure dirver is loaded.
	
	c. wpa_supplicant -B -D nl80211 -i wlan1 -c wpa_supplicant.conf
		--> There are few sample configuration files under this directory. Please use them to do test.
		
	d. There are two ways to change configuration for wpa_supplicant:

		* Kill and rerun
		killall wpa_supplicant
		<Modify configuration file for new setting>
		wpa_supplicant -B -D nl80211 -i wlan1 -c wpa_supplicant.conf
	
		* Reload configuration file
		<Modify configuration file for new setting>
		kill -1 <PID of wpa_supplicant>
		
6. Debug mode:

	a. hostapd:
	
	hostapd -d[dd] ./hostapd.conf
	
	b. wpa_supplicant:
	
	wpa_supplicant -ddK -D nl80211 -i wlan1 -c wpa_supplicant.conf
	
7. Add/Delete interface via iw:

	iw dev <devname> del
	iw dev <devname> interface add <name> type <type>
	
	You can omit the 'phy' or 'dev' if the identification is unique,
	e.g. "iw wlan0 info" or "iw phy0 info". (Don't when scripting.)

	Example:
	root@OpenWrt:/test# iw dev
	phy#1
        Interface wlan1
                ifindex 6
                wdev 0x100000001
                addr 00:25:9c:13:01:9a
                type managed
	phy#0
        Interface wlan0
                ifindex 8
                wdev 0x3
                addr 00:25:9c:13:01:99
                type AP
	root@OpenWrt:/test# iw wlan0 del
	root@OpenWrt:/test# iw dev
	phy#1
        Interface wlan1
                ifindex 6
                wdev 0x100000001
                addr 00:25:9c:13:01:9a
                type managed
	root@OpenWrt:/test# iw phy0 interface add wlan0 type managed
	root@OpenWrt:/test# iw dev
	phy#1
        Interface wlan1
                ifindex 6
                wdev 0x100000001
                addr 00:25:9c:13:01:9a
                type managed
	phy#0
        Interface wlan0
                ifindex 9
                wdev 0x4
                addr 00:25:9c:13:01:99
                type managed
	root@OpenWrt:/test#