Skip to contentSkip to conversation

w35und: remove unused struct net_dev

PATCH Pavel Machek 1 participant 1 message Apr 19, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

remove unused struct net_dev.

---
commit 192dfca4d5a025bd7d14ba1284897e0108a1cee6
tree 3ca911f2fa4a8fbd5e6f4288691e982fb5d3cc7f
parent 08118c99165a5e6c0f6f9e5730175a0708b93b0d
author Pavel <[email protected]> Sat, 19 Apr 2008 15:35:08 +0200 committer Pavel <[email protected]> Sat, 19 Apr 2008 15:35:08 +0200

 .../net/wireless/winbond/winbondport/linux/wbusb.c |   51 +++-------
 drivers/net/wireless/winbond/winbondport/wblinux.c |  114 +-------------------
 .../net/wireless/winbond/winbondport/wblinux_s.h   |    5 -
 3 files changed, 17 insertions(+), 153 deletions(-)
drivers/net/wireless/winbond/winbondport/linux/wbusb.c +14 -37
index 500e5bf..d883873 100644
@@ -1,4 +1,8 @@
-
+/*
+ * Copyright 2008 Pavel Machek <[email protected]>
+ *
+ * Distribute under GPLv2.
+ */
 #include "sysdef.h"
 #include <net/mac80211.h>
 
@@ -208,7 +212,6 @@ int wb35_probe(struct usb_interface *int
 	PADAPTER	Adapter;
 	PWBLINUX	pWbLinux;
 	PWBUSB		pWbUsb;
-	struct net_device *netdev = NULL;
         struct usb_host_interface *interface;
 	struct usb_endpoint_descriptor *endpoint;
 	int	i, ret = -1;
@@ -245,21 +248,11 @@ int wb35_probe(struct usb_interface *int
 		if (ltmp)  // Is already initialized?
 			break;
 
-		netdev = alloc_etherdev( sizeof(ADAPTER) );
-
-		if (!netdev) {
-			printk("[w35und]init_etherdev out of memory\n");
-			module_put(THIS_MODULE);
-			break;
-		}
 
-		// Clear out the adapter block, which sets all default values to FALSE, or NULL.
-		Adapter = netdev_priv(netdev);
+		Adapter = kzalloc(sizeof(ADAPTER), GFP_KERNEL);
 
-		memset(Adapter, 0, sizeof(ADAPTER));
 		my_adapter = Adapter;
 		pWbLinux = &Adapter->WbLinux;
-		pWbLinux->netdev = netdev;
 		pWbUsb = &Adapter->sHwData.WbUsb;
 		pWbUsb->udev = udev;
 
@@ -276,24 +269,6 @@ int wb35_probe(struct usb_interface *int
 			break;
 		}
 
-		// Set MAC Address
-		{
-			phw_data_t pHwData = &Adapter->sHwData;
-			hal_get_permanent_address(pHwData, netdev->dev_addr);
-		}
-
-		//Moved later, to make possible the changing of MAC
-		//Needs some more work
-		dev_alloc_name(netdev, "wlan%d");
-		SET_NETDEV_DEV(netdev, &intf->dev);
-
-#if 0
-		if (register_netdev(netdev)) {
-			printk("w35und: couldn't register the netdev!\n");
-			break;
-		}
-#endif
-
 		{
 			struct wbsoft_priv *priv;
 			struct ieee80211_hw *dev;
@@ -309,7 +284,13 @@ #endif
 			my_dev = dev;
 
 			SET_IEEE80211_DEV(dev, &udev->dev);
-			SET_IEEE80211_PERM_ADDR(dev, netdev->dev_addr);
+			{
+				phw_data_t pHwData = &Adapter->sHwData;
+				unsigned char		dev_addr[MAX_ADDR_LEN];
+				hal_get_permanent_address(pHwData, dev_addr);
+				SET_IEEE80211_PERM_ADDR(dev, dev_addr);	
+			}
+
 
 			dev->extra_tx_headroom = 12;	/* FIXME */
 			dev->flags = IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED;
@@ -317,7 +298,7 @@ #endif
 			dev->channel_change_time = 1000;
 			dev->max_rssi = 100;
 
-			dev->queues = 1; /* ADM8211C supports more, maybe ADM8211B too */
+			dev->queues = 1;
 
 			wbsoft_modes[0].num_channels = 1;
 			wbsoft_modes[0].channels = wbsoft_channels;
@@ -339,8 +320,6 @@ #endif
 
 	} while(FALSE);
 
-	if (netdev)
-		free_netdev(netdev);
 	return -ENOMEM;
 }
 
@@ -410,8 +389,6 @@ void wb35_disconnect(struct usb_interfac
 	// Card remove
 	WbWlanHalt(Adapter);
 
-	if (pWbLinux->netdev)
-		free_netdev(pWbLinux->netdev);
 }
 
 
drivers/net/wireless/winbond/winbondport/wblinux.c +3 -111

137 lines not on this page · raw message

drivers/net/wireless/winbond/winbondport/wblinux_s.h +0 -5
index 613421a..5f483b7 100644
@@ -29,13 +29,8 @@ typedef struct _WBLINUX
 	OS_SPIN_LOCK	SpinLock;
 	u32	shutdown;
 
-	// For storing the 802.3 NDIS packet
-	struct net_device_stats 	stats;
-
 	OS_ATOMIC	ThreadCount;
 
-	struct net_device *netdev;
-
 	u32	LinkStatus;		// OS_DISCONNECTED or OS_CONNECTED
 
 	u32	RxByteCount;
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html