net: wireless: bcmdhd: Fix sending ctrl packet
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 28 Aug 2012 23:17:37 +0000 (16:17 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Tue, 28 Aug 2012 23:17:37 +0000 (16:17 -0700)
- Schedule dpc thread to send ctrl frame if we cannot
  send ctrl packet immediately.

Change-Id: I5ae8b705a6ccddcc1f5c86b4c094342b57d26c7f
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_sdio.c

index 6049e16abb5d48270530236077453e0500172bf8..09dc45a0e9e873693ac029a709fc047916eaff03 100644 (file)
@@ -1375,7 +1375,13 @@ dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen)
                /* Send from dpc */
                bus->ctrl_frame_buf = frame;
                bus->ctrl_frame_len = len;
-               dhd_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+               if (!bus->dpc_sched) {
+                       bus->dpc_sched = TRUE;
+                       dhd_sched_dpc(bus->dhd);
+               }
+               if (bus->ctrl_frame_stat) {
+                       dhd_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+               }
                if (bus->ctrl_frame_stat == FALSE) {
                        DHD_INFO(("%s: ctrl_frame_stat == FALSE\n", __FUNCTION__));
                        ret = 0;