<h3>Contribution description</h3>
<p>This PR moves the netdev initialization in the gnrc_netif thread to the netif specific <code>ops</code>. This is required in order to remove the GNRC<-> netdev dependency and be able to use non netdev layers with GNRC netif (e.g <code>ieee802154_submac</code>).<br>
It also has the advantage that the specific interface has control of the netdev callbacks, in cases where the default is replaced ( <code>gnrc_lorawan</code>, <code>gnrc_gomach</code>, etc).</p>

<h3>Testing procedure</h3>
<p>Make sure that the following modules still work.</p>
<ul>
<li>esp_now_gnrc</li>
<li>nrfmin_gnrc</li>
<li>gnrc_netif_cc1xxx</li>
<li>gnrc_netif_nrf24l01p_ng</li>
<li>gnrc_xbee</li>
<li>nimble_netif</li>
<li>gomach</li>
<li>lwmac</li>
<li>gnrc_netif_ethernet</li>
<li>gnrc_netif_raw</li>
<li>gnrc_netif_ieee802154</li>
<li>gnrc_netif_lorawan</li>
</ul>

<h3>Issues/PRs references</h3>
<p>Same as <a href="https://github.com/RIOT-OS/RIOT/pull/13614/files">https://github.com/RIOT-OS/RIOT/pull/13614/files</a>, but this time going in smaller steps.</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/16918'>https://github.com/RIOT-OS/RIOT/pull/16918</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/30f92cd4a1d2500102c58e8e35630a05a0421c0a">net/gnrc_netif: add return values to init</a></li>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/4bd19ee8e979aa1ecd89bd9737201051db52087e">net/gnrc_netif: move netdev init code to ops->init</a></li>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/f59bf922891ba6146ec90df679b617d341c4e250">pkg/nimble/netif: adapt ops->init to handle driver initialization</a></li>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/fee330b342d46c537fb5e2b42a4e9af316bea828">net/gomach: adapt ops->init to handle driver initialization</a></li>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/0c6d313bb55147db00592dae82246b9eb6a04710">net/lwmac: adapt ops->init to handle driver initialization</a></li>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/942683dd4cbca44b4336ba7ec5de80e4c3197bbc">net/gnrc/lorawan: adapt ops->init to handle driver initialization</a></li>
  <li><a href="https://github.com/RIOT-OS/RIOT/pull/16918/commits/a3487c342a204200f3fd757cdf1aedb2b7cd068b">tests/gnrc_netif: adapt ops->init to handle driver initialization</a></li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-d1b6562c7153fdbfac99a708707aec36894eb39659d847a4e9032b939640556e">pkg/nimble/netif/nimble_netif.c</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-3166d0c85b3c32e3b3349286328fc8450229a87f10602d6d0ed2079a51fb6965">sys/include/net/gnrc/netif.h</a>
    (25)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-090a76a430dc1f52a7f2358195599a43ada390f84c2507961c32f97135a4bbfd">sys/net/gnrc/link_layer/gomach/gomach.c</a>
    (15)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-7b68c4395b14dd941c4478ee3585e2ebf6d372082a7f55be99144c741a64934e">sys/net/gnrc/link_layer/lwmac/lwmac.c</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-2ad823469e86d3772efecaa0f4bb5afcc1d6d039af9cc28db3535fcd292e28a6">sys/net/gnrc/netif/gnrc_netif.c</a>
    (23)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-78ee567a3ff73b1cc35dc49b94d0887bcecba500cbc23f72496147840e81596e">sys/net/gnrc/netif/lorawan/gnrc_netif_lorawan.c</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16918/files#diff-b734a9d2befddd51db825ef99ceee90f617feaf426bc4d674da26b493b8c7346">tests/gnrc_netif/main.c</a>
    (13)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16918.patch'>https://github.com/RIOT-OS/RIOT/pull/16918.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16918.diff'>https://github.com/RIOT-OS/RIOT/pull/16918.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/16918">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYENWONRONBVQKHWMODUEQRLJANCNFSM5FBZVFZA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABE7WYGXIG54PTCYE3HSVGLUEQRLJA5CNFSM5FBZVFZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PCQRPLQ.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/16918",
"url": "https://github.com/RIOT-OS/RIOT/pull/16918",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>