[PATCH 08/17] rtl8192e: Alloc and free ieee structs not net_devices

[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     |    9 +++++----
 .../staging/rtl8192e/ieee80211/ieee80211_module.c  |    8 ++++----
 drivers/staging/rtl8192e/r8192E_core.c             |   14 ++++++++------
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211.h b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
index 9b0e438..6b11a97 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h
@@ -299,8 +299,8 @@ enum	_ReasonCode{
 
 #define ieee80211_wep_null		ieee80211_wep_null_rsl
 
-#define free_ieee80211          	free_ieee80211_rsl
-#define alloc_ieee80211        		alloc_ieee80211_rsl
+#define ieee80211_free_hw		ieee80211_free_hw_rsl
+#define ieee80211_alloc_hw		ieee80211_alloc_hw_rsl
 
 #define ieee80211_rx 			ieee80211_rx_rsl
 #define ieee80211_rx_mgt		ieee80211_rx_mgt_rsl
@@ -2371,8 +2371,9 @@ static inline int ieee80211_is_cck_rate(u8 rate)
 
 
 /* ieee80211.c */
-void free_ieee80211(struct net_device *dev);
-struct net_device *alloc_ieee80211(int sizeof_priv, const struct ieee80211_ops *ops);
+struct ieee80211_device *ieee80211_alloc_hw(int sizeof_priv,
+					    const struct ieee80211_ops *ops);
+void ieee80211_free_hw(struct ieee80211_device *ieee);
 
 int ieee80211_set_encryption(struct ieee80211_device *ieee);
 
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
index e182e27..c2c518d 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
@@ -95,7 +95,7 @@ static inline void ieee80211_networks_initialize(struct ieee80211_device *ieee)
 }
 
 
-struct net_device *alloc_ieee80211(int sizeof_priv, const struct ieee80211_ops *ops)
+struct ieee80211_device *ieee80211_alloc_hw(int sizeof_priv, const struct ieee80211_ops *ops)
 {
 	struct ieee80211_device *ieee;
 	struct net_device *dev;
@@ -186,7 +186,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv, const struct ieee80211_ops *
 	ieee80211_wep_null();
 	ieee80211_ccmp_null();
 
-	return dev;
+	return ieee;
 
 failed:
 	if (dev) {
@@ -198,9 +198,9 @@ failed:
 }
 
 
-void free_ieee80211(struct net_device *dev)
+void ieee80211_free_hw(struct ieee80211_device *ieee)
 {
-	struct ieee80211_device *ieee = netdev_priv(dev);
+	struct net_device *dev = ieee->dev;
 	int i;
 	kfree(ieee->pHTInfo);
 	ieee->pHTInfo = NULL;
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index 28f4ffa..6956748 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -4541,6 +4541,7 @@ static const struct ieee80211_ops r8192e_ops = {
 static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
 			 const struct pci_device_id *id)
 {
+	struct ieee80211_device *ieee = NULL;
 	struct net_device *dev = NULL;
 	struct r8192_priv *priv= NULL;
 	u8 unit = 0;
@@ -4558,16 +4559,17 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
 	//pci_set_wmi(pdev);
 	pci_set_dma_mask(pdev, 0xffffff00ULL);
 	pci_set_consistent_dma_mask(pdev,0xffffff00ULL);
-	dev = alloc_ieee80211(sizeof *priv, &r8192e_ops);
-	if (!dev) {
+	ieee = ieee80211_alloc_hw(sizeof(*priv), &r8192e_ops);
+	if (!ieee) {
 		ret = -ENOMEM;
 		goto fail_free;
 	}
 
+	dev = ieee->dev;
 	pci_set_drvdata(pdev, dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
-	priv = ieee80211_priv(dev);
-	priv->ieee80211 = netdev_priv(dev);
+	priv = ieee->priv;
+	priv->ieee80211 = ieee;
 	priv->pdev=pdev;
 	if((pdev->subsystem_vendor == PCI_VENDOR_ID_DLINK)&&(pdev->subsystem_device == 0x3304)){
 		priv->ieee80211->bSupportRemoteWakeUp = 1;
@@ -4654,7 +4656,7 @@ fail:
 			free_irq(priv->irq, priv);
 			priv->irq = 0;
 		}
-		free_ieee80211(dev);
+		ieee80211_free_hw(ieee);
 	}
 
 fail_free:
@@ -4724,7 +4726,7 @@ static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev)
 					    pci_resource_len(pdev, 1) );
 		}
 
-		free_ieee80211(dev);
+		ieee80211_free_hw(priv->ieee80211);
 	}
 
 	pci_disable_device(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