[OLPC Networking] [PATCH 3/5] libertas: directly include our own headers

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


Avoid more dependencies that result from including more
headers than necessary.

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 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_join.c	2006-07-05 04:01:57.000000000 +0200
@@ -42,7 +42,10 @@
 
 #include <net/iw_handler.h>
 
-#include    "include.h"
+#include "host.h"
+#include "wlan_decl.h"
+#include "wlan_join.h"
+#include "wlan_dev.h"
 
 /**
  *  @brief This function finds out the common rates between rate1 and rate2.
Index: libertas/drivers/net/wireless/libertas/wlan_scan.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_scan.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_scan.c	2006-07-05 04:01:57.000000000 +0200
@@ -43,7 +43,10 @@
 #include <net/ieee80211.h>
 #include <net/iw_handler.h>
 
-#include    "include.h"
+#include "host.h"
+#include "wlan_decl.h"
+#include "wlan_dev.h"
+#include "wlan_scan.h"
 
 //! Approximate amount of data needed to pass a scan result back to iwlist
 #define MAX_SCAN_CELL_SIZE  (IW_EV_ADDR_LEN             \
Index: libertas/drivers/net/wireless/libertas/wlan_wext.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_wext.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_wext.c	2006-07-05 04:01:57.000000000 +0200
@@ -42,9 +42,14 @@
 
 #include <net/iw_handler.h>
 
-#include	"include.h"
-
-#include	"wlan_version.h"
+#include "host.h"
+#include "radiotap.h"
+#include "wlan_decl.h"
+#include "wlan_defs.h"
+#include "wlan_dev.h"
+#include "wlan_join.h"
+#include "wlan_version.h"
+#include "wlan_wext.h"
 
 #define GETLOG_BUFSIZE  300
 
Index: libertas/drivers/net/wireless/libertas/if_usb.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/if_usb.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/if_usb.c	2006-07-05 04:01:57.000000000 +0200
@@ -38,6 +38,12 @@
 #include <linux/usb.h>
 
 #include "if_usb.h"
+#include "host.h"
+#include "sbi.h"
+#include "wlan_decl.h"
+#include "wlan_defs.h"
+#include "wlan_dev.h"
+#include "os_macros.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 04:01:57.000000000 +0200
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,56 +0,0 @@
-/** @file include.h
-  * 
-  * @brief This file contains all the necessary include file.
-  *  
-  * (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.
-  *
-  */
-/********************************************************
-Change log:
-	10/11/05: Add Doxygen format comments
-	01/11/06: Change compile flag BULVERDE_SDIO to SD to support
-	          Monahans/Zylonite
-	01/11/06: Conditional include file removal/addition
-	01/30/06: Add kernel 2.6 support on GSPI8xxx/Bulverde
-	
-********************************************************/
-
-#ifndef _INCLUDE_H_
-#define _INCLUDE_H_
-
-#include    "wlan_defs.h"
-#include    "wlan_thread.h"
-#include "radiotap.h"
-#include <linux/kernel.h>
-#include    "wlan_types.h"
-
-#include    "wlan_11d.h"
-
-#include    "host.h"
-#include    "hostcmd.h"
-
-#include    "wlan_scan.h"
-#include    "wlan_join.h"
-
-#include    "wlan_dev.h"
-#include    "os_macros.h"
-#include    "sbi.h"
-
-#include    "wlan_fw.h"
-#include    "wlan_wext.h"
-#include    "wlan_decl.h"
-#endif				/* _INCLUDE_H_ */
Index: libertas/drivers/net/wireless/libertas/wlan_11d.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_11d.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_11d.c	2006-07-05 04:01:57.000000000 +0200
@@ -21,7 +21,11 @@
 #include <linux/ctype.h>
 #include <linux/wireless.h>
 
-#include	"include.h"
+#include "host.h"
+#include "wlan_decl.h"
+#include "wlan_11d.h"
+#include "wlan_dev.h"
+#include "wlan_wext.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 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_11d.h	2006-07-05 04:01:57.000000000 +0200
@@ -27,6 +27,9 @@
 #ifndef _WLAN_11D_
 #define _WLAN_11D_
 
+#include "wlan_types.h"
+#include "wlan_defs.h"
+
 #define MAX_CHAN_NUM				255
 
 #define UNIVERSAL_REGION_CODE			0xff
Index: libertas/drivers/net/wireless/libertas/wlan_cmd.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_cmd.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_cmd.c	2006-07-05 04:01:57.000000000 +0200
@@ -37,7 +37,15 @@
 
 #include <net/iw_handler.h>
 
-#include	"include.h"
+#include "host.h"
+#include "hostcmd.h"
+#include "sbi.h"
+#include "wlan_decl.h"
+#include "wlan_defs.h"
+#include "wlan_dev.h"
+#include "wlan_join.h"
+#include "wlan_wext.h"
+#include "os_macros.h"
 
 static u16 Commands_Allowed_In_PS[] = {
 	HostCmd_CMD_802_11_RSSI,
Index: libertas/drivers/net/wireless/libertas/wlan_cmdresp.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_cmdresp.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_cmdresp.c	2006-07-05 04:01:57.000000000 +0200
@@ -42,7 +42,13 @@
 
 #include <net/iw_handler.h>
 
-#include	"include.h"
+#include "host.h"
+#include "sbi.h"
+#include "wlan_decl.h"
+#include "wlan_defs.h"
+#include "wlan_dev.h"
+#include "wlan_join.h"
+#include "wlan_wext.h"
 
 /** 
  *  @brief This function handles disconnect event. it
Index: libertas/drivers/net/wireless/libertas/wlan_decl.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_decl.h	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_decl.h	2006-07-05 04:01:57.000000000 +0200
@@ -32,7 +32,13 @@
 #ifndef _WLAN_DECL_H_
 #define _WLAN_DECL_H_
 
+#include "wlan_defs.h"
+
 /** Function Prototype Declaration */
+struct wlan_private;
+struct sk_buff;
+struct net_device;
+
 int wlan_tx_packet(wlan_private * priv, struct sk_buff *skb);
 void wlan_free_adapter(wlan_private * priv);
 int SetMacPacketFilter(wlan_private * priv);
@@ -43,6 +49,7 @@
 
 void Wep_encrypt(wlan_private * priv, u8 * Buf, u32 Len);
 int FreeCmdBuffer(wlan_private * priv);
+struct CmdCtrlNode;
 void CleanUpCmdCtrlNode(struct CmdCtrlNode *pTempNode);
 struct CmdCtrlNode *GetFreeCmdCtrlNode(wlan_private * priv);
 
@@ -84,6 +91,7 @@
 #endif				/* REASSOCIATION */
 
 struct iw_point;
+struct iw_request_info;
 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);
Index: libertas/drivers/net/wireless/libertas/wlan_dev.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_dev.h	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_dev.h	2006-07-05 04:01:57.000000000 +0200
@@ -36,6 +36,10 @@
 #include <linux/netdevice.h>
 #include <linux/wireless.h>
 
+#include "wlan_defs.h"
+#include "wlan_scan.h"
+#include "wlan_thread.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 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_join.h	2006-07-05 04:01:57.000000000 +0200
@@ -37,9 +37,12 @@
 #ifndef _WLAN_JOIN_H
 #define _WLAN_JOIN_H
 
+#include "wlan_defs.h"
+
 //! Size of buffer allocated to store the association response from firmware
 #define MRVDRV_ASSOC_RSP_BUF_SIZE 500
 
+struct HostCmd_DS_COMMAND;
 extern int wlan_cmd_802_11_authenticate(wlan_private * priv,
 					struct HostCmd_DS_COMMAND *cmd,
 					void *pdata_buf);
@@ -73,6 +76,7 @@
 extern int wlan_ret_802_11_associate(wlan_private * priv,
 				     struct HostCmd_DS_COMMAND *resp);
 
+struct bss_descriptor;
 extern int wlan_associate(wlan_private * priv, struct bss_descriptor *pBSSDesc);
 
 extern int wlanidle_on(wlan_private * priv);
@@ -81,6 +85,7 @@
 extern int wlan_do_adhocstop_ioctl(wlan_private * priv);
 extern int wlan_reassociation_thread(void *data);
 
+struct WLAN_802_11_SSID;
 extern int StartAdhocNetwork(wlan_private * priv,
 			     struct WLAN_802_11_SSID *AdhocSSID);
 extern int JoinAdhocNetwork(wlan_private * priv, struct bss_descriptor *pBSSDesc);
Index: libertas/drivers/net/wireless/libertas/wlan_main.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_main.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_main.c	2006-07-05 04:01:57.000000000 +0200
@@ -52,7 +52,13 @@
 
 #include <net/iw_handler.h>
 
-#include	"include.h"
+#include "host.h"
+#include "sbi.h"
+#include "wlan_decl.h"
+#include "wlan_dev.h"
+#include "wlan_fw.h"
+#include "wlan_wext.h"
+#include "os_macros.h"
 
 #ifdef ENABLE_PM
 static struct pm_dev *wlan_pm_dev = NULL;
Index: libertas/drivers/net/wireless/libertas/wlan_proc.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_proc.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_proc.c	2006-07-05 04:01:57.000000000 +0200
@@ -26,8 +26,11 @@
 ********************************************************/
 
 #include <linux/proc_fs.h>
+#include <linux/netdevice.h>
 
-#include 	"include.h"
+#include "wlan_decl.h"
+#include "wlan_defs.h"
+#include "wlan_dev.h"
 
 static char *szModes[] = {
 	"Ad-hoc",
Index: libertas/drivers/net/wireless/libertas/wlan_rx.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_rx.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_rx.c	2006-07-05 04:01:57.000000000 +0200
@@ -26,7 +26,13 @@
 ********************************************************/
 
 #include <linux/types.h>
-#include	"include.h"
+
+#include "hostcmd.h"
+#include "radiotap.h"
+#include "wlan_decl.h"
+#include "wlan_dev.h"
+#include "wlan_wext.h"
+#include "os_macros.h"
 
 struct Eth803Hdr {
 	u8 dest_addr[6];
Index: libertas/drivers/net/wireless/libertas/wlan_scan.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_scan.h	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_scan.h	2006-07-05 04:01:57.000000000 +0200
@@ -36,6 +36,8 @@
 #ifndef _WLAN_SCAN_H
 #define _WLAN_SCAN_H
 
+#include "hostcmd.h"
+
 /**
  *  @brief Maximum number of channels that can be sent in a setuserscan ioctl
  *
Index: libertas/drivers/net/wireless/libertas/wlan_tx.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_tx.c	2006-07-05 04:01:57.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_tx.c	2006-07-05 04:01:57.000000000 +0200
@@ -28,7 +28,14 @@
 
 #include <linux/netdevice.h>
 
-#include	"include.h"
+#include "hostcmd.h"
+#include "radiotap.h"
+#include "sbi.h"
+#include "wlan_decl.h"
+#include "wlan_defs.h"
+#include "wlan_dev.h"
+#include "wlan_wext.h"
+#include "os_macros.h"
 
 /**
  *  @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE 
Index: libertas/drivers/net/wireless/libertas/hostcmd.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/hostcmd.h	2006-07-05 04:01:54.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/hostcmd.h	2006-07-05 04:02:00.000000000 +0200
@@ -34,6 +34,9 @@
 #ifndef __HOSTCMD__H
 #define __HOSTCMD__H
 
+#include "wlan_11d.h"
+#include "wlan_types.h"
+
 /* 802.11-related definitions */
 
 /* TxPD descriptor */
Index: libertas/drivers/net/wireless/libertas/if_usb.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/if_usb.h	2006-07-05 04:01:54.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/if_usb.h	2006-07-05 04:02:00.000000000 +0200
@@ -25,8 +25,6 @@
 	
 ********************************************************/
 
-#include	"include.h"
-
 #define CMD_TYPE_REQUEST                0xF00DFACE
 #define CMD_TYPE_DATA                   0xBEADC0DE
 #define CMD_TYPE_INDICATION             0xBEEFFACE
Index: libertas/drivers/net/wireless/libertas/sbi.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/sbi.h	2006-07-05 04:01:54.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/sbi.h	2006-07-05 04:02:00.000000000 +0200
@@ -29,6 +29,10 @@
 #ifndef	_SBI_H_
 #define	_SBI_H_
 
+#include <linux/interrupt.h>
+
+#include "wlan_defs.h"
+
 /**Bit Definition*/
 #define B_BIT_0		0x01
 #define B_BIT_1		0x02
Index: libertas/drivers/net/wireless/libertas/wlan_fw.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_fw.c	2006-07-05 04:01:54.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_fw.c	2006-07-05 04:02:00.000000000 +0200
@@ -37,7 +37,13 @@
 #include <linux/firmware.h>
 #include <linux/version.h>
 
-#include "include.h"
+#include "host.h"
+#include "sbi.h"
+#include "wlan_defs.h"
+#include "wlan_decl.h"
+#include "wlan_dev.h"
+#include "wlan_fw.h"
+#include "wlan_wext.h"
 
 char *fw_name = NULL;
 
Index: libertas/drivers/net/wireless/libertas/wlan_types.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_types.h	2006-07-05 04:01:54.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_types.h	2006-07-05 04:02:00.000000000 +0200
@@ -31,6 +31,8 @@
 #ifndef _WLAN_TYPES_
 #define _WLAN_TYPES_
 
+#include <linux/if_ether.h>
+
 /** IEEE Type definitions  */
 enum IEEEtypes_ElementId {
 	SSID = 0,

--



More information about the Networking mailing list