diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 13:03:59 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 13:03:59 -0500 |
commit | 80fb26863952eecef70b4e93c283d99584fbb912 (patch) | |
tree | f71941dc75665a9bde532c343a402515ee62077d | |
parent | 24fc32b35647401bbf03b3e2d5f01c6d0579a01c (diff) |
ath6kl: add ath6kl_bmi_read_hi32()
There are few 32 bit reads from the host interest area. Add
ath6kl_bmi_read_hi32() to make it easier to do that. As code is cleaner
this also fixes few checkpatch warnings.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/bmi.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 20 |
2 files changed, 11 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h index e6a7330aadcd..3c5b382a3529 100644 --- a/drivers/net/wireless/ath/ath6kl/bmi.h +++ b/drivers/net/wireless/ath/ath6kl/bmi.h | |||
@@ -231,6 +231,13 @@ struct ath6kl_bmi_target_info { | |||
231 | ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \ | 231 | ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \ |
232 | }) | 232 | }) |
233 | 233 | ||
234 | #define ath6kl_bmi_read_hi32(ar, item, val) \ | ||
235 | ({ \ | ||
236 | u32 addr, *check_type = val; \ | ||
237 | (void) (check_type == val); \ | ||
238 | addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \ | ||
239 | ath6kl_bmi_read(ar, addr, (u8 *) val, 4); \ | ||
240 | }) | ||
234 | 241 | ||
235 | int ath6kl_bmi_init(struct ath6kl *ar); | 242 | int ath6kl_bmi_init(struct ath6kl *ar); |
236 | void ath6kl_bmi_cleanup(struct ath6kl *ar); | 243 | void ath6kl_bmi_cleanup(struct ath6kl *ar); |
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index da5900d30caa..d1d121dc8970 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -501,10 +501,7 @@ int ath6kl_configure_target(struct ath6kl *ar) | |||
501 | /* set the firmware mode to STA/IBSS/AP */ | 501 | /* set the firmware mode to STA/IBSS/AP */ |
502 | param = 0; | 502 | param = 0; |
503 | 503 | ||
504 | if (ath6kl_bmi_read(ar, | 504 | if (ath6kl_bmi_read_hi32(ar, hi_option_flag, ¶m) != 0) { |
505 | ath6kl_get_hi_item_addr(ar, | ||
506 | HI_ITEM(hi_option_flag)), | ||
507 | (u8 *)¶m, 4) != 0) { | ||
508 | ath6kl_err("bmi_read_memory for setting fwmode failed\n"); | 505 | ath6kl_err("bmi_read_memory for setting fwmode failed\n"); |
509 | return -EIO; | 506 | return -EIO; |
510 | } | 507 | } |
@@ -1074,17 +1071,11 @@ static int ath6kl_upload_board_file(struct ath6kl *ar) | |||
1074 | ath6kl_bmi_write_hi32(ar, hi_board_data, | 1071 | ath6kl_bmi_write_hi32(ar, hi_board_data, |
1075 | ar->hw.board_addr); | 1072 | ar->hw.board_addr); |
1076 | } else { | 1073 | } else { |
1077 | ath6kl_bmi_read(ar, | 1074 | ath6kl_bmi_read_hi32(ar, hi_board_data, &board_address); |
1078 | ath6kl_get_hi_item_addr(ar, | ||
1079 | HI_ITEM(hi_board_data)), | ||
1080 | (u8 *) &board_address, 4); | ||
1081 | } | 1075 | } |
1082 | 1076 | ||
1083 | /* determine where in target ram to write extended board data */ | 1077 | /* determine where in target ram to write extended board data */ |
1084 | ath6kl_bmi_read(ar, | 1078 | ath6kl_bmi_read_hi32(ar, hi_board_ext_data, &board_ext_address); |
1085 | ath6kl_get_hi_item_addr(ar, | ||
1086 | HI_ITEM(hi_board_ext_data)), | ||
1087 | (u8 *) &board_ext_address, 4); | ||
1088 | 1079 | ||
1089 | if (ar->target_type == TARGET_TYPE_AR6003 && | 1080 | if (ar->target_type == TARGET_TYPE_AR6003 && |
1090 | board_ext_address == 0) { | 1081 | board_ext_address == 0) { |
@@ -1177,10 +1168,7 @@ static int ath6kl_upload_otp(struct ath6kl *ar) | |||
1177 | } | 1168 | } |
1178 | 1169 | ||
1179 | /* read firmware start address */ | 1170 | /* read firmware start address */ |
1180 | ret = ath6kl_bmi_read(ar, | 1171 | ret = ath6kl_bmi_read_hi32(ar, hi_app_start, &address); |
1181 | ath6kl_get_hi_item_addr(ar, | ||
1182 | HI_ITEM(hi_app_start)), | ||
1183 | (u8 *) &address, sizeof(address)); | ||
1184 | 1172 | ||
1185 | if (ret) { | 1173 | if (ret) { |
1186 | ath6kl_err("Failed to read hi_app_start: %d\n", ret); | 1174 | ath6kl_err("Failed to read hi_app_start: %d\n", ret); |