[riot-notifications] [RIOT-OS/RIOT] at86rf2xx: move PHY and MAC layer settings to netdev interface (#11717)

José Alamos notifications at github.com
Tue Jun 18 13:46:14 CEST 2019


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description
This PR is the first step of #11483 for moving the PHY and MAC logic out of drivers and define common layers for all transceivers.

The changes are:
- Remove `at86rf2xx_get_{pan, long_addr, short_addr}` and add `hwfilter` prefix to the setters. Usually devices are not aware of any kind of addresses (PAN ID, long address, short address) unless there device has hardware address filtering. In that case only setters for hardware address filters are needed (getters might be useful for testing though). In fact, most of this functions are replaced by netdev_ieee802154 stuff.
- Merge `at86rf2xx_set_channel` and `at86rf2xx_set_page` into `at86rf2xx_configure_phy`. In practice, the tuple `(channel_number, channel_page)` describes the PHY channel configuration, and these 2 numbers are not independent.
- Add `txpower` and `page` to netdev_ieee802154. These 2 variables are part of the Physical Information Base of the IEEE802154 PHY layer so they are not device specific.
- Change API of power and rx sensitivity getters/setters: I noticed they always convert from dBm to and from the internal representation values. In practice, upper layers are only interested in the value in dBm. Thus, this logic is handled in the netdev abstraction and the device only sets/gets the internal value.

With this change, the `at86rf2xx_getset.c` file is not dependent on `netdev` anymore.
<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure
Run `tests/drivers_at86rf2xx` and perform common operations (change addresses, send packets, etc).
<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references
#11483 
<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11717

-- Commit Summary --

  * at86rf2xx: unify configure PHY function
  * netdev_ieee802154: add channel page to descriptor
  * at86rf2xx: add at86rf2xx_phy_is_supported function
  * at86rf2xx_netdev: change checks of channel number and page
  * at86rf2xx_netdev: use SUBGHZ define for page logic
  * netdev_ieee802154: add txpower to descriptor
  * at86rf2xx_netdev: use netdev txpower instead of device
  * at86rf2xx: move PHY settings out of driver reset function
  * at86rf2xx: move sub ghz power correction to PHY layer
  * at87rf2xx: move txpower and rxsensitivity logic to PHY
  * at86rf2xx: move MAC addresses to netdev
  * at87rf2xx: move CSMA seed init to netdev

-- File Changes --

    M drivers/at86rf2xx/at86rf2xx.c (29)
    M drivers/at86rf2xx/at86rf2xx_getset.c (232)
    M drivers/at86rf2xx/at86rf2xx_internal.c (18)
    M drivers/at86rf2xx/at86rf2xx_netdev.c (210)
    M drivers/at86rf2xx/include/at86rf2xx_internal.h (8)
    M drivers/include/at86rf2xx.h (76)
    M drivers/include/net/netdev/ieee802154.h (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11717.patch
https://github.com/RIOT-OS/RIOT/pull/11717.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11717
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190618/97fe1a69/attachment.html>


More information about the notifications mailing list