aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-03-07 04:26:41 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-16 18:09:36 -0400
commit2c91108c55477334f6854a587ec6e9111d8f1407 (patch)
treecea98b7ea31c0e37508fec8513b4a299409fa556 /drivers/net/wireless/ath5k
parent77dcb6a9526b1e0d159a9300e512c7271bff3163 (diff)
ath5k: constify stuff
Make some structures const to place them in .rodata, since we won't change them. Most important parts of objdump -h: - 0 .text 00011170 + 0 .text 00011140 - 5 .rodata 0000828e + 5 .rodata 0000895e - 13 .data 00000560 + 13 .data 00000110 - 14 .devinit.data 00000260 Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Cc: Luis R. Rodriguez <lrodriguez@atheros.com> Cc: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/attach.c13
-rw-r--r--drivers/net/wireless/ath5k/base.c8
-rw-r--r--drivers/net/wireless/ath5k/debug.c10
-rw-r--r--drivers/net/wireless/ath5k/reset.c2
4 files changed, 16 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath5k/attach.c b/drivers/net/wireless/ath5k/attach.c
index 05bc5cb44e88..656cb9dc833b 100644
--- a/drivers/net/wireless/ath5k/attach.c
+++ b/drivers/net/wireless/ath5k/attach.c
@@ -34,14 +34,14 @@
34static int ath5k_hw_post(struct ath5k_hw *ah) 34static int ath5k_hw_post(struct ath5k_hw *ah)
35{ 35{
36 36
37 int i, c; 37 static const u32 static_pattern[4] = {
38 u16 cur_reg;
39 u16 regs[2] = {AR5K_STA_ID0, AR5K_PHY(8)};
40 u32 var_pattern;
41 u32 static_pattern[4] = {
42 0x55555555, 0xaaaaaaaa, 38 0x55555555, 0xaaaaaaaa,
43 0x66666666, 0x99999999 39 0x66666666, 0x99999999
44 }; 40 };
41 static const u16 regs[2] = { AR5K_STA_ID0, AR5K_PHY(8) };
42 int i, c;
43 u16 cur_reg;
44 u32 var_pattern;
45 u32 init_val; 45 u32 init_val;
46 u32 cur_val; 46 u32 cur_val;
47 47
@@ -106,7 +106,6 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
106{ 106{
107 struct ath5k_hw *ah; 107 struct ath5k_hw *ah;
108 struct pci_dev *pdev = sc->pdev; 108 struct pci_dev *pdev = sc->pdev;
109 u8 mac[ETH_ALEN] = {};
110 int ret; 109 int ret;
111 u32 srev; 110 u32 srev;
112 111
@@ -312,7 +311,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
312 } 311 }
313 312
314 /* MAC address is cleared until add_interface */ 313 /* MAC address is cleared until add_interface */
315 ath5k_hw_set_lladdr(ah, mac); 314 ath5k_hw_set_lladdr(ah, (u8[ETH_ALEN]){});
316 315
317 /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */ 316 /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */
318 memset(ah->ah_bssid, 0xff, ETH_ALEN); 317 memset(ah->ah_bssid, 0xff, ETH_ALEN);
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index f7c424dcac66..f2e5c3936f06 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -79,7 +79,7 @@ MODULE_VERSION("0.6.0 (EXPERIMENTAL)");
79 79
80 80
81/* Known PCI ids */ 81/* Known PCI ids */
82static struct pci_device_id ath5k_pci_id_table[] __devinitdata = { 82static const struct pci_device_id ath5k_pci_id_table[] = {
83 { PCI_VDEVICE(ATHEROS, 0x0207), .driver_data = AR5K_AR5210 }, /* 5210 early */ 83 { PCI_VDEVICE(ATHEROS, 0x0207), .driver_data = AR5K_AR5210 }, /* 5210 early */
84 { PCI_VDEVICE(ATHEROS, 0x0007), .driver_data = AR5K_AR5210 }, /* 5210 */ 84 { PCI_VDEVICE(ATHEROS, 0x0007), .driver_data = AR5K_AR5210 }, /* 5210 */
85 { PCI_VDEVICE(ATHEROS, 0x0011), .driver_data = AR5K_AR5211 }, /* 5311 - this is on AHB bus !*/ 85 { PCI_VDEVICE(ATHEROS, 0x0011), .driver_data = AR5K_AR5211 }, /* 5311 - this is on AHB bus !*/
@@ -103,7 +103,7 @@ static struct pci_device_id ath5k_pci_id_table[] __devinitdata = {
103MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table); 103MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
104 104
105/* Known SREVs */ 105/* Known SREVs */
106static struct ath5k_srev_name srev_names[] = { 106static const struct ath5k_srev_name srev_names[] = {
107 { "5210", AR5K_VERSION_MAC, AR5K_SREV_AR5210 }, 107 { "5210", AR5K_VERSION_MAC, AR5K_SREV_AR5210 },
108 { "5311", AR5K_VERSION_MAC, AR5K_SREV_AR5311 }, 108 { "5311", AR5K_VERSION_MAC, AR5K_SREV_AR5311 },
109 { "5311A", AR5K_VERSION_MAC, AR5K_SREV_AR5311A }, 109 { "5311A", AR5K_VERSION_MAC, AR5K_SREV_AR5311A },
@@ -142,7 +142,7 @@ static struct ath5k_srev_name srev_names[] = {
142 { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN }, 142 { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN },
143}; 143};
144 144
145static struct ieee80211_rate ath5k_rates[] = { 145static const struct ieee80211_rate ath5k_rates[] = {
146 { .bitrate = 10, 146 { .bitrate = 10,
147 .hw_value = ATH5K_RATE_CODE_1M, }, 147 .hw_value = ATH5K_RATE_CODE_1M, },
148 { .bitrate = 20, 148 { .bitrate = 20,
@@ -248,7 +248,7 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
248 struct ieee80211_bss_conf *bss_conf, 248 struct ieee80211_bss_conf *bss_conf,
249 u32 changes); 249 u32 changes);
250 250
251static struct ieee80211_ops ath5k_hw_ops = { 251static const struct ieee80211_ops ath5k_hw_ops = {
252 .tx = ath5k_tx, 252 .tx = ath5k_tx,
253 .start = ath5k_start, 253 .start = ath5k_start,
254 .stop = ath5k_stop, 254 .stop = ath5k_stop,
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c
index 413ed689cd5f..9770bb3d40f9 100644
--- a/drivers/net/wireless/ath5k/debug.c
+++ b/drivers/net/wireless/ath5k/debug.c
@@ -82,14 +82,14 @@ static int ath5k_debugfs_open(struct inode *inode, struct file *file)
82/* debugfs: registers */ 82/* debugfs: registers */
83 83
84struct reg { 84struct reg {
85 char *name; 85 const char *name;
86 int addr; 86 int addr;
87}; 87};
88 88
89#define REG_STRUCT_INIT(r) { #r, r } 89#define REG_STRUCT_INIT(r) { #r, r }
90 90
91/* just a few random registers, might want to add more */ 91/* just a few random registers, might want to add more */
92static struct reg regs[] = { 92static const struct reg regs[] = {
93 REG_STRUCT_INIT(AR5K_CR), 93 REG_STRUCT_INIT(AR5K_CR),
94 REG_STRUCT_INIT(AR5K_RXDP), 94 REG_STRUCT_INIT(AR5K_RXDP),
95 REG_STRUCT_INIT(AR5K_CFG), 95 REG_STRUCT_INIT(AR5K_CFG),
@@ -142,7 +142,7 @@ static struct reg regs[] = {
142 142
143static void *reg_start(struct seq_file *seq, loff_t *pos) 143static void *reg_start(struct seq_file *seq, loff_t *pos)
144{ 144{
145 return *pos < ARRAY_SIZE(regs) ? &regs[*pos] : NULL; 145 return *pos < ARRAY_SIZE(regs) ? (void *)&regs[*pos] : NULL;
146} 146}
147 147
148static void reg_stop(struct seq_file *seq, void *p) 148static void reg_stop(struct seq_file *seq, void *p)
@@ -153,7 +153,7 @@ static void reg_stop(struct seq_file *seq, void *p)
153static void *reg_next(struct seq_file *seq, void *p, loff_t *pos) 153static void *reg_next(struct seq_file *seq, void *p, loff_t *pos)
154{ 154{
155 ++*pos; 155 ++*pos;
156 return *pos < ARRAY_SIZE(regs) ? &regs[*pos] : NULL; 156 return *pos < ARRAY_SIZE(regs) ? (void *)&regs[*pos] : NULL;
157} 157}
158 158
159static int reg_show(struct seq_file *seq, void *p) 159static int reg_show(struct seq_file *seq, void *p)
@@ -290,7 +290,7 @@ static const struct file_operations fops_reset = {
290 290
291/* debugfs: debug level */ 291/* debugfs: debug level */
292 292
293static struct { 293static const struct {
294 enum ath5k_debug_level level; 294 enum ath5k_debug_level level;
295 const char *name; 295 const char *name;
296 const char *desc; 296 const char *desc;
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
index 1531ccd35066..685dc213edae 100644
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -102,7 +102,7 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah,
102 * index into rates for control rates, we can set it up like this because 102 * index into rates for control rates, we can set it up like this because
103 * this is only used for AR5212 and we know it supports G mode 103 * this is only used for AR5212 and we know it supports G mode
104 */ 104 */
105static int control_rates[] = 105static const unsigned int control_rates[] =
106 { 0, 1, 1, 1, 4, 4, 6, 6, 8, 8, 8, 8 }; 106 { 0, 1, 1, 1, 4, 4, 6, 6, 8, 8, 8, 8 };
107 107
108/** 108/**