drivers/net/wireless/ath/wil6210/cfg80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wil6210/cfg80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wil6210/cfg80211.c- Extension
.c- Size
- 89672 bytes
- Lines
- 3314
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/moduleparam.hnet/netlink.hnet/cfg80211.hwil6210.hwmi.hfw.h
Detected Declarations
enum wil_rx_cb_modeenum qca_wlan_vendor_attr_rf_sectorenum qca_wlan_vendor_attr_dmg_rf_sector_typeenum qca_wlan_vendor_attr_dmg_rf_sector_cfgenum qca_nl80211_vendor_subcmdsfunction wil_rx_cb_mode_to_n_bondedfunction wil_tx_cb_mode_to_n_bondedfunction wil_memdup_iefunction wil_num_supported_channelsfunction update_supported_bandsfunction wil_iftype_nl2wmifunction wil_spec2wmi_chfunction wil_wmi2spec_chfunction wil_cid_fill_sinfofunction MCSfunction wil_cfg80211_get_stationfunction wil_find_cid_by_idxfunction wil_cfg80211_dump_stationfunction wil_cfg80211_start_p2p_devicefunction wil_cfg80211_stop_p2p_devicefunction wil_cfg80211_validate_add_ifacefunction wil_cfg80211_validate_change_ifacefunction wil_cfg80211_add_ifacefunction wil_vif_prepare_stopfunction wil_cfg80211_del_ifacefunction wil_is_safe_switchfunction wil_cfg80211_change_ifacefunction netif_runningfunction wil_cfg80211_scanfunction wil_cfg80211_abort_scanfunction wil_print_cryptofunction wil_get_auth_type_namefunction wil_print_connect_paramsfunction wil_ft_connectfunction wil_get_wmi_edmg_channelfunction wil_cfg80211_connectfunction wil_cfg80211_disconnectfunction wil_cfg80211_set_wiphy_paramsfunction wil_cfg80211_mgmt_txfunction wil_cfg80211_set_channelfunction wil_detect_key_usagefunction wil_find_sta_by_key_usagefunction wil_set_crypto_rxfunction wil_del_rx_keyfunction wil_cfg80211_add_keyfunction wil_cfg80211_del_keyfunction wil_cfg80211_set_default_keyfunction wil_remain_on_channel
Annotated Snippet
if (wil->vifs[i]) {
wdev = vif_to_wdev(wil->vifs[i]);
params.iftype_num[wdev->iftype]++;
}
}
params.iftype_num[new_type]++;
return cfg80211_check_combinations(wil->wiphy, ¶ms);
}
static int wil_cfg80211_validate_change_iface(struct wil6210_priv *wil,
struct wil6210_vif *vif,
enum nl80211_iftype new_type)
{
int i, ret = 0;
struct wireless_dev *wdev;
struct iface_combination_params params = {
.num_different_channels = 1,
};
bool check_combos = false;
for (i = 0; i < GET_MAX_VIFS(wil); i++) {
struct wil6210_vif *vif_pos = wil->vifs[i];
if (vif_pos && vif != vif_pos) {
wdev = vif_to_wdev(vif_pos);
params.iftype_num[wdev->iftype]++;
check_combos = true;
}
}
if (check_combos) {
params.iftype_num[new_type]++;
ret = cfg80211_check_combinations(wil->wiphy, ¶ms);
}
return ret;
}
static struct wireless_dev *
wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name,
unsigned char name_assign_type,
enum nl80211_iftype type,
struct vif_params *params)
{
struct wil6210_priv *wil = wiphy_to_wil(wiphy);
struct net_device *ndev_main = wil->main_ndev, *ndev;
struct wil6210_vif *vif;
struct wireless_dev *p2p_wdev, *wdev;
int rc;
wil_dbg_misc(wil, "add_iface, type %d\n", type);
/* P2P device is not a real virtual interface, it is a management-only
* interface that shares the main interface.
* Skip concurrency checks here.
*/
if (type == NL80211_IFTYPE_P2P_DEVICE) {
if (wil->p2p_wdev) {
wil_err(wil, "P2P_DEVICE interface already created\n");
return ERR_PTR(-EINVAL);
}
p2p_wdev = kzalloc_obj(*p2p_wdev);
if (!p2p_wdev)
return ERR_PTR(-ENOMEM);
p2p_wdev->iftype = type;
p2p_wdev->wiphy = wiphy;
/* use our primary ethernet address */
ether_addr_copy(p2p_wdev->address, ndev_main->perm_addr);
wil->p2p_wdev = p2p_wdev;
return p2p_wdev;
}
if (!wil->wiphy->n_iface_combinations) {
wil_err(wil, "virtual interfaces not supported\n");
return ERR_PTR(-EINVAL);
}
rc = wil_cfg80211_validate_add_iface(wil, type);
if (rc) {
wil_err(wil, "iface validation failed, err=%d\n", rc);
return ERR_PTR(rc);
}
vif = wil_vif_alloc(wil, name, name_assign_type, type);
if (IS_ERR(vif))
return ERR_CAST(vif);
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/moduleparam.h`, `net/netlink.h`, `net/cfg80211.h`, `wil6210.h`, `wmi.h`, `fw.h`.
- Detected declarations: `enum wil_rx_cb_mode`, `enum qca_wlan_vendor_attr_rf_sector`, `enum qca_wlan_vendor_attr_dmg_rf_sector_type`, `enum qca_wlan_vendor_attr_dmg_rf_sector_cfg`, `enum qca_nl80211_vendor_subcmds`, `function wil_rx_cb_mode_to_n_bonded`, `function wil_tx_cb_mode_to_n_bonded`, `function wil_memdup_ie`, `function wil_num_supported_channels`, `function update_supported_bands`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.