drivers/net/wireless/ath/wil6210/p2p.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wil6210/p2p.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wil6210/p2p.c- Extension
.c- Size
- 8915 bytes
- Lines
- 380
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
wil6210.hwmi.h
Detected Declarations
function Copyrightfunction wil_p2p_is_social_scanfunction wil_p2p_searchfunction wil_p2p_listenfunction wil_p2p_stop_discoveryfunction wil_p2p_cancel_listenfunction wil_p2p_listen_expiredfunction wil_p2p_search_expiredfunction wil_p2p_delayed_listen_workfunction wil_p2p_stop_radio_operations
Annotated Snippet
if (p2p->pending_listen_wdev) {
/* discovery not really started, only pending */
p2p->pending_listen_wdev = NULL;
} else {
timer_delete_sync(&p2p->discovery_timer);
wmi_stop_discovery(vif);
}
p2p->discovery_started = 0;
}
return started;
}
int wil_p2p_cancel_listen(struct wil6210_vif *vif, u64 cookie)
{
struct wil6210_priv *wil = vif_to_wil(vif);
struct wil_p2p_info *p2p = &vif->p2p;
u8 started;
mutex_lock(&wil->mutex);
if (cookie != p2p->cookie) {
wil_info(wil, "Cookie mismatch: 0x%016llx vs. 0x%016llx\n",
p2p->cookie, cookie);
mutex_unlock(&wil->mutex);
return -ENOENT;
}
started = wil_p2p_stop_discovery(vif);
mutex_unlock(&wil->mutex);
if (!started) {
wil_err(wil, "listen not started\n");
return -ENOENT;
}
mutex_lock(&wil->vif_mutex);
cfg80211_remain_on_channel_expired(vif_to_radio_wdev(wil, vif),
p2p->cookie,
&p2p->listen_chan,
GFP_KERNEL);
if (vif->mid == 0)
wil->radio_wdev = wil->main_ndev->ieee80211_ptr;
mutex_unlock(&wil->vif_mutex);
return 0;
}
void wil_p2p_listen_expired(struct work_struct *work)
{
struct wil_p2p_info *p2p = container_of(work,
struct wil_p2p_info, discovery_expired_work);
struct wil6210_vif *vif = container_of(p2p,
struct wil6210_vif, p2p);
struct wil6210_priv *wil = vif_to_wil(vif);
u8 started;
wil_dbg_misc(wil, "p2p_listen_expired\n");
mutex_lock(&wil->mutex);
started = wil_p2p_stop_discovery(vif);
mutex_unlock(&wil->mutex);
if (!started)
return;
mutex_lock(&wil->vif_mutex);
cfg80211_remain_on_channel_expired(vif_to_radio_wdev(wil, vif),
p2p->cookie,
&p2p->listen_chan,
GFP_KERNEL);
if (vif->mid == 0)
wil->radio_wdev = wil->main_ndev->ieee80211_ptr;
mutex_unlock(&wil->vif_mutex);
}
void wil_p2p_search_expired(struct work_struct *work)
{
struct wil_p2p_info *p2p = container_of(work,
struct wil_p2p_info, discovery_expired_work);
struct wil6210_vif *vif = container_of(p2p,
struct wil6210_vif, p2p);
struct wil6210_priv *wil = vif_to_wil(vif);
u8 started;
wil_dbg_misc(wil, "p2p_search_expired\n");
mutex_lock(&wil->mutex);
started = wil_p2p_stop_discovery(vif);
mutex_unlock(&wil->mutex);
Annotation
- Immediate include surface: `wil6210.h`, `wmi.h`.
- Detected declarations: `function Copyright`, `function wil_p2p_is_social_scan`, `function wil_p2p_search`, `function wil_p2p_listen`, `function wil_p2p_stop_discovery`, `function wil_p2p_cancel_listen`, `function wil_p2p_listen_expired`, `function wil_p2p_search_expired`, `function wil_p2p_delayed_listen_work`, `function wil_p2p_stop_radio_operations`.
- 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.