aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154/wpan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac802154/wpan.c')
-rw-r--r--net/mac802154/wpan.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index cb34064d05f6..bb49e88c460f 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -192,15 +192,17 @@ static int mac802154_header_create(struct sk_buff *skb,
192{ 192{
193 struct ieee802154_hdr hdr; 193 struct ieee802154_hdr hdr;
194 struct mac802154_sub_if_data *priv = netdev_priv(dev); 194 struct mac802154_sub_if_data *priv = netdev_priv(dev);
195 struct ieee802154_mac_cb *cb = mac_cb(skb);
195 int hlen; 196 int hlen;
196 197
197 if (!daddr) 198 if (!daddr)
198 return -EINVAL; 199 return -EINVAL;
199 200
200 memset(&hdr.fc, 0, sizeof(hdr.fc)); 201 memset(&hdr.fc, 0, sizeof(hdr.fc));
201 hdr.fc.type = mac_cb_type(skb); 202 hdr.fc.type = cb->type;
202 hdr.fc.security_enabled = mac_cb_is_secen(skb); 203 hdr.fc.security_enabled = cb->secen;
203 hdr.fc.ack_request = mac_cb_is_ackreq(skb); 204 hdr.fc.ack_request = cb->ackreq;
205 hdr.seq = ieee802154_mlme_ops(dev)->get_dsn(dev);
204 206
205 if (!saddr) { 207 if (!saddr) {
206 spin_lock_bh(&priv->mib_lock); 208 spin_lock_bh(&priv->mib_lock);
@@ -391,12 +393,12 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb)
391 sdata->dev->stats.rx_packets++; 393 sdata->dev->stats.rx_packets++;
392 sdata->dev->stats.rx_bytes += skb->len; 394 sdata->dev->stats.rx_bytes += skb->len;
393 395
394 switch (mac_cb_type(skb)) { 396 switch (mac_cb(skb)->type) {
395 case IEEE802154_FC_TYPE_DATA: 397 case IEEE802154_FC_TYPE_DATA:
396 return mac802154_process_data(sdata->dev, skb); 398 return mac802154_process_data(sdata->dev, skb);
397 default: 399 default:
398 pr_warn("ieee802154: bad frame received (type = %d)\n", 400 pr_warn("ieee802154: bad frame received (type = %d)\n",
399 mac_cb_type(skb)); 401 mac_cb(skb)->type);
400 kfree_skb(skb); 402 kfree_skb(skb);
401 return NET_RX_DROP; 403 return NET_RX_DROP;
402 } 404 }
@@ -423,6 +425,7 @@ static int mac802154_parse_frame_start(struct sk_buff *skb)
423{ 425{
424 int hlen; 426 int hlen;
425 struct ieee802154_hdr hdr; 427 struct ieee802154_hdr hdr;
428 struct ieee802154_mac_cb *cb = mac_cb_init(skb);
426 429
427 hlen = ieee802154_hdr_pull(skb, &hdr); 430 hlen = ieee802154_hdr_pull(skb, &hdr);
428 if (hlen < 0) 431 if (hlen < 0)
@@ -433,18 +436,15 @@ static int mac802154_parse_frame_start(struct sk_buff *skb)
433 pr_debug("fc: %04x dsn: %02x\n", le16_to_cpup((__le16 *)&hdr.fc), 436 pr_debug("fc: %04x dsn: %02x\n", le16_to_cpup((__le16 *)&hdr.fc),
434 hdr.seq); 437 hdr.seq);
435 438
436 mac_cb(skb)->flags = hdr.fc.type; 439 cb->type = hdr.fc.type;
437 440 cb->ackreq = hdr.fc.ack_request;
438 if (hdr.fc.ack_request) 441 cb->secen = hdr.fc.security_enabled;
439 mac_cb(skb)->flags |= MAC_CB_FLAG_ACKREQ;
440 if (hdr.fc.security_enabled)
441 mac_cb(skb)->flags |= MAC_CB_FLAG_SECEN;
442 442
443 mac802154_print_addr("destination", &hdr.dest); 443 mac802154_print_addr("destination", &hdr.dest);
444 mac802154_print_addr("source", &hdr.source); 444 mac802154_print_addr("source", &hdr.source);
445 445
446 mac_cb(skb)->source = hdr.source; 446 cb->source = hdr.source;
447 mac_cb(skb)->dest = hdr.dest; 447 cb->dest = hdr.dest;
448 448
449 if (hdr.fc.security_enabled) { 449 if (hdr.fc.security_enabled) {
450 u64 key; 450 u64 key;