drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
Extension
.c
Size
12418 bytes
Lines
441
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

struct iwl_mvm_pasn_sta {
	struct list_head list;
	struct iwl_mvm_int_sta int_sta;
	u8 addr[ETH_ALEN];

	/* must be last as it followed by buffer holding the key */
	struct ieee80211_key_conf keyconf;
};

struct iwl_mvm_pasn_hltk_data {
	u8 *addr;
	u8 cipher;
	u8 *hltk;
};

static int iwl_mvm_ftm_responder_set_bw_v1(struct cfg80211_chan_def *chandef,
					   u8 *bw, u8 *ctrl_ch_position)
{
	switch (chandef->width) {
	case NL80211_CHAN_WIDTH_20_NOHT:
		*bw = IWL_TOF_BW_20_LEGACY;
		break;
	case NL80211_CHAN_WIDTH_20:
		*bw = IWL_TOF_BW_20_HT;
		break;
	case NL80211_CHAN_WIDTH_40:
		*bw = IWL_TOF_BW_40;
		*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
		break;
	case NL80211_CHAN_WIDTH_80:
		*bw = IWL_TOF_BW_80;
		*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
		break;
	default:
		return -EOPNOTSUPP;
	}

	return 0;
}

static int iwl_mvm_ftm_responder_set_bw_v2(struct cfg80211_chan_def *chandef,
					   u8 *format_bw, u8 *ctrl_ch_position,
					   u8 cmd_ver)
{
	switch (chandef->width) {
	case NL80211_CHAN_WIDTH_20_NOHT:
		*format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_LEGACY,
					    IWL_LOCATION_FMT_BW_FORMAT);
		*format_bw |= u8_encode_bits(IWL_LOCATION_BW_20MHZ,
					     IWL_LOCATION_FMT_BW_BANDWIDTH);
		break;
	case NL80211_CHAN_WIDTH_20:
		*format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_HT,
					    IWL_LOCATION_FMT_BW_FORMAT);
		*format_bw |= u8_encode_bits(IWL_LOCATION_BW_20MHZ,
					     IWL_LOCATION_FMT_BW_BANDWIDTH);
		break;
	case NL80211_CHAN_WIDTH_40:
		*format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_HT,
					    IWL_LOCATION_FMT_BW_FORMAT);
		*format_bw |= u8_encode_bits(IWL_LOCATION_BW_40MHZ,
					     IWL_LOCATION_FMT_BW_BANDWIDTH);
		*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
		break;
	case NL80211_CHAN_WIDTH_80:
		*format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_VHT,
					    IWL_LOCATION_FMT_BW_FORMAT);
		*format_bw |= u8_encode_bits(IWL_LOCATION_BW_80MHZ,
					     IWL_LOCATION_FMT_BW_BANDWIDTH);
		*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
		break;
	case NL80211_CHAN_WIDTH_160:
		if (cmd_ver >= 9) {
			*format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_HE,
						    IWL_LOCATION_FMT_BW_FORMAT);
			*format_bw |= u8_encode_bits(IWL_LOCATION_BW_160MHZ,
						     IWL_LOCATION_FMT_BW_BANDWIDTH);
			*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
			break;
		}
		fallthrough;
	default:
		return -EOPNOTSUPP;
	}

	return 0;
}

static void
iwl_mvm_ftm_responder_set_ndp(struct iwl_mvm *mvm,

Annotation

Implementation Notes