]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 29 May 2014 16:55:38 +0000 (12:55 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 May 2014 16:55:38 +0000 (12:55 -0400)
1  2 
net/mac80211/sta_info.c
net/mac80211/status.c
net/mac80211/trace.h

diff --combined net/mac80211/sta_info.c
index 632d372bb5117fa464dff4d5cb587f56a226647a,be9120fb844810487c3e07cc84f4e42a0b1387a7..a9b46d8ea22ff696623cec4cad55949fc5afd2a1
@@@ -240,6 -240,7 +240,7 @@@ void sta_info_free(struct ieee80211_loc
  
        sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
  
+       kfree(rcu_dereference_raw(sta->sta.rates));
        kfree(sta);
  }
  
@@@ -1147,8 -1148,7 +1148,8 @@@ void ieee80211_sta_ps_deliver_wakeup(st
        atomic_dec(&ps->num_sta_ps);
  
        /* This station just woke up and isn't aware of our SMPS state */
 -      if (!ieee80211_smps_is_restrictive(sta->known_smps_mode,
 +      if (!ieee80211_vif_is_mesh(&sdata->vif) &&
 +          !ieee80211_smps_is_restrictive(sta->known_smps_mode,
                                           sdata->smps_mode) &&
            sta->known_smps_mode != sdata->bss->req_smps &&
            sta_info_tx_streams(sta) != 1) {
diff --combined net/mac80211/status.c
index 60cb7a665976e10e7a909a9545b7643cf34e67a4,bfa5326776ab16bb042c92d73532bc8950dd57a0..ba29ebc8614121ea90ff5ff1cec44f137ac85a69
@@@ -314,9 -314,10 +314,9 @@@ ieee80211_add_tx_radiotap_header(struc
            !is_multicast_ether_addr(hdr->addr1))
                txflags |= IEEE80211_RADIOTAP_F_TX_FAIL;
  
 -      if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) ||
 -          (info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT))
 +      if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
                txflags |= IEEE80211_RADIOTAP_F_TX_CTS;
 -      else if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
 +      if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
                txflags |= IEEE80211_RADIOTAP_F_TX_RTS;
  
        put_unaligned_le16(txflags, pos);
@@@ -541,6 -542,23 +541,23 @@@ static void ieee80211_tx_latency_end_ms
   */
  #define STA_LOST_PKT_THRESHOLD        50
  
+ static void ieee80211_lost_packet(struct sta_info *sta, struct sk_buff *skb)
+ {
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+       /* This packet was aggregated but doesn't carry status info */
+       if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
+           !(info->flags & IEEE80211_TX_STAT_AMPDU))
+               return;
+       if (++sta->lost_packets < STA_LOST_PKT_THRESHOLD)
+               return;
+       cfg80211_cqm_pktloss_notify(sta->sdata->dev, sta->sta.addr,
+                                   sta->lost_packets, GFP_ATOMIC);
+       sta->lost_packets = 0;
+ }
  void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
  {
        struct sk_buff *skb2;
                                        sta, true, acked);
  
                if ((local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) &&
 +                  (ieee80211_is_data(hdr->frame_control)) &&
                    (rates_idx != -1))
                        sta->last_tx_rate = info->status.rates[rates_idx];
  
                        if (info->flags & IEEE80211_TX_STAT_ACK) {
                                if (sta->lost_packets)
                                        sta->lost_packets = 0;
-                       } else if (++sta->lost_packets >= STA_LOST_PKT_THRESHOLD) {
-                               cfg80211_cqm_pktloss_notify(sta->sdata->dev,
-                                                           sta->sta.addr,
-                                                           sta->lost_packets,
-                                                           GFP_ATOMIC);
-                               sta->lost_packets = 0;
+                       } else {
+                               ieee80211_lost_packet(sta, skb);
                        }
                }
  
diff --combined net/mac80211/trace.h
index 762e4cd163869e58baedae86751534020ebc0d5c,b22d6969cde98a9d8b1284bb7480adadc6a5eafb..cfe1a0688b5ce2846eb906b3f196c5cf51a4590b
  
  #define VIF_ENTRY     __field(enum nl80211_iftype, vif_type) __field(void *, sdata)   \
                        __field(bool, p2p)                                              \
 -                      __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
 +                      __string(vif_name, sdata->name)
  #define VIF_ASSIGN    __entry->vif_type = sdata->vif.type; __entry->sdata = sdata;    \
                        __entry->p2p = sdata->vif.p2p;                                  \
 -                      __assign_str(vif_name, sdata->dev ? sdata->dev->name : sdata->name)
 +                      __assign_str(vif_name, sdata->name)
  #define VIF_PR_FMT    " vif:%s(%d%s)"
  #define VIF_PR_ARG    __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
  
@@@ -1389,6 -1389,91 +1389,91 @@@ TRACE_EVENT(drv_change_chanctx
        )
  );
  
+ #if !defined(__TRACE_VIF_ENTRY)
+ #define __TRACE_VIF_ENTRY
+ struct trace_vif_entry {
+       enum nl80211_iftype vif_type;
+       bool p2p;
+       char vif_name[IFNAMSIZ];
+ } __packed;
+ struct trace_chandef_entry {
+       u32 control_freq;
+       u32 chan_width;
+       u32 center_freq1;
+       u32 center_freq2;
+ } __packed;
+ struct trace_switch_entry {
+       struct trace_vif_entry vif;
+       struct trace_chandef_entry old_chandef;
+       struct trace_chandef_entry new_chandef;
+ } __packed;
+ #define SWITCH_ENTRY_ASSIGN(to, from) local_vifs[i].to = vifs[i].from
+ #endif
+ TRACE_EVENT(drv_switch_vif_chanctx,
+       TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_vif_chanctx_switch *vifs,
+                int n_vifs, enum ieee80211_chanctx_switch_mode mode),
+           TP_ARGS(local, vifs, n_vifs, mode),
+       TP_STRUCT__entry(
+               LOCAL_ENTRY
+               __field(int, n_vifs)
+               __field(u32, mode)
+               __dynamic_array(u8, vifs,
+                               sizeof(struct trace_switch_entry) * n_vifs)
+       ),
+       TP_fast_assign(
+               LOCAL_ASSIGN;
+               __entry->n_vifs = n_vifs;
+               __entry->mode = mode;
+               {
+                       struct trace_switch_entry *local_vifs =
+                               __get_dynamic_array(vifs);
+                       int i;
+                       for (i = 0; i < n_vifs; i++) {
+                               struct ieee80211_sub_if_data *sdata;
+                               sdata = container_of(vifs[i].vif,
+                                               struct ieee80211_sub_if_data,
+                                               vif);
+                               SWITCH_ENTRY_ASSIGN(vif.vif_type, vif->type);
+                               SWITCH_ENTRY_ASSIGN(vif.p2p, vif->p2p);
+                               strncpy(local_vifs[i].vif.vif_name,
+                                       sdata->name,
+                                       sizeof(local_vifs[i].vif.vif_name));
+                               SWITCH_ENTRY_ASSIGN(old_chandef.control_freq,
+                                               old_ctx->def.chan->center_freq);
+                               SWITCH_ENTRY_ASSIGN(old_chandef.chan_width,
+                                                   old_ctx->def.width);
+                               SWITCH_ENTRY_ASSIGN(old_chandef.center_freq1,
+                                                   old_ctx->def.center_freq1);
+                               SWITCH_ENTRY_ASSIGN(old_chandef.center_freq2,
+                                                   old_ctx->def.center_freq2);
+                               SWITCH_ENTRY_ASSIGN(new_chandef.control_freq,
+                                               new_ctx->def.chan->center_freq);
+                               SWITCH_ENTRY_ASSIGN(new_chandef.chan_width,
+                                                   new_ctx->def.width);
+                               SWITCH_ENTRY_ASSIGN(new_chandef.center_freq1,
+                                                   new_ctx->def.center_freq1);
+                               SWITCH_ENTRY_ASSIGN(new_chandef.center_freq2,
+                                                   new_ctx->def.center_freq2);
+                       }
+               }
+       ),
+       TP_printk(
+               LOCAL_PR_FMT " n_vifs:%d mode:%d",
+               LOCAL_PR_ARG, __entry->n_vifs, __entry->mode
+       )
+ );
  DECLARE_EVENT_CLASS(local_sdata_chanctx,
        TP_PROTO(struct ieee80211_local *local,
                 struct ieee80211_sub_if_data *sdata,