drivers/net/wireless/microchip/wilc1000/cfg80211.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/microchip/wilc1000/cfg80211.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/microchip/wilc1000/cfg80211.c
Extension
.c
Size
48230 bytes
Lines
1891
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

struct wilc_p2p_mgmt_data {
	int size;
	u8 *buff;
};

struct wilc_p2p_pub_act_frame {
	u8 category;
	u8 action;
	u8 oui[3];
	u8 oui_type;
	u8 oui_subtype;
	u8 dialog_token;
	u8 elem[];
} __packed;

struct wilc_vendor_specific_ie {
	u8 tag_number;
	u8 tag_len;
	u8 oui[3];
	u8 oui_type;
	u8 attr[];
} __packed;

struct wilc_attr_entry {
	u8  attr_type;
	__le16 attr_len;
	u8 val[];
} __packed;

struct wilc_attr_oper_ch {
	u8 attr_type;
	__le16 attr_len;
	u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
	u8 op_class;
	u8 op_channel;
} __packed;

struct wilc_attr_ch_list {
	u8 attr_type;
	__le16 attr_len;
	u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
	u8 elem[];
} __packed;

struct wilc_ch_list_elem {
	u8 op_class;
	u8 no_of_channels;
	u8 ch_list[];
} __packed;

static void cfg_scan_result(enum scan_event scan_event,
			    struct wilc_rcvd_net_info *info,
			    struct wilc_priv *priv)
{
	if (!priv->cfg_scanning)
		return;

	if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
		s32 freq;
		struct ieee80211_channel *channel;
		struct cfg80211_bss *bss;
		struct wiphy *wiphy = priv->dev->ieee80211_ptr->wiphy;

		if (!wiphy || !info)
			return;

		freq = ieee80211_channel_to_frequency((s32)info->ch,
						      NL80211_BAND_2GHZ);
		channel = ieee80211_get_channel(wiphy, freq);
		if (!channel)
			return;

		bss = cfg80211_inform_bss_frame(wiphy, channel, info->mgmt,
						info->frame_len,
						(s32)info->rssi * 100,
						GFP_KERNEL);
		cfg80211_put_bss(wiphy, bss);
	} else if (scan_event == SCAN_EVENT_DONE) {
		mutex_lock(&priv->scan_req_lock);

		if (priv->scan_req) {
			struct cfg80211_scan_info info = {
				.aborted = false,
			};

			cfg80211_scan_done(priv->scan_req, &info);
			priv->cfg_scanning = false;
			priv->scan_req = NULL;
		}
		mutex_unlock(&priv->scan_req_lock);

Annotation

Implementation Notes