[PATCH 02/17] rtl8192e: Move set_chan function to mac80211 ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Mike McCormack <mikem@xxxxxxxxxx>
---
 drivers/staging/rtl8192e/ieee80211/ieee80211.h     |    1 +
 .../staging/rtl8192e/ieee80211/ieee80211_softmac.c |    6 +++---
 .../rtl8192e/ieee80211/ieee80211_softmac_wx.c      |    2 +-
 drivers/staging/rtl8192e/r8192E_core.c             |   13 +++++++++++++
 4 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211.h b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
index ec45854..f5717f9 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
@@ -1796,6 +1796,7 @@ typedef enum _HW_VARIABLES{
 /* partial clone of mac80211's ieee80211_ops struct */
 struct ieee80211_ops {
 	int (*tx)(struct ieee80211_device *hw, struct sk_buff *skb);
+	int (*config)(struct ieee80211_device *hw, u32 changed);
 };
 
 struct ieee80211_device {
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
index 49c006f..d1a7de5 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
@@ -517,7 +517,7 @@ void ieee80211_softmac_scan_wq(struct work_struct *work)
 #endif
 	if (ieee->scanning == 0 )
 		goto out;
-	ieee->set_chan(ieee, ieee->current_network.channel);
+	ieee->ops->config(ieee, 0);
 #ifdef ENABLE_DOT11D
 	if(channel_map[ieee->current_network.channel] == 1)
 #endif
@@ -2348,7 +2348,7 @@ void ieee80211_start_master_bss(struct ieee80211_device *ieee)
 
 	memcpy(ieee->current_network.bssid, ieee->dev->dev_addr, ETH_ALEN);
 
-	ieee->set_chan(ieee, ieee->current_network.channel);
+	ieee->ops->config(ieee, 0);
 	ieee->state = IEEE80211_LINKED;
 	ieee->link_change(ieee);
 	notify_wx_assoc_event(ieee);
@@ -2467,7 +2467,7 @@ void ieee80211_start_ibss_wq(struct work_struct *work)
 
 	ieee->state = IEEE80211_LINKED;
 
-	ieee->set_chan(ieee, ieee->current_network.channel);
+	ieee->ops->config(ieee, 0);
 	ieee->link_change(ieee);
 
 	notify_wx_assoc_event(ieee);
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c
index d8a068e..7063331 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c
@@ -70,7 +70,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info
 		}
 #endif
 		ieee->current_network.channel = fwrq->m;
-		ieee->set_chan(ieee, ieee->current_network.channel);
+		ieee->ops->config(ieee, 0);
 
 		if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
 			if(ieee->state == IEEE80211_LINKED){
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index 3d0c93c..122f212 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -659,6 +659,18 @@ static void rtl8192_set_chan(struct ieee80211_device *ieee80211, short ch)
 		priv->rf_set_chan(ieee80211, priv->chan);
 }
 
+static int rtl8192_config(struct ieee80211_device *ieee, u32 changed)
+{
+	struct r8192_priv *priv = ieee80211_priv(ieee->dev);
+
+	priv->chan = ieee->current_network.channel;
+
+	if (priv->rf_set_chan)
+		priv->rf_set_chan(ieee, priv->chan);
+
+	return 0;
+}
+
 static void rtl8192_rx_enable(struct r8192_priv *priv)
 {
 	write_nic_dword(priv, RDQDA, priv->rx_ring_dma);
@@ -4525,6 +4537,7 @@ static const struct net_device_ops rtl8192_netdev_ops = {
 
 static const struct ieee80211_ops r8192e_ops = {
 	.tx =				rtl8192_hard_start_xmit,
+	.config = 			rtl8192_config,
 };
 
 static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
-- 
1.7.0.4


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux