hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/net/wireless/intersil/p54/txrx.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Common code for mac80211 Prism54 drivers
34 *
....@@ -10,10 +11,6 @@
1011 * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
1112 * - stlc45xx driver
1213 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
13
- *
14
- * This program is free software; you can redistribute it and/or modify
15
- * it under the terms of the GNU General Public License version 2 as
16
- * published by the Free Software Foundation.
1714 */
1815
1916 #include <linux/export.h>
....@@ -121,8 +118,8 @@
121118 }
122119 if (unlikely(!target_skb)) {
123120 if (priv->rx_end - last_addr >= len) {
124
- target_skb = priv->tx_queue.prev;
125
- if (!skb_queue_empty(&priv->tx_queue)) {
121
+ target_skb = skb_peek_tail(&priv->tx_queue);
122
+ if (target_skb) {
126123 info = IEEE80211_SKB_CB(target_skb);
127124 range = (void *)info->rate_driver_data;
128125 target_addr = range->end_addr;
....@@ -142,7 +139,10 @@
142139 unlikely(GET_HW_QUEUE(skb) == P54_QUEUE_BEACON))
143140 priv->beacon_req_id = data->req_id;
144141
145
- __skb_queue_after(&priv->tx_queue, target_skb, skb);
142
+ if (target_skb)
143
+ __skb_queue_after(&priv->tx_queue, target_skb, skb);
144
+ else
145
+ __skb_queue_head(&priv->tx_queue, skb);
146146 spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
147147 return 0;
148148 }
....@@ -331,6 +331,7 @@
331331 u16 freq = le16_to_cpu(hdr->freq);
332332 size_t header_len = sizeof(*hdr);
333333 u32 tsf32;
334
+ __le16 fc;
334335 u8 rate = hdr->rate & 0xf;
335336
336337 /*
....@@ -379,6 +380,11 @@
379380
380381 skb_pull(skb, header_len);
381382 skb_trim(skb, le16_to_cpu(hdr->len));
383
+
384
+ fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
385
+ if (ieee80211_is_probe_resp(fc) || ieee80211_is_beacon(fc))
386
+ rx_status->boottime_ns = ktime_get_boottime_ns();
387
+
382388 if (unlikely(priv->hw->conf.flags & IEEE80211_CONF_PS))
383389 p54_pspoll_workaround(priv, skb);
384390