mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #21020 from benpicco/drivers/atwinc15x0-netdev_new
drivers/atwinc15x0: port to `netdev_new_api`
This commit is contained in:
commit
a841fc39b9
@ -1,6 +1,6 @@
|
||||
USEMODULE += netdev_eth
|
||||
USEMODULE += ztimer_msec
|
||||
USEMODULE += netdev_legacy_api
|
||||
USEMODULE += netdev_new_api
|
||||
|
||||
ifeq (,$(filter atwinc15x0_dynamic_%,$(USEMODULE)))
|
||||
# use static connect by default when no dynamic module is loaded
|
||||
|
@ -539,11 +539,11 @@ static int _atwinc15x0_send(netdev_t *netdev, const iolist_t *iolist)
|
||||
/* send wakes from standby but not from sleep */
|
||||
if (_atwinc15x0_is_sleeping(dev)) {
|
||||
DEBUG("%s WiFi is in SLEEP state, cannot send\n", __func__);
|
||||
return -ENODEV;
|
||||
return -ENETDOWN;
|
||||
}
|
||||
if (!_atwinc15x0_is_connected(dev)) {
|
||||
DEBUG("%s WiFi is still not connected to AP, cannot send\n", __func__);
|
||||
return -ENODEV;
|
||||
return -ENETDOWN;
|
||||
}
|
||||
/* atwinc15x0_eth_buf should not be used for incoming packets here */
|
||||
assert(dev->rx_buf == NULL);
|
||||
@ -570,7 +570,6 @@ static int _atwinc15x0_send(netdev_t *netdev, const iolist_t *iolist)
|
||||
|
||||
/* send the the packet */
|
||||
if (m2m_wifi_send_ethernet_pkt(atwinc15x0_eth_buf, tx_len) == M2M_SUCCESS) {
|
||||
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
|
||||
return tx_len;
|
||||
}
|
||||
else {
|
||||
@ -579,6 +578,14 @@ static int _atwinc15x0_send(netdev_t *netdev, const iolist_t *iolist)
|
||||
}
|
||||
}
|
||||
|
||||
static int _confirm_send(netdev_t *netdev, void *info)
|
||||
{
|
||||
(void)netdev;
|
||||
(void)info;
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static int _atwinc15x0_recv(netdev_t *netdev, void *buf, size_t len, void *info)
|
||||
{
|
||||
atwinc15x0_t *dev = (atwinc15x0_t *)netdev;
|
||||
@ -1077,6 +1084,7 @@ const netdev_driver_t atwinc15x0_netdev_driver = {
|
||||
.isr = _atwinc15x0_isr,
|
||||
.get = _atwinc15x0_get,
|
||||
.set = _atwinc15x0_set,
|
||||
.confirm_send = _confirm_send,
|
||||
};
|
||||
|
||||
void atwinc15x0_setup(atwinc15x0_t *dev, const atwinc15x0_params_t *params, uint8_t idx)
|
||||
|
Loading…
Reference in New Issue
Block a user