1 #ifndef __CFG802154_RDEV_OPS
2 #define __CFG802154_RDEV_OPS
4 #include <net/cfg802154.h>
9 static inline struct net_device *
10 rdev_add_virtual_intf_deprecated(struct cfg802154_registered_device *rdev,
12 unsigned char name_assign_type,
15 return rdev->ops->add_virtual_intf_deprecated(&rdev->wpan_phy, name,
16 name_assign_type, type);
20 rdev_del_virtual_intf_deprecated(struct cfg802154_registered_device *rdev,
21 struct net_device *dev)
23 rdev->ops->del_virtual_intf_deprecated(&rdev->wpan_phy, dev);
27 rdev_suspend(struct cfg802154_registered_device *rdev)
30 trace_802154_rdev_suspend(&rdev->wpan_phy);
31 ret = rdev->ops->suspend(&rdev->wpan_phy);
32 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
37 rdev_resume(struct cfg802154_registered_device *rdev)
40 trace_802154_rdev_resume(&rdev->wpan_phy);
41 ret = rdev->ops->resume(&rdev->wpan_phy);
42 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
47 rdev_add_virtual_intf(struct cfg802154_registered_device *rdev, char *name,
48 unsigned char name_assign_type,
49 enum nl802154_iftype type, __le64 extended_addr)
53 trace_802154_rdev_add_virtual_intf(&rdev->wpan_phy, name, type,
55 ret = rdev->ops->add_virtual_intf(&rdev->wpan_phy, name,
56 name_assign_type, type,
58 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
63 rdev_del_virtual_intf(struct cfg802154_registered_device *rdev,
64 struct wpan_dev *wpan_dev)
68 trace_802154_rdev_del_virtual_intf(&rdev->wpan_phy, wpan_dev);
69 ret = rdev->ops->del_virtual_intf(&rdev->wpan_phy, wpan_dev);
70 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
75 rdev_set_channel(struct cfg802154_registered_device *rdev, u8 page, u8 channel)
79 trace_802154_rdev_set_channel(&rdev->wpan_phy, page, channel);
80 ret = rdev->ops->set_channel(&rdev->wpan_phy, page, channel);
81 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
86 rdev_set_cca_mode(struct cfg802154_registered_device *rdev,
87 const struct wpan_phy_cca *cca)
91 trace_802154_rdev_set_cca_mode(&rdev->wpan_phy, cca);
92 ret = rdev->ops->set_cca_mode(&rdev->wpan_phy, cca);
93 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
98 rdev_set_cca_ed_level(struct cfg802154_registered_device *rdev, s32 ed_level)
102 trace_802154_rdev_set_cca_ed_level(&rdev->wpan_phy, ed_level);
103 ret = rdev->ops->set_cca_ed_level(&rdev->wpan_phy, ed_level);
104 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
109 rdev_set_tx_power(struct cfg802154_registered_device *rdev,
114 trace_802154_rdev_set_tx_power(&rdev->wpan_phy, power);
115 ret = rdev->ops->set_tx_power(&rdev->wpan_phy, power);
116 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
121 rdev_set_pan_id(struct cfg802154_registered_device *rdev,
122 struct wpan_dev *wpan_dev, __le16 pan_id)
126 trace_802154_rdev_set_pan_id(&rdev->wpan_phy, wpan_dev, pan_id);
127 ret = rdev->ops->set_pan_id(&rdev->wpan_phy, wpan_dev, pan_id);
128 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
133 rdev_set_short_addr(struct cfg802154_registered_device *rdev,
134 struct wpan_dev *wpan_dev, __le16 short_addr)
138 trace_802154_rdev_set_short_addr(&rdev->wpan_phy, wpan_dev, short_addr);
139 ret = rdev->ops->set_short_addr(&rdev->wpan_phy, wpan_dev, short_addr);
140 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
145 rdev_set_backoff_exponent(struct cfg802154_registered_device *rdev,
146 struct wpan_dev *wpan_dev, u8 min_be, u8 max_be)
150 trace_802154_rdev_set_backoff_exponent(&rdev->wpan_phy, wpan_dev,
152 ret = rdev->ops->set_backoff_exponent(&rdev->wpan_phy, wpan_dev,
154 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
159 rdev_set_max_csma_backoffs(struct cfg802154_registered_device *rdev,
160 struct wpan_dev *wpan_dev, u8 max_csma_backoffs)
164 trace_802154_rdev_set_csma_backoffs(&rdev->wpan_phy, wpan_dev,
166 ret = rdev->ops->set_max_csma_backoffs(&rdev->wpan_phy, wpan_dev,
168 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
173 rdev_set_max_frame_retries(struct cfg802154_registered_device *rdev,
174 struct wpan_dev *wpan_dev, s8 max_frame_retries)
178 trace_802154_rdev_set_max_frame_retries(&rdev->wpan_phy, wpan_dev,
180 ret = rdev->ops->set_max_frame_retries(&rdev->wpan_phy, wpan_dev,
182 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
187 rdev_set_lbt_mode(struct cfg802154_registered_device *rdev,
188 struct wpan_dev *wpan_dev, bool mode)
192 trace_802154_rdev_set_lbt_mode(&rdev->wpan_phy, wpan_dev, mode);
193 ret = rdev->ops->set_lbt_mode(&rdev->wpan_phy, wpan_dev, mode);
194 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
199 rdev_set_ackreq_default(struct cfg802154_registered_device *rdev,
200 struct wpan_dev *wpan_dev, bool ackreq)
204 trace_802154_rdev_set_ackreq_default(&rdev->wpan_phy, wpan_dev,
206 ret = rdev->ops->set_ackreq_default(&rdev->wpan_phy, wpan_dev, ackreq);
207 trace_802154_rdev_return_int(&rdev->wpan_phy, ret);
211 #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
212 /* TODO this is already a nl802154, so move into ieee802154 */
214 rdev_get_llsec_table(struct cfg802154_registered_device *rdev,
215 struct wpan_dev *wpan_dev,
216 struct ieee802154_llsec_table **table)
218 rdev->ops->get_llsec_table(&rdev->wpan_phy, wpan_dev, table);
222 rdev_lock_llsec_table(struct cfg802154_registered_device *rdev,
223 struct wpan_dev *wpan_dev)
225 rdev->ops->lock_llsec_table(&rdev->wpan_phy, wpan_dev);
229 rdev_unlock_llsec_table(struct cfg802154_registered_device *rdev,
230 struct wpan_dev *wpan_dev)
232 rdev->ops->unlock_llsec_table(&rdev->wpan_phy, wpan_dev);
236 rdev_get_llsec_params(struct cfg802154_registered_device *rdev,
237 struct wpan_dev *wpan_dev,
238 struct ieee802154_llsec_params *params)
240 return rdev->ops->get_llsec_params(&rdev->wpan_phy, wpan_dev, params);
244 rdev_set_llsec_params(struct cfg802154_registered_device *rdev,
245 struct wpan_dev *wpan_dev,
246 const struct ieee802154_llsec_params *params,
249 return rdev->ops->set_llsec_params(&rdev->wpan_phy, wpan_dev, params,
254 rdev_add_llsec_key(struct cfg802154_registered_device *rdev,
255 struct wpan_dev *wpan_dev,
256 const struct ieee802154_llsec_key_id *id,
257 const struct ieee802154_llsec_key *key)
259 return rdev->ops->add_llsec_key(&rdev->wpan_phy, wpan_dev, id, key);
263 rdev_del_llsec_key(struct cfg802154_registered_device *rdev,
264 struct wpan_dev *wpan_dev,
265 const struct ieee802154_llsec_key_id *id)
267 return rdev->ops->del_llsec_key(&rdev->wpan_phy, wpan_dev, id);
271 rdev_add_seclevel(struct cfg802154_registered_device *rdev,
272 struct wpan_dev *wpan_dev,
273 const struct ieee802154_llsec_seclevel *sl)
275 return rdev->ops->add_seclevel(&rdev->wpan_phy, wpan_dev, sl);
279 rdev_del_seclevel(struct cfg802154_registered_device *rdev,
280 struct wpan_dev *wpan_dev,
281 const struct ieee802154_llsec_seclevel *sl)
283 return rdev->ops->del_seclevel(&rdev->wpan_phy, wpan_dev, sl);
287 rdev_add_device(struct cfg802154_registered_device *rdev,
288 struct wpan_dev *wpan_dev,
289 const struct ieee802154_llsec_device *dev_desc)
291 return rdev->ops->add_device(&rdev->wpan_phy, wpan_dev, dev_desc);
295 rdev_del_device(struct cfg802154_registered_device *rdev,
296 struct wpan_dev *wpan_dev, __le64 extended_addr)
298 return rdev->ops->del_device(&rdev->wpan_phy, wpan_dev, extended_addr);
302 rdev_add_devkey(struct cfg802154_registered_device *rdev,
303 struct wpan_dev *wpan_dev, __le64 extended_addr,
304 const struct ieee802154_llsec_device_key *devkey)
306 return rdev->ops->add_devkey(&rdev->wpan_phy, wpan_dev, extended_addr,
311 rdev_del_devkey(struct cfg802154_registered_device *rdev,
312 struct wpan_dev *wpan_dev, __le64 extended_addr,
313 const struct ieee802154_llsec_device_key *devkey)
315 return rdev->ops->del_devkey(&rdev->wpan_phy, wpan_dev, extended_addr,
318 #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
320 #endif /* __CFG802154_RDEV_OPS */