net: complement wireless handling as ethernet

Change-Id: I13cc4cbfc1e305e17c0630f11a1173afe96e8a03
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2020-01-06 19:35:50 +08:00 committed by Alan Carvalho de Assis
parent 70fbc14103
commit 97bead5496
5 changed files with 8 additions and 3 deletions

View File

@ -248,7 +248,8 @@ int arp_send(in_addr_t ipaddr)
* Ethernet link layer protocol. * Ethernet link layer protocol.
*/ */
if (dev->d_lltype != NET_LL_ETHERNET) if (dev->d_lltype != NET_LL_ETHERNET &&
dev->d_lltype != NET_LL_IEEE80211)
{ {
return OK; return OK;
} }

View File

@ -80,6 +80,7 @@ void neighbor_out(FAR struct net_driver_s *dev)
{ {
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
case NET_LL_ETHERNET: case NET_LL_ETHERNET:
case NET_LL_IEEE80211:
neighbor_ethernet_out(dev); neighbor_ethernet_out(dev);
break; break;
#endif #endif

View File

@ -976,7 +976,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
if (dev) if (dev)
{ {
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET ||
dev->d_lltype == NET_LL_IEEE80211)
{ {
memcpy(dev->d_mac.ether.ether_addr_octet, memcpy(dev->d_mac.ether.ether_addr_octet,
req->ifr_hwaddr.sa_data, IFHWADDRLEN); req->ifr_hwaddr.sa_data, IFHWADDRLEN);

View File

@ -121,6 +121,7 @@ int netdev_lladdrsize(FAR struct net_driver_s *dev)
{ {
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
case NET_LL_ETHERNET: case NET_LL_ETHERNET:
case NET_LL_IEEE80211:
{ {
/* Size of the Ethernet MAC address */ /* Size of the Ethernet MAC address */

View File

@ -376,7 +376,8 @@ static int pkt_bind(FAR struct socket *psock, FAR const struct sockaddr *addr,
/* Only Ethernet is supported */ /* Only Ethernet is supported */
if (dev->d_lltype != NET_LL_ETHERNET) if (dev->d_lltype != NET_LL_ETHERNET &&
dev->d_lltype != NET_LL_IEEE80211)
{ {
return -EAFNOSUPPORT; return -EAFNOSUPPORT;
} }