WIF调试分享(ap6256)

  • Post author:
  • Post category:其他


板子:rk3568

模块:ap6256

平台:android11

设备树配置:

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		clocks = <&rk809 1>;
		clock-names = "ext_clock";
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_enable_h>;

		/*
		 * On the module itself this is one of these (depending
		 * on the actual card populated):
		 * - SDIO_RESET_L_WL_REG_ON
		 * - PDN (power down when low)
		 */
		post-power-on-delay-ms = <200>;
		reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>;
	};

	wireless_wlan: wireless-wlan {
		compatible = "wlan-platdata";
		rockchip,grf = <&grf>;
		sdio_vref = <1800>;
		wifi_chip_type = "ap6256";
		pinctrl-0 = <&wifi_host_wake_irq>;
		//WIFI,poweren_gpio = <&gpio2 RK_PB1 GPIO_ACTIVE_HIGH>;
		WIFI,host_wake_irq = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
		status = "okay"; 
	};


//for ap6256-wifi
&sdmmc1 {
	max-frequency = <150000000>;
	//max-frequency = <50000000>;
	supports-sdio;
	bus-width = <4>;
	disable-wp;
	cap-sd-highspeed;
	//cap-sdio-irq;
	keep-power-in-suspend;
	mmc-pwrseq = <&sdio_pwrseq>;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
	sd-uhs-sdr104;
	status = "okay";
};



1.错误日志

07-21 06:11:39.781   433   433 D WifiSleepController: onReceive, action=android.intent.action.SCREEN_ON
07-21 06:11:39.781   433   433 D WifiSleepController: exitSleepState()
07-21 06:11:39.781   433   577 E WifiClientModeImpl: getWifiLinkLayerStats called without an interface
07-21 06:11:44.778   433  1502 I WifiService: setWifiEnabled package=com.android.systemui uid=10113 enable=true
07-21 06:11:44.787   433   577 D WifiActiveModeWarden: Starting ClientModeManager
07-21 06:11:44.803   433   577 D WifiController: DisabledState.exit()
07-21 06:11:44.804   433   577 D WifiController: EnabledState.enter()
07-21 06:11:44.804   433   577 D WifiClientModeManager: entering IdleState
07-21 06:11:44.805   292   292 E android.hardware.wifi@1.0-service: Kernel version is 4.19.: Success
07-21 06:11:44.805   292   292 E android.hardware.wifi@1.0-service: Kernel version is 4.19.: Success
07-21 06:11:44.806   292   292 E android.hardware.wifi@1.0-service: Wifi driver is not ready.: Success
07-21 06:11:44.807   292   292 E android.hardware.wifi@1.0-service: matched ko file path /vendor/lib/modules/bcmdhd.ko: Success
07-21 06:11:44.917   292   292 E android.hardware.wifi@1.0-service: finit_module return: -1: File exists
07-21 06:11:44.917   292   292 E android.hardware.wifi@1.0-service: Failed to load WiFi driver
07-21 06:11:44.917   292   292 E android.hardware.wifi@1.0-service: Failed to initialize firmware mode controller
07-21 06:11:44.918   292   292 E android.hardware.wifi@1.0-service: Wifi HAL start failed
07-21 06:11:44.919   433   577 E HalDevMgr: Cannot start IWifi: 9 ()
07-21 06:11:44.919   433   577 E WifiVendorHal: Failed to start vendor HAL
07-21 06:11:44.919   433   577 E WifiNative: Failed to start vendor HAL
07-21 06:11:44.919   433   577 E WifiNative: Failed to start Hal
07-21 06:11:44.919   433   577 E WifiClientModeManager: Failed to create ClientInterface. Sit in Idle
07-21 06:11:44.922   433   577 D WifiScanRequestProxy: Sending scan available broadcast: false
07-21 06:11:44.923   433   577 I WifiScanRequestProxy: Scanning is disabled
07-21 06:11:44.924   433   577 D WifiClientModeManager: received an invalid message: { when=-120ms what=2 arg1=2 target=com.android.wifi.x.com.android.internal.util.StateMachine$SmHandler }
07-21 06:11:44.925   433   577 E HalDevMgr: IWifiEventCallback.onFailure: 9 ()
07-21 06:11:44.925   433   577 D WifiController: STA disabled, return to DisabledState.
07-21 06:11:44.925   433   577 D WifiController: EnabledState.exit()
07-21 06:11:44.925   433   577 D WifiController: DisabledState.enter()
07-21 06:11:44.940   433   580 I WifiScanningService: Received a request to disable scanning, UID = 1000
07-21 06:11:44.941   433   580 I WifiScanningService: wifi driver unloaded
07-21 06:11:49.707   433  1502 I ActivityTaskManager: START u0 {act=android.settings.WIFI_SETTINGS flg=0x14000000 cmp=com.android.settings/.Settings$WifiSettingsActivity} from uid 10113
07-21 06:11:49.713   433  1502 I wm_create_activity: [0,135963776,8,com.android.settings/.Settings$WifiSettingsActivity,android.settings.WIFI_SETTINGS,NULL,NULL,335544320]
07-21 06:11:49.738   433   760 I wm_restart_activity: [0,135963776,8,com.android.settings/.Settings$WifiSettingsActivity]
07-21 06:11:49.740   433   760 I wm_set_resumed_activity: [0,com.android.settings/.Settings$WifiSettingsActivity,minimalResumeActivityLocked]
07-21 06:11:49.769   433   469 W WindowManager: Token{47c0d03 ActivityRecord{81aa480 u0 com.android.settings/.Settings$WifiSettingsActivity t8}} failed creating starting window
07-21 06:11:49.923  1043  1043 D SettingsActivity: Switching to fragment com.android.settings.wifi.WifiSettings
07-21 06:11:50.106   433   760 I ActivityTaskManager: START u0 {act=android.settings.WIFI_SETTINGS2 cmp=com.android.settings/.Settings$WifiSettings2Activity (has extras)} from uid 1000
07-21 06:11:50.118   433   760 I wm_create_activity: [0,230055324,8,com.android.settings/.Settings$WifiSettings2Activity,android.settings.WIFI_SETTINGS2,NULL,NULL,0]
07-21 06:11:50.120   433   760 I wm_pause_activity: [0,135963776,com.android.settings/.Settings$WifiSettingsActivity,userLeaving=true]
07-21 06:11:50.128   433  1494 I wm_finish_activity: [0,135963776,8,com.android.settings/.Settings$WifiSettingsActivity,app-request]
07-21 06:11:50.130  1043  1043 I wm_on_create_called: [135963776,com.android.settings.Settings$WifiSettingsActivity,performCreate]
07-21 06:11:50.139   433   469 W WindowManager: Token{b14c90f ActivityRecord{db65d9c u0 com.android.settings/.Settings$WifiSettings2Activity t8}} failed creating starting window
07-21 06:11:50.143   433   759 I wm_add_to_stopping: [0,135963776,com.android.settings/.Settings$WifiSettingsActivity,completeFinishing]
07-21 06:11:50.150   433   759 I wm_restart_activity: [0,230055324,8,com.android.settings/.Settings$WifiSettings2Activity]
07-21 06:11:50.152   433   759 I wm_set_resumed_activity: [0,com.android.settings/.Settings$WifiSettings2Activity,minimalResumeActivityLocked]
07-21 06:11:50.244  1043  1043 D SettingsActivity: Switching to fragment com.android.settings.wifi.WifiSettings2
07-21 06:11:50.352   433   759 I netstats_wifi_sample: [0,0,0,0,0,0,0,0,0,0,0,0,1658383910352]
07-21 06:11:50.420   433   759 I netstats_wifi_sample: [0,0,0,0,0,0,0,0,0,0,0,0,1658383910420]
07-21 06:11:50.425  1043  1043 I wm_on_create_called: [230055324,com.android.settings.Settings$WifiSettings2Activity,performCreate]
07-21 06:11:50.470   433   577 D WifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=19, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 1000 AdministratorUids: [] RequestorUid: 1000 RequestorPackageName: com.android.settings] ] with score 0 and providerId 0
07-21 06:11:50.470   433   577 D UntrustedWifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=19, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 1000 AdministratorUids: [] RequestorUid: 1000 RequestorPackageName: com.android.settings] ] with score 0 and providerId 0
07-21 06:11:50.473  1043  1043 I wm_on_start_called: [230055324,com.android.settings.Settings$WifiSettings2Activity,handleStartActivity]
07-21 06:11:50.480   433   577 E WifiNative: Could not get Iface object for interface null
07-21 06:11:50.483   433   577 E WifiNative: Could not get Iface object for interface null
07-21 06:11:50.485   433   577 E WifiNative: Could not get Iface object for interface null
07-21 06:11:50.488  1043  1043 I wm_on_resume_called: [230055324,com.android.settings.Settings$WifiSettings2Activity,RESUME_ACTIVITY]
07-21 06:11:50.490   433   577 E WifiNative: Could not get Iface object for interface null
07-21 06:11:50.493   433   577 E WifiNative: Could not get Iface object for interface null
07-21 06:11:50.496   433   577 E WifiNative: Could not get Iface object for interface null
07-21 06:11:50.499   433  1494 E WifiService: Attempt to retrieve WifiConfiguration with invalid scanResult List
07-21 06:11:50.501   433  1494 E WifiService: Attempt to retrieve passpoint with invalid scanResult List
07-21 06:11:50.502   433  1494 E WifiService: Attempt to retrieve OsuProviders with invalid scanResult List
07-21 06:11:50.519  1043  1043 I wm_on_top_resumed_gained_called: [230055324,com.android.settings.Settings$WifiSettings2Activity,topStateChangedWhenResumed]

(1)

07-21 06:11:44.805   292   292 E android.hardware.wifi@1.0-service: Kernel version is 4.19.: Success
07-21 06:11:44.806   292   292 E android.hardware.wifi@1.0-service: Wifi driver is not ready.: Success

这里显示我的驱动没有成功,从这里可以确定驱动部分是有问题的,驱动部分就有SDIO接口,所以折个是后就要去确定SDIO 驱动是不是跑起来了,如果没有就要在设备树中添加节点,使能SDIO驱动



2. 调试分享



2.1确定SDIO通信是否正常

下面是我的sdio配置:

根节点下:
	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		clocks = <&rk809 1>;
		clock-names = "ext_clock";
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_enable_h>;

		/*
		 * On the module itself this is one of these (depending
		 * on the actual card populated):
		 * - SDIO_RESET_L_WL_REG_ON
		 * - PDN (power down when low)
		 */
		post-power-on-delay-ms = <200>;
		reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>;
	};
//for ap6256-wifi
&sdmmc1 {
	max-frequency = <150000000>;
	//max-frequency = <50000000>;
	supports-sdio;
	bus-width = <4>;
	disable-wp;
	cap-sd-highspeed;
	//cap-sdio-irq;
	keep-power-in-suspend;
	mmc-pwrseq = <&sdio_pwrseq>;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
	sd-uhs-sdr104;
	status = "okay";
};

添加了上面的节点发现还是不行,于是查看SDIO驱动是否成功

[    5.329780] dhd_module_init: in Dongle Host Driver, version 1.579.77.41.22 (r-20191105-2)(20191120-1)
[    5.330221] ======== dhd_wlan_init_plat_data ========
[    5.330324] dhd_wlan_init_gpio: WL_HOST_WAKE=-1, oob_irq=107, oob_irq_flags=0x414
[    5.330343] dhd_wlan_init_gpio: WL_REG_ON=-1
[    5.330359] dhd_wifi_platform_load: Enter
[   10.100345] ======== dhd_wlan_deinit_plat_data ========
[   10.100350] dhd_module_init: Failed to load the driver, try cnt 0
[   10.100387] dhd_module_init: Failed to load driver max retry reached**
[   10.100392] dhd_module_init: Exit err=-19
sbc_rk3568:/ # cat d/gpio   

从这里看出来还是驱动部分有问题,量了SDIO数据也没有

io_list中有上面这个sdio的reset控制引脚,如果这个脚不能受控制那SDIO就起不来,

SDMMC1_PWREN/I2C4_SDA_M1/UART8_RTSn_M0/CAN2_RX_M1/GPIO2_B1_d

根据上面的复用功能,我逐个排查看是否复用最后发现I2C4打开了,这肯定不行,果断关掉

后来检测供电发现我一个供电没有改到,更改后WIFI正常

&pmu_io_domains {
	status = "okay";
	pmuio2-supply = <&vcc3v3_pmu>;
	vccio1-supply = <&vccio_acodec>;
	vccio3-supply = <&vccio_sd>;
	vccio4-supply = <&vcc_1v8>;	//更改这里
	vccio5-supply = <&vcc_3v3>;
	vccio6-supply = <&vcc_3v3>;
	vccio7-supply = <&vcc_3v3>;
};

成功后的dhd正常打印:

sbc_rk3568:/sys/bus/sdio/devices # dmesg | grep dhd                                                                                                                                                        
[    5.199785] dhd_module_init: in Dongle Host Driver, version 1.579.77.41.22 (r-20191105-2)(20191120-1)
[    5.199820] ======== dhd_wlan_init_plat_data ========
[    5.199893] dhd_wlan_init_gpio: WL_HOST_WAKE=-1, oob_irq=107, oob_irq_flags=0x414
[    5.199900] dhd_wlan_init_gpio: WL_REG_ON=-1
[    5.199906] dhd_wifi_platform_load: Enter
[    5.539237] dhdsdio_probe : no mutex held. set lock
[    5.542742] [dhd] dhd_conf_set_chiprev : chip=0x4345, chiprev=9
[    5.542948] [dhd] CFG80211-ERROR) wl_setup_wiphy : Registering Vendor80211
[    5.548539] [dhd] CFG80211-ERROR) wl_setup_wiphy : SAE support
[    5.549480] [dhd] CFG80211-ERROR) wl_init_prof : wl_init_prof: No profile
[    5.552621] dhd_attach(): thread:dhd_watchdog_thread:16a started
[    5.552768] dhd_attach(): thread:dhd_dpc:16b started
[    5.559029] dhd_attach(): thread:dhd_rxf:16c started
[    5.559132] dhd_deferred_work_init: work queue initialized
[    5.559146] dhd_tcpack_suppress_set: TCP ACK Suppress mode 0 -> mode 2
[    5.559182] dhd_bus_set_default_min_res_mask: Unhandled chip id
[    5.568999] dhd_tcpack_suppress_set: TCP ACK Suppress mode 2 -> mode 0
[    5.569095] dhd_wl_ioctl: returning as busstate=0
[    5.569115] dhd_dbg_detach_pkt_monitor, 2204
[    5.569131] dhd_bus_devreset: == Power OFF ==
[    5.569446] dhd_txglom_enable: enable 0
[    5.569452] dhd_bus_devreset:  WLAN OFF DONE
[    5.569543] dhdsdio_probe : the lock is released.
[    5.569731] dhd_module_init: Exit err=0
[   13.632692] dhd_open: Enter 000000002f344e43
[   13.632719] dhd_open : no mutex held. set lock
[   13.632743] [dhd-wlan0] wl_android_wifi_on : in g_wifi_on=0
[   14.328365] \x0a\x0adhd_bus_devreset: == WLAN ON ==
[   14.333672] dhd_bus_set_default_min_res_mask: Unhandled chip id
[   14.366077] [dhd] dhd_conf_read_config : Ignore config file /vendor/etc/firmware/config.txt
[   14.366115] [dhd] dhd_conf_set_path_params : Final fw_path=/vendor/etc/firmware/fw_bcm43456c5_ag.bin
[   14.366202] [dhd] dhd_conf_set_path_params : Final nv_path=/vendor/etc/firmware/nvram_ap6256.txt
[   14.366215] [dhd] dhd_conf_set_path_params : Final clm_path=/vendor/etc/firmware/clm_bcm43456c5_ag.blob
[   14.366221] [dhd] dhd_conf_set_path_params : Final conf_path=/vendor/etc/firmware/config.txt
[   14.366997] dhd_os_open_image: /vendor/etc/firmware/fw_bcm43456c5_ag.bin (603086 bytes) open success
[   14.457817] dhd_os_open_image: /vendor/etc/firmware/nvram_ap6256.txt (2440 bytes) open success
[   14.466371] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[   14.545824] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[   14.546563] dhd_get_memdump_info: File [/data/misc/wifi/.memdump.info] doesn't exist
[   14.547303] dhd_get_memdump_info: MEMDUMP ENABLED = 2
[   14.547743] dhd_tcpack_suppress_set: TCP ACK Suppress mode 0 -> mode 1
[   14.548142] dhd_apply_default_clm: Ignore clm file /vendor/etc/firmware/clm_bcm43456c5_ag.blob
[   14.568281] dhd_txglom_enable: enable 1
[   14.568307] [dhd] dhd_conf_set_txglom_params : txglom_mode=copy
[   14.568319] [dhd] dhd_conf_set_txglom_params : txglomsize=36, deferred_tx_len=0
[   14.568332] [dhd] dhd_conf_set_txglom_params : txinrx_thres=128, dhd_txminmax=-1
[   14.568342] [dhd] dhd_conf_set_txglom_params : tx_max_offset=0, txctl_tmo_fix=300
[   14.568358] [dhd] dhd_conf_get_disable_proptx : fw_proptx=1, disable_proptx=-1
[   14.569403] dhd_wlfc_hostreorder_init(): successful bdcv2 tlv signaling, 64
[   14.571025] dhd_pno_init: Support Android Location Service
[   14.591022] [dhd] CFG80211-ERROR) wl_cfg80211_event : Event handler is not created
[   14.591337] dhd_rtt_init : FTM is supported
[   14.591367] dhd_preinit_ioctls: SensorHub diabled 0
[   14.592046] dhd_preinit_ioctls failed to set ShubHub disable
[   14.593769] [dhd] dhd_conf_map_country_list : CN/38
[   14.593777] [dhd] CFG80211-ERROR) wl_cfg80211_event : Event handler is not created
[   14.593796] [dhd] dhd_conf_set_country : set country CN, revision 38
[   14.597100] [dhd] dhd_conf_set_country : Country code: CN (CN/38)
[   14.603538] [dhd-wlan0] wl_android_wifi_on : Success
[   14.650015] dhd_open : the lock is released.
[   14.650045] dhd_open: Exit ret=0
[   16.311282] [dhd] dhd_conf_map_country_list : CN/38
[   16.313581] dhd_dbg_attach_pkt_monitor, 1606
[   16.374872] dhd_set_suspend: Remove extra suspend setting 
[   16.374904] dhd_enable_packet_filter: enter, value = 0
[   19.083881] [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 0, bssidx: 0
[   31.292863] dhd_set_suspend: force extra suspend setting
[   31.292935] dhd_enable_packet_filter: enter, value = 1

logcat -b all | grep -Ei “wlan|wifi”抓取的成功后的日志

07-22 08:36:58.730   439   468 I WifiService: setWifiEnabled package=com.android.systemui uid=10115 enable=true
07-22 08:36:58.739   439   581 D WifiActiveModeWarden: Starting ClientModeManager
07-22 08:36:58.743   439   581 D WifiController: DisabledState.exit()
07-22 08:36:58.743   439   581 D WifiController: EnabledState.enter()
07-22 08:36:58.743   439   581 D WifiClientModeManager: entering IdleState
07-22 08:36:58.756   439   581 I android_os_HwBinder: HwBinder: Starting thread pool for getting: android.hardware.wifi@1.0::IWifi/default
07-22 08:36:58.777     0     0 I init    : processing action (wlan.driver.status=ok) from (/vendor/etc/init/hw/init.connectivity.rc:51)
07-22 08:36:58.766   290   290 E android.hardware.wifi@1.0-service: Kernel version is 4.19.: Success
07-22 08:36:58.766   290   290 E android.hardware.wifi@1.0-service: Kernel version is 4.19.: Success
07-22 08:36:58.767   290   290 E android.hardware.wifi@1.0-service: Wifi driver is ready for now...: Success
07-22 08:36:58.769   290   290 D android.hardware.wifi@1.0-service: Initialize legacy HAL
07-22 08:36:58.774   290   290 I android.hardware.wifi@1.0-service: Wifi HAL started
07-22 08:36:58.780   439   581 I WifiVendorHal: Vendor Hal started successfully
07-22 08:36:58.782   439   582 I WifiP2pNative: Registering for interface available listener
07-22 08:36:58.811   439   582 D WifiP2pNative: P2P InterfaceAvailableListener true
07-22 08:36:58.811   439   582 D WifiP2pService: Wifi enabled=false, P2P Interface availability=true
07-22 08:36:58.819   290   290 D android.hardware.wifi@1.0-service: Waiting for the driver ready
07-22 08:36:58.820   290   290 D android.hardware.wifi@1.0-service: Starting legacy HAL
07-22 08:36:58.827     0     0 E [dhd-wlan0] wl_android_wifi_on: in g_wifi_on=0
07-22 08:36:58.827     0     0 W         : wifi_platform_set_power = 1
07-22 08:36:58.827     0     0 I init    : processing action (wlan.driver.status=ok) from (/vendor/etc/init/hw/init.connectivity.rc:51)
07-22 08:36:58.827     0     0 I [WLAN_RFKILL]: rockchip_wifi_power: 1
07-22 08:36:58.827     0     0 I [WLAN_RFKILL]: rockchip_wifi_power: toggle = false
07-22 08:36:58.827     0     0 I [WLAN_RFKILL]: wifi turn on power [GPIO-1-0]
07-22 08:36:59.491     0     0 W dhd_bus_devreset: == WLAN ON ==
07-22 08:36:59.630     0     0 W dhd_get_memdump_info: File [/data/misc/wifi/.memdump.info] doesn't exist
07-22 08:36:59.694     0     0 E [dhd-wlan0] wl_android_wifi_on: Success
07-22 08:36:59.732   290   290 I WifiHAL : Initializing BROADCOM_WIFI
07-22 08:36:59.732   290   290 I WifiHAL : Creating socket
07-22 08:36:59.734   290   290 I WifiHAL : Initialized Wifi HAL Successfully; vendor cmd = 103
07-22 08:36:59.736   290   290 I android.hardware.wifi@1.0-service: Adding interface handle for wlan0
07-22 08:36:59.736   290   290 D android.hardware.wifi@1.0-service: Legacy HAL start complete
07-22 08:36:59.736   290   290 W android.hardware.wifi@1.0-service: No active wlan interfaces in use! Using default
07-22 08:36:59.736   290   290 E android.hardware.wifi@1.0-service: Failed to register radio mode change callback
07-22 08:36:59.736   290   290 W android.hardware.wifi@1.0-service: No active wlan interfaces in use! Using default
07-22 08:36:59.736   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:36:59.736   439   470 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
07-22 08:36:59.736   290  2144 D android.hardware.wifi@1.0-service: Starting legacy HAL event loop
07-22 08:36:59.736   290   290 D WifiHAL : len = 72, expected len = 256
07-22 08:36:59.736   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:36:59.736   290   290 D WifiHAL : len = 164, expected len = 256
07-22 08:36:59.737   290   290 I android.hardware.wifi@1.0-service: Configured chip in mode 0
07-22 08:36:59.737   290   290 W android.hardware.wifi@1.0-service: No active wlan interfaces in use! Using default
07-22 08:36:59.742   290   290 I android.hardware.wifi@1.0-service: Adding interface handle for wlan0
07-22 08:36:59.743   290   290 E android.hardware.wifi@1.0-service: Failed to set DFS flag; DFS channels may be unavailable.
07-22 08:36:59.756   439   581 D WifiNl80211Manager: Setting up interface for client mode
07-22 08:36:59.758   394   394 I wificond: create scanner for interface with index: 8
07-22 08:36:59.758   394   394 I wificond: subscribe scan result for interface with index: 8
07-22 08:36:59.762   439   581 I WifiNative: Interface state changed on Iface:{Name=wlan0,Id=1,Type=STA_SCAN}, isUp=true
07-22 08:36:59.762   439   581 I WifiNative: Successfully setup Iface:{Name=wlan0,Id=1,Type=STA_SCAN}
07-22 08:36:59.764   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:36:59.764   290   290 D WifiHAL : len = 4, expected len = 4
07-22 08:36:59.765   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:36:59.765   290   290 D WifiHAL : len = 4, expected len = 4
07-22 08:36:59.781   439   581 D WifiClientModeManager: entering StartedState
07-22 08:36:59.789   439   581 D WifiClientModeManager: entering ScanOnlyModeState
07-22 08:36:59.790   439   581 D WifiScanRequestProxy: Sending scan available broadcast: true
07-22 08:36:59.790   439   584 I WifiScanningService: Received a request to enable scanning, UID = 1000
07-22 08:36:59.791   439   581 I WifiScanRequestProxy: Scanning is enabled
07-22 08:36:59.792   439   581 I WifiScanRequestProxy: Scanning for hidden networks is disabled
07-22 08:36:59.796   439   439 D WifiP2pService: Wifi enabled=false, P2P Interface availability=true
07-22 08:36:59.798   146   146 I hwservicemanager: Since android.hardware.wifi.supplicant@1.0::ISupplicant/default is not registered, trying to start it as a lazy HAL.
07-22 08:36:59.804   439   584 I WifiScanningService: Created a new impl for wlan0
07-22 08:36:59.806   439   584 I WifiScanningService: wifi driver loaded with scan capabilities: max buckets=8
07-22 08:36:59.817     0     0 I init    : Created socket '/dev/socket/wpa_wlan0', mode 660, user 1010, group 1010
07-22 08:36:59.826     0     0 I init    : Control message: Processed ctl.interface_start for 'android.hardware.wifi.supplicant@1.0::ISupplicant/default' from pid: 146 (/system/bin/hwservicemanager)
07-22 08:36:59.883  2146  2146 E wpa_supplicant: check_wifi_chip_type_string : AP6255: Permission denied
07-22 08:36:59.883  2146  2146 I wpa_supplicant: Current wifi chip is AP6255
07-22 08:36:59.884  2146  2146 I wpa_supplicant: wpa_param_len = 4 | wpa_param[1] = -O/data/vendor/wifi/wpa/sockets
07-22 08:36:59.884  2146  2146 I wpa_supplicant: wpa_param_len = 4 | wpa_param[3] = -g@android:wpa_wlan0
07-22 08:36:59.884  2146  2146 D wpa_supplicant: Global control interface '@android:wpa_wlan0'
07-22 08:36:59.884  2146  2146 D wpa_supplicant: Using Android control socket 'wpa_wlan0'
07-22 08:36:59.889  2146  2146 I HidlServiceManagement: Registered android.hardware.wifi.supplicant@1.3::ISupplicant/default
07-22 08:36:59.896   439   857 I android_os_HwBinder: HwBinder: Starting thread pool for getting: android.hardware.wifi.supplicant@1.0::ISupplicant/default
07-22 08:36:59.897   439   862 I android_os_HwBinder: HwBinder: Starting thread pool for getting: android.hardware.wifi.supplicant@1.0::ISupplicant/default
07-22 08:36:59.906   439   581 I android_os_HwBinder: HwBinder: Starting thread pool for getting: android.hardware.wifi.supplicant@1.0::ISupplicant/default
07-22 08:36:59.908  2146  2146 E wpa_supplicant: check_wifi_chip_type_string : AP6255: Success
07-22 08:36:59.909  2146  2146 I wpa_supplicant: Use /vendor/etc/wifi/wpa_supplicant_overlay.conf, read ok.
07-22 08:36:59.909  2146  2146 D wpa_supplicant: Override interface parameter: ctrl_interface ('(null)' -> '/data/vendor/wifi/wpa/sockets')
07-22 08:36:59.909  2146  2146 D wpa_supplicant: Initializing interface 'wlan0' conf '/data/vendor/wifi/wpa/wpa_supplicant.conf' driver 'nl80211' ctrl_interface '/data/vendor/wifi/wpa/sockets' bridge 'N/A'
07-22 08:36:59.909  2146  2146 D wpa_supplicant: Configuration file '/data/vendor/wifi/wpa/wpa_supplicant.conf' -> '/data/vendor/wifi/wpa/wpa_supplicant.conf'
07-22 08:36:59.909  2146  2146 D wpa_supplicant: Reading configuration file '/data/vendor/wifi/wpa/wpa_supplicant.conf'
07-22 08:36:59.909  2146  2146 D wpa_supplicant: ctrl_interface='/data/vendor/wifi/wpa/sockets'
07-22 08:36:59.909  2146  2146 D wpa_supplicant: wowlan_disconnect_on_deinit=1
07-22 08:36:59.909  2146  2146 D wpa_supplicant: Reading configuration file '/vendor/etc/wifi/wpa_supplicant_overlay.conf'
07-22 08:36:59.910  2146  2146 D wpa_supplicant: wowlan_triggers='any'
07-22 08:36:59.923  2146  2146 D wpa_supplicant: nl80211: interface wlan0 in phy phy0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0xb400007d0a5d1a00 match=0300 multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0104 multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=040a multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=040b multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=040c multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=040d multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=090a multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=090b multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=090c multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=090d multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0409506f9a09 multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=7f506f9a09 multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0409506f9a1a multicast=0
07-22 08:36:59.925  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0801 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=040e multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=06 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0a07 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0a11 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0a0b multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0a1a multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=1101 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=1102 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0505 multicast=0
07-22 08:36:59.926  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d1a00 match=0500 multicast=0
07-22 08:36:59.928  2146  2146 D wpa_supplicant: Add interface wlan0 to a new radio phy0
07-22 08:36:59.930   439   470 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
07-22 08:36:59.930   439   470 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: true
07-22 08:36:59.942  2146  2146 D wpa_supplicant: wlan0: Own MAC address: 08:e9:f6:5c:41:6e
07-22 08:36:59.942  2146  2146 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=8 (wlan0) alg=0 addr=0x0 key_idx=0 set_tx=0 seq_len=0 key_len=0 key_flag=0x10
07-22 08:36:59.942  2146  2146 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=8 (wlan0) alg=0 addr=0x0 key_idx=1 set_tx=0 seq_len=0 key_len=0 key_flag=0x10
07-22 08:36:59.943  2146  2146 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=8 (wlan0) alg=0 addr=0x0 key_idx=2 set_tx=0 seq_len=0 key_len=0 key_flag=0x10
07-22 08:36:59.943  2146  2146 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=8 (wlan0) alg=0 addr=0x0 key_idx=3 set_tx=0 seq_len=0 key_len=0 key_flag=0x10
07-22 08:36:59.943  2146  2146 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=8 (wlan0) alg=0 addr=0x0 key_idx=4 set_tx=0 seq_len=0 key_len=0 key_flag=0x10
07-22 08:36:59.944  2146  2146 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=8 (wlan0) alg=0 addr=0x0 key_idx=5 set_tx=0 seq_len=0 key_len=0 key_flag=0x10
07-22 08:36:59.944  2146  2146 D wpa_supplicant: wlan0: RSN: flushing PMKID list in the driver
07-22 08:36:59.945  2146  2146 D wpa_supplicant: wlan0: State: DISCONNECTED -> INACTIVE
07-22 08:36:59.961  2146  2146 D wpa_supplicant: wlan0: WPS: UUID based on MAC address: 3f514d10-847e-5b1b-8560-7ea8a3f0f40d
07-22 08:36:59.976  2146  2146 D wpa_supplicant: nl80211: Setting wowlan
07-22 08:36:59.976  2146  2146 D wpa_supplicant: Registering interface to hidl control: wlan0
07-22 08:36:59.976  2146  2146 D wpa_supplicant: wlan0: Added interface wlan0
07-22 08:36:59.976  2146  2146 D wpa_supplicant: wlan0: State: INACTIVE -> DISCONNECTED
07-22 08:36:59.976  2146  2146 D wpa_supplicant: nl80211: Set wlan0 operstate 0->0 (DORMANT)
07-22 08:36:59.978  2146  2146 D wpa_supplicant: nl80211: New P2P Device interface p2p-dev-wlan0 (0x3) created
07-22 08:36:59.978  2146  2146 D wpa_supplicant: Override interface parameter: ctrl_interface ('/data/vendor/wifi/wpa/sockets' -> '/data/vendor/wifi/wpa/sockets')
07-22 08:36:59.978  2146  2146 D wpa_supplicant: Initializing interface 'p2p-dev-wlan0' conf '/data/vendor/wifi/wpa/wpa_supplicant.conf' driver 'nl80211' ctrl_interface '/data/vendor/wifi/wpa/sockets' bridge 'N/A'
07-22 08:36:59.978  2146  2146 D wpa_supplicant: Configuration file '/data/vendor/wifi/wpa/wpa_supplicant.conf' -> '/data/vendor/wifi/wpa/wpa_supplicant.conf'
07-22 08:36:59.978  2146  2146 D wpa_supplicant: Reading configuration file '/data/vendor/wifi/wpa/wpa_supplicant.conf'
07-22 08:36:59.978  2146  2146 D wpa_supplicant: ctrl_interface='/data/vendor/wifi/wpa/sockets'
07-22 08:36:59.978  2146  2146 D wpa_supplicant: wowlan_disconnect_on_deinit=1
07-22 08:36:59.986  2146  2146 D wpa_supplicant: nl80211: interface p2p-dev-wlan0 in phy phy0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0xb400007d0a5d15a0 match=0300 multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0104 multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=040a multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=040b multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=040c multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=040d multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=090a multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=090b multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=090c multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=090d multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0409506f9a09 multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=7f506f9a09 multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0409506f9a1a multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0801 multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=040e multicast=0
07-22 08:36:59.989  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=06 multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0a07 multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0a11 multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0a0b multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0a1a multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=1101 multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=1102 multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0505 multicast=0
07-22 08:36:59.990  2146  2146 D wpa_supplicant: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xb400007d0a5d15a0 match=0500 multicast=0
07-22 08:36:59.994  2146  2146 D wpa_supplicant: nl80211: Start P2P Device p2p-dev-wlan0 (0x3): Success
07-22 08:36:59.995  2146  2146 D wpa_supplicant: Add interface p2p-dev-wlan0 to existing radio phy0
07-22 08:36:59.996  2146  2146 D wpa_supplicant: p2p-dev-wlan0: Own MAC address: 0a:e9:f6:5c:41:6e
07-22 08:36:59.996  2146  2146 D wpa_supplicant: p2p-dev-wlan0: RSN: flushing PMKID list in the driver
07-22 08:36:59.996  2146  2146 D wpa_supplicant: p2p-dev-wlan0: State: DISCONNECTED -> INACTIVE
07-22 08:36:59.996  2146  2146 D wpa_supplicant: p2p-dev-wlan0: WPS: UUID from the first interface: 3f514d10-847e-5b1b-8560-7ea8a3f0f40d
07-22 08:37:00.005  2146  2146 D wpa_supplicant: Registering interface to hidl control: p2p-dev-wlan0
07-22 08:37:00.005  2146  2146 D wpa_supplicant: p2p-dev-wlan0: Added interface p2p-dev-wlan0
07-22 08:37:00.005  2146  2146 D wpa_supplicant: p2p-dev-wlan0: State: INACTIVE -> DISCONNECTED
07-22 08:37:00.005  2146  2146 D wpa_supplicant: nl80211: Set p2p-dev-wlan0 operstate 0->0 (DORMANT)
07-22 08:37:00.005  2146  2146 D wpa_supplicant: p2p-dev-wlan0: Determining shared radio frequencies (max len 2)
07-22 08:37:00.005  2146  2146 D wpa_supplicant: p2p-dev-wlan0: Shared frequencies (len=0): completed iteration
07-22 08:37:00.005  2146  2146 D wpa_supplicant: RTM_NEWLINK: ifi_index=8 ifname=wlan0 operstate=5 linkmode=0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
07-22 08:37:00.006  2146  2146 D wpa_supplicant: RTM_NEWLINK: ifi_index=8 ifname=wlan0 operstate=5 linkmode=1 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
07-22 08:37:00.011   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:37:00.011   290   290 D WifiHAL : len = 4, expected len = 4
07-22 08:37:00.012   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:37:00.012   290   290 D WifiHAL : len = 4, expected len = 4
07-22 08:37:00.019   439   581 I WifiNative: Successfully switched to connectivity mode on iface=Iface:{Name=wlan0,Id=1,Type=STA_CONNECTIVITY}
07-22 08:37:00.020   439   581 E WifiScanner: listener cannot be found
07-22 08:37:00.020   439   581 D WifiClientModeManager: entering ConnectModeState
07-22 08:37:00.023   439   581 D WifiScanRequestProxy: Sending scan available broadcast: true
07-22 08:37:00.023   439   584 I WifiScanningService: Received a request to enable scanning, UID = 1000
07-22 08:37:00.023   439   584 I WifiScanningService: scanner impls already exists
07-22 08:37:00.023   439   584 E WifiScanningService: wifi driver loaded received while already loaded
07-22 08:37:00.023   439   581 I WifiScanRequestProxy: Scanning is enabled
07-22 08:37:00.023   439   581 I WifiScanRequestProxy: Scanning for hidden networks is enabled
07-22 08:37:00.025   439   439 D WifiP2pService: Wifi enabled=true, P2P Interface availability=true, Number of clients=1
07-22 08:37:00.026   439   439 D WifiP2pService: Wifi enabled=true, P2P Interface availability=true
07-22 08:37:00.026   439   581 D WifiClientModeImpl: entering ConnectModeState: ifaceName = wlan0
07-22 08:37:00.026   439   582 D WifiP2pNative: Setup P2P interface
07-22 08:37:00.026   439   581 D WifiClientModeImpl: setupClientMode() ifacename = wlan0
07-22 08:37:00.027   439   473 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcastMultiplePermissions:1143 android.content.Context.sendBroadcastWithMultiplePermissions:2150 com.android.server.display.WifiDisplayAdapter.handleSendStatusChangeBroadcast:440 com.android.server.display.WifiDisplayAdapter.access$1700:63 com.android.server.display.WifiDisplayAdapter$WifiDisplayHandler.handleMessage:675 
07-22 08:37:00.045   439   581 D WifiCountryCode: Reading country code from telephony
07-22 08:37:00.046   644   644 W View    : requestLayout() improperly called by com.android.keyguard.AlphaOptimizedLinearLayout{f177480 V.E...... ......ID 5,0-35,44 #7f0a04f5 app:id/wifi_group} during layout: running second layout pass
07-22 08:37:00.048   439   581 D WifiCountryCode: Set telephony country code to: 
07-22 08:37:00.049   439   581 D WifiCountryCode: updateCountryCode to CN
07-22 08:37:00.051  2146  2146 E wpa_supplicant: check_wifi_chip_type_string : AP6255: Try again
07-22 08:37:00.052  2146  2146 I wpa_supplicant: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=CN
07-22 08:37:00.053   439   581 D WifiCountryCode: Succeeded to set country code to: CN
07-22 08:37:00.055   644   644 W View    : requestLayout() improperly called by com.android.keyguard.AlphaOptimizedLinearLayout{d7bcab9 V.E...... ......ID 5,0-35,44 #7f0a04f5 app:id/wifi_group} during layout: running second layout pass
07-22 08:37:00.055   644   644 W View    : requestLayout() improperly called by com.android.keyguard.AlphaOptimizedLinearLayout{98fdefe V.E...... ......ID 5,0-35,44 #7f0a04f5 app:id/wifi_group} during layout: running second layout pass
07-22 08:37:00.055   290   290 D WifiHAL : Start get packet fate command
07-22 08:37:00.055   290   290 D WifiHAL : createRequest Monitor packet fate request
07-22 08:37:00.057   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:37:00.057   290   290 D WifiHAL : len = 72, expected len = 256
07-22 08:37:00.062     0     0 I init    : processing action (vendor.wifi.direct.interface=p2p-dev-wlan0) from (/vendor/etc/init/hw/init.connectivity.rc:58)
07-22 08:37:00.057   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:37:00.057   290   290 D WifiHAL : len = 164, expected len = 256
07-22 08:37:00.058   439   581 I WifiVendorHal: Driver: Dongle Host Driver, version 1.579.77.41.22 (r-20191105-2)(20191120-1) Firmware: Firmware: wl0: Dec 21 2020 18:51:04 version 7.45.96.76 (91a4c5d@SYNA) (r745790) FWID 01-6955613d es7.c5.n4.a3
07-22 08:37:00.058   439   581 I WifiVendorHal:   CLM: 9.2.9 (2016-02-03 04:34:31) 
07-22 08:37:00.058   439   581 I WifiVendorHal:   Chip: 4345 Rev 9
07-22 08:37:00.059   290   290 D WifiHAL : In DebugCommand::handleResponse
07-22 08:37:00.108   439   581 D WifiDiags: startLogging() iface list is {wlan0} after adding wlan0
07-22 08:37:00.115   439   582 W SupplicantP2pIfaceHal: addInterface({.type = P2P, .name = p2p-dev-wlan0}) failed: 5 ()
07-22 08:37:00.131   439   582 I WifiP2pNative: P2P interface setup completed
07-22 08:37:00.143   269   807 W InterfaceController: Failed to retrieve HW addr for p2p-dev-wlan0 (No such device)
07-22 08:37:00.153   439   581 D WifiConnectivityHelper: Firmware supported feature set: 8a8311599
07-22 08:37:00.153   439   581 D WifiConnectivityHelper: Firmware roaming is not supported
07-22 08:37:00.161   439   582 E WifiP2pService: Unable to change interface settings: java.lang.IllegalStateException: android.os.ServiceSpecificException: [No such device] : ioctl() failed (code 19)
07-22 08:37:00.170   439   581 I WifiClientModeImpl: disconnectedstate enter
07-22 08:37:00.171   439   582 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcastMultiplePermissions:1143 android.content.Context.sendBroadcastWithMultiplePermissions:2150 com.android.server.wifi.p2p.WifiP2pServiceImpl$P2pStateMachine.sendBroadcastMultiplePermissions:3106 com.android.server.wifi.p2p.WifiP2pServiceImpl$P2pStateMachine.sendP2pConnectionChangedBroadcast:3133 com.android.server.wifi.p2p.WifiP2pServiceImpl$P2pStateMachine.access$4900:756 
07-22 08:37:00.187   439   582 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcastMultiplePermissions:1143 android.content.Context.sendBroadcastWithMultiplePermissions:2150 com.android.server.wifi.p2p.WifiP2pServiceImpl$P2pStateMachine.sendBroadcastMultiplePermissions:3106 com.android.server.wifi.p2p.WifiP2pServiceImpl$P2pStateMachine.sendThisDeviceChangedBroadcast:3115 com.android.server.wifi.p2p.WifiP2pServiceImpl$P2pStateMachine.updateThisDevice:3835 
07-22 08:37:00.190   439   581 E WifiScoringParams: Invalid frequency(-1), using 5G as default rssi array
07-22 08:37:00.208     0     0 E [dhd-wlan0] wl_run_escan: LEGACY_SCAN sync ID: 1, bssidx: 0
07-22 08:37:00.212   439   582 D WifiP2pNative: P2P InterfaceAvailableListener false
07-22 08:37:00.212   439   582 I WifiP2pNative: Masking interface non-availability callback because we created a P2P iface
07-22 08:37:00.256   439   485 D WifiService:  getWifiActivityEnergyInfo:  on_time_millis=0 tx_time_millis=0 tx_time_per_level_millis=[] rx_time_millis=7 rxIdleTimeMillis=-7 scan_time_millis=0
07-22 08:37:00.272   439   485 W BatteryExternalStatsWorker: wifi info is invalid: WifiActivityEnergyInfo{ mTimeSinceBootMillis=1197241 mStackState=3 mControllerTxDurationMillis=0 mControllerRxDurationMillis=7 mControllerScanDurationMillis=0 mControllerIdleDurationMillis=-7 mControllerEnergyUsedMicroJoules=0 }
07-22 08:37:02.538   439   755 D WifiNl80211Manager: Scan result ready event
07-22 08:37:02.539   439   755 D WifiNative: Scan result ready event
07-22 08:37:02.561   439   584 D WificondScannerImpl: Filtering out 1 scan results.
07-22 08:37:20.194   439   581 E WifiScoringParams: Invalid frequency(-1), using 5G as default rssi array
07-22 08:37:20.223     0     0 E [dhd-wlan0] wl_run_escan: LEGACY_SCAN sync ID: 2, bssidx: 0
07-22 08:37:22.574   439   755 D WifiNl80211Manager: Scan result ready event
07-22 08:37:22.575   439   755 D WifiNative: Scan result ready event
07-22 08:37:22.598   439   584 D WificondScannerImpl: Filtering out 2 scan results.



3.瑞星微提供的调试方法

首先确认开机后系统是否有 USB WIFI 或者 SDIO wifi 设备,正常开机后,可以首先通过内核

log 进行确认,如果是 sdio,wifi 内 log 会有如下 sdio 识别成功 log:

如果是 usb,wifi 会有类似如下 usb 信息:

If it is usb, wifi will have the usb information similar as below:
usb 2-1: new high-speed USB device number 2 using ehci-platform
usb 2-1: New USB device found, idVendor=0bda, idProduct=b82c
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: 802.11ac NIC

如果 usb 信息和 sdio 扫卡成功 log 信息都没有,那说明 wifi 模块没有正常上电或者 sdio 扫卡

异常,需要再次确认硬件是否有问题以及软件 dts 里面 wifi 管脚是否正确配置;因为开机对模块成

功上电是检测 wifi 芯片 id 的前提

另外也可以 cat 如下路径下的 uevent 文件进行确认:

Besides, you can also cat the uevent file in the following path to confirm:
sys/bus/sdio/devices
sys/bus/usb/devices
  1. 如果模块正常上电,也可以识别到 wifi 模块的 vid pid,再确认是否正确加载 wifi ko 驱动文件;

以 AP6255 wifi 模块为例

sbc_rk3568:/sys/bus/sdio/devices # cd ./ 
sbc_rk3568:/sys/bus/sdio/devices #lsmod                                                                                                                                                                   
Module                  Size  Used by
bcmdhd               1175552  0 

3.Wifi 模块与相应 ko 相应的对应关系:

模块名称 ko 名称
AP6xxx(SDIO) bcmdhd.ko
RTL8723BU(USB) 8723bu.ko
RTL8188EU(USB) 8188eu.ko
RTL8188EU(USB) 8188fu.ko
RTL8723BS(SDIO) 8723bs.ko
RTL8723CS(SDIO) 8723cs.ko
RTL8723DS(SDIO) 8723ds.ko
RTL8189ES(SDIO) 8189es.ko
RTL8189FS(SDIO) 8189fs.ko

详细的 ko 和模块对应关系详见 android/frameworks/opt/net/wifi/libwifi_hal/wifi_hal_common.

cpp 文件。

系统 ko(ap6256的) 文件存放路径如下:

sbc_rk3568:/vendor/lib/modules # ls -l
total 18084
-rw-r--r-- 1 root root 3910536 2022-07-21 07:28 8723cs.ko
-rw-r--r-- 1 root root 4979920 2022-07-21 07:28 8821cs.ko
-rw-r--r-- 1 root root 6637152 2022-07-21 07:28 8822bs.ko
-rw-r--r-- 1 root root 2186448 2022-07-21 07:28 bcmdhd.ko
-rw-r--r-- 1 root root 1316880 2022-07-21 07:28 mali_kbase.ko
-rw-r--r-- 1 root root     801 2022-07-21 07:28 modules.alias
-rw-r--r-- 1 root root     159 2022-07-21 07:28 modules.dep
-rw-r--r-- 1 root root      54 2022-07-21 07:28 modules.load
-rw-r--r-- 1 root root      55 2022-07-21 07:28 modules.softdep

注意:由于目前 wifi 驱动是采用 ko 方式,如果有修改内核网络相关配置,一定要重新编译

ko,否则很可能加载 wifi ko 引起内核 panic



4. WIFI 芯片识别流程

  1. 开机对 wifi 模块上电,并自动进行扫描 sdio 操作。

    Power up wifi module, and automatically scan sdio.
  2. 系统启动打开 wifi 操作时,分别对系统 sys/bus/sdio(sdio wifi), sys/bus/usb(usb wifi)sys/bus/pic (pcie wifi )文件系统下的 uevent 进行读取
  3. 获取到 wifi 芯片 vid pid 加载相应的 wifi ko 驱动
  4. 识别到 wifi 类型后加载不同的 wpa_supplicant 参数启动 wifi。

核心代码目录:

android /frameworks/opt/net/wifi

kernel/net/rfkill/rfkill-wlan.c

hardware/broadcom

external/wpa_supplicant_8



5.WIFI移植

RK 平台上所有的 WIFI 模块驱动都是放到内核 kernel/drivers/net/wireless/rockchip_wlan 目录,一般移植新的 WIFI 驱动,需要在 kernel/drivers/net/wireless 目录添加相应的 wifi 模块的 Kconfig 和Makefile,有的模块还需要修改 wifi 驱动的 Kconfig 和 Makefile(根据特定的 wifi 模块驱动)

内核能正确编译出 wifi ko 驱动文件,wifi ko 文件在编译 kernel 的时候会自动编译。

注意:由于目前 wifi 驱动是采用 ko 方式,如果有修改内核网络相关配置,一定要重新编译ko,否则很可能导致 wifi ko 和内核网络协议栈不匹配。



6.WIFI兼容

1.添加 wifi 名称和 wifi vid pid

源码路径:frameworks/opt/net/wifi/libwifi_hal/rk_wifi_ctrl.cpp 代码 supported_wifi_devices[]结

构体中添加 wifi 模块的名称和对应 vid pid, vid pid 可以根据下面章节手动读取 uevent 进行查看;

以 AP6255 为例:AP6255 为模块名称,02d0:09bf 为 vid pid

如下列表中已经添加了几款 wifi 的

兼容,参考如下格式添加:

typedef struct _wifi_devices
{
  char wifi_name[64];
  char wifi_vid_pid[64];
} wifi_device;

static wifi_device supported_wifi_devices[] = {
	{"RTL8188EU",	"0bda:8179"},
	{"RTL8188EU",	"0bda:0179"},
	{"RTL8723BU",	"0bda:b720"},
	{"RTL8723BS",	"024c:b723"},
	{"RTL8822BS",	"024c:b822"},
	{"RTL8723CS",	"024c:b703"},
	{"RTL8723DS",	"024c:d723"},
	{"RTL8188FU",	"0bda:f179"},
	{"RTL8822BU",	"0bda:b82c"},
	{"RTL8189ES",	"024c:8179"},
	{"RTL8189FS",	"024c:f179"},
	{"RTL8192DU",	"0bda:8194"},
	{"RTL8812AU",	"0bda:8812"},
	{"RTL8821CS",	"024c:c821"},
        {"RTL8822CU",   "0bda:c82c"},
	{"RTL8822CS",   "024c:c822"},
	{"SSV6051",	"3030:3030"},
	{"ESP8089",	"6666:1111"},
	{"AP6354",	"02d0:4354"},
	{"AP6330",	"02d0:4330"},
	{"AP6356S",	"02d0:4356"},
	{"AP6335",	"02d0:4335"},
	{"AP6255",      "02d0:a9bf"},
	{"RTL8822BE",	"10ec:b822"},
	{"MVL88W8977",	"02df:9145"},
	{"SPRDWL",	"0000:0000"},
};
  1. 添加 wifi 驱动 ko 文件存放路径

    frameworks/opt/net/wifi/libwifi_hal/wifi_hal_common.cpp 中 wifi_ko_file_name module_list[]结构体存放的是 wifi 模块的 ko 驱动存放路径和加载 wifi ko 驱动所需的参数, wifi ko 存放路径统一采用 XXXX_DRIVER_MODULE_PATH 的命名方式,如果 ismod wifi ko 不需要带参数,那么可以使用 UNKKOWN_DRIVER_MODULE_ARG,注意:wifi 名称supported_wifi_devies[]结构体中定义的名称一样
#define WIFI_MODULE_PATH		"/vendor/lib/modules/"
#define RTL8188EU_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8188eu.ko"
#define RTL8723BU_DRIVER_MODULE_PATH 	 WIFI_MODULE_PATH"8723bu.ko"
#define RTL8723BS_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8723bs.ko"
#define RTL8723BS_VQ0_DRIVER_MODULE_PATH WIFI_MODULE_PATH"8723bs-vq0.ko"
#define RTL8723CS_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8723cs.ko"
#define RTL8723DS_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8723ds.ko"
#define RTL8188FU_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8188fu.ko"
#define RTL8822BU_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8822bu.ko"
#define RTL8822BS_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8822bs.ko"
#define RTL8189ES_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8189es.ko"
#define RTL8189FS_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8189fs.ko"
#define RTL8192DU_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8192du.ko"
#define RTL8812AU_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8812au.ko"
#define RTL8822BE_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"8822be.ko"
#define RTL8821CS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8821cs.ko"
#define RTL8822CU_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822cu.ko"
#define RTL8822CS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822cs.ko"
#define SSV6051_DRIVER_MODULE_PATH  	 WIFI_MODULE_PATH"ssv6051.ko"
#define ESP8089_DRIVER_MODULE_PATH  	 WIFI_MODULE_PATH"esp8089.ko"
#define BCM_DRIVER_MODULE_PATH      	 WIFI_MODULE_PATH"bcmdhd.ko"
#define MLAN_DRIVER_MODULE_PATH      	 WIFI_MODULE_PATH"mlan.ko"
#define MVL_DRIVER_MODULE_PATH      	 WIFI_MODULE_PATH"sd8xxx.ko"
#define RK912_DRIVER_MODULE_PATH         WIFI_MODULE_PATH"rk912.ko"
#define SPRDWL_DRIVER_MODULE_PATH	 WIFI_MODULE_PATH"sprdwl_ng.ko"
#define DRIVER_MODULE_PATH_UNKNOW   	 ""

#define RTL8188EU_DRIVER_MODULE_NAME	 "8188eu"
#define RTL8723BU_DRIVER_MODULE_NAME	 "8723bu"
#define RTL8723BS_DRIVER_MODULE_NAME	 "8723bs"
#define RTL8723BS_VQ0_DRIVER_MODULE_NAME "8723bs-vq0"
#define RTL8723CS_DRIVER_MODULE_NAME	 "8723cs"
#define RTL8723DS_DRIVER_MODULE_NAME	 "8723ds"
#define RTL8188FU_DRIVER_MODULE_NAME	 "8188fu"
#define RTL8822BU_DRIVER_MODULE_NAME	 "8822bu"
#define RTL8822BS_DRIVER_MODULE_NAME	 "8822bs"
#define RTL8189ES_DRIVER_MODULE_NAME	 "8189es"
#define RTL8189FS_DRIVER_MODULE_NAME	 "8189fs"
#define RTL8192DU_DRIVER_MODULE_NAME	 "8192du"
#define RTL8812AU_DRIVER_MODULE_NAME	 "8812au"
#define RTL8822BE_DRIVER_MODULE_NAME	 "8822be"
#define RTL8821CS_DRIVER_MODULE_NAME	 "8821cs"
#define RTL8822CU_DRIVER_MODULE_NAME     "8822cu"
#define RTL8822CS_DRIVER_MODULE_NAME     "8822cs"
#define SSV6051_DRIVER_MODULE_NAME  	 "ssv6051"
#define ESP8089_DRIVER_MODULE_NAME  	 "esp8089"
#define BCM_DRIVER_MODULE_NAME      	 "bcmdhd"
#define MVL_DRIVER_MODULE_NAME      	 "sd8xxx"
#define RK912_DRIVER_MODULE_NAME         "rk912"
#define SPRDWL_DRIVER_MODULE_NAME	 "sprdwl"
#define DRIVER_MODULE_NAME_UNKNOW   	 ""

wifi_ko_file_name module_list[] =
{
	{"RTL8723BU", RTL8723BU_DRIVER_MODULE_NAME, RTL8723BU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8188EU", RTL8188EU_DRIVER_MODULE_NAME, RTL8188EU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8192DU", RTL8192DU_DRIVER_MODULE_NAME, RTL8192DU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8822BU", RTL8822BU_DRIVER_MODULE_NAME, RTL8822BU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8822BS", RTL8822BS_DRIVER_MODULE_NAME, RTL8822BS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8188FU", RTL8188FU_DRIVER_MODULE_NAME, RTL8188FU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8189ES", RTL8189ES_DRIVER_MODULE_NAME, RTL8189ES_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8723BS", RTL8723BS_DRIVER_MODULE_NAME, RTL8723BS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8723CS", RTL8723CS_DRIVER_MODULE_NAME, RTL8723CS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8723DS", RTL8723DS_DRIVER_MODULE_NAME, RTL8723DS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8812AU", RTL8812AU_DRIVER_MODULE_NAME, RTL8812AU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8189FS", RTL8189FS_DRIVER_MODULE_NAME, RTL8189FS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8822BE", RTL8822BE_DRIVER_MODULE_NAME, RTL8822BE_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8821CS", RTL8821CS_DRIVER_MODULE_NAME, RTL8821CS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"RTL8822CU", RTL8822CU_DRIVER_MODULE_NAME, RTL8822CU_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
        {"RTL8822CS", RTL8822CS_DRIVER_MODULE_NAME, RTL8822CS_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"SSV6051",     SSV6051_DRIVER_MODULE_NAME,   SSV6051_DRIVER_MODULE_PATH, SSV6051_DRIVER_MODULE_ARG},
	{"ESP8089",     ESP8089_DRIVER_MODULE_NAME,   ESP8089_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"AP6335",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"AP6330",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"AP6354",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"AP6356S",         BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"AP6255",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"APXXX",           BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"MVL88W8977",      MVL_DRIVER_MODULE_NAME,       MVL_DRIVER_MODULE_PATH, MVL88W8977_DRIVER_MODULE_ARG},
        {"RK912",         RK912_DRIVER_MODULE_NAME,     RK912_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"SPRDWL",	    SPRDWL_DRIVER_MODULE_NAME, SPRDWL_DRIVER_MODULE_PATH, UNKKOWN_DRIVER_MODULE_ARG},
	{"UNKNOW",       DRIVER_MODULE_NAME_UNKNOW,    DRIVER_MODULE_PATH_UNKNOW, UNKKOWN_DRIVER_MODULE_ARG}

};

3.添加 wpa_supplicant 启动参数 Add wpa_supplicant start parameter

init.connectivity.rc 中启动 wpa_supplicant 参数从/vendor/etc/wifi/wpa_config.txt 文件中读取

该文件如下:

sbc_rk3568:/vendor/etc/wifi $ cat wpa_config.txt    
wpa_config.txt                 
[broadcom]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-puse_p2p_group_interface=1
-g@android:wpa_wlan0

[realtek]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-g@android:wpa_wlan0

[ssv]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-g@android:wpa_wlan0

[esp]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-puse_p2p_group_interface=1
-g@android:wpa_wlan0

[mvl]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-g@android:wpa_wlan0


wpa_config.txt 代码中存放在 deivice/rockchip/common/wpa_config.txt

wpa_supplicant/main.c 中 main 函数入口会根据芯片类型来选择读取不同的 wpa_supplicant 参数,该文件的路径:external/wpa_supplicant_8/wpa_supplicant

以 broadcom 模块为例:

当读取到芯片是 APxxx 系列的,就会根据 BROADCOM_MODULE_NAME 在/vendor/etc/

wifi/wpa_config.txt 文件中查找 broadcom 模块的参数。

[broadcom]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-puse_p2p_group_interface=1
-g@android:wpa_wlan0



7.另外让wifi和eht0从eeprom中获取MAC的patch

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index dc35376..d338883 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -615,6 +615,19 @@
 	}
 }
 
+/* Get eternet/Wi-Fi MAC from eeprom start*/
+static struct at24_data *at24_priv = NULL;
+int at24_get_macaddr(unsigned char *buf, int offset)
+{
+	if (at24_priv != NULL) {
+		return at24_read(at24_priv, offset, buf, 6);
+	} else
+		return -1;
+}
+
+EXPORT_SYMBOL(at24_get_macaddr);
+/* Get eternet/Wi-Fi MAC from eeprom end*/
+
 static int at24_probe(struct i2c_client *client)
 {
 	struct regmap_config regmap_config = { };
@@ -749,6 +762,10 @@
 	if (pdata.setup)
 		pdata.setup(at24->nvmem, pdata.context);
 
+	/* Get eternet/Wi-Fi MAC from eeprom start*/
+	at24_priv = at24;
+	/* Get eternet/Wi-Fi MAC from eeprom end*/
+
 	return 0;
 
 err_clients:

修改dhd_cdc

diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_cdc.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_cdc.c
index 21286dd..9d223cc 100644
--- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_cdc.c
+++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_cdc.c
@@ -44,6 +44,7 @@
 #include <dhd_bus.h>
 #include <dhd_dbg.h>
 
+#include <linux/etherdevice.h>
 
 #ifdef PROP_TXSTATUS
 #include <wlfc_proto.h>
@@ -79,6 +80,11 @@
 	unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
 } dhd_prot_t;
 
+/* Set Wi-Fi MAC from eeprom start*/
+#define WLAN_MAC_OFFSET 0
+extern int at24_get_macaddr(unsigned char *buf, int offset);
+/* Set Wi-Fi MAC from eeprom end*/
+
 static int
 dhdcdc_msg(dhd_pub_t *dhd)
 {
@@ -661,6 +667,11 @@
 {
 	int ret = 0;
 	wlc_rev_info_t revinfo;
+/* Set Wi-Fi MAC from eeprom start*/
+	unsigned char mac[6];
+	char buf[WLC_IOCTL_SMLEN];
+	int ret_value;
+/* Set Wi-Fi MAC from eeprom end*/
 	DHD_TRACE(("%s: Enter\n", __FUNCTION__));
 
 #ifdef DHD_FW_COREDUMP
@@ -690,6 +701,20 @@
 	DHD_SSSR_DUMP_INIT(dhd);
 
 	dhd_process_cid_mac(dhd, TRUE);
+/* Set Wi-Fi MAC from eeprom start*/
+	ret_value = at24_get_macaddr(mac, WLAN_MAC_OFFSET);
+	if (ret_value)
+		DHD_ERROR(("%s: Read WLAN MAC address from eeprom failed\n", __FUNCTION__));
+	else {
+		if (is_valid_ether_addr(mac)) {
+			memset(buf, 0, sizeof(buf));
+			bcm_mkiovar("cur_etheraddr", mac, ETHER_ADDR_LEN, buf, sizeof(buf));
+			ret_value = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, buf, sizeof(buf), TRUE, 0);
+			if (ret_value)
+				DHD_ERROR(("%s: Set WLAN MAC address failed\n", __FUNCTION__));
+		}
+	}
+/* Set Wi-Fi MAC from eeprom end*/
 	ret = dhd_preinit_ioctls(dhd);
 	dhd_process_cid_mac(dhd, FALSE);
diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c
index dc80027..6359ad9 100644
--- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c
+++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c
@@ -20,11 +20,18 @@
 #include <dhd_dbg.h>
 #include <wl_android.h>
 
+#include <linux/etherdevice.h>
+
 /* message levels */
 #define CONFIG_ERROR_LEVEL	(1 << 0)
 #define CONFIG_TRACE_LEVEL	(1 << 1)
 #define CONFIG_MSG_LEVEL	(1 << 15)
 
+/* Set Wi-Fi MAC from eeprom start*/
+#define WLAN_MAC_OFFSET 0
+extern int at24_get_macaddr(unsigned char *buf, int offset);
+/* Set Wi-Fi MAC from eeprom end*/
+
 uint config_msg_level = CONFIG_ERROR_LEVEL | CONFIG_MSG_LEVEL;
 uint dump_msg_level = 0;
 
@@ -229,6 +236,10 @@
 	unsigned char tpl_code, tpl_link='\0';
 	uint8 header[3] = {0x80, 0x07, 0x19};
 	uint8 *cis;
+/* Set Wi-Fi MAC from eeprom start*/
+	unsigned char mac_address[6];
+	int ret;
+/* Set Wi-Fi MAC from eeprom end*/
 
 	if (!(cis = MALLOC(dhd->osh, SBSDIO_CIS_SIZE_LIMIT))) {
 		CONFIG_ERROR("cis malloc failed\n");
@@ -299,6 +310,18 @@
 	ASSERT(cis);
 	MFREE(dhd->osh, cis, SBSDIO_CIS_SIZE_LIMIT);
 
+/* Set Wi-Fi MAC from eeprom start*/
+	if (err == 0) {
+		ret = at24_get_macaddr(mac_address, WLAN_MAC_OFFSET);
+		if (ret)
+			DHD_ERROR(("%s: Read WLAN MAC address from eeprom failed\n", __FUNCTION__));
+		else {
+			if (is_valid_ether_addr(mac_address))
+				memcpy(mac, mac_address, 6);
+		}
+	}
+/* Set Wi-Fi MAC from eeprom end*/
+
 	return err;
 }

以太网从eeprom中获取mac地址的:

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 419fb60..1724725 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -58,6 +58,11 @@
 #define	STMMAC_ALIGN(x)		ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
 #define	TSO_MAX_BUFF_SIZE	(SZ_16K - 1)
 
+/* Set ethernet MAC from eeprom start*/
+#define ETHERNET_MAC_OFFSET 12
+extern int at24_get_macaddr(unsigned char *buf, int offset);
+/* Set ethernet MAC from eeprom end*/
+
 /* Module parameters */
 #define TX_TIMEO	5000
 static int watchdog = TX_TIMEO;
@@ -2167,8 +2172,18 @@
  */
 static void stmmac_check_ether_addr(struct stmmac_priv *priv)
 {
-	if (!is_valid_ether_addr(priv->dev->dev_addr)) {
-		stmmac_get_umac_addr(priv, priv->hw, priv->dev->dev_addr, 0);
+	//if (!is_valid_ether_addr(priv->dev->dev_addr)) {
+		//stmmac_get_umac_addr(priv, priv->hw, priv->dev->dev_addr, 0);
+		/* Set ethernet MAC from eeprom start*/
+		if (!at24_get_macaddr(priv->dev->dev_addr, ETHERNET_MAC_OFFSET)) {
+			if (is_valid_ether_addr(priv->dev->dev_addr)){
+				printk("at24_get_macaddr %X:%X:%X:%X:%X:%X\n", priv->dev->dev_addr[0], priv->dev->dev_addr[1],
+						priv->dev->dev_addr[2], priv->dev->dev_addr[3], priv->dev->dev_addr[4], priv->dev->dev_addr[5]);
+			} else
+				stmmac_get_umac_addr(priv, priv->hw, priv->dev->dev_addr, 0);
+		} else
+			stmmac_get_umac_addr(priv, priv->hw, priv->dev->dev_addr, 0);
+		/* Set ethernet MAC from eeprom end*/
 		if (likely(priv->plat->get_eth_addr))
 			priv->plat->get_eth_addr(priv->plat->bsp_priv,
 				priv->dev->dev_addr);
@@ -2176,7 +2191,7 @@
 			eth_hw_addr_random(priv->dev);
 		dev_info(priv->device, "device MAC address %pM\n",
 			 priv->dev->dev_addr);
-	}
+	//}
 }
 
 /**

at24.c中的修改如下(主要是添加:at24_get_macaddr,和at24_set_macaddr):


diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index dc35376..a6ebde5 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -614,6 +614,28 @@
 		return 0;
 	}
 }
+/* Get MAC from eeprom start*/
+static struct at24_data *at24_priv = NULL;
+int at24_get_macaddr(unsigned char *buf, int offset)
+{
+	if (at24_priv != NULL) {
+		return at24_read(at24_priv, offset, buf, 6);
+	} else
+		return -1;
+}
+
+EXPORT_SYMBOL(at24_get_macaddr);
+
+int at24_set_macaddr(unsigned char *buf, int offset)
+{
+	if (at24_priv != NULL) {
+		return at24_write(at24_priv, offset, buf, 6);
+	} else
+		return -1;
+}
+
+EXPORT_SYMBOL(at24_set_macaddr);
+/* Get MAC from eeprom end*/
 
 static int at24_probe(struct i2c_client *client)
 {
@@ -749,6 +771,10 @@
 	if (pdata.setup)
 		pdata.setup(at24->nvmem, pdata.context);
 
+	/* Get MAC from eeprom start*/
+	at24_priv = at24;
+	/* Get MAC from eeprom end*/
+	
 	return 0;
 



版权声明:本文为weixin_68294039原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。