blob: 5903a74d0de60d2f139f0e531391cbba73baf688 [file] [log] [blame]
developer15a43312022-04-12 11:23:23 +08001# If not stated otherwise in this file or this component's LICENSE
2# file the following copyright and licenses apply:
3#
4#Copyright [2019] [RDK Management]
5#
6#Licensed under the Apache License, Version 2.0 (the "License");
7#you may not use this file except in compliance with the License.
8#You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12#Unless required by applicable law or agreed to in writing, software
13#distributed under the License is distributed on an "AS IS" BASIS,
14#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15#See the License for the specific language governing permissions and
16#limitations under the License.
17
18#!/bin/sh
19
20wifi_wifi0=`iwconfig wifi0|grep IEEE\ 802.11 | wc -l`
21wifi_wifi1=`iwconfig wifi1|grep IEEE\ 802.11 | wc -l`
22wifi_wifi2=`iwconfig wifi2|grep IEEE\ 802.11 | wc -l`
23wifi_wifi3=`iwconfig wifi3|grep IEEE\ 802.11 | wc -l`
24
25if [ $wifi_wifi0 == "1" ] ; then
26 flag=wifi0
27 wifi0=$(iwconfig wifi0|grep IEEE\ 802.11)
28elif [ $wifi_wifi1 == "1" ]; then
29 flag=wifi1
30 wifi0=$(iwconfig wifi1|grep IEEE\ 802.11)
31elif [ $wifi_wifi2 == "1" ]; then
32 flag=wifi2
33 wifi0=$(iwconfig wifi2|grep IEEE\ 802.11)
34elif [ $wifi_wifi3 == "1" ]; then
35 flag=wifi3
36 wifi0=$(iwconfig wifi3|grep IEEE\ 802.11)
37fi
38
39wifi_driver_init=${#wifi0}
40check_dual_band=1
41if [ $wifi_driver_init != 0 ]; then
42 echo "Wifi (single band) driver is initialized"
43 while [ $check_dual_band -le 5 ]
44 do
45 echo "checking for dual band support:$check_dual_band"
46 if [ $flag == "wifi0" ]; then
47 wifi_dual_band=1
48 elif [ $flag == "wifi1" ]; then
49 wifi_dual_band=1
50 elif [ $flag == "wifi2" ]; then
51 wifi_dual_band=1
52 elif [ $flag == "wifi3" ]; then
53 wifi_dual_band=1
54 fi
55 echo "$wifi_dual_band"
56 if [ $wifi_dual_band == 1 ]; then
57 break
58 fi
59 check_dual_band=`expr $check_dual_band + 1`
60 sleep 1;
61 done
62 sleep 1;
63 touch /tmp/wifi_driver_initialized
64else
65 echo "Wifi driver is not initialized"
66fi