hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/net/mac802154/rx.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2007-2012 Siemens AG
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2
6
- * as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 *
135 * Written by:
146 * Pavel Smolenskiy <pavel.smolenskiy@gmail.com>
....@@ -52,7 +44,7 @@
5244
5345 switch (mac_cb(skb)->dest.mode) {
5446 case IEEE802154_ADDR_NONE:
55
- if (mac_cb(skb)->dest.mode != IEEE802154_ADDR_NONE)
47
+ if (hdr->source.mode != IEEE802154_ADDR_NONE)
5648 /* FIXME: check if we are PAN coordinator */
5749 skb->pkt_type = PACKET_OTHERHOST;
5850 else
....@@ -140,7 +132,7 @@
140132 ieee802154_parse_frame_start(struct sk_buff *skb, struct ieee802154_hdr *hdr)
141133 {
142134 int hlen;
143
- struct ieee802154_mac_cb *cb = mac_cb_init(skb);
135
+ struct ieee802154_mac_cb *cb = mac_cb(skb);
144136
145137 skb_reset_mac_header(skb);
146138
....@@ -302,8 +294,9 @@
302294 ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb, u8 lqi)
303295 {
304296 struct ieee802154_local *local = hw_to_local(hw);
297
+ struct ieee802154_mac_cb *cb = mac_cb_init(skb);
305298
306
- mac_cb(skb)->lqi = lqi;
299
+ cb->lqi = lqi;
307300 skb->pkt_type = IEEE802154_RX_MSG;
308301 skb_queue_tail(&local->skb_queue, skb);
309302 tasklet_schedule(&local->tasklet);