Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath5k: clean up base.h and its use

Remove unnecessary includes from base.h. Add includes to other files as
necessary. Don't include base.h unless needed.

Move declarations for functions in base.c from ath5k.h to base.h.

Use a better named define to protect base.h against double inclusion.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Pavel Roskin and committed by
John W. Linville
931be260 d601d9ca

+63 -71
-1
drivers/net/wireless/ath/ath5k/ani.c
··· 15 15 */ 16 16 17 17 #include "ath5k.h" 18 - #include "base.h" 19 18 #include "reg.h" 20 19 #include "debug.h" 21 20 #include "ani.h"
+4
drivers/net/wireless/ath/ath5k/ani.h
··· 16 16 #ifndef ANI_H 17 17 #define ANI_H 18 18 19 + #include "../ath.h" 20 + 21 + enum ath5k_phy_error_code; 22 + 19 23 /* these thresholds are relative to the ATH5K_ANI_LISTEN_PERIOD */ 20 24 #define ATH5K_ANI_LISTEN_PERIOD 100 21 25 #define ATH5K_ANI_OFDM_TRIG_HIGH 500
-34
drivers/net/wireless/ath/ath5k/ath5k.h
··· 287 287 * Common silicon revision/version values 288 288 */ 289 289 290 - enum ath5k_srev_type { 291 - AR5K_VERSION_MAC, 292 - AR5K_VERSION_RAD, 293 - }; 294 - 295 - struct ath5k_srev_name { 296 - const char *sr_name; 297 - enum ath5k_srev_type sr_type; 298 - u_int sr_val; 299 - }; 300 - 301 290 #define AR5K_SREV_UNKNOWN 0xffff 302 291 303 292 #define AR5K_SREV_AR5210 0x00 /* Crete */ ··· 1260 1271 extern const struct ieee80211_ops ath5k_hw_ops; 1261 1272 1262 1273 /* Initialization and detach functions */ 1263 - int ath5k_init_softc(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops); 1264 - void ath5k_deinit_softc(struct ath5k_hw *ah); 1265 1274 int ath5k_hw_init(struct ath5k_hw *ah); 1266 1275 void ath5k_hw_deinit(struct ath5k_hw *ah); 1267 1276 1268 1277 int ath5k_sysfs_register(struct ath5k_hw *ah); 1269 1278 void ath5k_sysfs_unregister(struct ath5k_hw *ah); 1270 1279 1271 - /* base.c */ 1272 - struct ath5k_buf; 1273 - struct ath5k_txq; 1274 - 1275 - void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable); 1276 - bool ath5k_any_vif_assoc(struct ath5k_hw *ah); 1277 - void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, 1278 - struct ath5k_txq *txq); 1279 - int ath5k_start(struct ieee80211_hw *hw); 1280 - void ath5k_stop(struct ieee80211_hw *hw); 1281 - void ath5k_mode_setup(struct ath5k_hw *ah, struct ieee80211_vif *vif); 1282 - void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah, 1283 - struct ieee80211_vif *vif); 1284 - int ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan); 1285 - void ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf); 1286 - int ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 1287 - void ath5k_beacon_config(struct ath5k_hw *ah); 1288 - void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf); 1289 - void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf); 1290 - 1291 1280 /*Chip id helper functions */ 1292 - const char *ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val); 1293 1281 int ath5k_hw_read_srev(struct ath5k_hw *ah); 1294 1282 1295 1283 /* LED functions */
-1
drivers/net/wireless/ath/ath5k/attach.c
··· 25 25 #include "ath5k.h" 26 26 #include "reg.h" 27 27 #include "debug.h" 28 - #include "base.h" 29 28 30 29 /** 31 30 * ath5k_hw_post - Power On Self Test helper function
+3
drivers/net/wireless/ath/ath5k/base.c
··· 52 52 #include <linux/uaccess.h> 53 53 #include <linux/slab.h> 54 54 #include <linux/etherdevice.h> 55 + #include <linux/nl80211.h> 55 56 56 57 #include <net/ieee80211_radiotap.h> 57 58 ··· 62 61 #include "reg.h" 63 62 #include "debug.h" 64 63 #include "ani.h" 64 + #include "ath5k.h" 65 + #include "../regd.h" 65 66 66 67 #define CREATE_TRACE_POINTS 67 68 #include "trace.h"
+43 -12
drivers/net/wireless/ath/ath5k/base.h
··· 38 38 /* 39 39 * Definitions for the Atheros Wireless LAN controller driver. 40 40 */ 41 - #ifndef _DEV_ATH_ATHVAR_H 42 - #define _DEV_ATH_ATHVAR_H 41 + #ifndef _DEV_ATH5K_BASE_H 42 + #define _DEV_ATH5K_BASE_H 43 43 44 - #include <linux/interrupt.h> 45 - #include <linux/list.h> 46 - #include <linux/if_ether.h> 47 - #include <linux/rfkill.h> 48 - #include <linux/workqueue.h> 44 + struct ieee80211_vif; 45 + struct ieee80211_hw; 46 + struct ath5k_hw; 47 + struct ath5k_txq; 48 + struct ieee80211_channel; 49 + struct ath_bus_ops; 50 + enum nl80211_iftype; 49 51 50 - #include "ath5k.h" 51 - #include "../regd.h" 52 - #include "../ath.h" 52 + enum ath5k_srev_type { 53 + AR5K_VERSION_MAC, 54 + AR5K_VERSION_RAD, 55 + }; 56 + 57 + struct ath5k_srev_name { 58 + const char *sr_name; 59 + enum ath5k_srev_type sr_type; 60 + u_int sr_val; 61 + }; 53 62 54 63 struct ath5k_buf { 55 64 struct list_head list; ··· 85 76 enum nl80211_iftype opmode; 86 77 int n_stas; 87 78 }; 88 - void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif); 89 79 80 + void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif); 81 + bool ath5k_any_vif_assoc(struct ath5k_hw *ah); 82 + 83 + int ath5k_start(struct ieee80211_hw *hw); 84 + void ath5k_stop(struct ieee80211_hw *hw); 85 + 86 + void ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf); 87 + int ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 88 + void ath5k_beacon_config(struct ath5k_hw *ah); 89 + void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable); 90 + 91 + void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah, 92 + struct ieee80211_vif *vif); 93 + int ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan); 94 + void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf); 95 + void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf); 96 + void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, 97 + struct ath5k_txq *txq); 98 + 99 + const char *ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val); 100 + 101 + int ath5k_init_softc(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops); 102 + void ath5k_deinit_softc(struct ath5k_hw *ah); 90 103 91 104 /* Check whether BSSID mask is supported */ 92 105 #define ath5k_hw_hasbssidmask(_ah) (ah->ah_version == AR5K_AR5212) ··· 116 85 /* Check whether virtual EOL is supported */ 117 86 #define ath5k_hw_hasveol(_ah) (ah->ah_version != AR5K_AR5210) 118 87 119 - #endif 88 + #endif /* _DEV_ATH5K_BASE_H */
+1 -1
drivers/net/wireless/ath/ath5k/caps.c
··· 24 24 #include "ath5k.h" 25 25 #include "reg.h" 26 26 #include "debug.h" 27 - #include "base.h" 27 + #include "../regd.h" 28 28 29 29 /* 30 30 * Fill the capabilities struct
+6 -9
drivers/net/wireless/ath/ath5k/debug.c
··· 58 58 * THE POSSIBILITY OF SUCH DAMAGES. 59 59 */ 60 60 61 - #include "base.h" 61 + #include <linux/module.h> 62 + #include <linux/seq_file.h> 63 + #include <linux/list.h> 62 64 #include "debug.h" 65 + #include "ath5k.h" 66 + #include "reg.h" 67 + #include "base.h" 63 68 64 69 static unsigned int ath5k_debug; 65 70 module_param_named(debug, ath5k_debug, uint, 0); 66 71 67 - 68 - #ifdef CONFIG_ATH5K_DEBUG 69 - 70 - #include <linux/seq_file.h> 71 - #include "reg.h" 72 - #include "ani.h" 73 72 74 73 static int ath5k_debugfs_open(struct inode *inode, struct file *file) 75 74 { ··· 1030 1031 td->tx_stat.tx_status_0, td->tx_stat.tx_status_1, 1031 1032 done ? ' ' : (ts.ts_status == 0) ? '*' : '!'); 1032 1033 } 1033 - 1034 - #endif /* ifdef CONFIG_ATH5K_DEBUG */
-1
drivers/net/wireless/ath/ath5k/desc.c
··· 24 24 #include "ath5k.h" 25 25 #include "reg.h" 26 26 #include "debug.h" 27 - #include "base.h" 28 27 29 28 30 29 /************************\
-1
drivers/net/wireless/ath/ath5k/dma.c
··· 35 35 #include "ath5k.h" 36 36 #include "reg.h" 37 37 #include "debug.h" 38 - #include "base.h" 39 38 40 39 41 40 /*********\
-1
drivers/net/wireless/ath/ath5k/eeprom.c
··· 26 26 #include "ath5k.h" 27 27 #include "reg.h" 28 28 #include "debug.h" 29 - #include "base.h" 30 29 31 30 32 31 /******************\
-1
drivers/net/wireless/ath/ath5k/gpio.c
··· 23 23 #include "ath5k.h" 24 24 #include "reg.h" 25 25 #include "debug.h" 26 - #include "base.h" 27 26 28 27 /* 29 28 * Set led state
-1
drivers/net/wireless/ath/ath5k/initvals.c
··· 22 22 #include "ath5k.h" 23 23 #include "reg.h" 24 24 #include "debug.h" 25 - #include "base.h" 26 25 27 26 /* 28 27 * Mode-independent initial register writes
-1
drivers/net/wireless/ath/ath5k/led.c
··· 41 41 42 42 #include <linux/pci.h> 43 43 #include "ath5k.h" 44 - #include "base.h" 45 44 46 45 #define ATH_SDEVICE(subv, subd) \ 47 46 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
+2
drivers/net/wireless/ath/ath5k/mac80211-ops.c
··· 41 41 * 42 42 */ 43 43 44 + #include <net/mac80211.h> 44 45 #include <asm/unaligned.h> 45 46 47 + #include "ath5k.h" 46 48 #include "base.h" 47 49 #include "reg.h" 48 50
-1
drivers/net/wireless/ath/ath5k/pcu.c
··· 29 29 #include "ath5k.h" 30 30 #include "reg.h" 31 31 #include "debug.h" 32 - #include "base.h" 33 32 34 33 /* 35 34 * AR5212+ can use higher rates for ack transmission
+1 -1
drivers/net/wireless/ath/ath5k/phy.c
··· 26 26 27 27 #include "ath5k.h" 28 28 #include "reg.h" 29 - #include "base.h" 30 29 #include "rfbuffer.h" 31 30 #include "rfgain.h" 31 + #include "../regd.h" 32 32 33 33 34 34 /******************\
-1
drivers/net/wireless/ath/ath5k/qcu.c
··· 23 23 #include "ath5k.h" 24 24 #include "reg.h" 25 25 #include "debug.h" 26 - #include "base.h" 27 26 28 27 29 28 /******************\
-1
drivers/net/wireless/ath/ath5k/reset.c
··· 30 30 #include <linux/platform_device.h> 31 31 #include "ath5k.h" 32 32 #include "reg.h" 33 - #include "base.h" 34 33 #include "debug.h" 35 34 36 35
+1 -1
drivers/net/wireless/ath/ath5k/rfkill.c
··· 33 33 * THE POSSIBILITY OF SUCH DAMAGES. 34 34 */ 35 35 36 - #include "base.h" 36 + #include "ath5k.h" 37 37 38 38 39 39 static inline void ath5k_rfkill_disable(struct ath5k_hw *ah)
-1
drivers/net/wireless/ath/ath5k/sysfs.c
··· 1 1 #include <linux/device.h> 2 2 #include <linux/pci.h> 3 3 4 - #include "base.h" 5 4 #include "ath5k.h" 6 5 #include "reg.h" 7 6
+2 -1
drivers/net/wireless/ath/ath5k/trace.h
··· 2 2 #define __TRACE_ATH5K_H 3 3 4 4 #include <linux/tracepoint.h> 5 - #include "base.h" 6 5 7 6 #ifndef CONFIG_ATH5K_TRACER 8 7 #undef TRACE_EVENT ··· 10 11 #endif 11 12 12 13 struct sk_buff; 14 + struct ath5k_txq; 15 + struct ath5k_tx_status; 13 16 14 17 #undef TRACE_SYSTEM 15 18 #define TRACE_SYSTEM ath5k