Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions drivers/atwinc15x0/atwinc15x0_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
auth_type = M2M_WIFI_SEC_802_1X;
#else /* defined(WIFI_USER) && defined(WIFI_PASS) */
#error WIFI_EAP_USER and WIFI_EAP_PASS have to define the user name \
and the password for EAP phase 2 authentication in wifi_enterprise

Check warning on line 254 in drivers/atwinc15x0/atwinc15x0_netdev.c

View workflow job for this annotation

GitHub Actions / static-tests

keyword 'for' not followed by a single space
#endif /* defined(WIFI_USER) && defined(WIFI_PASS) */

#endif /* defined(MODULE_WIFI_ENTERPRISE) */
Expand Down Expand Up @@ -454,11 +454,11 @@
conn.credentials.wep = *((const wifi_security_wep_psk_t *)
_atwinc15x0_connect_req.conn_req.cred);
}
else if (*_atwinc15x0_connect_req.conn_req.cred == WIFI_SECURITY_MODE_WPA2_PERSONAL) {

Check warning on line 457 in drivers/atwinc15x0/atwinc15x0_netdev.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
conn.credentials.wpa_psk = *((const wifi_security_wpa_psk_t *)
_atwinc15x0_connect_req.conn_req.cred);
}
else if (*_atwinc15x0_connect_req.conn_req.cred == WIFI_SECURITY_MODE_WPA2_ENTERPRISE) {

Check warning on line 461 in drivers/atwinc15x0/atwinc15x0_netdev.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
conn.credentials.wpa_enterprise = *((const wifi_security_wpa_enterprise_t *)
_atwinc15x0_connect_req.conn_req.cred);
}
Expand Down Expand Up @@ -530,12 +530,14 @@

static int _atwinc15x0_send(netdev_t *netdev, const iolist_t *iolist)
{
atwinc15x0_t *dev = (atwinc15x0_t *)netdev;
atwinc15x0_t *dev = container_of(netdev, atwinc15x0_t, netdev);

assert(dev);
assert(dev == atwinc15x0);
assert(iolist);

dev->tx_result = -EAGAIN;

/* send wakes from standby but not from sleep */
if (_atwinc15x0_is_sleeping(dev)) {
DEBUG("%s WiFi is in SLEEP state, cannot send\n", __func__);
Expand Down Expand Up @@ -570,20 +572,23 @@

/* send the packet */
if (m2m_wifi_send_ethernet_pkt(atwinc15x0_eth_buf, tx_len) == M2M_SUCCESS) {
return tx_len;
dev->tx_result = tx_len;
}
else {
DEBUG("%s sending WiFi packet failed", __func__);
return -EIO;
dev->tx_result = -EIO;
}

netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
return 0;
}

static int _confirm_send(netdev_t *netdev, void *info)
{
(void)netdev;
(void)info;

return -EOPNOTSUPP;
atwinc15x0_t *dev = container_of(netdev, atwinc15x0_t, netdev);
return dev->tx_result;
}

static int _atwinc15x0_recv(netdev_t *netdev, void *buf, size_t len, void *info)
Expand Down
1 change: 1 addition & 0 deletions drivers/include/atwinc15x0.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ typedef struct atwinc15x0 {
int8_t rssi; /**< RSSI last measured by the WiFi module */

uint8_t* rx_buf; /**< Incoming packet in receive buffer */
int tx_result; /**< value to return in confirm_send() */
uint16_t rx_len; /**< Length of an incoming packet, if there
is no packet in the buffer, it is 0 */

Expand Down
Loading