Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2 1/7] wl12xx: implement change_interface
@ 2011-12-19 10:00 Eliad Peller
  2011-12-19 10:59 ` Luciano Coelho
  0 siblings, 1 reply; 6+ messages in thread
From: Eliad Peller @ 2011-12-19 10:00 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Implement the change_interface callback by simply removing the
current vif and adding a new one after updating the vif type.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v2: update vif->p2p as well

 drivers/net/wireless/wl12xx/main.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index c305841..82fc318 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2269,6 +2269,17 @@ out:
 	cancel_work_sync(&wl->recovery_work);
 }
 
+static int wl12xx_op_change_interface(struct ieee80211_hw *hw,
+				      struct ieee80211_vif *vif,
+				      enum nl80211_iftype new_type, bool p2p)
+{
+	wl1271_op_remove_interface(hw, vif);
+
+	vif->type = ieee80211_iftype_p2p(new_type, p2p);
+	vif->p2p = p2p;
+	return wl1271_op_add_interface(hw, vif);
+}
+
 static int wl1271_join(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 			  bool set_assoc)
 {
@@ -4629,6 +4640,7 @@ static const struct ieee80211_ops wl1271_ops = {
 	.stop = wl1271_op_stop,
 	.add_interface = wl1271_op_add_interface,
 	.remove_interface = wl1271_op_remove_interface,
+	.change_interface = wl12xx_op_change_interface,
 #ifdef CONFIG_PM
 	.suspend = wl1271_op_suspend,
 	.resume = wl1271_op_resume,
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-19 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-19 10:00 [PATCH v2 1/7] wl12xx: implement change_interface Eliad Peller
2011-12-19 10:59 ` Luciano Coelho
2011-12-19 11:17   ` Eliad Peller
2011-12-19 11:37     ` Luciano Coelho
2011-12-19 16:06     ` Johannes Berg
2011-12-19 16:21       ` Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox