Alexander Aring | 4a9a816 | 2014-11-02 04:18:38 +0100 | [diff] [blame] | 1 | #ifndef __CFG802154_RDEV_OPS |
| 2 | #define __CFG802154_RDEV_OPS |
| 3 | |
| 4 | #include <net/cfg802154.h> |
| 5 | |
| 6 | #include "core.h" |
| 7 | |
| 8 | static inline struct net_device * |
| 9 | rdev_add_virtual_intf_deprecated(struct cfg802154_registered_device *rdev, |
| 10 | const char *name, int type) |
| 11 | { |
| 12 | return rdev->ops->add_virtual_intf_deprecated(&rdev->wpan_phy, name, |
| 13 | type); |
| 14 | } |
| 15 | |
| 16 | static inline void |
| 17 | rdev_del_virtual_intf_deprecated(struct cfg802154_registered_device *rdev, |
| 18 | struct net_device *dev) |
| 19 | { |
| 20 | rdev->ops->del_virtual_intf_deprecated(&rdev->wpan_phy, dev); |
| 21 | } |
| 22 | |
Alexander Aring | ab0bd56 | 2014-11-12 03:36:55 +0100 | [diff] [blame] | 23 | static inline int |
Alexander Aring | f3ea5e4 | 2014-11-17 08:20:51 +0100 | [diff] [blame] | 24 | rdev_add_virtual_intf(struct cfg802154_registered_device *rdev, char *name, |
Alexander Aring | 0e57547 | 2014-11-17 08:20:52 +0100 | [diff] [blame] | 25 | enum nl802154_iftype type, __le64 extended_addr) |
Alexander Aring | f3ea5e4 | 2014-11-17 08:20:51 +0100 | [diff] [blame] | 26 | { |
Alexander Aring | 0e57547 | 2014-11-17 08:20:52 +0100 | [diff] [blame] | 27 | return rdev->ops->add_virtual_intf(&rdev->wpan_phy, name, type, |
| 28 | extended_addr); |
Alexander Aring | f3ea5e4 | 2014-11-17 08:20:51 +0100 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | static inline int |
Alexander Aring | b821ecd | 2014-11-17 08:20:53 +0100 | [diff] [blame] | 32 | rdev_del_virtual_intf(struct cfg802154_registered_device *rdev, |
| 33 | struct wpan_dev *wpan_dev) |
| 34 | { |
| 35 | return rdev->ops->del_virtual_intf(&rdev->wpan_phy, wpan_dev); |
| 36 | } |
| 37 | |
| 38 | static inline int |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 39 | rdev_set_channel(struct cfg802154_registered_device *rdev, u8 page, u8 channel) |
Alexander Aring | ab0bd56 | 2014-11-12 03:36:55 +0100 | [diff] [blame] | 40 | { |
| 41 | return rdev->ops->set_channel(&rdev->wpan_phy, page, channel); |
| 42 | } |
| 43 | |
Alexander Aring | 702bf37 | 2014-11-12 03:36:57 +0100 | [diff] [blame] | 44 | static inline int |
Alexander Aring | ba2a950 | 2014-12-10 15:33:13 +0100 | [diff] [blame] | 45 | rdev_set_cca_mode(struct cfg802154_registered_device *rdev, |
| 46 | const struct wpan_phy_cca *cca) |
| 47 | { |
| 48 | return rdev->ops->set_cca_mode(&rdev->wpan_phy, cca); |
| 49 | } |
| 50 | |
| 51 | static inline int |
Alexander Aring | 702bf37 | 2014-11-12 03:36:57 +0100 | [diff] [blame] | 52 | rdev_set_pan_id(struct cfg802154_registered_device *rdev, |
Alexander Aring | ee7b905 | 2014-11-17 08:20:55 +0100 | [diff] [blame] | 53 | struct wpan_dev *wpan_dev, __le16 pan_id) |
Alexander Aring | 702bf37 | 2014-11-12 03:36:57 +0100 | [diff] [blame] | 54 | { |
| 55 | return rdev->ops->set_pan_id(&rdev->wpan_phy, wpan_dev, pan_id); |
| 56 | } |
| 57 | |
Alexander Aring | 9830c62 | 2014-11-12 03:36:58 +0100 | [diff] [blame] | 58 | static inline int |
| 59 | rdev_set_short_addr(struct cfg802154_registered_device *rdev, |
Alexander Aring | ee7b905 | 2014-11-17 08:20:55 +0100 | [diff] [blame] | 60 | struct wpan_dev *wpan_dev, __le16 short_addr) |
Alexander Aring | 9830c62 | 2014-11-12 03:36:58 +0100 | [diff] [blame] | 61 | { |
| 62 | return rdev->ops->set_short_addr(&rdev->wpan_phy, wpan_dev, short_addr); |
| 63 | } |
| 64 | |
Alexander Aring | 656a999 | 2014-11-12 03:36:59 +0100 | [diff] [blame] | 65 | static inline int |
| 66 | rdev_set_backoff_exponent(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 67 | struct wpan_dev *wpan_dev, u8 min_be, u8 max_be) |
Alexander Aring | 656a999 | 2014-11-12 03:36:59 +0100 | [diff] [blame] | 68 | { |
| 69 | return rdev->ops->set_backoff_exponent(&rdev->wpan_phy, wpan_dev, |
| 70 | min_be, max_be); |
| 71 | } |
| 72 | |
Alexander Aring | a01ba76 | 2014-11-12 03:37:01 +0100 | [diff] [blame] | 73 | static inline int |
| 74 | rdev_set_max_csma_backoffs(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 75 | struct wpan_dev *wpan_dev, u8 max_csma_backoffs) |
Alexander Aring | a01ba76 | 2014-11-12 03:37:01 +0100 | [diff] [blame] | 76 | { |
| 77 | return rdev->ops->set_max_csma_backoffs(&rdev->wpan_phy, wpan_dev, |
| 78 | max_csma_backoffs); |
| 79 | } |
| 80 | |
Alexander Aring | 17a3a46 | 2014-11-12 03:37:03 +0100 | [diff] [blame] | 81 | static inline int |
| 82 | rdev_set_max_frame_retries(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 83 | struct wpan_dev *wpan_dev, s8 max_frame_retries) |
Alexander Aring | 17a3a46 | 2014-11-12 03:37:03 +0100 | [diff] [blame] | 84 | { |
| 85 | return rdev->ops->set_max_frame_retries(&rdev->wpan_phy, wpan_dev, |
| 86 | max_frame_retries); |
| 87 | } |
| 88 | |
Alexander Aring | c8937a1d | 2014-11-12 03:37:05 +0100 | [diff] [blame] | 89 | static inline int |
| 90 | rdev_set_lbt_mode(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 91 | struct wpan_dev *wpan_dev, bool mode) |
Alexander Aring | c8937a1d | 2014-11-12 03:37:05 +0100 | [diff] [blame] | 92 | { |
| 93 | return rdev->ops->set_lbt_mode(&rdev->wpan_phy, wpan_dev, mode); |
| 94 | } |
| 95 | |
Alexander Aring | 4a9a816 | 2014-11-02 04:18:38 +0100 | [diff] [blame] | 96 | #endif /* __CFG802154_RDEV_OPS */ |