aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:44:43 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:42 -0400
commitfea3318d20776a94afeea0460c6ee9904e60569e (patch)
tree07af7d4b42998da70ed5c61d427b79282101f93c /net/mac802154
parent72f655e44db9c7e835ceba96dc03cbe979d3f80d (diff)
ieee802154: add several phy supported handling
This patch adds support for phy supported handling for all other already existing handling 802.15.4 functionality. We assume now a fully 802.15.4 complaint transceiver at phy allocation. If a transceiver can support 802.15.4 default values only, then the values should be overwirtten by values the transceiver supports. If the transceiver doesn't set the according hardware flags, we assume the 802.15.4 defaults now which cannot be changed. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Suggested-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 08cb32dc8fd3..ddcd6ff8d39c 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -107,6 +107,15 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
107 107
108 skb_queue_head_init(&local->skb_queue); 108 skb_queue_head_init(&local->skb_queue);
109 109
110 /* init supported flags with 802.15.4 default ranges */
111 phy->supported.max_minbe = 8;
112 phy->supported.min_maxbe = 3;
113 phy->supported.max_maxbe = 8;
114 phy->supported.min_frame_retries = -1;
115 phy->supported.max_frame_retries = 7;
116 phy->supported.max_csma_backoffs = 5;
117 phy->supported.lbt = NL802154_SUPPORTED_BOOL_FALSE;
118
110 return &local->hw; 119 return &local->hw;
111} 120}
112EXPORT_SYMBOL(ieee802154_alloc_hw); 121EXPORT_SYMBOL(ieee802154_alloc_hw);
@@ -155,6 +164,23 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
155 164
156 ieee802154_setup_wpan_phy_pib(local->phy); 165 ieee802154_setup_wpan_phy_pib(local->phy);
157 166
167 if (!(hw->flags & IEEE802154_HW_CSMA_PARAMS)) {
168 local->phy->supported.min_csma_backoffs = 4;
169 local->phy->supported.max_csma_backoffs = 4;
170 local->phy->supported.min_maxbe = 5;
171 local->phy->supported.max_maxbe = 5;
172 local->phy->supported.min_minbe = 3;
173 local->phy->supported.max_minbe = 3;
174 }
175
176 if (!(hw->flags & IEEE802154_HW_FRAME_RETRIES)) {
177 /* TODO should be 3, but our default value is -1 which means
178 * no ARET handling.
179 */
180 local->phy->supported.min_frame_retries = -1;
181 local->phy->supported.max_frame_retries = -1;
182 }
183
158 rc = wpan_phy_register(local->phy); 184 rc = wpan_phy_register(local->phy);
159 if (rc < 0) 185 if (rc < 0)
160 goto out_wq; 186 goto out_wq;