Commit 1caf6f47 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

ieee802154: 6lowpan: set ackreq when needed

This patch sets the acknowledge request bit inside the 802.15.4 mac
header when frame retries is 0 or above. The other frame retries value
which is -1 indicates that the transmitter doesn't care about an
acknowledge frame which will be ignored after transmitting if the node
sends anyway an ack frame after receiving. This is currently unnecessary
traffic if the max frame retries parameter is -1.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Reviewed-by: default avatarStefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent d6d244d4
......@@ -190,6 +190,7 @@ lowpan_xmit_fragmented(struct sk_buff *skb, struct net_device *dev,
static int lowpan_header(struct sk_buff *skb, struct net_device *dev)
{
struct wpan_dev *wpan_dev = lowpan_dev_info(dev)->real_dev->ieee802154_ptr;
struct ieee802154_addr sa, da;
struct ieee802154_mac_cb *cb = mac_cb_init(skb);
struct lowpan_addr_info info;
......@@ -207,7 +208,7 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *dev)
/* prepare wpan address data */
sa.mode = IEEE802154_ADDR_LONG;
sa.pan_id = lowpan_dev_info(dev)->real_dev->ieee802154_ptr->pan_id;
sa.pan_id = wpan_dev->pan_id;
sa.extended_addr = ieee802154_devaddr_from_raw(saddr);
/* intra-PAN communications */
......@@ -223,7 +224,7 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *dev)
} else {
da.mode = IEEE802154_ADDR_LONG;
da.extended_addr = ieee802154_devaddr_from_raw(daddr);
cb->ackreq = true;
cb->ackreq = wpan_dev->frame_retries >= 0;
}
return dev_hard_header(skb, lowpan_dev_info(dev)->real_dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment