diff options
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/cfg.c | 9 | ||||
-rw-r--r-- | net/mac802154/ieee802154_i.h | 3 | ||||
-rw-r--r-- | net/mac802154/iface.c | 5 | ||||
-rw-r--r-- | net/mac802154/llsec.c | 4 | ||||
-rw-r--r-- | net/mac802154/main.c | 7 |
5 files changed, 18 insertions, 10 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c index 5d9f68c75e5f..70be9c799f8a 100644 --- a/net/mac802154/cfg.c +++ b/net/mac802154/cfg.c | |||
@@ -22,13 +22,14 @@ | |||
22 | 22 | ||
23 | static struct net_device * | 23 | static struct net_device * |
24 | ieee802154_add_iface_deprecated(struct wpan_phy *wpan_phy, | 24 | ieee802154_add_iface_deprecated(struct wpan_phy *wpan_phy, |
25 | const char *name, int type) | 25 | const char *name, |
26 | unsigned char name_assign_type, int type) | ||
26 | { | 27 | { |
27 | struct ieee802154_local *local = wpan_phy_priv(wpan_phy); | 28 | struct ieee802154_local *local = wpan_phy_priv(wpan_phy); |
28 | struct net_device *dev; | 29 | struct net_device *dev; |
29 | 30 | ||
30 | rtnl_lock(); | 31 | rtnl_lock(); |
31 | dev = ieee802154_if_add(local, name, type, | 32 | dev = ieee802154_if_add(local, name, name_assign_type, type, |
32 | cpu_to_le64(0x0000000000000000ULL)); | 33 | cpu_to_le64(0x0000000000000000ULL)); |
33 | rtnl_unlock(); | 34 | rtnl_unlock(); |
34 | 35 | ||
@@ -45,12 +46,14 @@ static void ieee802154_del_iface_deprecated(struct wpan_phy *wpan_phy, | |||
45 | 46 | ||
46 | static int | 47 | static int |
47 | ieee802154_add_iface(struct wpan_phy *phy, const char *name, | 48 | ieee802154_add_iface(struct wpan_phy *phy, const char *name, |
49 | unsigned char name_assign_type, | ||
48 | enum nl802154_iftype type, __le64 extended_addr) | 50 | enum nl802154_iftype type, __le64 extended_addr) |
49 | { | 51 | { |
50 | struct ieee802154_local *local = wpan_phy_priv(phy); | 52 | struct ieee802154_local *local = wpan_phy_priv(phy); |
51 | struct net_device *err; | 53 | struct net_device *err; |
52 | 54 | ||
53 | err = ieee802154_if_add(local, name, type, extended_addr); | 55 | err = ieee802154_if_add(local, name, name_assign_type, type, |
56 | extended_addr); | ||
54 | return PTR_ERR_OR_ZERO(err); | 57 | return PTR_ERR_OR_ZERO(err); |
55 | } | 58 | } |
56 | 59 | ||
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index bebd70ffc7a3..127ba18386fc 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h | |||
@@ -182,7 +182,8 @@ void ieee802154_iface_exit(void); | |||
182 | void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata); | 182 | void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata); |
183 | struct net_device * | 183 | struct net_device * |
184 | ieee802154_if_add(struct ieee802154_local *local, const char *name, | 184 | ieee802154_if_add(struct ieee802154_local *local, const char *name, |
185 | enum nl802154_iftype type, __le64 extended_addr); | 185 | unsigned char name_assign_type, enum nl802154_iftype type, |
186 | __le64 extended_addr); | ||
186 | void ieee802154_remove_interfaces(struct ieee802154_local *local); | 187 | void ieee802154_remove_interfaces(struct ieee802154_local *local); |
187 | 188 | ||
188 | #endif /* __IEEE802154_I_H */ | 189 | #endif /* __IEEE802154_I_H */ |
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 38b56f9d9386..91b75abbd1a1 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c | |||
@@ -522,7 +522,8 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, | |||
522 | 522 | ||
523 | struct net_device * | 523 | struct net_device * |
524 | ieee802154_if_add(struct ieee802154_local *local, const char *name, | 524 | ieee802154_if_add(struct ieee802154_local *local, const char *name, |
525 | enum nl802154_iftype type, __le64 extended_addr) | 525 | unsigned char name_assign_type, enum nl802154_iftype type, |
526 | __le64 extended_addr) | ||
526 | { | 527 | { |
527 | struct net_device *ndev = NULL; | 528 | struct net_device *ndev = NULL; |
528 | struct ieee802154_sub_if_data *sdata = NULL; | 529 | struct ieee802154_sub_if_data *sdata = NULL; |
@@ -531,7 +532,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name, | |||
531 | ASSERT_RTNL(); | 532 | ASSERT_RTNL(); |
532 | 533 | ||
533 | ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, name, | 534 | ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, name, |
534 | NET_NAME_UNKNOWN, ieee802154_if_setup); | 535 | name_assign_type, ieee802154_if_setup); |
535 | if (!ndev) | 536 | if (!ndev) |
536 | return ERR_PTR(-ENOMEM); | 537 | return ERR_PTR(-ENOMEM); |
537 | 538 | ||
diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c index dcf73958133a..5b2be12832e6 100644 --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c | |||
@@ -134,7 +134,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template) | |||
134 | for (i = 0; i < ARRAY_SIZE(key->tfm); i++) { | 134 | for (i = 0; i < ARRAY_SIZE(key->tfm); i++) { |
135 | key->tfm[i] = crypto_alloc_aead("ccm(aes)", 0, | 135 | key->tfm[i] = crypto_alloc_aead("ccm(aes)", 0, |
136 | CRYPTO_ALG_ASYNC); | 136 | CRYPTO_ALG_ASYNC); |
137 | if (!key->tfm[i]) | 137 | if (IS_ERR(key->tfm[i])) |
138 | goto err_tfm; | 138 | goto err_tfm; |
139 | if (crypto_aead_setkey(key->tfm[i], template->key, | 139 | if (crypto_aead_setkey(key->tfm[i], template->key, |
140 | IEEE802154_LLSEC_KEY_SIZE)) | 140 | IEEE802154_LLSEC_KEY_SIZE)) |
@@ -144,7 +144,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | key->tfm0 = crypto_alloc_blkcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC); | 146 | key->tfm0 = crypto_alloc_blkcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC); |
147 | if (!key->tfm0) | 147 | if (IS_ERR(key->tfm0)) |
148 | goto err_tfm; | 148 | goto err_tfm; |
149 | 149 | ||
150 | if (crypto_blkcipher_setkey(key->tfm0, template->key, | 150 | if (crypto_blkcipher_setkey(key->tfm0, template->key, |
diff --git a/net/mac802154/main.c b/net/mac802154/main.c index 8500378c8318..08cb32dc8fd3 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c | |||
@@ -161,18 +161,21 @@ int ieee802154_register_hw(struct ieee802154_hw *hw) | |||
161 | 161 | ||
162 | rtnl_lock(); | 162 | rtnl_lock(); |
163 | 163 | ||
164 | dev = ieee802154_if_add(local, "wpan%d", NL802154_IFTYPE_NODE, | 164 | dev = ieee802154_if_add(local, "wpan%d", NET_NAME_ENUM, |
165 | NL802154_IFTYPE_NODE, | ||
165 | cpu_to_le64(0x0000000000000000ULL)); | 166 | cpu_to_le64(0x0000000000000000ULL)); |
166 | if (IS_ERR(dev)) { | 167 | if (IS_ERR(dev)) { |
167 | rtnl_unlock(); | 168 | rtnl_unlock(); |
168 | rc = PTR_ERR(dev); | 169 | rc = PTR_ERR(dev); |
169 | goto out_wq; | 170 | goto out_phy; |
170 | } | 171 | } |
171 | 172 | ||
172 | rtnl_unlock(); | 173 | rtnl_unlock(); |
173 | 174 | ||
174 | return 0; | 175 | return 0; |
175 | 176 | ||
177 | out_phy: | ||
178 | wpan_phy_unregister(local->phy); | ||
176 | out_wq: | 179 | out_wq: |
177 | destroy_workqueue(local->workqueue); | 180 | destroy_workqueue(local->workqueue); |
178 | out: | 181 | out: |