[PATCH 03/17] rtl8192e: Add start 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 +
 drivers/staging/rtl8192e/r8192E_core.c         |   29 ++++++++++++-----------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211.h b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
index f5717f9..d100db9 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
@@ -1797,6 +1797,7 @@ typedef enum _HW_VARIABLES{
 struct ieee80211_ops {
 	int (*tx)(struct ieee80211_device *hw, struct sk_buff *skb);
 	int (*config)(struct ieee80211_device *hw, u32 changed);
+	int (*start)(struct ieee80211_device *hw);
 };
 
 struct ieee80211_device {
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index 122f212..2c27baa 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -2512,11 +2512,12 @@ static void rtl8192_hwconfig(struct r8192_priv *priv)
 }
 
 
-static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv)
+static int rtl8192_start(struct ieee80211_device *ieee)
 {
+	struct r8192_priv *priv = ieee80211_priv(ieee->dev);
 	struct net_device *dev = priv->ieee80211->dev;
 	u32 ulRegRead;
-	RT_STATUS rtStatus = RT_STATUS_SUCCESS;
+	RT_STATUS rtStatus;
 	u8 tmpvalue;
 	u8 ICVersion,SwitchingRegulatorOutput;
 	bool bfirmwareok = true;
@@ -2584,7 +2585,7 @@ static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv)
 	if(rtStatus != RT_STATUS_SUCCESS)
 	{
 		RT_TRACE(COMP_ERR, "BB Config failed\n");
-		return rtStatus;
+		return -1;
 	}
 	RT_TRACE(COMP_INIT,"BB Config Finished!\n");
 
@@ -2722,10 +2723,9 @@ static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv)
 	//Firmware download
 	RT_TRACE(COMP_INIT, "Load Firmware!\n");
 	bfirmwareok = init_firmware(priv);
-	if(bfirmwareok != true) {
-		rtStatus = RT_STATUS_FAILURE;
-		return rtStatus;
-	}
+	if(bfirmwareok != true)
+		return -EIO;
+
 	RT_TRACE(COMP_INIT, "Load Firmware finished!\n");
 
 	//RF config
@@ -2736,7 +2736,7 @@ static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv)
 	if(rtStatus != RT_STATUS_SUCCESS)
 	{
 		RT_TRACE(COMP_ERR, "RF Config failed\n");
-			return rtStatus;
+		return -EIO;
 	}
 	RT_TRACE(COMP_INIT, "RF Config Finished!\n");
 	}
@@ -2821,7 +2821,7 @@ static RT_STATUS rtl8192_adapter_start(struct r8192_priv *priv)
 
 	rtl8192_irq_enable(priv);
 	priv->being_init_adapter = false;
-	return rtStatus;
+	return 0;
 
 }
 
@@ -3368,19 +3368,19 @@ void watch_dog_timer_callback(unsigned long data)
 
 static int _rtl8192_up(struct r8192_priv *priv)
 {
-	RT_STATUS init_status = RT_STATUS_SUCCESS;
 	struct net_device *dev = priv->ieee80211->dev;
+	int ret;
 
 	priv->up=1;
 	priv->ieee80211->ieee_up=1;
 	priv->bdisable_nic = false;  //YJ,add,091111
 	RT_TRACE(COMP_INIT, "Bringing up iface\n");
 
-	init_status = rtl8192_adapter_start(priv);
-	if(init_status != RT_STATUS_SUCCESS)
+	ret = rtl8192_start(priv->ieee80211);
+	if (ret < 0)
 	{
 		RT_TRACE(COMP_ERR,"ERR!!! %s(): initialization is failed!\n",__FUNCTION__);
-		return -1;
+		return ret;
 	}
 	RT_TRACE(COMP_INIT, "start adapter finished\n");
 
@@ -4538,6 +4538,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,
+	.start =			rtl8192_start,
 };
 
 static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
@@ -5006,7 +5007,7 @@ bool NicIFEnableNIC(struct r8192_priv *priv)
 
 	// <2> Enable Adapter
 	//priv->bfirst_init = true;
-	init_status = rtl8192_adapter_start(priv);
+	init_status = rtl8192_start(priv->ieee80211);
 	if (init_status != RT_STATUS_SUCCESS) {
 		RT_TRACE(COMP_ERR,"ERR!!! %s(): initialization is failed!\n",__FUNCTION__);
 		priv->bdisable_nic = false;  //YJ,add,091111
-- 
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