aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2010-10-29 16:44:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:25:29 -0500
commit3f1240e4f4b249f2388903864bdc766973f76687 (patch)
tree3882032c63054c976877cf4c485f4f25adda08f0 /drivers/net
parentbdd7bd16439975133d36bcd7c9c489302a114525 (diff)
carl9170: import hw/fw header updates
This patch imports all shared header changes from carl9170fw.git. * add some strategic __aligned(4). This allows the compiler generate optimized code for architectures which can't access (unaligned/packed) data efficiently. ("ath9k_hw: optimize all descriptor access functions") * add a forgotten __CARL9170FW__ ifdef around a private firmware-internal struct. * GET_VAL macro helper Very useful for extracting data out of the bit-packed PHY registers. * cosmetic changes e.g.: _CCA_MINCCA_ to just _CCA_MIN_. * version bump 1.8.8.3 -> 1.9.0. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/carl9170/fwcmd.h13
-rw-r--r--drivers/net/wireless/ath/carl9170/hw.h7
-rw-r--r--drivers/net/wireless/ath/carl9170/phy.h24
-rw-r--r--drivers/net/wireless/ath/carl9170/version.h6
4 files changed, 30 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/carl9170/fwcmd.h b/drivers/net/wireless/ath/carl9170/fwcmd.h
index d552166db505..3680dfc70f46 100644
--- a/drivers/net/wireless/ath/carl9170/fwcmd.h
+++ b/drivers/net/wireless/ath/carl9170/fwcmd.h
@@ -97,13 +97,13 @@ struct carl9170_set_key_cmd {
97 __le16 type; 97 __le16 type;
98 u8 macAddr[6]; 98 u8 macAddr[6];
99 u32 key[4]; 99 u32 key[4];
100} __packed; 100} __packed __aligned(4);
101#define CARL9170_SET_KEY_CMD_SIZE 28 101#define CARL9170_SET_KEY_CMD_SIZE 28
102 102
103struct carl9170_disable_key_cmd { 103struct carl9170_disable_key_cmd {
104 __le16 user; 104 __le16 user;
105 __le16 padding; 105 __le16 padding;
106} __packed; 106} __packed __aligned(4);
107#define CARL9170_DISABLE_KEY_CMD_SIZE 4 107#define CARL9170_DISABLE_KEY_CMD_SIZE 4
108 108
109struct carl9170_u32_list { 109struct carl9170_u32_list {
@@ -206,7 +206,7 @@ struct carl9170_cmd {
206 struct carl9170_rx_filter_cmd rx_filter; 206 struct carl9170_rx_filter_cmd rx_filter;
207 u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN]; 207 u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN];
208 } __packed; 208 } __packed;
209} __packed; 209} __packed __aligned(4);
210 210
211#define CARL9170_TX_STATUS_QUEUE 3 211#define CARL9170_TX_STATUS_QUEUE 3
212#define CARL9170_TX_STATUS_QUEUE_S 0 212#define CARL9170_TX_STATUS_QUEUE_S 0
@@ -216,6 +216,7 @@ struct carl9170_cmd {
216#define CARL9170_TX_STATUS_TRIES (7 << CARL9170_TX_STATUS_TRIES_S) 216#define CARL9170_TX_STATUS_TRIES (7 << CARL9170_TX_STATUS_TRIES_S)
217#define CARL9170_TX_STATUS_SUCCESS 0x80 217#define CARL9170_TX_STATUS_SUCCESS 0x80
218 218
219#ifdef __CARL9170FW__
219/* 220/*
220 * NOTE: 221 * NOTE:
221 * Both structs [carl9170_tx_status and _carl9170_tx_status] 222 * Both structs [carl9170_tx_status and _carl9170_tx_status]
@@ -232,6 +233,8 @@ struct carl9170_tx_status {
232 u8 tries:3; 233 u8 tries:3;
233 u8 success:1; 234 u8 success:1;
234} __packed; 235} __packed;
236#endif /* __CARL9170FW__ */
237
235struct _carl9170_tx_status { 238struct _carl9170_tx_status {
236 /* 239 /*
237 * This version should be immune to all alignment bugs. 240 * This version should be immune to all alignment bugs.
@@ -272,13 +275,15 @@ struct carl9170_rsp {
272 struct carl9170_rf_init_result rf_init_res; 275 struct carl9170_rf_init_result rf_init_res;
273 struct carl9170_u32_list rreg_res; 276 struct carl9170_u32_list rreg_res;
274 struct carl9170_u32_list echo; 277 struct carl9170_u32_list echo;
278#ifdef __CARL9170FW__
275 struct carl9170_tx_status tx_status[0]; 279 struct carl9170_tx_status tx_status[0];
280#endif /* __CARL9170FW__ */
276 struct _carl9170_tx_status _tx_status[0]; 281 struct _carl9170_tx_status _tx_status[0];
277 struct carl9170_gpio gpio; 282 struct carl9170_gpio gpio;
278 struct carl9170_tsf_rsp tsf; 283 struct carl9170_tsf_rsp tsf;
279 struct carl9170_psm psm; 284 struct carl9170_psm psm;
280 u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN]; 285 u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN];
281 } __packed; 286 } __packed;
282} __packed; 287} __packed __aligned(4);
283 288
284#endif /* __CARL9170_SHARED_FWCMD_H */ 289#endif /* __CARL9170_SHARED_FWCMD_H */
diff --git a/drivers/net/wireless/ath/carl9170/hw.h b/drivers/net/wireless/ath/carl9170/hw.h
index 2f471b3f05af..e85df6edfed3 100644
--- a/drivers/net/wireless/ath/carl9170/hw.h
+++ b/drivers/net/wireless/ath/carl9170/hw.h
@@ -712,7 +712,8 @@ struct ar9170_stream {
712 __le16 tag; 712 __le16 tag;
713 713
714 u8 payload[0]; 714 u8 payload[0];
715}; 715} __packed __aligned(4);
716#define AR9170_STREAM_LEN 4
716 717
717#define AR9170_MAX_ACKTABLE_ENTRIES 8 718#define AR9170_MAX_ACKTABLE_ENTRIES 8
718#define AR9170_MAX_VIRTUAL_MAC 7 719#define AR9170_MAX_VIRTUAL_MAC 7
@@ -736,4 +737,8 @@ struct ar9170_stream {
736 737
737#define MOD_VAL(reg, value, newvalue) \ 738#define MOD_VAL(reg, value, newvalue) \
738 (((value) & ~reg) | (((newvalue) << reg##_S) & reg)) 739 (((value) & ~reg) | (((newvalue) << reg##_S) & reg))
740
741#define GET_VAL(reg, value) \
742 (((value) & reg) >> reg##_S)
743
739#endif /* __CARL9170_SHARED_HW_H */ 744#endif /* __CARL9170_SHARED_HW_H */
diff --git a/drivers/net/wireless/ath/carl9170/phy.h b/drivers/net/wireless/ath/carl9170/phy.h
index 02c34eb4ebde..024fb42bc787 100644
--- a/drivers/net/wireless/ath/carl9170/phy.h
+++ b/drivers/net/wireless/ath/carl9170/phy.h
@@ -139,8 +139,8 @@
139#define AR9170_PHY_AGC_CONTROL_NO_UPDATE_NF 0x00020000 139#define AR9170_PHY_AGC_CONTROL_NO_UPDATE_NF 0x00020000
140 140
141#define AR9170_PHY_REG_CCA (AR9170_PHY_REG_BASE + 0x0064) 141#define AR9170_PHY_REG_CCA (AR9170_PHY_REG_BASE + 0x0064)
142#define AR9170_PHY_CCA_MINCCA_PWR 0x0ff80000 142#define AR9170_PHY_CCA_MIN_PWR 0x0ff80000
143#define AR9170_PHY_CCA_MINCCA_PWR_S 19 143#define AR9170_PHY_CCA_MIN_PWR_S 19
144#define AR9170_PHY_CCA_THRESH62 0x0007f000 144#define AR9170_PHY_CCA_THRESH62 0x0007f000
145#define AR9170_PHY_CCA_THRESH62_S 12 145#define AR9170_PHY_CCA_THRESH62_S 12
146 146
@@ -338,8 +338,8 @@
338#define AR9170_PHY_EXT_CCA_CYCPWR_THR1_S 9 338#define AR9170_PHY_EXT_CCA_CYCPWR_THR1_S 9
339#define AR9170_PHY_EXT_CCA_THRESH62 0x007f0000 339#define AR9170_PHY_EXT_CCA_THRESH62 0x007f0000
340#define AR9170_PHY_EXT_CCA_THRESH62_S 16 340#define AR9170_PHY_EXT_CCA_THRESH62_S 16
341#define AR9170_PHY_EXT_MINCCA_PWR 0xff800000 341#define AR9170_PHY_EXT_CCA_MIN_PWR 0xff800000
342#define AR9170_PHY_EXT_MINCCA_PWR_S 23 342#define AR9170_PHY_EXT_CCA_MIN_PWR_S 23
343 343
344#define AR9170_PHY_REG_SFCORR_EXT (AR9170_PHY_REG_BASE + 0x01c0) 344#define AR9170_PHY_REG_SFCORR_EXT (AR9170_PHY_REG_BASE + 0x01c0)
345#define AR9170_PHY_SFCORR_EXT_M1_THRESH 0x0000007f 345#define AR9170_PHY_SFCORR_EXT_M1_THRESH 0x0000007f
@@ -546,19 +546,19 @@
546#define AR9170_PHY_FORCE_XPA_CFG_S 0 546#define AR9170_PHY_FORCE_XPA_CFG_S 0
547 547
548#define AR9170_PHY_REG_CH1_CCA (AR9170_PHY_REG_BASE + 0x1064) 548#define AR9170_PHY_REG_CH1_CCA (AR9170_PHY_REG_BASE + 0x1064)
549#define AR9170_PHY_CH1_MINCCA_PWR 0x0ff80000 549#define AR9170_PHY_CH1_CCA_MIN_PWR 0x0ff80000
550#define AR9170_PHY_CH1_MINCCA_PWR_S 19 550#define AR9170_PHY_CH1_CCA_MIN_PWR_S 19
551 551
552#define AR9170_PHY_REG_CH2_CCA (AR9170_PHY_REG_BASE + 0x2064) 552#define AR9170_PHY_REG_CH2_CCA (AR9170_PHY_REG_BASE + 0x2064)
553#define AR9170_PHY_CH2_MINCCA_PWR 0x0ff80000 553#define AR9170_PHY_CH2_CCA_MIN_PWR 0x0ff80000
554#define AR9170_PHY_CH2_MINCCA_PWR_S 19 554#define AR9170_PHY_CH2_CCA_MIN_PWR_S 19
555 555
556#define AR9170_PHY_REG_CH1_EXT_CCA (AR9170_PHY_REG_BASE + 0x11bc) 556#define AR9170_PHY_REG_CH1_EXT_CCA (AR9170_PHY_REG_BASE + 0x11bc)
557#define AR9170_PHY_CH1_EXT_MINCCA_PWR 0xff800000 557#define AR9170_PHY_CH1_EXT_CCA_MIN_PWR 0xff800000
558#define AR9170_PHY_CH1_EXT_MINCCA_PWR_S 23 558#define AR9170_PHY_CH1_EXT_CCA_MIN_PWR_S 23
559 559
560#define AR9170_PHY_REG_CH2_EXT_CCA (AR9170_PHY_REG_BASE + 0x21bc) 560#define AR9170_PHY_REG_CH2_EXT_CCA (AR9170_PHY_REG_BASE + 0x21bc)
561#define AR9170_PHY_CH2_EXT_MINCCA_PWR 0xff800000 561#define AR9170_PHY_CH2_EXT_CCA_MIN_PWR 0xff800000
562#define AR9170_PHY_CH2_EXT_MINCCA_PWR_S 23 562#define AR9170_PHY_CH2_EXT_CCA_MIN_PWR_S 23
563 563
564#endif /* __CARL9170_SHARED_PHY_H */ 564#endif /* __CARL9170_SHARED_PHY_H */
diff --git a/drivers/net/wireless/ath/carl9170/version.h b/drivers/net/wireless/ath/carl9170/version.h
index ff53f078a0b5..ee0f84f2a2f6 100644
--- a/drivers/net/wireless/ath/carl9170/version.h
+++ b/drivers/net/wireless/ath/carl9170/version.h
@@ -1,7 +1,7 @@
1#ifndef __CARL9170_SHARED_VERSION_H 1#ifndef __CARL9170_SHARED_VERSION_H
2#define __CARL9170_SHARED_VERSION_H 2#define __CARL9170_SHARED_VERSION_H
3#define CARL9170FW_VERSION_YEAR 10 3#define CARL9170FW_VERSION_YEAR 10
4#define CARL9170FW_VERSION_MONTH 9 4#define CARL9170FW_VERSION_MONTH 10
5#define CARL9170FW_VERSION_DAY 28 5#define CARL9170FW_VERSION_DAY 29
6#define CARL9170FW_VERSION_GIT "1.8.8.3" 6#define CARL9170FW_VERSION_GIT "1.9.0"
7#endif /* __CARL9170_SHARED_VERSION_H */ 7#endif /* __CARL9170_SHARED_VERSION_H */