Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368510
b: refs/heads/master
c: 55f7acd
h: refs/heads/master
v: v3
  • Loading branch information
Vladimir Kondratiev authored and John W. Linville committed Mar 13, 2013
1 parent 21464e2 commit af0bede
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 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: c7996ef852d2c8382b381268b53657175cc2dbc0
refs/heads/master: 55f7acdd2440285c5b1236e29c4194eacd624008
11 changes: 11 additions & 0 deletions trunk/drivers/net/wireless/ath/wil6210/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ static void wil_notify_fw_error(struct wil6210_priv *wil)
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
}

static void wil_cache_mbox_regs(struct wil6210_priv *wil)
{
/* make shadow copy of registers that should not change on run time */
wil_memcpy_fromio_32(&wil->mbox_ctl, wil->csr + HOST_MBOX,
sizeof(struct wil6210_mbox_ctl));
wil_mbox_ring_le2cpus(&wil->mbox_ctl.rx);
wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx);
}

static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
{
struct wil6210_priv *wil = cookie;
Expand Down Expand Up @@ -268,6 +277,8 @@ static irqreturn_t wil6210_irq_misc(int irq, void *cookie)

if (isr & ISR_MISC_FW_READY) {
wil_dbg_irq(wil, "IRQ: FW ready\n");
wil_cache_mbox_regs(wil);
set_bit(wil_status_reset_done, &wil->status);
/**
* Actual FW ready indicated by the
* WMI_FW_READY_EVENTID
Expand Down
23 changes: 0 additions & 23 deletions trunk/drivers/net/wireless/ath/wil6210/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,6 @@ static void wil_connect_timer_fn(ulong x)
schedule_work(&wil->disconnect_worker);
}

static void wil_cache_mbox_regs(struct wil6210_priv *wil)
{
/* make shadow copy of registers that should not change on run time */
wil_memcpy_fromio_32(&wil->mbox_ctl, wil->csr + HOST_MBOX,
sizeof(struct wil6210_mbox_ctl));
wil_mbox_ring_le2cpus(&wil->mbox_ctl.rx);
wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx);
}

static void wil_connect_worker(struct work_struct *work)
{
int rc;
Expand Down Expand Up @@ -161,8 +152,6 @@ int wil_priv_init(struct wil6210_priv *wil)
return -EAGAIN;
}

wil_cache_mbox_regs(wil);

return 0;
}

Expand Down Expand Up @@ -199,15 +188,11 @@ static void wil_target_reset(struct wil6210_priv *wil)
W(RGF_USER_MAC_CPU_0, BIT(1)); /* mac_cpu_man_rst */
W(RGF_USER_USER_CPU_0, BIT(1)); /* user_cpu_man_rst */

msleep(100);

W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000);
W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0x0000003F);
W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000170);
W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0xFFE7FC00);

msleep(100);

W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0);
W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0);
W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0);
Expand All @@ -217,12 +202,6 @@ static void wil_target_reset(struct wil6210_priv *wil)
W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00000080);
W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);

msleep(2000);

W(RGF_USER_USER_CPU_0, BIT(0)); /* user_cpu_man_de_rst */

msleep(2000);

wil_dbg_misc(wil, "Reset completed\n");

#undef W
Expand Down Expand Up @@ -279,8 +258,6 @@ int wil_reset(struct wil6210_priv *wil)
wil->pending_connect_cid = -1;
INIT_COMPLETION(wil->wmi_ready);

wil_cache_mbox_regs(wil);

/* TODO: release MAC reset */
wil6210_enable_irq(wil);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/wil6210/wil6210.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ enum { /* for wil6210_priv.status */
wil_status_fwready = 0,
wil_status_fwconnected,
wil_status_dontscan,
wil_status_reset_done,
wil_status_irqen, /* FIXME: interrupts enabled - for debug */
};

Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/ath/wil6210/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,11 @@ void wmi_recv_cmd(struct wil6210_priv *wil)
void __iomem *src;
ulong flags;

if (!test_bit(wil_status_reset_done, &wil->status)) {
wil_err(wil, "Reset not completed\n");
return;
}

for (;;) {
u16 len;

Expand Down

0 comments on commit af0bede

Please sign in to comment.