提交 56f004b4 编写于 作者: V Vladimir Kondratiev 提交者: John W. Linville

wil6210: Separate common code for mbox regs caching to function

Signed-off-by: NVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b98917d7
...@@ -109,6 +109,15 @@ static void wil_connect_timer_fn(ulong x) ...@@ -109,6 +109,15 @@ static void wil_connect_timer_fn(ulong x)
schedule_work(&wil->disconnect_worker); 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);
}
int wil_priv_init(struct wil6210_priv *wil) int wil_priv_init(struct wil6210_priv *wil)
{ {
wil_dbg_MISC(wil, "%s()\n", __func__); wil_dbg_MISC(wil, "%s()\n", __func__);
...@@ -138,11 +147,7 @@ int wil_priv_init(struct wil6210_priv *wil) ...@@ -138,11 +147,7 @@ int wil_priv_init(struct wil6210_priv *wil)
return -EAGAIN; return -EAGAIN;
} }
/* make shadow copy of registers that should not change on run time */ wil_cache_mbox_regs(wil);
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);
return 0; return 0;
} }
...@@ -260,11 +265,7 @@ int wil_reset(struct wil6210_priv *wil) ...@@ -260,11 +265,7 @@ int wil_reset(struct wil6210_priv *wil)
wil->pending_connect_cid = -1; wil->pending_connect_cid = -1;
INIT_COMPLETION(wil->wmi_ready); INIT_COMPLETION(wil->wmi_ready);
/* make shadow copy of registers that should not change on run time */ wil_cache_mbox_regs(wil);
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);
/* TODO: release MAC reset */ /* TODO: release MAC reset */
wil6210_enable_irq(wil); wil6210_enable_irq(wil);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册