[OLPC Networking] [PATCH 2/5] libertas: directly include linux headers

Arnd Bergmann arnd at arndb.de
Tue Jul 4 23:10:31 EDT 2006


The current code adds many false dependencies on linux headers
for stuff that is not used by all of the files.

Signed-off-by: Arnd Bergmann <arnd at arndb.de>
Index: libertas/drivers/net/wireless/libertas/wlan_join.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_join.c	2006-07-05 02:34:04.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_join.c	2006-07-05 02:32:37.000000000 +0200
@@ -36,6 +36,12 @@
 
 ************************************************************/
 
+#include <linux/netdevice.h>
+#include <linux/if_arp.h>
+#include <linux/wireless.h>
+
+#include <net/iw_handler.h>
+
 #include    "include.h"
 
 /**
Index: libertas/drivers/net/wireless/libertas/wlan_scan.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_scan.c	2006-07-05 02:34:04.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_scan.c	2006-07-05 02:32:37.000000000 +0200
@@ -35,7 +35,14 @@
 
 ************************************************************/
 
+#include <linux/ctype.h>
+#include <linux/if.h>
+#include <linux/netdevice.h>
+#include <linux/wireless.h>
+
 #include <net/ieee80211.h>
+#include <net/iw_handler.h>
+
 #include    "include.h"
 
 //! Approximate amount of data needed to pass a scan result back to iwlist
Index: libertas/drivers/net/wireless/libertas/wlan_wext.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_wext.c	2006-07-05 02:34:04.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_wext.c	2006-07-05 02:32:37.000000000 +0200
@@ -34,6 +34,14 @@
 		  implementation through generic hostcmd API
 ********************************************************/
 
+#include <linux/ctype.h>
+#include <linux/delay.h>
+#include <linux/if.h>
+#include <linux/if_arp.h>
+#include <linux/wireless.h>
+
+#include <net/iw_handler.h>
+
 #include	"include.h"
 
 #include	"wlan_version.h"
Index: libertas/drivers/net/wireless/libertas/if_usb.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/if_usb.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/if_usb.c	2006-07-05 02:32:37.000000000 +0200
@@ -32,9 +32,12 @@
 	
 ********************************************************/
 
-#include	"if_usb.h"
+#include <linux/delay.h>
+#include <linux/firmware.h>
+#include <linux/netdevice.h>
+#include <linux/usb.h>
 
-#include	<linux/firmware.h>
+#include "if_usb.h"
 
 /* Context definition for Interrupt simulation */
 #define TX_SUCCESS	1
Index: libertas/drivers/net/wireless/libertas/include.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/include.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/include.h	2006-07-05 02:33:42.000000000 +0200
@@ -32,7 +32,6 @@
 #ifndef _INCLUDE_H_
 #define _INCLUDE_H_
 
-#include    "os_headers.h"
 #include    "wlan_defs.h"
 #include    "wlan_thread.h"
 #include "radiotap.h"
Index: libertas/drivers/net/wireless/libertas/os_headers.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/os_headers.h	2006-07-05 01:10:24.000000000 +0200
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,76 +0,0 @@
-/**
-  * (c) Copyright © 2003-2006, Marvell International Ltd. 
-  * All Rights Reserved
-  *
-  * This software file (the "File") is distributed by Marvell International 
-  * Ltd. under the terms of the GNU General Public License Version 2, June 1991 
-  * (the "License").  You may use, redistribute and/or modify this File in 
-  * accordance with the terms and conditions of the License, a copy of which 
-  * is available along with the File in the license.txt file or by writing to 
-  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
-  * 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
-  *
-  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 
-  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 
-  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about 
-  * this warranty disclaimer.
-  *
-  */
-
-#ifndef _OS_HEADERS_H
-#define _OS_HEADERS_H
-
-/* Linux header files */
-#include        <linux/kernel.h>
-#include        <linux/module.h>
-#include        <linux/init.h>
-#include        <linux/version.h>
-#include        <linux/param.h>
-#include        <linux/delay.h>
-#include        <linux/slab.h>
-#include        <linux/mm.h>
-#include        <linux/types.h>
-#include        <linux/sched.h>
-#include        <linux/timer.h>
-#include        <linux/types.h>
-#include        <linux/ioport.h>
-#include        <linux/pci.h>
-#include        <linux/ctype.h>
-#include        <linux/proc_fs.h>
-#include	<linux/ptrace.h>
-#include	<linux/string.h>
-#include	<linux/config.h>
-#include	<linux/ioport.h>
-
-#include	<linux/usb.h>
-
-/* New Code to synchronize between IEEE Power save and PM*/
-#ifdef ENABLE_PM
-#include <linux/pm.h>
-#endif
-
-/* ASM files */
-#include        <asm/semaphore.h>
-#include        <asm/byteorder.h>
-#include        <asm/irq.h>
-#include        <asm/uaccess.h>
-#include        <asm/io.h>
-#include	<asm/system.h>
-
-/* Net header files */
-#include        <linux/wireless.h>
-#include        <linux/netdevice.h>
-#include        <linux/net.h>
-#include        <linux/ip.h>
-#include        <linux/skbuff.h>
-#include        <linux/if_arp.h>
-#include        <linux/if_ether.h>
-#include        <linux/etherdevice.h>
-#include        <net/arp.h>
-#include        <linux/rtnetlink.h>
-
-/* Wireless header */
-#include        <net/iw_handler.h>
-#include        <linux/wireless.h>
-
-#endif
Index: libertas/drivers/net/wireless/libertas/os_macros.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/os_macros.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/os_macros.h	2006-07-05 02:32:37.000000000 +0200
@@ -20,6 +20,9 @@
 #ifndef	_OS_MACROS_H
 #define _OS_MACROS_H
 
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+
 extern spinlock_t driver_lock;
 
 static inline int CopyMulticastAddrs(wlan_adapter * Adapter,
Index: libertas/drivers/net/wireless/libertas/wlan_11d.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_11d.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_11d.c	2006-07-05 02:32:37.000000000 +0200
@@ -18,6 +18,9 @@
   * this warranty disclaimer.
   *
   */
+#include <linux/ctype.h>
+#include <linux/wireless.h>
+
 #include	"include.h"
 
 #define TX_PWR_DEFAULT	10
Index: libertas/drivers/net/wireless/libertas/wlan_11d.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_11d.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_11d.h	2006-07-05 02:32:37.000000000 +0200
@@ -151,6 +151,7 @@
 				 struct HostCmd_DS_COMMAND *cmd, u16 cmdno,
 				 u16 CmdOption);
 
+struct iwreq;
 int wlan_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq);
 
 int wlan_ret_802_11d_domain_info(wlan_private * priv,
Index: libertas/drivers/net/wireless/libertas/wlan_cmd.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_cmd.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_cmd.c	2006-07-05 02:32:37.000000000 +0200
@@ -35,6 +35,8 @@
 	      implementation through generic hostcmd API
 ********************************************************/
 
+#include <net/iw_handler.h>
+
 #include	"include.h"
 
 static u16 Commands_Allowed_In_PS[] = {
Index: libertas/drivers/net/wireless/libertas/wlan_cmdresp.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_cmdresp.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_cmdresp.c	2006-07-05 02:32:37.000000000 +0200
@@ -36,6 +36,12 @@
 	05/08/06: Remove Adapter->PermanentAddr memcpy
 ********************************************************/
 
+#include <linux/delay.h>
+#include <linux/if_arp.h>
+#include <linux/netdevice.h>
+
+#include <net/iw_handler.h>
+
 #include	"include.h"
 
 /** 
Index: libertas/drivers/net/wireless/libertas/wlan_debug.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_debug.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_debug.c	2006-07-05 02:32:37.000000000 +0200
@@ -25,6 +25,8 @@
 	
 ********************************************************/
 
+#include <linux/proc_fs.h>
+
 #include  "include.h"
 
 #define item_size(n) (sizeof ((wlan_adapter *)0)->n)
Index: libertas/drivers/net/wireless/libertas/wlan_decl.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_decl.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_decl.h	2006-07-05 02:32:37.000000000 +0200
@@ -83,6 +83,7 @@
 void reassoc_timer_fn(unsigned long data);
 #endif				/* REASSOCIATION */
 
+struct iw_point;
 int wlan_set_essid(struct net_device *dev, struct iw_request_info *info,
 		   struct iw_point *dwrq, char *extra);
 int wlan_set_regiontable(wlan_private * priv, u8 region, u8 band);
@@ -106,8 +107,6 @@
 
 extern void MacEventDisconnected(wlan_private * priv);
 
-#if WIRELESS_EXT > 14
 void send_iwevcustom_event(wlan_private * priv, s8 * str);
-#endif
 
 #endif				/* _WLAN_DECL_H_ */
Index: libertas/drivers/net/wireless/libertas/wlan_dev.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_dev.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_dev.h	2006-07-05 02:32:37.000000000 +0200
@@ -33,6 +33,9 @@
 #ifndef _WLAN_DEV_H_
 #define _WLAN_DEV_H_
 
+#include <linux/netdevice.h>
+#include <linux/wireless.h>
+
 #define	MAX_BSSID_PER_CHANNEL		16
 
 #define NR_TX_QUEUE			3
Index: libertas/drivers/net/wireless/libertas/wlan_join.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_join.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_join.h	2006-07-05 02:32:37.000000000 +0200
@@ -90,10 +90,12 @@
 extern int wlan_send_deauth(wlan_private * priv);
 
 extern int wlan_do_adhocstop_ioctl(wlan_private * priv);
+struct iwreq;
 extern int wlan_get_assoc_rsp_ioctl(wlan_private * priv, struct iwreq *wrq);
 extern int wlan_set_mrvl_tlv_ioctl(wlan_private * priv, struct iwreq *wrq);
 
 #ifdef __KERNEL__
+struct iw_request_info;
 extern int wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 			struct sockaddr *awrq, char *extra);
 #endif
Index: libertas/drivers/net/wireless/libertas/wlan_main.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_main.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_main.c	2006-07-05 02:32:37.000000000 +0200
@@ -45,6 +45,13 @@
 	02/13/06: Add a patch for USB interoperability issue
 ********************************************************/
 
+#include <linux/delay.h>
+#include <linux/etherdevice.h>
+#include <linux/netdevice.h>
+#include <linux/if_arp.h>
+
+#include <net/iw_handler.h>
+
 #include	"include.h"
 
 #ifdef ENABLE_PM
Index: libertas/drivers/net/wireless/libertas/wlan_proc.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_proc.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_proc.c	2006-07-05 02:32:37.000000000 +0200
@@ -24,6 +24,9 @@
 	01/05/06: Add kernel 2.6.x support	
 	
 ********************************************************/
+
+#include <linux/proc_fs.h>
+
 #include 	"include.h"
 
 static char *szModes[] = {
Index: libertas/drivers/net/wireless/libertas/wlan_rx.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_rx.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_rx.c	2006-07-05 02:32:37.000000000 +0200
@@ -25,6 +25,7 @@
 	
 ********************************************************/
 
+#include <linux/types.h>
 #include	"include.h"
 
 struct Eth803Hdr {
Index: libertas/drivers/net/wireless/libertas/wlan_scan.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_scan.h	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_scan.h	2006-07-05 02:32:37.000000000 +0200
@@ -305,9 +305,13 @@
 extern int wlan_ret_802_11_scan(wlan_private * priv,
 				struct HostCmd_DS_COMMAND *resp);
 
+struct ifreq;
 extern int wlan_extscan_ioctl(wlan_private * priv, struct ifreq *req);
 
 #ifdef __KERNEL__
+struct iw_point;
+struct iw_param;
+struct iw_request_info;
 extern int wlan_get_scan(struct net_device *dev, struct iw_request_info *info,
 			 struct iw_point *dwrq, char *extra);
 extern int wlan_set_scan(struct net_device *dev, struct iw_request_info *info,
Index: libertas/drivers/net/wireless/libertas/wlan_tx.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_tx.c	2006-07-05 01:10:24.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_tx.c	2006-07-05 02:32:37.000000000 +0200
@@ -26,6 +26,8 @@
 	04/06/06: Add TSPEC, queue metrics, and MSDU expiry support
 ********************************************************/
 
+#include <linux/netdevice.h>
+
 #include	"include.h"
 
 /**

--



More information about the Networking mailing list