提交 0483546a 编写于 作者: T Tony Cheneau 提交者: David S. Miller

mac802154: add mac802154_dev_get_dsn()

Bring-over mac802154_dev_get_dsn() function that was present in the
Linux ZigBee kernel. This function is called by the 6LoWPAN code in
order to properly set the DSN (Data Sequence Number) value in the IEEE
802.15.4 frame.
Signed-off-by: NTony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d4ac3236
...@@ -114,5 +114,6 @@ void mac802154_dev_set_ieee_addr(struct net_device *dev); ...@@ -114,5 +114,6 @@ void mac802154_dev_set_ieee_addr(struct net_device *dev);
u16 mac802154_dev_get_pan_id(const struct net_device *dev); u16 mac802154_dev_get_pan_id(const struct net_device *dev);
void mac802154_dev_set_pan_id(struct net_device *dev, u16 val); void mac802154_dev_set_pan_id(struct net_device *dev, u16 val);
void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan); void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan);
u8 mac802154_dev_get_dsn(const struct net_device *dev);
#endif /* MAC802154_H */ #endif /* MAC802154_H */
...@@ -73,4 +73,5 @@ struct ieee802154_mlme_ops mac802154_mlme_wpan = { ...@@ -73,4 +73,5 @@ struct ieee802154_mlme_ops mac802154_mlme_wpan = {
.start_req = mac802154_mlme_start_req, .start_req = mac802154_mlme_start_req,
.get_pan_id = mac802154_dev_get_pan_id, .get_pan_id = mac802154_dev_get_pan_id,
.get_short_addr = mac802154_dev_get_short_addr, .get_short_addr = mac802154_dev_get_short_addr,
.get_dsn = mac802154_dev_get_dsn,
}; };
...@@ -159,6 +159,15 @@ void mac802154_dev_set_pan_id(struct net_device *dev, u16 val) ...@@ -159,6 +159,15 @@ void mac802154_dev_set_pan_id(struct net_device *dev, u16 val)
} }
} }
u8 mac802154_dev_get_dsn(const struct net_device *dev)
{
struct mac802154_sub_if_data *priv = netdev_priv(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
return priv->dsn++;
}
static void phy_chan_notify(struct work_struct *work) static void phy_chan_notify(struct work_struct *work)
{ {
struct phy_chan_notify_work *nw = container_of(work, struct phy_chan_notify_work *nw = container_of(work,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册