Commit 641459ca authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Marcel Holtmann

mac802154: mac802154_mlme_start_req() optimisation.

mac802154_mlme_start_req() calls
ieee802154_mlme_ops(dev)->llsec->set_params() on the net_device
passed into it, however, this net_device will always be a mac802154
net_device, so just call mac802154_set_params() directly instead.
Signed-off-by: default avatarLennert Buytenhek <buytenh@wantstofly.org>
Acked-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 66a3297f
...@@ -36,8 +36,8 @@ static int mac802154_mlme_start_req(struct net_device *dev, ...@@ -36,8 +36,8 @@ static int mac802154_mlme_start_req(struct net_device *dev,
u8 pan_coord, u8 blx, u8 pan_coord, u8 blx,
u8 coord_realign) u8 coord_realign)
{ {
struct ieee802154_mlme_ops *ops = ieee802154_mlme_ops(dev); struct ieee802154_llsec_params params;
int rc = 0; int changed = 0;
ASSERT_RTNL(); ASSERT_RTNL();
...@@ -47,13 +47,6 @@ static int mac802154_mlme_start_req(struct net_device *dev, ...@@ -47,13 +47,6 @@ static int mac802154_mlme_start_req(struct net_device *dev,
dev->ieee802154_ptr->short_addr = addr->short_addr; dev->ieee802154_ptr->short_addr = addr->short_addr;
mac802154_dev_set_page_channel(dev, page, channel); mac802154_dev_set_page_channel(dev, page, channel);
if (ops->llsec) {
struct ieee802154_llsec_params params;
int changed = 0;
params.coord_shortaddr = addr->short_addr;
changed |= IEEE802154_LLSEC_PARAM_COORD_SHORTADDR;
params.pan_id = addr->pan_id; params.pan_id = addr->pan_id;
changed |= IEEE802154_LLSEC_PARAM_PAN_ID; changed |= IEEE802154_LLSEC_PARAM_PAN_ID;
...@@ -63,10 +56,10 @@ static int mac802154_mlme_start_req(struct net_device *dev, ...@@ -63,10 +56,10 @@ static int mac802154_mlme_start_req(struct net_device *dev,
params.coord_hwaddr = params.hwaddr; params.coord_hwaddr = params.hwaddr;
changed |= IEEE802154_LLSEC_PARAM_COORD_HWADDR; changed |= IEEE802154_LLSEC_PARAM_COORD_HWADDR;
rc = ops->llsec->set_params(dev, &params, changed); params.coord_shortaddr = addr->short_addr;
} changed |= IEEE802154_LLSEC_PARAM_COORD_SHORTADDR;
return rc; return mac802154_set_params(dev, &params, changed);
} }
static int mac802154_set_mac_params(struct net_device *dev, static int mac802154_set_mac_params(struct net_device *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