Linux SDIO-WiFi 协议栈
- 1. 简介
- 2. BCMDHD
- 2.1 WiFi模组
- 2.2 驱动初始化(dhd_module_init)
- 3. Broadcom fullmac WLAN
1. 简介
2. BCMDHD
- BCMDHD:Broadcom Dongle Host Driver
- SIP:System In Package
2.1 WiFi模组
2.2 驱动初始化(dhd_module_init)
- dhd_module_init
dhd_module_init => # dhd_linux.c (drivers\net\wireless\bcmdhd)
dhd_wifi_platform_register_drv =>
wifi_ctrlfunc_register_dr =>
dhd_wifi_platform_load => # 对于不同接口,包括usb,sdio,pcie的wifi进行加载
dhd_wifi_platform_load_sdio => # 主要是给所有adapters上电,然后匹配func
dhd_bus_register => # 主要是注册sdio驱动sdio_register_driver(&dummy_sdmmc_driver);
# 通过总线驱动sdio_bus_match匹配,
# 主要匹配三个参数ids->class || ids->vendor || ids->device。
# 匹配成功后调用bcmsdh_sdmmc_probe 》 sdioh_probe 》 bcmsdh_probe
bcmsdh_register => # 注册bcmsdh_driver_t dhd_sdio
- dhd_sdio驱动
static bcmsdh_driver_t dhd_sdio = {
dhdsdio_probe,
dhdsdio_disconnect,
dhdsdio_suspend,
dhdsdio_resume
};
- dhdsdio_probe
dhdsdio_probe =>
dhd_attach => # 绑定到dhd/OS/网口, 对DHD管理的每个硬件(狗)实例调用一次
wl_cfg80211_attach # 把设备注册到cfg80211,操作函数是wl_cfg80211_ops, 注册到rfkill
wl_iw_attach # 加入到iw里面
dhd_dpc_thread # 启动延迟函数,也就是中断后半部
dhd_rxf_thread # 启动 网络包接收线程
dhd_attach_net =>
dhd_register_if # Register primary net device , 这里的need_rtnl_lock=true
wl_cfg80211_net_attach # 加入到cfg80211里面,cfg80211是Linux 802.11用于管理配置的一套API,
# 它是用户和驱动之间的桥梁,替代了WEXT,提供和802.11相关的功能
3. Broadcom fullmac WLAN
- The brcm80211 drivers are included in the kernel. They are named brcmsmac for PCI cards and brcmfmac for SDIO devices.
- SDIO设备驱动代码
drivers/net/wireless/broadcom/brcm80211/brcmfmac