315-mac80211-add-rx-decapsulation-offload-support.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. From: Felix Fietkau <[email protected]>
  2. Date: Wed, 16 Dec 2020 21:34:03 +0100
  3. Subject: [PATCH] mac80211: add rx decapsulation offload support
  4. This allows drivers to pass 802.3 frames to mac80211, with some restrictions:
  5. - the skb must be passed with a valid sta
  6. - fast-rx needs to be active for the sta
  7. - monitor mode needs to be disabled
  8. mac80211 will tell the driver when it is safe to enable rx decap offload for
  9. a particular station.
  10. In order to implement support, a driver must:
  11. - call ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD)
  12. - implement ops->sta_set_decap_offload
  13. - mark 802.3 frames with RX_FLAG_8023
  14. If it doesn't want to enable offload for some vif types, it can mask out
  15. IEEE80211_OFFLOAD_DECAP_ENABLED in vif->offload_flags from within the
  16. .add_interface or .update_vif_offload driver ops
  17. Signed-off-by: Felix Fietkau <[email protected]>
  18. ---
  19. --- a/include/net/mac80211.h
  20. +++ b/include/net/mac80211.h
  21. @@ -1297,6 +1297,8 @@ ieee80211_tx_info_clear_status(struct ie
  22. * the "0-length PSDU" field included there. The value for it is
  23. * in &struct ieee80211_rx_status. Note that if this value isn't
  24. * known the frame shouldn't be reported.
  25. + * @RX_FLAG_8023: the frame has an 802.3 header (decap offload performed by
  26. + * hardware or driver)
  27. */
  28. enum mac80211_rx_flags {
  29. RX_FLAG_MMIC_ERROR = BIT(0),
  30. @@ -1329,6 +1331,7 @@ enum mac80211_rx_flags {
  31. RX_FLAG_RADIOTAP_HE_MU = BIT(27),
  32. RX_FLAG_RADIOTAP_LSIG = BIT(28),
  33. RX_FLAG_NO_PSDU = BIT(29),
  34. + RX_FLAG_8023 = BIT(30),
  35. };
  36. /**
  37. @@ -1650,11 +1653,15 @@ enum ieee80211_vif_flags {
  38. * The driver supports sending frames passed as 802.3 frames by mac80211.
  39. * It must also support sending 802.11 packets for the same interface.
  40. * @IEEE80211_OFFLOAD_ENCAP_4ADDR: support 4-address mode encapsulation offload
  41. + * @IEEE80211_OFFLOAD_DECAP_ENABLED: rx encapsulation offload is enabled
  42. + * The driver supports passing received 802.11 frames as 802.3 frames to
  43. + * mac80211.
  44. */
  45. enum ieee80211_offload_flags {
  46. IEEE80211_OFFLOAD_ENCAP_ENABLED = BIT(0),
  47. IEEE80211_OFFLOAD_ENCAP_4ADDR = BIT(1),
  48. + IEEE80211_OFFLOAD_DECAP_ENABLED = BIT(2),
  49. };
  50. /**
  51. @@ -2390,6 +2397,9 @@ struct ieee80211_txq {
  52. * @IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD: Hardware supports tx encapsulation
  53. * offload
  54. *
  55. + * @IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD: Hardware supports rx decapsulation
  56. + * offload
  57. + *
  58. * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
  59. */
  60. enum ieee80211_hw_flags {
  61. @@ -2443,6 +2453,7 @@ enum ieee80211_hw_flags {
  62. IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID,
  63. IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT,
  64. IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD,
  65. + IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD,
  66. /* keep last, obviously */
  67. NUM_IEEE80211_HW_FLAGS
  68. @@ -4196,6 +4207,9 @@ struct ieee80211_ops {
  69. struct ieee80211_vif *vif);
  70. void (*sta_set_4addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  71. struct ieee80211_sta *sta, bool enabled);
  72. + void (*sta_set_decap_offload)(struct ieee80211_hw *hw,
  73. + struct ieee80211_vif *vif,
  74. + struct ieee80211_sta *sta, bool enabled);
  75. };
  76. /**
  77. --- a/net/mac80211/debugfs.c
  78. +++ b/net/mac80211/debugfs.c
  79. @@ -405,6 +405,7 @@ static const char *hw_flag_names[] = {
  80. FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID),
  81. FLAG(AMPDU_KEYBORDER_SUPPORT),
  82. FLAG(SUPPORTS_TX_ENCAP_OFFLOAD),
  83. + FLAG(SUPPORTS_RX_DECAP_OFFLOAD),
  84. #undef FLAG
  85. };
  86. --- a/net/mac80211/debugfs_sta.c
  87. +++ b/net/mac80211/debugfs_sta.c
  88. @@ -79,6 +79,7 @@ static const char * const sta_flag_names
  89. FLAG(MPSP_RECIPIENT),
  90. FLAG(PS_DELIVER),
  91. FLAG(USES_ENCRYPTION),
  92. + FLAG(DECAP_OFFLOAD),
  93. #undef FLAG
  94. };
  95. --- a/net/mac80211/driver-ops.h
  96. +++ b/net/mac80211/driver-ops.h
  97. @@ -1413,4 +1413,20 @@ static inline void drv_sta_set_4addr(str
  98. trace_drv_return_void(local);
  99. }
  100. +static inline void drv_sta_set_decap_offload(struct ieee80211_local *local,
  101. + struct ieee80211_sub_if_data *sdata,
  102. + struct ieee80211_sta *sta,
  103. + bool enabled)
  104. +{
  105. + sdata = get_bss_sdata(sdata);
  106. + if (!check_sdata_in_driver(sdata))
  107. + return;
  108. +
  109. + trace_drv_sta_set_decap_offload(local, sdata, sta, enabled);
  110. + if (local->ops->sta_set_decap_offload)
  111. + local->ops->sta_set_decap_offload(&local->hw, &sdata->vif, sta,
  112. + enabled);
  113. + trace_drv_return_void(local);
  114. +}
  115. +
  116. #endif /* __MAC80211_DRIVER_OPS */
  117. --- a/net/mac80211/iface.c
  118. +++ b/net/mac80211/iface.c
  119. @@ -839,7 +839,7 @@ static const struct net_device_ops ieee8
  120. };
  121. -static bool ieee80211_iftype_supports_encap_offload(enum nl80211_iftype iftype)
  122. +static bool ieee80211_iftype_supports_hdr_offload(enum nl80211_iftype iftype)
  123. {
  124. switch (iftype) {
  125. /* P2P GO and client are mapped to AP/STATION types */
  126. @@ -859,7 +859,7 @@ static bool ieee80211_set_sdata_offload_
  127. flags = sdata->vif.offload_flags;
  128. if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) &&
  129. - ieee80211_iftype_supports_encap_offload(sdata->vif.type)) {
  130. + ieee80211_iftype_supports_hdr_offload(sdata->vif.type)) {
  131. flags |= IEEE80211_OFFLOAD_ENCAP_ENABLED;
  132. if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) &&
  133. @@ -872,10 +872,21 @@ static bool ieee80211_set_sdata_offload_
  134. flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
  135. }
  136. + if (ieee80211_hw_check(&local->hw, SUPPORTS_RX_DECAP_OFFLOAD) &&
  137. + ieee80211_iftype_supports_hdr_offload(sdata->vif.type)) {
  138. + flags |= IEEE80211_OFFLOAD_DECAP_ENABLED;
  139. +
  140. + if (local->monitors)
  141. + flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
  142. + } else {
  143. + flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
  144. + }
  145. +
  146. if (sdata->vif.offload_flags == flags)
  147. return false;
  148. sdata->vif.offload_flags = flags;
  149. + ieee80211_check_fast_rx_iface(sdata);
  150. return true;
  151. }
  152. @@ -893,7 +904,7 @@ static void ieee80211_set_vif_encap_ops(
  153. }
  154. if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) ||
  155. - !ieee80211_iftype_supports_encap_offload(bss->vif.type))
  156. + !ieee80211_iftype_supports_hdr_offload(bss->vif.type))
  157. return;
  158. enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED;
  159. --- a/net/mac80211/rx.c
  160. +++ b/net/mac80211/rx.c
  161. @@ -4114,7 +4114,9 @@ void ieee80211_check_fast_rx(struct sta_
  162. .vif_type = sdata->vif.type,
  163. .control_port_protocol = sdata->control_port_protocol,
  164. }, *old, *new = NULL;
  165. + bool set_offload = false;
  166. bool assign = false;
  167. + bool offload;
  168. /* use sparse to check that we don't return without updating */
  169. __acquire(check_fast_rx);
  170. @@ -4227,6 +4229,17 @@ void ieee80211_check_fast_rx(struct sta_
  171. if (assign)
  172. new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);
  173. + offload = assign &&
  174. + (sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED);
  175. +
  176. + if (offload)
  177. + set_offload = !test_and_set_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
  178. + else
  179. + set_offload = test_and_clear_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
  180. +
  181. + if (set_offload)
  182. + drv_sta_set_decap_offload(local, sdata, &sta->sta, assign);
  183. +
  184. spin_lock_bh(&sta->lock);
  185. old = rcu_dereference_protected(sta->fast_rx, true);
  186. rcu_assign_pointer(sta->fast_rx, new);
  187. @@ -4273,6 +4286,108 @@ void ieee80211_check_fast_rx_iface(struc
  188. mutex_unlock(&local->sta_mtx);
  189. }
  190. +static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
  191. + struct ieee80211_fast_rx *fast_rx,
  192. + int orig_len)
  193. +{
  194. + struct ieee80211_sta_rx_stats *stats;
  195. + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
  196. + struct sta_info *sta = rx->sta;
  197. + struct sk_buff *skb = rx->skb;
  198. + void *sa = skb->data + ETH_ALEN;
  199. + void *da = skb->data;
  200. +
  201. + stats = &sta->rx_stats;
  202. + if (fast_rx->uses_rss)
  203. + stats = this_cpu_ptr(sta->pcpu_rx_stats);
  204. +
  205. + /* statistics part of ieee80211_rx_h_sta_process() */
  206. + if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
  207. + stats->last_signal = status->signal;
  208. + if (!fast_rx->uses_rss)
  209. + ewma_signal_add(&sta->rx_stats_avg.signal,
  210. + -status->signal);
  211. + }
  212. +
  213. + if (status->chains) {
  214. + int i;
  215. +
  216. + stats->chains = status->chains;
  217. + for (i = 0; i < ARRAY_SIZE(status->chain_signal); i++) {
  218. + int signal = status->chain_signal[i];
  219. +
  220. + if (!(status->chains & BIT(i)))
  221. + continue;
  222. +
  223. + stats->chain_signal_last[i] = signal;
  224. + if (!fast_rx->uses_rss)
  225. + ewma_signal_add(&sta->rx_stats_avg.chain_signal[i],
  226. + -signal);
  227. + }
  228. + }
  229. + /* end of statistics */
  230. +
  231. + stats->last_rx = jiffies;
  232. + stats->last_rate = sta_stats_encode_rate(status);
  233. +
  234. + stats->fragments++;
  235. + stats->packets++;
  236. +
  237. + skb->dev = fast_rx->dev;
  238. +
  239. + ieee80211_rx_stats(fast_rx->dev, skb->len);
  240. +
  241. + /* The seqno index has the same property as needed
  242. + * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
  243. + * for non-QoS-data frames. Here we know it's a data
  244. + * frame, so count MSDUs.
  245. + */
  246. + u64_stats_update_begin(&stats->syncp);
  247. + stats->msdu[rx->seqno_idx]++;
  248. + stats->bytes += orig_len;
  249. + u64_stats_update_end(&stats->syncp);
  250. +
  251. + if (fast_rx->internal_forward) {
  252. + struct sk_buff *xmit_skb = NULL;
  253. + if (is_multicast_ether_addr(da)) {
  254. + xmit_skb = skb_copy(skb, GFP_ATOMIC);
  255. + } else if (!ether_addr_equal(da, sa) &&
  256. + sta_info_get(rx->sdata, da)) {
  257. + xmit_skb = skb;
  258. + skb = NULL;
  259. + }
  260. +
  261. + if (xmit_skb) {
  262. + /*
  263. + * Send to wireless media and increase priority by 256
  264. + * to keep the received priority instead of
  265. + * reclassifying the frame (see cfg80211_classify8021d).
  266. + */
  267. + xmit_skb->priority += 256;
  268. + xmit_skb->protocol = htons(ETH_P_802_3);
  269. + skb_reset_network_header(xmit_skb);
  270. + skb_reset_mac_header(xmit_skb);
  271. + dev_queue_xmit(xmit_skb);
  272. + }
  273. +
  274. + if (!skb)
  275. + return;
  276. + }
  277. +
  278. + /* deliver to local stack */
  279. + skb->protocol = eth_type_trans(skb, fast_rx->dev);
  280. + memset(skb->cb, 0, sizeof(skb->cb));
  281. + if (rx->list)
  282. +#if LINUX_VERSION_IS_GEQ(4,19,0)
  283. + list_add_tail(&skb->list, rx->list);
  284. +#else
  285. + __skb_queue_tail(rx->list, skb);
  286. +#endif
  287. + else
  288. + netif_receive_skb(skb);
  289. +
  290. +}
  291. +
  292. static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
  293. struct ieee80211_fast_rx *fast_rx)
  294. {
  295. @@ -4293,9 +4408,6 @@ static bool ieee80211_invoke_fast_rx(str
  296. } addrs __aligned(2);
  297. struct ieee80211_sta_rx_stats *stats = &sta->rx_stats;
  298. - if (fast_rx->uses_rss)
  299. - stats = this_cpu_ptr(sta->pcpu_rx_stats);
  300. -
  301. /* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
  302. * to a common data structure; drivers can implement that per queue
  303. * but we don't have that information in mac80211
  304. @@ -4369,32 +4481,6 @@ static bool ieee80211_invoke_fast_rx(str
  305. pskb_trim(skb, skb->len - fast_rx->icv_len))
  306. goto drop;
  307. - /* statistics part of ieee80211_rx_h_sta_process() */
  308. - if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
  309. - stats->last_signal = status->signal;
  310. - if (!fast_rx->uses_rss)
  311. - ewma_signal_add(&sta->rx_stats_avg.signal,
  312. - -status->signal);
  313. - }
  314. -
  315. - if (status->chains) {
  316. - int i;
  317. -
  318. - stats->chains = status->chains;
  319. - for (i = 0; i < ARRAY_SIZE(status->chain_signal); i++) {
  320. - int signal = status->chain_signal[i];
  321. -
  322. - if (!(status->chains & BIT(i)))
  323. - continue;
  324. -
  325. - stats->chain_signal_last[i] = signal;
  326. - if (!fast_rx->uses_rss)
  327. - ewma_signal_add(&sta->rx_stats_avg.chain_signal[i],
  328. - -signal);
  329. - }
  330. - }
  331. - /* end of statistics */
  332. -
  333. if (rx->key && !ieee80211_has_protected(hdr->frame_control))
  334. goto drop;
  335. @@ -4406,12 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str
  336. return true;
  337. }
  338. - stats->last_rx = jiffies;
  339. - stats->last_rate = sta_stats_encode_rate(status);
  340. -
  341. - stats->fragments++;
  342. - stats->packets++;
  343. -
  344. /* do the header conversion - first grab the addresses */
  345. ether_addr_copy(addrs.da, skb->data + fast_rx->da_offs);
  346. ether_addr_copy(addrs.sa, skb->data + fast_rx->sa_offs);
  347. @@ -4420,62 +4500,14 @@ static bool ieee80211_invoke_fast_rx(str
  348. /* push the addresses in front */
  349. memcpy(skb_push(skb, sizeof(addrs)), &addrs, sizeof(addrs));
  350. - skb->dev = fast_rx->dev;
  351. -
  352. - ieee80211_rx_stats(fast_rx->dev, skb->len);
  353. -
  354. - /* The seqno index has the same property as needed
  355. - * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
  356. - * for non-QoS-data frames. Here we know it's a data
  357. - * frame, so count MSDUs.
  358. - */
  359. - u64_stats_update_begin(&stats->syncp);
  360. - stats->msdu[rx->seqno_idx]++;
  361. - stats->bytes += orig_len;
  362. - u64_stats_update_end(&stats->syncp);
  363. -
  364. - if (fast_rx->internal_forward) {
  365. - struct sk_buff *xmit_skb = NULL;
  366. - if (is_multicast_ether_addr(addrs.da)) {
  367. - xmit_skb = skb_copy(skb, GFP_ATOMIC);
  368. - } else if (!ether_addr_equal(addrs.da, addrs.sa) &&
  369. - sta_info_get(rx->sdata, addrs.da)) {
  370. - xmit_skb = skb;
  371. - skb = NULL;
  372. - }
  373. -
  374. - if (xmit_skb) {
  375. - /*
  376. - * Send to wireless media and increase priority by 256
  377. - * to keep the received priority instead of
  378. - * reclassifying the frame (see cfg80211_classify8021d).
  379. - */
  380. - xmit_skb->priority += 256;
  381. - xmit_skb->protocol = htons(ETH_P_802_3);
  382. - skb_reset_network_header(xmit_skb);
  383. - skb_reset_mac_header(xmit_skb);
  384. - dev_queue_xmit(xmit_skb);
  385. - }
  386. -
  387. - if (!skb)
  388. - return true;
  389. - }
  390. -
  391. - /* deliver to local stack */
  392. - skb->protocol = eth_type_trans(skb, fast_rx->dev);
  393. - memset(skb->cb, 0, sizeof(skb->cb));
  394. - if (rx->list)
  395. -#if LINUX_VERSION_IS_GEQ(4,19,0)
  396. - list_add_tail(&skb->list, rx->list);
  397. -#else
  398. - __skb_queue_tail(rx->list, skb);
  399. -#endif
  400. - else
  401. - netif_receive_skb(skb);
  402. + ieee80211_rx_8023(rx, fast_rx, orig_len);
  403. return true;
  404. drop:
  405. dev_kfree_skb(skb);
  406. + if (fast_rx->uses_rss)
  407. + stats = this_cpu_ptr(sta->pcpu_rx_stats);
  408. +
  409. stats->dropped++;
  410. return true;
  411. }
  412. @@ -4529,6 +4561,47 @@ static bool ieee80211_prepare_and_rx_han
  413. return true;
  414. }
  415. +static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
  416. + struct ieee80211_sta *pubsta,
  417. + struct sk_buff *skb,
  418. +#if LINUX_VERSION_IS_GEQ(4,19,0)
  419. + struct list_head *list)
  420. +#else
  421. + struct sk_buff_head *list)
  422. +#endif
  423. +{
  424. + struct ieee80211_local *local = hw_to_local(hw);
  425. + struct ieee80211_fast_rx *fast_rx;
  426. + struct ieee80211_rx_data rx;
  427. +
  428. + memset(&rx, 0, sizeof(rx));
  429. + rx.skb = skb;
  430. + rx.local = local;
  431. + rx.list = list;
  432. +
  433. + I802_DEBUG_INC(local->dot11ReceivedFragmentCount);
  434. +
  435. + /* drop frame if too short for header */
  436. + if (skb->len < sizeof(struct ethhdr))
  437. + goto drop;
  438. +
  439. + if (!pubsta)
  440. + goto drop;
  441. +
  442. + rx.sta = container_of(pubsta, struct sta_info, sta);
  443. + rx.sdata = rx.sta->sdata;
  444. +
  445. + fast_rx = rcu_dereference(rx.sta->fast_rx);
  446. + if (!fast_rx)
  447. + goto drop;
  448. +
  449. + ieee80211_rx_8023(&rx, fast_rx, skb->len);
  450. + return;
  451. +
  452. +drop:
  453. + dev_kfree_skb(skb);
  454. +}
  455. +
  456. /*
  457. * This is the actual Rx frames handler. as it belongs to Rx path it must
  458. * be called with rcu_read_lock protection.
  459. @@ -4766,15 +4839,20 @@ void ieee80211_rx_list(struct ieee80211_
  460. * if it was previously present.
  461. * Also, frames with less than 16 bytes are dropped.
  462. */
  463. - skb = ieee80211_rx_monitor(local, skb, rate);
  464. - if (!skb)
  465. - return;
  466. + if (!(status->flag & RX_FLAG_8023)) {
  467. + skb = ieee80211_rx_monitor(local, skb, rate);
  468. + if (!skb)
  469. + return;
  470. + }
  471. ieee80211_tpt_led_trig_rx(local,
  472. ((struct ieee80211_hdr *)skb->data)->frame_control,
  473. skb->len);
  474. - __ieee80211_rx_handle_packet(hw, pubsta, skb, list);
  475. + if (status->flag & RX_FLAG_8023)
  476. + __ieee80211_rx_handle_8023(hw, pubsta, skb, list);
  477. + else
  478. + __ieee80211_rx_handle_packet(hw, pubsta, skb, list);
  479. return;
  480. drop:
  481. --- a/net/mac80211/sta_info.h
  482. +++ b/net/mac80211/sta_info.h
  483. @@ -71,6 +71,7 @@
  484. * until pending frames are delivered
  485. * @WLAN_STA_USES_ENCRYPTION: This station was configured for encryption,
  486. * so drop all packets without a key later.
  487. + * @WLAN_STA_DECAP_OFFLOAD: This station uses rx decap offload
  488. *
  489. * @NUM_WLAN_STA_FLAGS: number of defined flags
  490. */
  491. @@ -102,6 +103,7 @@ enum ieee80211_sta_info_flags {
  492. WLAN_STA_MPSP_RECIPIENT,
  493. WLAN_STA_PS_DELIVER,
  494. WLAN_STA_USES_ENCRYPTION,
  495. + WLAN_STA_DECAP_OFFLOAD,
  496. NUM_WLAN_STA_FLAGS,
  497. };
  498. --- a/net/mac80211/trace.h
  499. +++ b/net/mac80211/trace.h
  500. @@ -2761,7 +2761,7 @@ DEFINE_EVENT(local_sdata_addr_evt, drv_u
  501. TP_ARGS(local, sdata)
  502. );
  503. -TRACE_EVENT(drv_sta_set_4addr,
  504. +DECLARE_EVENT_CLASS(sta_flag_evt,
  505. TP_PROTO(struct ieee80211_local *local,
  506. struct ieee80211_sub_if_data *sdata,
  507. struct ieee80211_sta *sta, bool enabled),
  508. @@ -2788,6 +2788,22 @@ TRACE_EVENT(drv_sta_set_4addr,
  509. )
  510. );
  511. +DEFINE_EVENT(sta_flag_evt, drv_sta_set_4addr,
  512. + TP_PROTO(struct ieee80211_local *local,
  513. + struct ieee80211_sub_if_data *sdata,
  514. + struct ieee80211_sta *sta, bool enabled),
  515. +
  516. + TP_ARGS(local, sdata, sta, enabled)
  517. +);
  518. +
  519. +DEFINE_EVENT(sta_flag_evt, drv_sta_set_decap_offload,
  520. + TP_PROTO(struct ieee80211_local *local,
  521. + struct ieee80211_sub_if_data *sdata,
  522. + struct ieee80211_sta *sta, bool enabled),
  523. +
  524. + TP_ARGS(local, sdata, sta, enabled)
  525. +);
  526. +
  527. #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
  528. #undef TRACE_INCLUDE_PATH