broadcom-wl: read channel using wlc on detect
Hardcoding channel number to 11 is a bad idea, it may be even not available on some devices. If there are two single-band radios, the one for 5GHz doesn't have 11 channel. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 36479
This commit is contained in:
		@@ -370,12 +370,15 @@ detect_broadcom() {
 | 
				
			|||||||
	local i=-1
 | 
						local i=-1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while grep -qs "^ *wl$((++i)):" /proc/net/dev; do
 | 
						while grep -qs "^ *wl$((++i)):" /proc/net/dev; do
 | 
				
			||||||
 | 
							local channel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		config_get type wl${i} type
 | 
							config_get type wl${i} type
 | 
				
			||||||
		[ "$type" = broadcom ] && continue
 | 
							[ "$type" = broadcom ] && continue
 | 
				
			||||||
 | 
							channel=`wlc ifname wl${i} channel`
 | 
				
			||||||
		cat <<EOF
 | 
							cat <<EOF
 | 
				
			||||||
config wifi-device  wl${i}
 | 
					config wifi-device  wl${i}
 | 
				
			||||||
	option type     broadcom
 | 
						option type     broadcom
 | 
				
			||||||
	option channel  11
 | 
						option channel  ${channel:-11}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# REMOVE THIS LINE TO ENABLE WIFI:
 | 
						# REMOVE THIS LINE TO ENABLE WIFI:
 | 
				
			||||||
	option disabled 1
 | 
						option disabled 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user