Commit a4203c64 authored by Victor Goldenshtein's avatar Victor Goldenshtein Committed by Luciano Coelho

wlcore: wait for roc complete only for the first roc command

In some multi role scenarios the driver might send multi
roc requests without sending a croc first, the fw queues
those requests and starts service the next roc request as
soon as the driver sends a croc for the previous one. So,
if the fw rocs on channel X and driver asks to roc also
on channel Y, the fw will not start service Y (and will
not send roc complete event for this request) until the
driver releases the fw with croc X.
Signed-off-by: default avatarVictor Goldenshtein <victorg@ti.com>
Signed-off-by: default avatarIgal Chernobelsky <igalc@ti.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent e832837b
...@@ -1606,20 +1606,26 @@ static int wl12xx_cmd_croc(struct wl1271 *wl, u8 role_id) ...@@ -1606,20 +1606,26 @@ static int wl12xx_cmd_croc(struct wl1271 *wl, u8 role_id)
int wl12xx_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 role_id) int wl12xx_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 role_id)
{ {
int ret = 0; int ret = 0;
bool is_first_roc;
if (WARN_ON(test_bit(role_id, wl->roc_map))) if (WARN_ON(test_bit(role_id, wl->roc_map)))
return 0; return 0;
is_first_roc = (find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) >=
WL12XX_MAX_ROLES);
ret = wl12xx_cmd_roc(wl, wlvif, role_id); ret = wl12xx_cmd_roc(wl, wlvif, role_id);
if (ret < 0) if (ret < 0)
goto out; goto out;
if (is_first_roc) {
ret = wl1271_cmd_wait_for_event(wl, ret = wl1271_cmd_wait_for_event(wl,
REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID); REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID);
if (ret < 0) { if (ret < 0) {
wl1271_error("cmd roc event completion error"); wl1271_error("cmd roc event completion error");
goto out; goto out;
} }
}
__set_bit(role_id, wl->roc_map); __set_bit(role_id, wl->roc_map);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment