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.

Dependency Surface

Detected Declarations

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

Implementation Notes