mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Suggested-by: Phoebe Buckheister <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
This commit is contained in:
parent
72f655e44d
commit
fea3318d20
4 changed files with 90 additions and 6 deletions
|
|
@ -107,6 +107,15 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
|
|||
|
||||
skb_queue_head_init(&local->skb_queue);
|
||||
|
||||
/* init supported flags with 802.15.4 default ranges */
|
||||
phy->supported.max_minbe = 8;
|
||||
phy->supported.min_maxbe = 3;
|
||||
phy->supported.max_maxbe = 8;
|
||||
phy->supported.min_frame_retries = -1;
|
||||
phy->supported.max_frame_retries = 7;
|
||||
phy->supported.max_csma_backoffs = 5;
|
||||
phy->supported.lbt = NL802154_SUPPORTED_BOOL_FALSE;
|
||||
|
||||
return &local->hw;
|
||||
}
|
||||
EXPORT_SYMBOL(ieee802154_alloc_hw);
|
||||
|
|
@ -155,6 +164,23 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
|
|||
|
||||
ieee802154_setup_wpan_phy_pib(local->phy);
|
||||
|
||||
if (!(hw->flags & IEEE802154_HW_CSMA_PARAMS)) {
|
||||
local->phy->supported.min_csma_backoffs = 4;
|
||||
local->phy->supported.max_csma_backoffs = 4;
|
||||
local->phy->supported.min_maxbe = 5;
|
||||
local->phy->supported.max_maxbe = 5;
|
||||
local->phy->supported.min_minbe = 3;
|
||||
local->phy->supported.max_minbe = 3;
|
||||
}
|
||||
|
||||
if (!(hw->flags & IEEE802154_HW_FRAME_RETRIES)) {
|
||||
/* TODO should be 3, but our default value is -1 which means
|
||||
* no ARET handling.
|
||||
*/
|
||||
local->phy->supported.min_frame_retries = -1;
|
||||
local->phy->supported.max_frame_retries = -1;
|
||||
}
|
||||
|
||||
rc = wpan_phy_register(local->phy);
|
||||
if (rc < 0)
|
||||
goto out_wq;
|
||||
|
|
|
|||
Loading…
Reference in a new issue