summaryrefslogtreecommitdiff
path: root/net/mac802154/mib.c
diff options
context:
space:
mode:
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>2014-03-14 21:24:01 +0100
committerDavid S. Miller <davem@davemloft.net>2014-03-14 22:15:26 -0400
commite6278d92005e9d6e374f269b4ce39c908a68ad5d (patch)
tree4991dd3441843d55104c0fdba78cf36ed5d75034 /net/mac802154/mib.c
parent94b4f6c21cf54029377a0645675a9d81b6cf890d (diff)
mac802154: use header operations to create/parse headers
Use the operations on 802.15.4 header structs introduced in a previous patch to create and parse all headers in the mac802154 stack. This patch reduces code duplication between different parts of the mac802154 stack that needed information from headers, and also fixes a few bugs that seem to have gone unnoticed until now: * 802.15.4 dgram sockets would return a slightly incorrect value for the SIOCINQ ioctl * mac802154 would not drop frames with the "security enabled" bit set, even though it does not support security, in violation of the standard Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac802154/mib.c')
-rw-r--r--net/mac802154/mib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/mac802154/mib.c b/net/mac802154/mib.c
index ba5abdcbd25f..153bd1ddbfbb 100644
--- a/net/mac802154/mib.c
+++ b/net/mac802154/mib.c
@@ -26,6 +26,7 @@
#include <net/mac802154.h>
#include <net/ieee802154_netdev.h>
#include <net/wpan-phy.h>
+#include <net/ieee802154_netdev.h>
#include "mac802154.h"
@@ -115,13 +116,12 @@ void mac802154_dev_set_ieee_addr(struct net_device *dev)
{
struct mac802154_sub_if_data *priv = netdev_priv(dev);
struct mac802154_priv *mac = priv->hw;
- __le64 addr;
- addr = ieee802154_devaddr_from_raw(dev->dev_addr);
- priv->extended_addr = addr;
+ priv->extended_addr = ieee802154_devaddr_from_raw(dev->dev_addr);
- if (mac->ops->set_hw_addr_filt && mac->hw.hw_filt.ieee_addr != addr) {
- mac->hw.hw_filt.ieee_addr = addr;
+ if (mac->ops->set_hw_addr_filt &&
+ mac->hw.hw_filt.ieee_addr != priv->extended_addr) {
+ mac->hw.hw_filt.ieee_addr = priv->extended_addr;
set_hw_addr_filt(dev, IEEE802515_AFILT_IEEEADDR_CHANGED);
}
}