wilc1000_driver.c
Go to the documentation of this file.
1 /**
2  * @file wilc1000_driver.c
3  * @brief WILC1000 Wi-Fi controller
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL NIC_TRACE_LEVEL
33 
34 //Dependencies
35 #include "driver/include/m2m_wifi.h"
36 #include "core/net.h"
38 #include "wilc1000_config.h"
39 #include "debug.h"
40 
41 //Underlying network interface
44 
45 //Transmit buffer
46 static uint8_t txBuffer[WILC1000_TX_BUFFER_SIZE];
47 //Receive buffer
48 static uint8_t rxBuffer[WILC1000_RX_BUFFER_SIZE];
49 
50 
51 /**
52  * @brief WILC1000 driver (STA mode)
53  **/
54 
56 {
58  ETH_MTU,
66  NULL,
67  NULL,
68  NULL,
69  TRUE,
70  TRUE,
71  TRUE,
72  TRUE
73 };
74 
75 
76 /**
77  * @brief WILC1000 driver (AP mode)
78  **/
79 
81 {
83  ETH_MTU,
91  NULL,
92  NULL,
93  NULL,
94  TRUE,
95  TRUE,
96  TRUE,
97  TRUE
98 };
99 
100 
101 /**
102  * @brief WILC1000 initialization
103  * @param[in] interface Underlying network interface
104  * @return Error code
105  **/
106 
108 {
109  int8_t status;
110  tstrWifiInitParam param;
111 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4)
112  MacAddr staMacAddr;
113  MacAddr apMacAddr;
114 #endif
115 
116  //STA or AP mode?
117  if(interface->nicDriver == &wilc1000StaDriver)
118  {
119  //Debug message
120  TRACE_INFO("Initializing WILC1000 (STA mode)...\r\n");
121  //Save underlying network interface
122  wilc1000StaInterface = interface;
123  }
124  else
125  {
126  //Debug message
127  TRACE_INFO("Initializing WILC1000 (AP mode)...\r\n");
128  //Save underlying network interface
129  wilc1000ApInterface = interface;
130  }
131 
132  //Start of exception handling block
133  do
134  {
135  //Initialization sequence is performed once
136  if(wilc1000StaInterface == NULL || wilc1000ApInterface == NULL)
137  {
138  //Low-level initialization
139  status = nm_bsp_init();
140  //Check status code
141  if(status != M2M_SUCCESS)
142  {
143  break;
144  }
145 
146  //Set default parameters
147  osMemset(&param, 0, sizeof(param));
148 
149  //Register callback functions
150  param.pfAppWifiCb = wilc1000AppWifiEvent;
151  param.pfAppMonCb = NULL;
152 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 3)
153  param.strEthInitParam.pfAppWifiCb = NULL;
154 #endif
155  param.strEthInitParam.pfAppEthCb = wilc1000AppEthEvent;
156 
157  //Set receive buffer
158  param.strEthInitParam.au8ethRcvBuf = rxBuffer;
159  param.strEthInitParam.u16ethRcvBufSize = WILC1000_RX_BUFFER_SIZE;
160 
161  //Initialize WILC1000 controller
162  status = m2m_wifi_init(&param);
163  //Check status code
164  if(status != M2M_SUCCESS)
165  {
166  break;
167  }
168 
169 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 3)
170  //Optionally set the station MAC address
171  if(macCompAddr(&interface->macAddr, &MAC_UNSPECIFIED_ADDR))
172  {
173  //Use the factory preprogrammed station address
174  status = m2m_wifi_get_mac_address(interface->macAddr.b);
175  //Check status code
176  if(status != M2M_SUCCESS)
177  {
178  break;
179  }
180 
181  //Generate the 64-bit interface identifier
182  macAddrToEui64(&interface->macAddr, &interface->eui64);
183  }
184  else
185  {
186  //Override the factory preprogrammed address
187  status = m2m_wifi_set_mac_address(interface->macAddr.b);
188  //Check status code
189  if(status != M2M_SUCCESS)
190  {
191  break;
192  }
193  }
194 #endif
195  }
196  else
197  {
198  //Initialization was already done
199  status = M2M_SUCCESS;
200  }
201 
202 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 3)
203  //STA or AP mode?
204  if(interface->nicDriver == &wilc1000StaDriver)
205  {
206  //Check whether the AP interface has been initialized first
207  if(wilc1000ApInterface != NULL)
208  {
209  //Copy MAC address
210  interface->macAddr = wilc1000ApInterface->macAddr;
211  interface->eui64 = wilc1000ApInterface->eui64;
212  }
213  }
214  else
215  {
216  //Check whether the STA interface has been initialized first
217  if(wilc1000StaInterface != NULL)
218  {
219  //Copy MAC
220  interface->macAddr = wilc1000StaInterface->macAddr;
221  interface->eui64 = wilc1000StaInterface->eui64;
222  }
223  }
224 
225 #elif (M2M_FIRMWARE_VERSION_MAJOR_NO == 4)
226  //Retrieve current MAC addresses
227  status = m2m_wifi_get_mac_address(apMacAddr.b, staMacAddr.b);
228  //Check status code
229  if(status != M2M_SUCCESS)
230  {
231  break;
232  }
233 
234  //Optionally set the MAC address
235  if(macCompAddr(&interface->macAddr, &MAC_UNSPECIFIED_ADDR))
236  {
237  //Use the factory preprogrammed MAC address
238  if(interface == wilc1000StaInterface)
239  {
240  interface->macAddr = staMacAddr;
241  }
242  else
243  {
244  interface->macAddr = apMacAddr;
245  }
246 
247  //Generate the 64-bit interface identifier
248  macAddrToEui64(&interface->macAddr, &interface->eui64);
249  }
250  else
251  {
252  //Override the factory preprogrammed address
253  if(interface == wilc1000StaInterface)
254  {
255  staMacAddr = interface->macAddr;
256  }
257  else
258  {
259  apMacAddr = interface->macAddr;
260  }
261 
262  //Assign MAC addresses
263  status = m2m_wifi_set_mac_address(staMacAddr.b, apMacAddr.b);
264  //Check status code
265  if(status != M2M_SUCCESS)
266  {
267  break;
268  }
269  }
270 #endif
271 
272  //End of exception handling block
273  } while(0);
274 
275  //WILC1000 is now ready to send
276  osSetEvent(&interface->nicTxEvent);
277 
278  //Return status code
279  if(status == M2M_SUCCESS)
280  {
281  return NO_ERROR;
282  }
283  else
284  {
285  return ERROR_FAILURE;
286  }
287 }
288 
289 
290 /**
291  * @brief WILC1000 timer handler
292  *
293  * This routine is periodically called by the TCP/IP stack to handle periodic
294  * operations such as polling the link state
295  *
296  * @param[in] interface Underlying network interface
297  **/
298 
299 void wilc1000Tick(NetInterface *interface)
300 {
301 }
302 
303 
304 /**
305  * @brief Enable interrupts
306  * @param[in] interface Underlying network interface
307  **/
308 
310 {
311 }
312 
313 
314 /**
315  * @brief Disable interrupts
316  * @param[in] interface Underlying network interface
317  **/
318 
320 {
321 }
322 
323 
324 /**
325  * @brief WILC1000 interrupt service routine
326  * @return TRUE if a higher priority task must be woken. Else FALSE is returned
327  **/
328 
330 {
331  bool_t flag;
332 
333  //This flag will be set if a higher priority task must be woken
334  flag = FALSE;
335 
336  //STA and/or AP mode?
337  if(wilc1000StaInterface != NULL)
338  {
339  wilc1000StaInterface->nicEvent = TRUE;
340  }
341  else if(wilc1000ApInterface != NULL)
342  {
343  wilc1000ApInterface->nicEvent = TRUE;
344  }
345 
346  //Notify the TCP/IP stack of the event
347  flag = osSetEventFromIsr(&netEvent);
348 
349  //A higher priority task must be woken?
350  return flag;
351 }
352 
353 
354 /**
355  * @brief WILC1000 event handler
356  * @param[in] interface Underlying network interface
357  **/
358 
360 {
361  //Process Wi-Fi events
362  m2m_wifi_handle_events(NULL);
363 }
364 
365 
366 /**
367  * @brief Send a packet
368  * @param[in] interface Underlying network interface
369  * @param[in] buffer Multi-part buffer containing the data to send
370  * @param[in] offset Offset to the first data byte
371  * @param[in] ancillary Additional options passed to the stack along with
372  * the packet
373  * @return Error code
374  **/
375 
377  const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
378 {
379  int8_t status;
380  size_t length;
381 
382  //Retrieve the length of the packet
383  length = netBufferGetLength(buffer) - offset;
384 
385  //Check the frame length
387  {
388  //The transmitter can accept another packet
389  osSetEvent(&interface->nicTxEvent);
390  //Report an error
391  return ERROR_INVALID_LENGTH;
392  }
393 
394  //Make sure the link is up before transmitting the frame
395  if(!interface->linkState)
396  {
397  //The transmitter can accept another packet
398  osSetEvent(&interface->nicTxEvent);
399  //Drop current packet
400  return NO_ERROR;
401  }
402 
403 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 3)
404  //Copy user data to the transmit buffer
405  netBufferRead(txBuffer, buffer, offset, length);
406 #elif (M2M_FIRMWARE_VERSION_MAJOR_NO == 4)
407  //Copy user data to the transmit buffer
408  netBufferRead(txBuffer + M2M_ETHERNET_HDR_OFFSET + M2M_ETH_PAD_SIZE,
409  buffer, offset, length);
410 #endif
411 
412  //STA or AP mode?
413  if(interface == wilc1000StaInterface)
414  {
415  //Send packet
416 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
417  status = m2m_wifi_send_ethernet_pkt(txBuffer, length, STATION_INTERFACE);
418 #else
419  status = m2m_wifi_send_ethernet_pkt(txBuffer, length);
420 #endif
421  }
422  else
423  {
424  //Send packet
425 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
426  status = m2m_wifi_send_ethernet_pkt(txBuffer, length, AP_INTERFACE);
427 #else
428  status = m2m_wifi_send_ethernet_pkt_ifc1(txBuffer, length);
429 #endif
430  }
431 
432  //The transmitter can accept another packet
433  osSetEvent(&interface->nicTxEvent);
434 
435  //Return status code
436  if(status == M2M_SUCCESS)
437  {
438  return NO_ERROR;
439  }
440  else
441  {
442  return ERROR_FAILURE;
443  }
444 }
445 
446 
447 /**
448  * @brief Configure MAC address filtering
449  * @param[in] interface Underlying network interface
450  * @return Error code
451  **/
452 
454 {
455  uint_t i;
456  uint_t refCount;
457  MacFilterEntry *entry;
458 
459  //Debug message
460  TRACE_INFO("Updating WILC1000 multicast filter...\r\n");
461 
462  //The MAC address filter contains the list of MAC addresses to accept
463  //when receiving an Ethernet frame
464  for(i = 0; i < MAC_ADDR_FILTER_SIZE; i++)
465  {
466  //Point to the current entry
467  entry = &interface->macAddrFilter[i];
468 
469  //Valid entry?
470  if(!macCompAddr(&entry->addr, &MAC_UNSPECIFIED_ADDR))
471  {
472  //Check whether the multicast MAC address has already been registered
473  //on the alternate interface
474  if(interface == wilc1000StaInterface)
475  {
476  refCount = wilc1000GetAddrRefCount(wilc1000ApInterface, &entry->addr);
477  }
478  else
479  {
481  }
482 
483  //Ensure that there are no duplicate address entries in the table
484  if(refCount == 0)
485  {
486  //Update MAC filter table only if necessary
487  if(entry->addFlag)
488  {
489  //Add a new entry to the MAC filter table
490  m2m_wifi_enable_mac_mcast(entry->addr.b, TRUE);
491  }
492  else if(entry->deleteFlag)
493  {
494  //Remove the current entry from the MAC filter table
495  m2m_wifi_enable_mac_mcast(entry->addr.b, FALSE);
496  }
497  }
498  }
499  }
500 
501  //Successful processing
502  return NO_ERROR;
503 }
504 
505 
506 /**
507  * @brief Get reference count for the specified multicast MAC address
508  * @param[in] interface Underlying network interface
509  * @param[in] macAddr MAC address
510  * @return Reference count
511  **/
512 
514 {
515  uint_t i;
516  uint_t refCount;
517  MacFilterEntry *entry;
518 
519  //Clear reference count
520  refCount = 0;
521 
522  //Valid network interface?
523  if(interface != NULL)
524  {
525  //Go through the multicast filter table
526  for(i = 0; i < MAC_ADDR_FILTER_SIZE; i++)
527  {
528  //Point to the current entry
529  entry = &interface->macAddrFilter[i];
530 
531  //Valid entry?
532  if(entry->refCount > 0)
533  {
534  //Check whether the specified MAC address matches
535  //a multicast address in the table
536  if(macCompAddr(&entry->addr, macAddr))
537  {
538  //Get reference count
539  refCount = entry->refCount;
540  //We are done
541  break;
542  }
543  }
544  }
545  }
546 
547  //Return reference count
548  return refCount;
549 }
550 
551 
552 /**
553  * @brief Callback function that handles Wi-Fi events
554  * @param[in] msgType Type of notification
555  * @param[in] msg Pointer to the buffer containing the notification parameters
556  **/
557 
558 void wilc1000AppWifiEvent(uint8_t msgType, void *msg)
559 {
560  tstrM2mWifiStateChanged *stateChangedMsg;
561 
562  //Debug message
563  TRACE_INFO("WILC1000 Wi-Fi event callback\r\n");
564 
565  //Check message type
566  if(msgType == M2M_WIFI_RESP_FIRMWARE_STRTED)
567  {
568  //Debug message
569  TRACE_INFO(" M2M_WIFI_RESP_FIRMWARE_STRTED\r\n");
570  }
571  else if(msgType == M2M_WIFI_RESP_CON_STATE_CHANGED)
572  {
573  //Debug message
574  TRACE_INFO(" M2M_WIFI_RESP_CON_STATE_CHANGED\r\n");
575 
576  //Connection state
577  stateChangedMsg = (tstrM2mWifiStateChanged *) msg;
578 
579  //Check interface identifier
580 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
581  if(stateChangedMsg->u8IfcId == STATION_INTERFACE)
582 #else
583  if(stateChangedMsg->u8IfcId == INTERFACE_1)
584 #endif
585  {
586  //Check whether STA mode is enabled
587  if(wilc1000StaInterface != NULL)
588  {
589  //Check connection state
590  if(stateChangedMsg->u8CurrState == M2M_WIFI_CONNECTED)
591  {
592  //Link is up
593  wilc1000StaInterface->linkState = TRUE;
594  }
595  else
596  {
597  //Link is down
598  wilc1000StaInterface->linkState = FALSE;
599  }
600 
601  //Process link state change event
603  }
604  }
605 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
606  else if(stateChangedMsg->u8IfcId == AP_INTERFACE)
607 #else
608  else if(stateChangedMsg->u8IfcId == INTERFACE_2)
609 #endif
610  {
611  //Check whether AP mode is enabled
612  if(wilc1000ApInterface != NULL)
613  {
614  //Check connection state
615  if(stateChangedMsg->u8CurrState == M2M_WIFI_CONNECTED)
616  {
617  //Check link state
618  if(!wilc1000ApInterface->linkState)
619  {
620  //Link is up
621  wilc1000ApInterface->linkState = TRUE;
622  //Process link state change event
624  }
625  }
626  }
627  }
628  }
629 
630 #if defined(CONF_WILC_EVENT_HOOK)
631  //Release exclusive access
633  //Invoke user callback function
634  CONF_WILC_EVENT_HOOK(msgType, msg);
635  //Get exclusive access
637 #endif
638 }
639 
640 
641 /**
642  * @brief Callback function that handles events in bypass mode
643  * @param[in] msgType Type of notification
644  * @param[in] msg Pointer to the buffer containing the notification parameters
645  * @param[in] ctrlBuf Pointer to the control buffer
646  **/
647 
648 void wilc1000AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf)
649 {
650  size_t length;
651  uint8_t *packet;
652  NetRxAncillary ancillary;
653 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
654  tstrM2MDataBufCtrl *ctrl;
655 #else
656  tstrM2mIpCtrlBuf *ctrl;
657 #endif
658 
659  //Debug message
660  TRACE_DEBUG("WILC1000 RX event callback\r\n");
661 
662  //Point to the control buffer
663 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
664  ctrl = (tstrM2MDataBufCtrl *) ctrlBuf;
665 #else
666  ctrl = (tstrM2mIpCtrlBuf *) ctrlBuf;
667 #endif
668 
669  //Check message type
670  if(msgType == M2M_WIFI_RESP_ETHERNET_RX_PACKET)
671  {
672  //Debug message
673  TRACE_DEBUG(" M2M_WIFI_RESP_ETHERNET_RX_PACKET\r\n");
674 
675 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 3)
676  //Point to the beginning of the packet
677  packet = rxBuffer;
678 #elif (M2M_FIRMWARE_VERSION_MAJOR_NO == 4)
679  //Point to the beginning of the packet
680  packet = rxBuffer + ctrl->u8DataOffset;
681 #endif
682 
683  //Retrieve the length of the packet
684  length = ctrl->u16DataSize;
685 
686  //Check interface identifier
687 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
688  if(ctrl->u8IfcId == STATION_INTERFACE)
689 #else
690  if(ctrl->u8IfcId == INTERFACE_1)
691 #endif
692  {
693  //Valid interface?
694  if(wilc1000StaInterface != NULL)
695  {
696  //Check destination MAC address
697  if(wilc1000ApInterface != NULL)
698  {
699  if(macCompAddr(packet, wilc1000ApInterface->macAddr.b))
700  {
701  macCopyAddr(packet, wilc1000StaInterface->macAddr.b);
702  }
703  }
704 
705  //Additional options can be passed to the stack along with the packet
706  ancillary = NET_DEFAULT_RX_ANCILLARY;
707 
708  //Pass the packet to the upper layer
709  nicProcessPacket(wilc1000StaInterface, packet, length, &ancillary);
710  }
711  }
712 #if (M2M_FIRMWARE_VERSION_MAJOR_NO == 4 && M2M_FIRMWARE_VERSION_MINOR_NO >= 2)
713  else if(ctrl->u8IfcId == AP_INTERFACE)
714 #else
715  else if(ctrl->u8IfcId == INTERFACE_2)
716 #endif
717  {
718  //Valid interface?
719  if(wilc1000ApInterface != NULL)
720  {
721  //Check destination MAC address
722  if(wilc1000StaInterface != NULL)
723  {
724  if(macCompAddr(packet, wilc1000StaInterface->macAddr.b))
725  {
726  macCopyAddr(packet, wilc1000ApInterface->macAddr.b);
727  }
728  }
729 
730  //Additional options can be passed to the stack along with the packet
731  ancillary = NET_DEFAULT_RX_ANCILLARY;
732 
733  //Pass the packet to the upper layer
734  nicProcessPacket(wilc1000ApInterface, packet, length, &ancillary);
735  }
736  }
737  }
738 }
#define rxBuffer
#define txBuffer
unsigned int uint_t
Definition: compiler_port.h:50
int bool_t
Definition: compiler_port.h:53
Debugging facilities.
#define TRACE_DEBUG(...)
Definition: debug.h:107
#define TRACE_INFO(...)
Definition: debug.h:95
error_t
Error codes.
Definition: error.h:43
@ NO_ERROR
Success.
Definition: error.h:44
@ ERROR_INVALID_LENGTH
Definition: error.h:111
@ ERROR_FAILURE
Generic error code.
Definition: error.h:45
const MacAddr MAC_UNSPECIFIED_ADDR
Definition: ethernet.c:53
void macAddrToEui64(const MacAddr *macAddr, Eui64 *interfaceId)
Map a MAC address to the IPv6 modified EUI-64 identifier.
Definition: ethernet.c:944
#define ETH_MTU
Definition: ethernet.h:116
#define macCompAddr(macAddr1, macAddr2)
Definition: ethernet.h:130
#define macCopyAddr(destMacAddr, srcMacAddr)
Definition: ethernet.h:127
MacAddr
Definition: ethernet.h:195
#define MAC_ADDR_FILTER_SIZE
Definition: ethernet.h:95
uint8_t msgType
TCP/IP stack core.
#define NetInterface
Definition: net.h:36
#define netMutex
Definition: net_legacy.h:195
#define netEvent
Definition: net_legacy.h:196
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
size_t netBufferRead(void *dest, const NetBuffer *src, size_t srcOffset, size_t length)
Read data from a multi-part buffer.
Definition: net_mem.c:674
const NetRxAncillary NET_DEFAULT_RX_ANCILLARY
Definition: net_misc.c:101
#define NetRxAncillary
Definition: net_misc.h:40
#define NetTxAncillary
Definition: net_misc.h:36
void nicProcessPacket(NetInterface *interface, uint8_t *packet, size_t length, NetRxAncillary *ancillary)
Handle a packet received by the network controller.
Definition: nic.c:391
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:548
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83
#define osMemset(p, value, length)
Definition: os_port.h:135
#define TRUE
Definition: os_port.h:50
#define FALSE
Definition: os_port.h:46
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
MAC filter table entry.
Definition: ethernet.h:262
bool_t addFlag
Definition: ethernet.h:265
MacAddr addr
MAC address.
Definition: ethernet.h:263
uint_t refCount
Reference count for the current entry.
Definition: ethernet.h:264
bool_t deleteFlag
Definition: ethernet.h:266
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
NIC driver.
Definition: nic.h:283
uint8_t length
Definition: tcp.h:368
void wilc1000AppWifiEvent(uint8_t msgType, void *msg)
Callback function that handles Wi-Fi events.
void wilc1000EventHandler(NetInterface *interface)
WILC1000 event handler.
error_t wilc1000SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
NetInterface * wilc1000ApInterface
error_t wilc1000UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void wilc1000EnableIrq(NetInterface *interface)
Enable interrupts.
bool_t wilc1000IrqHandler(void)
WILC1000 interrupt service routine.
error_t wilc1000Init(NetInterface *interface)
WILC1000 initialization.
void wilc1000AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf)
Callback function that handles events in bypass mode.
const NicDriver wilc1000ApDriver
WILC1000 driver (AP mode)
void wilc1000DisableIrq(NetInterface *interface)
Disable interrupts.
const NicDriver wilc1000StaDriver
WILC1000 driver (STA mode)
NetInterface * wilc1000StaInterface
bool_t wilc1000GetAddrRefCount(NetInterface *interface, const MacAddr *macAddr)
Get reference count for the specified multicast MAC address.
void wilc1000Tick(NetInterface *interface)
WILC1000 timer handler.
WILC1000 Wi-Fi controller.
#define WILC1000_TX_BUFFER_SIZE
#define WILC1000_RX_BUFFER_SIZE