diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-02-27 09:20:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:33:31 -0500 |
commit | 9a1773847d592c546f1fd5100d6ff434b414bedc (patch) | |
tree | ba5b29123c559a6a83d8de9f8ff9d28f6170cdfc | |
parent | b4490f423c0e61b77461be6557c62e533b8c60e3 (diff) |
wil6210: Find free vring for Tx
There are 24 possible Tx vrings; when doind multiple connections, more then
one vring has to be used. Search for free one and select it.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 38906f1bc769..5079e4944205 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -107,12 +107,23 @@ static void wil_connect_timer_fn(ulong x) | |||
107 | schedule_work(&wil->disconnect_worker); | 107 | schedule_work(&wil->disconnect_worker); |
108 | } | 108 | } |
109 | 109 | ||
110 | static int wil_find_free_vring(struct wil6210_priv *wil) | ||
111 | { | ||
112 | int i; | ||
113 | for (i = 0; i < WIL6210_MAX_TX_RINGS; i++) { | ||
114 | if (!wil->vring_tx[i].va) | ||
115 | return i; | ||
116 | } | ||
117 | return -EINVAL; | ||
118 | } | ||
119 | |||
110 | static void wil_connect_worker(struct work_struct *work) | 120 | static void wil_connect_worker(struct work_struct *work) |
111 | { | 121 | { |
112 | int rc; | 122 | int rc; |
113 | struct wil6210_priv *wil = container_of(work, struct wil6210_priv, | 123 | struct wil6210_priv *wil = container_of(work, struct wil6210_priv, |
114 | connect_worker); | 124 | connect_worker); |
115 | int cid = wil->pending_connect_cid; | 125 | int cid = wil->pending_connect_cid; |
126 | int ringid = wil_find_free_vring(wil); | ||
116 | 127 | ||
117 | if (cid < 0) { | 128 | if (cid < 0) { |
118 | wil_err(wil, "No connection pending\n"); | 129 | wil_err(wil, "No connection pending\n"); |
@@ -121,7 +132,7 @@ static void wil_connect_worker(struct work_struct *work) | |||
121 | 132 | ||
122 | wil_dbg_wmi(wil, "Configure for connection CID %d\n", cid); | 133 | wil_dbg_wmi(wil, "Configure for connection CID %d\n", cid); |
123 | 134 | ||
124 | rc = wil_vring_init_tx(wil, 0, WIL6210_TX_RING_SIZE, cid, 0); | 135 | rc = wil_vring_init_tx(wil, ringid, WIL6210_TX_RING_SIZE, cid, 0); |
125 | wil->pending_connect_cid = -1; | 136 | wil->pending_connect_cid = -1; |
126 | if (rc == 0) { | 137 | if (rc == 0) { |
127 | wil->sta[cid].status = wil_sta_connected; | 138 | wil->sta[cid].status = wil_sta_connected; |