summaryrefslogtreecommitdiff
path: root/drivers/net/wimax/i2400m/sdio-fw.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-06 16:01:54 +0300
committerDavid S. Miller <davem@davemloft.net>2009-11-06 16:01:54 +0300
commit62d83681e53fd87c91927018cfe5ba9f9e8109a3 (patch)
tree3dc4d99c1d9e782de6fb56b61369aee8f4291a5e /drivers/net/wimax/i2400m/sdio-fw.c
parent230f9bb701d37ae9b48e96456689452978f5c439 (diff)
parente7fec0bbf13b9bc2869a18e66f0cda7bb7f559f0 (diff)
downloadlinux-62d83681e53fd87c91927018cfe5ba9f9e8109a3.tar.xz
Merge branch 'linux-2.6.33.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax
Diffstat (limited to 'drivers/net/wimax/i2400m/sdio-fw.c')
-rw-r--r--drivers/net/wimax/i2400m/sdio-fw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wimax/i2400m/sdio-fw.c b/drivers/net/wimax/i2400m/sdio-fw.c
index 7d6ec0f475f8..8e025418f5be 100644
--- a/drivers/net/wimax/i2400m/sdio-fw.c
+++ b/drivers/net/wimax/i2400m/sdio-fw.c
@@ -118,7 +118,8 @@ ssize_t i2400ms_bus_bm_cmd_send(struct i2400m *i2400m,
if (cmd_size > I2400M_BM_CMD_BUF_SIZE)
goto error_too_big;
- memcpy(i2400m->bm_cmd_buf, _cmd, cmd_size); /* Prep command */
+ if (_cmd != i2400m->bm_cmd_buf)
+ memmove(i2400m->bm_cmd_buf, _cmd, cmd_size);
cmd = i2400m->bm_cmd_buf;
if (cmd_size_a > cmd_size) /* Zero pad space */
memset(i2400m->bm_cmd_buf + cmd_size, 0, cmd_size_a - cmd_size);
@@ -177,10 +178,6 @@ ssize_t i2400ms_bus_bm_wait_for_ack(struct i2400m *i2400m,
d_fnstart(5, dev, "(i2400m %p ack %p size %zu)\n",
i2400m, ack, ack_size);
- spin_lock(&i2400m->rx_lock);
- i2400ms->bm_ack_size = -EINPROGRESS;
- spin_unlock(&i2400m->rx_lock);
-
result = wait_event_timeout(i2400ms->bm_wfa_wq,
i2400ms->bm_ack_size != -EINPROGRESS,
2 * HZ);
@@ -199,6 +196,10 @@ ssize_t i2400ms_bus_bm_wait_for_ack(struct i2400m *i2400m,
size = min(ack_size, i2400ms->bm_ack_size);
memcpy(ack, i2400m->bm_ack_buf, size);
}
+ /*
+ * Remember always to clear the bm_ack_size to -EINPROGRESS
+ * after the RX data is processed
+ */
i2400ms->bm_ack_size = -EINPROGRESS;
spin_unlock(&i2400m->rx_lock);