<h3>Contribution description</h3>
<p>This PR is the first step of <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="440008979" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11483" data-hovercard-type="issue" data-hovercard-url="/RIOT-OS/RIOT/issues/11483/hovercard" href="https://github.com/RIOT-OS/RIOT/issues/11483">#11483</a> for moving the PHY and MAC logic out of drivers and define common layers for all transceivers.</p>
<p>The changes are:</p>
<ul>
<li>Remove <code>at86rf2xx_get_{pan, long_addr, short_addr}</code> and add <code>hwfilter</code> 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.</li>
<li>Merge <code>at86rf2xx_set_channel</code> and <code>at86rf2xx_set_page</code> into <code>at86rf2xx_configure_phy</code>. In practice, the tuple <code>(channel_number, channel_page)</code> describes the PHY channel configuration, and these 2 numbers are not independent.</li>
<li>Add <code>txpower</code> and <code>page</code> to netdev_ieee802154. These 2 variables are part of the Physical Information Base of the IEEE802154 PHY layer so they are not device specific.</li>
<li>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.</li>
</ul>
<p>With this change, the <code>at86rf2xx_getset.c</code> file is not dependent on <code>netdev</code> anymore.</p>

<h3>Testing procedure</h3>
<p>Run <code>tests/drivers_at86rf2xx</code> and perform common operations (change addresses, send packets, etc).</p>

<h3>Issues/PRs references</h3>
<p><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="440008979" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11483" data-hovercard-type="issue" data-hovercard-url="/RIOT-OS/RIOT/issues/11483/hovercard" href="https://github.com/RIOT-OS/RIOT/issues/11483">#11483</a></p>


<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/11717'>https://github.com/RIOT-OS/RIOT/pull/11717</a></p>

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

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-0">drivers/at86rf2xx/at86rf2xx.c</a>
    (29)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-1">drivers/at86rf2xx/at86rf2xx_getset.c</a>
    (232)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-2">drivers/at86rf2xx/at86rf2xx_internal.c</a>
    (18)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-3">drivers/at86rf2xx/at86rf2xx_netdev.c</a>
    (210)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-4">drivers/at86rf2xx/include/at86rf2xx_internal.h</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-5">drivers/include/at86rf2xx.h</a>
    (76)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11717/files#diff-6">drivers/include/net/netdev/ieee802154.h</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11717.patch'>https://github.com/RIOT-OS/RIOT/pull/11717.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11717.diff'>https://github.com/RIOT-OS/RIOT/pull/11717.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11717?email_source=notifications&email_token=ABE7WYDU5E2YAJCFA7YYN33P3DDINA5CNFSM4HY7FFMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2D3PGA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYGTWWLGFNZ2GKWZZ5DP3DDINANCNFSM4HY7FFMA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYHB7W2JKRHXJOICUUDP3DDINA5CNFSM4HY7FFMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2D3PGA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11717?email_source=notifications\u0026email_token=ABE7WYDU5E2YAJCFA7YYN33P3DDINA5CNFSM4HY7FFMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2D3PGA",
"url": "https://github.com/RIOT-OS/RIOT/pull/11717?email_source=notifications\u0026email_token=ABE7WYDU5E2YAJCFA7YYN33P3DDINA5CNFSM4HY7FFMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2D3PGA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>