]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Cancel offchannel TX wait on PD Response TX status
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 27 Feb 2014 14:36:03 +0000 (16:36 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 27 Feb 2014 14:38:27 +0000 (16:38 +0200)
PD Response is sent out using a 200 ms offchannel wait, but that wait
was not cancelled on TX status report. This could result in offchannel
operation being left waiting unnecessarily long. Fix this by making the
P2P_NO_PENDING_ACTION case in Action TX callback cancel the wait if a
pending wait is marked (and mark this for PD Response).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/p2p/p2p.c
src/p2p/p2p_i.h
src/p2p/p2p_pd.c

index 6f3cd6877be7c59bb732118774f0820d046e0cc1..4b909898ff7ea61f3f45a1ac7f6cf11cb1f00cf8 100644 (file)
@@ -2990,6 +2990,10 @@ void p2p_send_action_cb(struct p2p_data *p2p, unsigned int freq, const u8 *dst,
        p2p->pending_action_state = P2P_NO_PENDING_ACTION;
        switch (state) {
        case P2P_NO_PENDING_ACTION:
+               if (p2p->send_action_in_progress) {
+                       p2p->send_action_in_progress = 0;
+                       p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
+               }
                if (p2p->after_scan_tx_in_progress) {
                        p2p->after_scan_tx_in_progress = 0;
                        if (p2p->start_after_scan != P2P_AFTER_SCAN_NOTHING &&
index 6de3461666fd2997ed87db13b8039148f2f1e0ff..420c7391b64ddb5d08bdb456aa006209b63d0045 100644 (file)
@@ -389,6 +389,7 @@ struct p2p_data {
        u8 after_scan_peer[ETH_ALEN];
        struct p2p_pending_action_tx *after_scan_tx;
        unsigned int after_scan_tx_in_progress:1;
+       unsigned int send_action_in_progress:1;
 
        /* Requested device types for find/search */
        unsigned int num_req_dev_types;
index 409405fb26888bec2f7fa1405f0f75403590a913..68d79d23995a8481d01b6288b1f0ff52c9e143be 100644 (file)
@@ -224,7 +224,8 @@ out:
                            p2p->cfg->dev_addr,
                            wpabuf_head(resp), wpabuf_len(resp), 200) < 0) {
                p2p_dbg(p2p, "Failed to send Action frame");
-       }
+       } else
+               p2p->send_action_in_progress = 1;
 
        wpabuf_free(resp);