mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jerome Pouiller <Jerome.Pouiller@silabs.com>
To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH 15/19] staging: wfx: introduce wfx_join_ibss() and wfx_leave_ibss()
Date: Fri, 10 Apr 2020 15:32:35 +0200	[thread overview]
Message-ID: <20200410133239.438347-16-Jerome.Pouiller@silabs.com> (raw)
In-Reply-To: <20200410133239.438347-1-Jerome.Pouiller@silabs.com>

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Currently, IBSS networks are started by the mean of
wfx_bss_info_changed(). It easier to use use callbacks provided by
mac80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/main.c |  2 ++
 drivers/staging/wfx/sta.c  | 19 +++++++++++++++++--
 drivers/staging/wfx/sta.h  |  2 ++
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index b459fac928fd..b8a01ba0d381 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -133,6 +133,8 @@ static const struct ieee80211_ops wfx_ops = {
 	.remove_interface	= wfx_remove_interface,
 	.config                 = wfx_config,
 	.tx			= wfx_tx,
+	.join_ibss		= wfx_join_ibss,
+	.leave_ibss		= wfx_leave_ibss,
 	.conf_tx		= wfx_conf_tx,
 	.hw_scan		= wfx_hw_scan,
 	.cancel_hw_scan		= wfx_cancel_hw_scan,
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 8aa373f5deae..21eceafc9a95 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -648,6 +648,22 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
 	}
 }
 
+int wfx_join_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+	struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
+
+	wfx_upload_ap_templates(wvif);
+	wfx_do_join(wvif);
+	return 0;
+}
+
+void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+	struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
+
+	wfx_do_unjoin(wvif);
+}
+
 void wfx_enable_beacon(struct wfx_vif *wvif, bool enable)
 {
 	// Driver has Content After DTIM Beacon in queue. Driver is waiting for
@@ -688,8 +704,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw,
 	if (changed & BSS_CHANGED_BASIC_RATES ||
 	    changed & BSS_CHANGED_BEACON_INT ||
 	    changed & BSS_CHANGED_BSSID) {
-		if (vif->type == NL80211_IFTYPE_STATION ||
-		    vif->type == NL80211_IFTYPE_ADHOC)
+		if (vif->type == NL80211_IFTYPE_STATION)
 			wfx_do_join(wvif);
 	}
 
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 6a4b91a47f5b..3002d89dc871 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -56,6 +56,8 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
+int wfx_join_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
+void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		u16 queue, const struct ieee80211_tx_queue_params *params);
 void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
-- 
2.25.1


  parent reply	other threads:[~2020-04-10 13:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10 13:32 [PATCH 00/19] staging: wfx: simplify start/shutdown of RF Jerome Pouiller
2020-04-10 13:32 ` [PATCH 01/19] staging: wfx: fix race between configure_filter and remove_interface Jerome Pouiller
2020-04-10 13:32 ` [PATCH 02/19] staging: wfx: reduce hold duration of cfg80211_bss Jerome Pouiller
2020-04-10 13:32 ` [PATCH 03/19] staging: wfx: call wfx_do_unjoin() synchronously Jerome Pouiller
2020-04-10 13:32 ` [PATCH 04/19] staging: wfx: implement start_ap/stop_ap Jerome Pouiller
2020-04-10 13:32 ` [PATCH 05/19] staging: wfx: set all parameters before starting AP Jerome Pouiller
2020-04-10 13:32 ` [PATCH 06/19] staging: wfx: change the way the station associate to an AP Jerome Pouiller
2020-04-10 13:32 ` [PATCH 07/19] staging: wfx: remove useless call to wfx_tx_flush() Jerome Pouiller
2020-04-10 13:32 ` [PATCH 08/19] staging: wfx: fix support for BSS_CHANGED_KEEP_ALIVE Jerome Pouiller
2020-04-10 13:32 ` [PATCH 09/19] staging: wfx: disabling keep alive during unjoin is useless Jerome Pouiller
2020-04-10 13:32 ` [PATCH 10/19] staging: wfx: drop unnecessary condition checks in wfx_upload_ap_templates() Jerome Pouiller
2020-04-10 13:32 ` [PATCH 11/19] staging: wfx: request to send beacons in IBSS mode Jerome Pouiller
2020-04-10 13:32 ` [PATCH 12/19] staging: wfx: remove unnecessary conditions in wfx_bss_info_changed() Jerome Pouiller
2020-04-10 13:32 ` [PATCH 13/19] staging: wfx: avoid duplicate updating of beacon template Jerome Pouiller
2020-04-10 13:32 ` [PATCH 14/19] staging: wfx: allow to join IBSS networks Jerome Pouiller
2020-04-10 13:32 ` Jerome Pouiller [this message]
2020-04-10 13:32 ` [PATCH 16/19] staging: wfx: re-enable BA after reset Jerome Pouiller
2020-04-10 13:32 ` [PATCH 17/19] staging: wfx: check value of beacon_int Jerome Pouiller
2020-04-10 13:32 ` [PATCH 18/19] staging: wfx: drop unused attribute 'beacon_int' Jerome Pouiller
2020-04-10 13:32 ` [PATCH 19/19] staging: wfx: drop useless update of macaddr Jerome Pouiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200410133239.438347-16-Jerome.Pouiller@silabs.com \
    --to=jerome.pouiller@silabs.com \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®