diff options
| author | Lennert Buytenhek <buytenh@wantstofly.org> | 2015-05-25 08:38:51 -0400 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2015-05-26 14:26:10 -0400 |
| commit | 641459ca336edc009e044b76d16ee3d1ca6464c0 (patch) | |
| tree | 61aaa96ea72a06de08837df1021dc6c2cadeee52 /net/mac802154 | |
| parent | 66a3297f6d3f9dc35e27c3cec6b4437ac13f07ff (diff) | |
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: Lennert Buytenhek <buytenh@wantstofly.org>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
| -rw-r--r-- | net/mac802154/mac_cmd.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c index 5220c2b2735b..8606da459ff3 100644 --- a/net/mac802154/mac_cmd.c +++ b/net/mac802154/mac_cmd.c | |||
| @@ -36,8 +36,8 @@ static int mac802154_mlme_start_req(struct net_device *dev, | |||
| 36 | u8 pan_coord, u8 blx, | 36 | u8 pan_coord, u8 blx, |
| 37 | u8 coord_realign) | 37 | u8 coord_realign) |
| 38 | { | 38 | { |
| 39 | struct ieee802154_mlme_ops *ops = ieee802154_mlme_ops(dev); | 39 | struct ieee802154_llsec_params params; |
| 40 | int rc = 0; | 40 | int changed = 0; |
| 41 | 41 | ||
| 42 | ASSERT_RTNL(); | 42 | ASSERT_RTNL(); |
| 43 | 43 | ||
| @@ -47,26 +47,19 @@ static int mac802154_mlme_start_req(struct net_device *dev, | |||
| 47 | dev->ieee802154_ptr->short_addr = addr->short_addr; | 47 | dev->ieee802154_ptr->short_addr = addr->short_addr; |
| 48 | mac802154_dev_set_page_channel(dev, page, channel); | 48 | mac802154_dev_set_page_channel(dev, page, channel); |
| 49 | 49 | ||
| 50 | if (ops->llsec) { | 50 | params.pan_id = addr->pan_id; |
| 51 | struct ieee802154_llsec_params params; | 51 | changed |= IEEE802154_LLSEC_PARAM_PAN_ID; |
| 52 | int changed = 0; | ||
| 53 | 52 | ||
| 54 | params.coord_shortaddr = addr->short_addr; | 53 | params.hwaddr = ieee802154_devaddr_from_raw(dev->dev_addr); |
| 55 | changed |= IEEE802154_LLSEC_PARAM_COORD_SHORTADDR; | 54 | changed |= IEEE802154_LLSEC_PARAM_HWADDR; |
| 56 | 55 | ||
| 57 | params.pan_id = addr->pan_id; | 56 | params.coord_hwaddr = params.hwaddr; |
| 58 | changed |= IEEE802154_LLSEC_PARAM_PAN_ID; | 57 | changed |= IEEE802154_LLSEC_PARAM_COORD_HWADDR; |
| 59 | 58 | ||
| 60 | params.hwaddr = ieee802154_devaddr_from_raw(dev->dev_addr); | 59 | params.coord_shortaddr = addr->short_addr; |
| 61 | changed |= IEEE802154_LLSEC_PARAM_HWADDR; | 60 | changed |= IEEE802154_LLSEC_PARAM_COORD_SHORTADDR; |
| 62 | 61 | ||
| 63 | params.coord_hwaddr = params.hwaddr; | 62 | return mac802154_set_params(dev, ¶ms, changed); |
| 64 | changed |= IEEE802154_LLSEC_PARAM_COORD_HWADDR; | ||
| 65 | |||
| 66 | rc = ops->llsec->set_params(dev, ¶ms, changed); | ||
| 67 | } | ||
| 68 | |||
| 69 | return rc; | ||
| 70 | } | 63 | } |
| 71 | 64 | ||
| 72 | static int mac802154_set_mac_params(struct net_device *dev, | 65 | static int mac802154_set_mac_params(struct net_device *dev, |
