mac80211: end service period only after sending last buffered frame
authorMarco Porsch <marco.porsch@etit.tu-chemnitz.de>
Fri, 16 Mar 2012 14:30:26 +0000 (15:30 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Apr 2012 20:06:00 +0000 (16:06 -0400)
Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/sta_info.c

index 38137cb5f6f05877a6aadca7fcb846d0062df648..7fd7ac48f893fee56059ff7bca20ba264864bfdd 100644 (file)
@@ -1195,13 +1195,15 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta,
                            ieee80211_is_qos_nullfunc(hdr->frame_control))
                                qoshdr = ieee80211_get_qos_ctl(hdr);
 
-                       /* set EOSP for the frame */
-                       if (reason == IEEE80211_FRAME_RELEASE_UAPSD &&
-                           qoshdr && skb_queue_empty(&frames))
-                               *qoshdr |= IEEE80211_QOS_CTL_EOSP;
-
-                       info->flags |= IEEE80211_TX_STATUS_EOSP |
-                                      IEEE80211_TX_CTL_REQ_TX_STATUS;
+                       /* end service period after last frame */
+                       if (skb_queue_empty(&frames)) {
+                               if (reason == IEEE80211_FRAME_RELEASE_UAPSD &&
+                                   qoshdr)
+                                       *qoshdr |= IEEE80211_QOS_CTL_EOSP;
+
+                               info->flags |= IEEE80211_TX_STATUS_EOSP |
+                                              IEEE80211_TX_CTL_REQ_TX_STATUS;
+                       }
 
                        if (qoshdr)
                                tids |= BIT(*qoshdr & IEEE80211_QOS_CTL_TID_MASK);