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

Commit c13a765b authored by Sujith Manoharan's avatar Sujith Manoharan Committed by Johannes Berg
Browse files

mac80211: Notify new IBSS network creation



Initialization of beacon transmission in IBSS mode depends
on whether a new BSS is being created or joined. When joining
an existing IBSS network, beaconing has to start only after
a TSF-sync has happened - this is explained in 11.1.4.

Introduce a new parameter in the BSS information structure to
indicate creator/joiner mode.

Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent cd2bb512
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -258,6 +258,7 @@ enum ieee80211_rssi_event {
 * @assoc: association status
 * @assoc: association status
 * @ibss_joined: indicates whether this station is part of an IBSS
 * @ibss_joined: indicates whether this station is part of an IBSS
 *	or not
 *	or not
 * @ibss_creator: indicates if a new IBSS network is being created
 * @aid: association ID number, valid only when @assoc is true
 * @aid: association ID number, valid only when @assoc is true
 * @use_cts_prot: use CTS protection
 * @use_cts_prot: use CTS protection
 * @use_short_preamble: use 802.11b short preamble;
 * @use_short_preamble: use 802.11b short preamble;
@@ -313,6 +314,7 @@ struct ieee80211_bss_conf {
	const u8 *bssid;
	const u8 *bssid;
	/* association related data */
	/* association related data */
	bool assoc, ibss_joined;
	bool assoc, ibss_joined;
	bool ibss_creator;
	u16 aid;
	u16 aid;
	/* erp related data */
	/* erp related data */
	bool use_cts_prot;
	bool use_cts_prot;
+8 −3
Original line number Original line Diff line number Diff line
@@ -38,7 +38,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
				      const u8 *bssid, const int beacon_int,
				      const u8 *bssid, const int beacon_int,
				      struct ieee80211_channel *chan,
				      struct ieee80211_channel *chan,
				      const u32 basic_rates,
				      const u32 basic_rates,
				      const u16 capability, u64 tsf)
				      const u16 capability, u64 tsf,
				      bool creator)
{
{
	struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
	struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
	struct ieee80211_local *local = sdata->local;
	struct ieee80211_local *local = sdata->local;
@@ -71,6 +72,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
	/* if merging, indicate to driver that we leave the old IBSS */
	/* if merging, indicate to driver that we leave the old IBSS */
	if (sdata->vif.bss_conf.ibss_joined) {
	if (sdata->vif.bss_conf.ibss_joined) {
		sdata->vif.bss_conf.ibss_joined = false;
		sdata->vif.bss_conf.ibss_joined = false;
		sdata->vif.bss_conf.ibss_creator = false;
		netif_carrier_off(sdata->dev);
		netif_carrier_off(sdata->dev);
		ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS);
		ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS);
	}
	}
@@ -197,6 +199,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
	bss_change |= BSS_CHANGED_HT;
	bss_change |= BSS_CHANGED_HT;
	bss_change |= BSS_CHANGED_IBSS;
	bss_change |= BSS_CHANGED_IBSS;
	sdata->vif.bss_conf.ibss_joined = true;
	sdata->vif.bss_conf.ibss_joined = true;
	sdata->vif.bss_conf.ibss_creator = creator;
	ieee80211_bss_info_change_notify(sdata, bss_change);
	ieee80211_bss_info_change_notify(sdata, bss_change);


	ieee80211_sta_def_wmm_params(sdata, sband->n_bitrates, supp_rates);
	ieee80211_sta_def_wmm_params(sdata, sband->n_bitrates, supp_rates);
@@ -249,7 +252,8 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
				  cbss->channel,
				  cbss->channel,
				  basic_rates,
				  basic_rates,
				  cbss->capability,
				  cbss->capability,
				  cbss->tsf);
				  cbss->tsf,
				  false);
}
}


static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta,
static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta,
@@ -734,7 +738,7 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)


	__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
	__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
				  ifibss->channel, ifibss->basic_rates,
				  ifibss->channel, ifibss->basic_rates,
				  capability, 0);
				  capability, 0, true);
}
}


/*
/*
@@ -1198,6 +1202,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
					lockdep_is_held(&sdata->u.ibss.mtx));
					lockdep_is_held(&sdata->u.ibss.mtx));
	RCU_INIT_POINTER(sdata->u.ibss.presp, NULL);
	RCU_INIT_POINTER(sdata->u.ibss.presp, NULL);
	sdata->vif.bss_conf.ibss_joined = false;
	sdata->vif.bss_conf.ibss_joined = false;
	sdata->vif.bss_conf.ibss_creator = false;
	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
						BSS_CHANGED_IBSS);
						BSS_CHANGED_IBSS);
	synchronize_rcu();
	synchronize_rcu();