Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278091
b: refs/heads/master
c: 5fe4dff
h: refs/heads/master
i:
  278089: 1f89cc4
  278087: f25f480
v: v3
  • Loading branch information
Kalle Valo committed Nov 11, 2011
1 parent d1e1bee commit 53e668f
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 8 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: 32a07e4448f78158a75f7c1f0056289647d83946
refs/heads/master: 5fe4dffbc12b22507d2416667720cbd4b27c693b
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/bmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,11 @@ int ath6kl_bmi_fast_download(struct ath6kl *ar, u32 addr, u8 *buf, u32 len)
return ret;
}

void ath6kl_bmi_reset(struct ath6kl *ar)
{
ar->bmi.done_sent = false;
}

int ath6kl_bmi_init(struct ath6kl *ar)
{
ar->bmi.cmd_buf = kzalloc(MAX_BMI_CMDBUF_SZ, GFP_ATOMIC);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/bmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ struct ath6kl_bmi_target_info {

int ath6kl_bmi_init(struct ath6kl *ar);
void ath6kl_bmi_cleanup(struct ath6kl *ar);
void ath6kl_bmi_reset(struct ath6kl *ar);

int ath6kl_bmi_done(struct ath6kl *ar);
int ath6kl_bmi_get_target_info(struct ath6kl *ar,
struct ath6kl_bmi_target_info *targ_info);
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ enum ath6kl_dev_state {
DESTROY_IN_PROGRESS,
SKIP_SCAN,
ROAM_TBL_PEND,
FIRST_BOOT,
};

struct ath6kl {
Expand Down Expand Up @@ -662,4 +663,7 @@ void ath6kl_deinit_if_data(struct ath6kl_vif *vif);
void ath6kl_core_free(struct ath6kl *ar);
struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar);
void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready);
int ath6kl_init_hw_start(struct ath6kl *ar);
int ath6kl_init_hw_stop(struct ath6kl *ar);

#endif /* CORE_H */
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/htc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,9 @@ int ath6kl_htc_start(struct htc_target *target)
struct htc_packet *packet;
int status;

memset(&target->dev->irq_proc_reg, 0,
sizeof(target->dev->irq_proc_reg));

/* Disable interrupts at the chip level */
ath6kl_hif_disable_intrs(target->dev);

Expand Down
35 changes: 32 additions & 3 deletions trunk/drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,11 +1421,13 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
return 0;
}

static int ath6kl_hw_start(struct ath6kl *ar)
int ath6kl_init_hw_start(struct ath6kl *ar)
{
long timeleft;
int ret, i;

ath6kl_dbg(ATH6KL_DBG_BOOT, "hw start\n");

ret = ath6kl_hif_power_on(ar);
if (ret)
return ret;
Expand Down Expand Up @@ -1517,6 +1519,25 @@ static int ath6kl_hw_start(struct ath6kl *ar)
return ret;
}

int ath6kl_init_hw_stop(struct ath6kl *ar)
{
int ret;

ath6kl_dbg(ATH6KL_DBG_BOOT, "hw stop\n");

ath6kl_htc_stop(ar->htc_target);

ath6kl_hif_stop(ar);

ath6kl_bmi_reset(ar);

ret = ath6kl_hif_power_off(ar);
if (ret)
ath6kl_warn("failed to power off hif: %d\n", ret);

return 0;
}

int ath6kl_core_init(struct ath6kl *ar)
{
struct ath6kl_bmi_target_info targ_info;
Expand Down Expand Up @@ -1629,9 +1650,11 @@ int ath6kl_core_init(struct ath6kl *ar)
ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM |
WIPHY_FLAG_HAVE_AP_SME;

ret = ath6kl_hw_start(ar);
set_bit(FIRST_BOOT, &ar->flag);

ret = ath6kl_init_hw_start(ar);
if (ret) {
ath6kl_err("Failed to boot hardware: %d\n", ret);
ath6kl_err("Failed to start hardware: %d\n", ret);
goto err_rxbuf_cleanup;
}

Expand All @@ -1641,6 +1664,12 @@ int ath6kl_core_init(struct ath6kl *ar)
*/
memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);

ret = ath6kl_init_hw_stop(ar);
if (ret) {
ath6kl_err("Failed to stop hardware: %d\n", ret);
goto err_htc_cleanup;
}

return ret;

err_rxbuf_cleanup:
Expand Down
22 changes: 18 additions & 4 deletions trunk/drivers/net/wireless/ath/ath6kl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,12 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver)
set_bit(WMI_READY, &ar->flag);
wake_up(&ar->event_wq);

ath6kl_info("hw %s fw %s%s\n",
get_hw_id_string(ar->wiphy->hw_version),
ar->wiphy->fw_version,
test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) {
ath6kl_info("hw %s fw %s%s\n",
get_hw_id_string(ar->wiphy->hw_version),
ar->wiphy->fw_version,
test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
}
}

void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
Expand Down Expand Up @@ -1112,6 +1114,12 @@ struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar)
static int ath6kl_open(struct net_device *dev)
{
struct ath6kl_vif *vif = netdev_priv(dev);
int ret;

/* FIXME: how to handle multi vif support? */
ret = ath6kl_init_hw_start(vif->ar);
if (ret)
return ret;

set_bit(WLAN_ENABLED, &vif->flags);

Expand All @@ -1128,6 +1136,7 @@ static int ath6kl_close(struct net_device *dev)
{
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);
int ret;

netif_stop_queue(dev);

Expand All @@ -1143,6 +1152,11 @@ static int ath6kl_close(struct net_device *dev)

ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);

/* FIXME: how to handle multi vif support? */
ret = ath6kl_init_hw_stop(ar);
if (ret)
return ret;

return 0;
}

Expand Down

0 comments on commit 53e668f

Please sign in to comment.