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 | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 24 | rdev_set_channel(struct cfg802154_registered_device *rdev, u8 page, u8 channel) |
Alexander Aring | ab0bd56 | 2014-11-12 03:36:55 +0100 | [diff] [blame] | 25 | { |
| 26 | return rdev->ops->set_channel(&rdev->wpan_phy, page, channel); |
| 27 | } |
| 28 | |
Alexander Aring | 702bf37 | 2014-11-12 03:36:57 +0100 | [diff] [blame] | 29 | static inline int |
| 30 | rdev_set_pan_id(struct cfg802154_registered_device *rdev, |
| 31 | struct wpan_dev *wpan_dev, u16 pan_id) |
| 32 | { |
| 33 | return rdev->ops->set_pan_id(&rdev->wpan_phy, wpan_dev, pan_id); |
| 34 | } |
| 35 | |
Alexander Aring | 9830c62 | 2014-11-12 03:36:58 +0100 | [diff] [blame] | 36 | static inline int |
| 37 | rdev_set_short_addr(struct cfg802154_registered_device *rdev, |
| 38 | struct wpan_dev *wpan_dev, u16 short_addr) |
| 39 | { |
| 40 | return rdev->ops->set_short_addr(&rdev->wpan_phy, wpan_dev, short_addr); |
| 41 | } |
| 42 | |
Alexander Aring | 656a999 | 2014-11-12 03:36:59 +0100 | [diff] [blame] | 43 | static inline int |
| 44 | rdev_set_backoff_exponent(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 45 | struct wpan_dev *wpan_dev, u8 min_be, u8 max_be) |
Alexander Aring | 656a999 | 2014-11-12 03:36:59 +0100 | [diff] [blame] | 46 | { |
| 47 | return rdev->ops->set_backoff_exponent(&rdev->wpan_phy, wpan_dev, |
| 48 | min_be, max_be); |
| 49 | } |
| 50 | |
Alexander Aring | a01ba76 | 2014-11-12 03:37:01 +0100 | [diff] [blame] | 51 | static inline int |
| 52 | rdev_set_max_csma_backoffs(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 53 | struct wpan_dev *wpan_dev, u8 max_csma_backoffs) |
Alexander Aring | a01ba76 | 2014-11-12 03:37:01 +0100 | [diff] [blame] | 54 | { |
| 55 | return rdev->ops->set_max_csma_backoffs(&rdev->wpan_phy, wpan_dev, |
| 56 | max_csma_backoffs); |
| 57 | } |
| 58 | |
Alexander Aring | 17a3a46 | 2014-11-12 03:37:03 +0100 | [diff] [blame] | 59 | static inline int |
| 60 | rdev_set_max_frame_retries(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 61 | struct wpan_dev *wpan_dev, s8 max_frame_retries) |
Alexander Aring | 17a3a46 | 2014-11-12 03:37:03 +0100 | [diff] [blame] | 62 | { |
| 63 | return rdev->ops->set_max_frame_retries(&rdev->wpan_phy, wpan_dev, |
| 64 | max_frame_retries); |
| 65 | } |
| 66 | |
Alexander Aring | c8937a1d | 2014-11-12 03:37:05 +0100 | [diff] [blame] | 67 | static inline int |
| 68 | rdev_set_lbt_mode(struct cfg802154_registered_device *rdev, |
Alexander Aring | 628b1e1 | 2014-11-17 08:20:47 +0100 | [diff] [blame] | 69 | struct wpan_dev *wpan_dev, bool mode) |
Alexander Aring | c8937a1d | 2014-11-12 03:37:05 +0100 | [diff] [blame] | 70 | { |
| 71 | return rdev->ops->set_lbt_mode(&rdev->wpan_phy, wpan_dev, mode); |
| 72 | } |
| 73 | |
Alexander Aring | 4a9a816 | 2014-11-02 04:18:38 +0100 | [diff] [blame] | 74 | #endif /* __CFG802154_RDEV_OPS */ |