Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290238
b: refs/heads/master
c: 65a8b4c
h: refs/heads/master
v: v3
  • Loading branch information
Kalle Valo committed Dec 23, 2011
1 parent c4fd1d0 commit 7a24e9e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0038972b1253ad7f3ab7cc35ed57a830f5c8568
refs/heads/master: 65a8b4cc511b68712799e91137324f2abece7d3e
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct ath6kl_fw_ie {
};

#define ATH6KL_FW_API2_FILE "fw-2.bin"
#define ATH6KL_FW_API3_FILE "fw-3.bin"

/* AR6003 1.0 definitions */
#define AR6003_HW_1_0_VERSION 0x300002ba
Expand Down Expand Up @@ -582,7 +583,6 @@ struct ath6kl {
const char *fw;
const char *tcmd;
const char *patch;
const char *api2;
} fw;

const char *fw_board;
Expand All @@ -608,6 +608,7 @@ struct ath6kl {
u8 *fw_patch;
size_t fw_patch_len;

unsigned int fw_api;
unsigned long fw_capabilities[ATH6KL_CAPABILITY_LEN];

struct workqueue_struct *ath6kl_wq;
Expand Down
32 changes: 17 additions & 15 deletions trunk/drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ static const struct ath6kl_hw hw_list[] = {
.fw = AR6003_HW_2_0_FIRMWARE_FILE,
.tcmd = AR6003_HW_2_0_TCMD_FIRMWARE_FILE,
.patch = AR6003_HW_2_0_PATCH_FILE,
.api2 = ATH6KL_FW_API2_FILE,
},

.fw_board = AR6003_HW_2_0_BOARD_DATA_FILE,
Expand All @@ -75,7 +74,6 @@ static const struct ath6kl_hw hw_list[] = {
.fw = AR6003_HW_2_1_1_FIRMWARE_FILE,
.tcmd = AR6003_HW_2_1_1_TCMD_FIRMWARE_FILE,
.patch = AR6003_HW_2_1_1_PATCH_FILE,
.api2 = ATH6KL_FW_API2_FILE,
},

.fw_board = AR6003_HW_2_1_1_BOARD_DATA_FILE,
Expand All @@ -95,7 +93,6 @@ static const struct ath6kl_hw hw_list[] = {
.fw = {
.dir = AR6004_HW_1_0_FW_DIR,
.fw = AR6004_HW_1_0_FIRMWARE_FILE,
.api2 = ATH6KL_FW_API2_FILE,
},

.fw_board = AR6004_HW_1_0_BOARD_DATA_FILE,
Expand All @@ -115,7 +112,6 @@ static const struct ath6kl_hw hw_list[] = {
.fw = {
.dir = AR6004_HW_1_1_FW_DIR,
.fw = AR6004_HW_1_1_FIRMWARE_FILE,
.api2 = ATH6KL_FW_API2_FILE,
},

.fw_board = AR6004_HW_1_1_BOARD_DATA_FILE,
Expand Down Expand Up @@ -841,7 +837,7 @@ static int ath6kl_fetch_fw_api1(struct ath6kl *ar)
return 0;
}

static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
{
size_t magic_len, len, ie_len;
const struct firmware *fw;
Expand All @@ -851,11 +847,7 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
int ret, ie_id, i, index, bit;
__le32 *val;

if (ar->hw.fw.api2 == NULL)
return -EOPNOTSUPP;

snprintf(filename, sizeof(filename), "%s/%s",
ar->hw.fw.dir, ar->hw.fw.api2);
snprintf(filename, sizeof(filename), "%s/%s", ar->hw.fw.dir, name);

ret = request_firmware(&fw, filename, ar->dev);
if (ret)
Expand Down Expand Up @@ -1025,17 +1017,26 @@ static int ath6kl_fetch_firmwares(struct ath6kl *ar)
if (ret)
return ret;

ret = ath6kl_fetch_fw_api2(ar);
ret = ath6kl_fetch_fw_apin(ar, ATH6KL_FW_API3_FILE);
if (ret == 0) {
ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api 2\n");
return 0;
ar->fw_api = 3;
goto out;
}

ret = ath6kl_fetch_fw_apin(ar, ATH6KL_FW_API2_FILE);
if (ret == 0) {
ar->fw_api = 2;
goto out;
}

ret = ath6kl_fetch_fw_api1(ar);
if (ret)
return ret;

ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api 1\n");
ar->fw_api = 1;

out:
ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api %d\n", ar->fw_api);

return 0;
}
Expand Down Expand Up @@ -1488,10 +1489,11 @@ int ath6kl_init_hw_start(struct ath6kl *ar)


if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) {
ath6kl_info("%s %s fw %s%s\n",
ath6kl_info("%s %s fw %s api %d%s\n",
ar->hw.name,
ath6kl_init_get_hif_name(ar->hif_type),
ar->wiphy->fw_version,
ar->fw_api,
test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
}

Expand Down

0 comments on commit 7a24e9e

Please sign in to comment.