summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>2014-03-31 21:37:46 +0200
committerDavid S. Miller <davem@davemloft.net>2014-04-01 16:25:51 -0400
commite462ded699aa2cca04b68fbf203ea4675d4c44d4 (patch)
tree4c7b2f9d1e456acad01eb052f2dfa7d8533d92d8 /include
parent336908f6d73ca297bd46948eb5d04d2020a88606 (diff)
downloadlinux-stable-e462ded699aa2cca04b68fbf203ea4675d4c44d4.tar.gz
linux-stable-e462ded699aa2cca04b68fbf203ea4675d4c44d4.tar.bz2
linux-stable-e462ded699aa2cca04b68fbf203ea4675d4c44d4.zip
mac802154: make csma/cca parameters per-wpan
Commit 9b2777d6089bcd (ieee802154: add TX power control to wpan_phy) and following erroneously added CSMA and CCA parameters for 802.15.4 devices as PHY parameters, while they are actually MAC parameters and can differ for any two WPAN instances. Since it is now sensible to have multiple WPAN devices with differing CSMA/CCA parameters, make these parameters MAC parameters instead. Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl802154.h2
-rw-r--r--include/net/ieee802154_netdev.h17
2 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index e110b8c266f5..c8d7f3965fff 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -132,7 +132,7 @@ enum {
IEEE802154_ADD_IFACE,
IEEE802154_DEL_IFACE,
- IEEE802154_SET_PHYPARAMS,
+ IEEE802154_SET_MACPARAMS,
__IEEE802154_CMD_MAX,
};
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h
index e1717cbf609b..5a719ca892f4 100644
--- a/include/net/ieee802154_netdev.h
+++ b/include/net/ieee802154_netdev.h
@@ -229,6 +229,18 @@ static inline int mac_cb_type(struct sk_buff *skb)
#define IEEE802154_MAC_SCAN_PASSIVE 2
#define IEEE802154_MAC_SCAN_ORPHAN 3
+struct ieee802154_mac_params {
+ s8 transmit_power;
+ u8 min_be;
+ u8 max_be;
+ u8 csma_retries;
+ s8 frame_retries;
+
+ bool lbt;
+ u8 cca_mode;
+ s32 cca_ed_level;
+};
+
struct wpan_phy;
/*
* This should be located at net_device->ml_priv
@@ -255,6 +267,11 @@ struct ieee802154_mlme_ops {
int (*scan_req)(struct net_device *dev,
u8 type, u32 channels, u8 page, u8 duration);
+ int (*set_mac_params)(struct net_device *dev,
+ const struct ieee802154_mac_params *params);
+ void (*get_mac_params)(struct net_device *dev,
+ struct ieee802154_mac_params *params);
+
/* The fields below are required. */
struct wpan_phy *(*get_phy)(const struct net_device *dev);