梳理了 RTL8852bs wifi 驱动的加载流程. 方便熟悉代码逻辑和超找需要的功能.
我看了所有的代码,但是还是没有找到是哪里设置的AP模式.
c
rtw_dev_probe()
|---> sdio_dvobj_init()
|---> devobj_init()
|---> atomic_set()
|---> sdio_init()
|---> sdio_claim_host()/* 3 1. init SDIO bus */
|---> mmc_claim_host()
|---> sdio_enable_func()
|---> mmc_io_rw_direct()
|---> sdio_set_block_size()
|---> mmc_io_rw_direct()
|---> fail---> sdio_release_host()
|---> rtw_reset_continual_io_error()
|---> ATOMIC_SET()
|---> fail---> devobj_deinit()
|---> devobj_trx_resource_init()
|---> rtw_init_lite_xmit_resource()
|---> _rtw_init_queue() /* init lite_xmit_buf */ /* Init lite xmit extension buff */ /* init xmit_urb */
|---> rtw_zvmalloc()
|---> _rtw_init_listhead()
|---> rtw_list_insert_tail()
|---> rtw_init_lite_recv_resource()
|---> _rtw_init_queue() /* init int_in_buf */ /* Init int_in_urb */
|---> rtw_zvmalloc()
|---> _rtw_init_listhead()
|---> rtw_list_insert_tail()
|---> rtw_init_recv_priv()
|---> _rtw_init_sema()
|---> _rtw_init_queue()
|---> rtw_os_recv_resource_init()
|---> rtw_zvmalloc()
|---> _rtw_init_listhead()
|---> rtw_list_insert_tail()
|---> rtw_os_recv_resource_alloc()
|---> rtw_intf_init_recv_priv()
|---> rtw_init_cmd_priv()
|---> init_completion()
|---> init_completion()
|---> INIT_LIST_HEAD()
|---> spin_lock_init()
|---> rtw_hw_init()
|---> rtw_phl_init()
|---> _os_mem_alloc()
|---> _os_mem_set()
|---> phl_regulation_init()
|---> _os_spinlock_init() --- 这些都是空函数,不知道有没有影响
|---> phl_regu_policy_init()
|---> _os_spinlock(); --- 这些都是空函数,不知道有没有影响
|---> _regu_policy_5g_bp_init()
|---> _reset_regu_policy_5g_bp()
|---> _update_cntry_prop_5g_bp("CN")
|---> _update_cntry_prop_5g_bp("IL")
|---> _os_spinunlock(); --- 这些都是空函数,不知道有没有影响
|---> phl_com_init()
|---> _os_mem_alloc()
|---> phl_sw_cap_init()
|---> _os_spinlock_init()
|---> phl_chsw_ofld_info_init()
|---> phl_fw_init()
|---> phl_chaninfo_init()
|---> _phl_com_init_rssi_stat()
|---> _phl_com_init_ppdu_sts()
|---> _os_spinlock_init()
|---> phl_txpwr_regu_info_init()
|---> phl_hci_init()
|---> _os_mem_alloc()
|---> phl_set_hci_ops()
|---> phl_get_hci_type()
|---> phl_hook_trx_ops_pci()
|---> or phl_hook_trx_ops_usb()
|---> or phl_hook_trx_ops_sdio()
|---> _phl_hci_ops_check();
|---> phl_twt_init()
|---> _os_mem_alloc()
|---> _os_mem_set()
|---> pq_init()
|---> phl_acs_info_init()
|---> _os_mem_alloc()
|---> _os_mem_set()
|---> rtw_hal_init()
|---> _os_mem_alloc()
|---> hal_init_io_priv() fail ---> hal_deinit_io_priv()
|---> rtw_hal_mac_init() fail ---> rtw_hal_mac_deinit()
|---> hal_set_ops()
|---> rtw_hal_efuse_init() fail ---> rtw_hal_efuse_deinit()
|---> rtw_hal_bb_init() fail ---> rtw_hal_bb_deinit()
|---> rtw_hal_rf_init() fail ---> rtw_hal_rf_deinit()
|---> rtw_hal_btc_init() fail ---> rtw_hal_btc_deinit()
|---> hal_bcn_init()
|---> fail ---> _os_mem_free()
|---> rtw_hal_hci_cfg()
|---> hal_get_ops()
|---> rtw_hal_read_chip_info()/* 3 6. read efuse/eeprom data */
|---> hal_get_ops()
|---> rtw_hal_var_init()
|---> rtw_hal_set_default_var()
|---> hal_csi_init()
|---> hal_bf_init()
|---> hal_snd_obj_init()
|---> phl_var_init()
|---> return RTW_PHL_STATUS_SUCCESS; -- 空函数,直接返回成功
|---> phl_mr_ctrl_init()
|---> rtw_hal_get_halcom()
|---> _os_spinlock_init()
|---> _phl_band_ctrl_init()
|---> _phl_role_bk_module_init()
|---> _os_mem_set()
|---> pq_init()
|---> rtw_phl_mcc_init()
|---> phl_module_init()
|---> phl_msg_hub_init() ---> phl_msg_hub_deinit()
|---> phl_wow_mdl_init() ---> phl_wow_mdl_deinit()
|---> phl_pkt_ofld_init() ---> phl_pkt_ofld_deinit()
|---> phl_test_module_init()
|---> phl_p2pps_init() ---> phl_p2pps_deinit()
|---> phl_disp_eng_init() ---> phl_disp_eng_deinit()
|---> phl_register_background_module_entry()
|---> phl_ecsa_ctrl_init()
|---> phl_macid_ctrl_init()
|---> rtw_hal_get_halcom()
|---> _os_spinlock_init()
|---> phl_stainfo_ctrl_init()
|---> phl_to_sta_ctrl()
|---> _os_mem_alloc()
|---> pq_init()
|---> _phl_stainfo_init()
|---> phl_stainfo_enqueue()
|---> fail ---> phl_stainfo_ctrl_deinit()
|---> phl_mld_ctrl_init()
|---> phl_to_mld_ctrl()
|---> _os_mem_alloc()
|---> pq_init()
|---> _phl_mld_init()
|---> phl_mld_enqueue()
|---> fail ---> phl_mld_ctrl_deinit()
|---> rtw_core_update_default_setting()/*init sw cap from registary*/
|---> GET_PHL_INFO()
|---> rtw_phl_log_level_cfg() -- debug 等级
|---> rtw_load_phy_file_path()
|---> BW_MODE_2G()
|---> BW_MODE_5G()
|---> is_supported_5g()
|---> is_supported_6g()
|---> rtw_max()
|---> ch_width_to_bw_cap()
|---> rtw_phl_pcie_trx_mit_cfg() -- bs用不上,be用
|---> rtw_phl_led_set_ctrl_mode()
|---> rtw_phl_cap_pre_config() /* sw & hw cap*/
|---> rtw_hal_fw_cap_pre_config()
|---> rtw_hal_bus_cap_pre_config()
|---> _hal_bus_cap_pre_decision()
|---> rtw_phl_init_ppdu_sts_para()
|---> /* Forced disable PSTS for DATA frame, to avoid unknown performance issue */
|---> rtw_phl_trx_alloc()
|---> phl_datapath_init()
|---> fail ---> phl_datapath_deinit()
|---> rtw_core_set_phl_ops() -- ops 赋值
|---> rx_process = rtw_core_rx_process;
|---> tx_recycle = rtw_core_tx_recycle;
|---> indicate_wake_rsn = rtw_core_wow_handle_wake_up_rsn;
|---> wow_handle_sec_info_update = rtw_update_gtk_ofld_info;
|---> set_rf_state = rtw_core_set_ips_state;
|---> issue_null_data = rtw_core_issu_null_data;
|---> os_query_local_buf = rtw_os_query_local_buf;
|---> os_return_local_buf = rtw_os_return_local_buf;
|---> tx_power_tbl_loaded = rtw_core_tx_power_tbl_loaded;
|---> rtw_core_register_phl_msg()
|---> core_handler_phl_msg()
|---> rtw_phl_msg_hub_register_recver()
|---> rtw_phl_msg_hub_update_recver_mask()
|---> rtw_phl_preload()
|---> rtw_hal_preload()
|---> phl_datapath_reset()
|---> rtw_phl_final_cap_decision()
|---> rtw_hal_final_cap_decision()
|---> rtw_core_register_mr_config()
|---> rtw_phl_mr_ops_init()
|---> phlcom_to_mr_ctrl
|---> rtw_phl_mcc_init_ops
|---> rtw_core_register_p2pps_ops()
|---> rtw_phl_p2pps_init_ops()
|---> phl_to_p2pps_info()
|---> rtw_core_set_ecsa_ops()
|---> rtw_phl_ecsa_init_ops()
|---> rtw_dump_rfe_type()
|---> RTW_INFO("RFE Type: %d\n");
|---> rtw_phl_watchdog_init()
|---> _os_init_timer()
|---> fail ---> rtw_hw_deinit()
|---> rtw_sdio_primary_adapter_init() -- 只有bs有,这是sdio的,be不用这个函数
|---> rtw_zvmalloc()
|==== dbg_rtw_zvmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
|---> rtw_load_registry() // struct registry_priv {} 参数定义在这里 drivers/net/wireless/realtek/rtl8852bs/include/drv_types.h
|---> chip_version
|---> rfintfs
|---> lbkmode
|---> network_mode -- 设置模式, 可能和AP有关
|---> _rtw_memcpy -- SSID
|---> band
|---> channel
|---> wireless_mode
|---> band_type
|---> rtw_init_drv_sw() /* 3 7. init driver common data */
|---> rtw_init_default_value()
|---> rtw_init_hal_com_default_value()
|---> rtw_init_cmd_priv() fail ---> rtw_free_cmd_priv()
|---> rtw_init_evt_priv() fail ---> rtw_free_evt_priv()
|---> rtw_init_mlme_priv()
|---> init_mlme_ext_priv() fail ---> free_mlme_ext_priv() rtw_free_mlme_priv()
|---> _rtw_init_xmit_priv() fail ---> _rtw_free_xmit_priv()
|---> _rtw_init_recv_priv() fail ---> _rtw_free_recv_priv()
|---> _rtw_init_sta_priv()
|---> rtw_init_bcmc_stainfo()
|---> rtw_init_pwrctrl_priv()
|---> rtw_hal_dm_init()
|---> rtw_hw_get_mac_addr() /* get mac addr */
|---> rtw_hw_get_mac_addr()
|---> rtw_macaddr_cfg() /* set mac addr */
|---> ether_addr_copy()
|---> is_broadcast_ether_addr()
|---> is_zero_ether_addr()
|---> of_get_property()
|---> eth_random_addr()
|---> fail ---> rtw_vmfree()
|---> rtw_adapter_link_init()
|---> init_adapter_link()
|---> rtw_zvmalloc()
|---> rtw_init_link_default_value()
|---> rtw_init_link_mlme_priv()
|---> rtw_init_link_mlme_ext_priv()
|---> fail ---> rtw_vmfree()
|---> fail ---> rtw_adapter_link_deinit()
|---> devobj_data_init()
|---> dev_set_drv_stopped() /*init*/
|---> ATOMIC_SET(&dvobj->bDriverStopped, _TRUE);
|---> dev_clr_hw_start() /* init */
|---> ATOMIC_SET(&dvobj->hw_start, _FALSE);
|---> rtw_rfctl_init() /*init data of dvobj*/
|---> dvobj_to_regsty()
|---> dvobj_to_rfctl()
|---> dvobj_get_primary_adapter()
|---> rtw_rfctl_get_band_and_bw_bmp()
|---> rtw_rfctl_addl_ch_disable_conf_init()
|---> rtw_regd_req_list_init()
|---> rtw_rfctl_cis_init()
|---> rtw_rfctl_dfs_init()
|---> rtw_chset_init()
|---> rtw_rfctl_op_class_pref_init()
|---> devobj_decide_init_chplan()
|---> dvobj_to_rfctl()
|---> GET_PHL_COM()
|---> rtw_rfctl_decide_init_chplan() /*Use hardware(efuse), driver parameter(registry) and default channel plan
* to decide which one should be used.*/
|---> rtw_get_chplan_from_country()
|---> rtw_is_channel_plan_6g_valid()
|---> dvobj_to_regsty()
|---> rtw_get_chplan_worldwide()
|---> rtw_chplan_rtk_priv_domain_code_get_country_chplan()
|---> rtw_regd_req_list_insert()
|---> rtw_rfctl_regd_status_init_by_req()
|---> rtw_edcca_mode_update()
|---> edcca_mode_5g 赋值
|---> edcca_mode_6g 赋值
|---> rtw_edcca_mode_update_by_regd_reqs()
|---> rtw_edcca_hal_update()
|---> rtw_rfctl_chset_apply_regulatory()
|---> band_to_band_cap()
|---> rtw_rfctl_is_excl_chs()
|---> rtw_rfctl_chset_apply_regd_reqs()
|---> rtw_rfctl_reg_allow_beacon_hint()
|---> rtw_chinfo_allow_beacon_hint()
|---> op_class_pref_apply_regulatory()
|---> RFCTL_REG_EN_11AC()
|---> rtw_rfctl_get_reg_max_txpwr_mbm()
|---> rtw_get_center_ch_by_band()
|---> rtw_get_op_chs_by_bcch_bw()
|---> rtw_chset_search_bch()
|---> init_channel_list()
|---> adapter_to_rfctl()
|---> adapter_to_regsty()
|---> adapter_to_chset()
|---> rtw_chset_search_ch()
|---> REGSTY_IS_BW_5G_SUPPORT()
|---> rtw_hw_cap_init()
|---> GET_HAL_SPEC()
|---> GET_PHL_COM()
|---> dvobj_get_primary_adapter()
|---> rtw_min()
|---> RTW_ENABLE_FUNC(DF_RX_BIT)
|---> ATOMIC_READ
|---> df &= ~(func_bit);
|---> ATOMIC_SET
|---> RTW_ENABLE_FUNC(DF_TX_BIT)
|---> rtw_os_ndevs_init()
|---> rtw_os_ndevs_alloc()
|---> rtw_cfg80211_dev_res_alloc()
|---> rtw_os_ndev_alloc()
|---> fail ---> rtw_os_ndev_free()
|---> fail ---> rtw_cfg80211_dev_res_free()
|---> rtw_os_ndevs_register()
|---> dvobj_to_regsty()
|---> rtw_cfg80211_dev_res_register()
|---> rtw_os_ndev_register() : wlan0
|---> fail ---> rtw_os_ndev_unregister()
|---> fail ---> rtw_os_ndevs_free()
|---> rtw_init_link_capab()
|---> init_link_capab_from_adapter()
|---> GET_LINK()
|---> _rtw_memcpy()
|---> is_supported_5g()
|---> is_supported_6g()
|---> rtw_sdio_alloc_irq()
|---> dvobj_to_sdio()
|---> sdio_claim_host()
|---> sdio_claim_irq()
|---> sdio_release_host()
|---> init_adapter_link()
|---> rtw_zvmalloc()
|---> adapter_mac_addr()
|---> _rtw_memcpy()
|---> rtw_init_link_default_value()
|---> rtw_init_link_mlme_priv()
|---> rtw_init_link_mlme_ext_priv()