Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70c33eaa authored by Ashok Nagarajan's avatar Ashok Nagarajan Committed by John W. Linville
Browse files

{nl,cfg,mac}80211: Allow user to see/configure HT protection mode



This patch introduces a new mesh configuration parameter "ht_opmode" and will
allow user to check the current HT protection mode selected. Users could
configure the protection mode by the command "iw mesh_iface set mesh_param
mesh_ht_protection_mode=2". The default protection mode of mesh is set to
non-HT mixed mode.

Signed-off-by: default avatarAshok Nagarajan <ashok@cozybit.com>
Reviewed-by: default avatarThomas Pedersen <thomas@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b91e64aa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2154,6 +2154,8 @@ enum nl80211_mntr_flags {
 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
 * to synchronize to for 11s default synchronization method (see 11C.12.2.2)
 *
 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
 *
 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
 */
enum nl80211_meshconf_params {
@@ -2179,6 +2181,7 @@ enum nl80211_meshconf_params {
	NL80211_MESHCONF_FORWARDING,
	NL80211_MESHCONF_RSSI_THRESHOLD,
	NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
	NL80211_MESHCONF_HT_OPMODE,

	/* keep last */
	__NL80211_MESHCONF_ATTR_AFTER_LAST,
+1 −0
Original line number Diff line number Diff line
@@ -821,6 +821,7 @@ struct mesh_config {
	bool  dot11MeshGateAnnouncementProtocol;
	bool dot11MeshForwarding;
	s32 rssi_threshold;
	u16 ht_opmode;
};

/**
+5 −0
Original line number Diff line number Diff line
@@ -1538,6 +1538,11 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
			return -ENOTSUPP;
		conf->rssi_threshold = nconf->rssi_threshold;
	}
	if (_chg_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)) {
		conf->ht_opmode = nconf->ht_opmode;
		sdata->vif.bss_conf.ht_operation_mode = nconf->ht_opmode;
		ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
	}
	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -595,12 +595,15 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
	set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
	ieee80211_mesh_root_setup(ifmsh);
	ieee80211_queue_work(&local->hw, &sdata->work);
	sdata->vif.bss_conf.ht_operation_mode =
				ifmsh->mshcfg.ht_opmode;
	sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
	sdata->vif.bss_conf.basic_rates =
		ieee80211_mandatory_rates(sdata->local,
					  sdata->local->hw.conf.channel->band);
	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON |
						BSS_CHANGED_BEACON_ENABLED |
						BSS_CHANGED_HT |
						BSS_CHANGED_BASIC_RATES |
						BSS_CHANGED_BEACON_INT);
}
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)

	if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) {
		sdata->vif.bss_conf.ht_operation_mode = ht_opmode;
		sdata->u.mesh.mshcfg.ht_opmode = ht_opmode;
		changed = BSS_CHANGED_HT;
		mpl_dbg("mesh_plink %pM: protection mode changed to %d",
			sdata->vif.addr, ht_opmode);
Loading