nic.h
Go to the documentation of this file.
1 /**
2  * @file nic.h
3  * @brief Network interface controller abstraction layer
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.4
29  **/
30 
31 #ifndef _NIC_H
32 #define _NIC_H
33 
34 //Dependencies
35 #include "core/net.h"
36 
37 //Tick interval to handle NIC periodic operations
38 #ifndef NIC_TICK_INTERVAL
39  #define NIC_TICK_INTERVAL 1000
40 #elif (NIC_TICK_INTERVAL < 10)
41  #error NIC_TICK_INTERVAL parameter is not valid
42 #endif
43 
44 //Maximum duration a write operation may block
45 #ifndef NIC_MAX_BLOCKING_TIME
46  #define NIC_MAX_BLOCKING_TIME INFINITE_DELAY
47 #elif (NIC_MAX_BLOCKING_TIME < 0)
48  #error NIC_MAX_BLOCKING_TIME parameter is not valid
49 #endif
50 
51 //Size of the NIC driver context
52 #ifndef NIC_CONTEXT_SIZE
53  #define NIC_CONTEXT_SIZE 16
54 #elif (NIC_CONTEXT_SIZE < 1)
55  #error NIC_CONTEXT_SIZE parameter is not valid
56 #endif
57 
58 //Switch CPU port
59 #define SWITCH_CPU_PORT 32
60 #define SWITCH_CPU_PORT_MASK 0x80000000
61 
62 //Serial Management Interface
63 #define SMI_SYNC 0xFFFFFFFF
64 #define SMI_START 1
65 #define SMI_OPCODE_0 0
66 #define SMI_OPCODE_WRITE 1
67 #define SMI_OPCODE_READ 2
68 #define SMI_TA 2
69 
70 //C++ guard
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
75 
76 /**
77  * @brief NIC types
78  **/
79 
80 typedef enum
81 {
82  NIC_TYPE_UNKNOWN = 0, ///<Unknown interface type
83  NIC_TYPE_ETHERNET = 1, ///<Ethernet interface
84  NIC_TYPE_PPP = 2, ///<PPP interface
85  NIC_TYPE_IPV4 = 3, ///<IPv4 interface
86  NIC_TYPE_IPV6 = 4, ///<IPv6 interface
87  NIC_TYPE_6LOWPAN = 4, ///<6LoWPAN interface
88  NIC_TYPE_LOOPBACK = 5 ///<Loopback interface
90 
91 
92 /**
93  * @brief Link state
94  **/
95 
96 typedef enum
97 {
102 
103 
104 /**
105  * @brief Link speed
106  **/
107 
108 typedef enum
109 {
113  NIC_LINK_SPEED_1GBPS = 1000000000
115 
116 
117 /**
118  * @brief Duplex mode
119  **/
120 
121 typedef enum
122 {
127 
128 
129 /**
130  * @brief Switch port state
131  **/
132 
133 typedef enum
134 {
142 
143 
144 /**
145  * @brief Forwarding database entry
146  **/
147 
148 typedef struct
149 {
151  uint8_t srcPort;
152  uint32_t destPorts;
153  bool_t override;
155 
156 
157 /**
158  * @brief VLAN entry
159  **/
160 
161 typedef struct
162 {
163  uint16_t vlanId;
165  uint16_t fid;
166  uint32_t ports;
168 
169 
170 //NIC driver abstraction layer
171 typedef error_t (*NicInit)(NetInterface *interface);
172 typedef void (*NicTick)(NetInterface *interface);
173 typedef void (*NicEnableIrq)(NetInterface *interface);
174 typedef void (*NicDisableIrq)(NetInterface *interface);
175 typedef void (*NicEventHandler)(NetInterface *interface);
176 
177 typedef error_t (*NicSendPacket)(NetInterface *interface,
178  const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary);
179 
181 typedef error_t (*NicUpdateMacConfig)(NetInterface *interface);
182 
183 typedef void (*NicWritePhyReg)(uint8_t opcode, uint8_t phyAddr,
184  uint8_t regAddr, uint16_t data);
185 
186 typedef uint16_t (*NicReadPhyReg)(uint8_t opcode, uint8_t phyAddr,
187  uint8_t regAddr);
188 
189 //Ethernet PHY driver abstraction layer
190 typedef error_t (*PhyInit)(NetInterface *interface);
191 typedef void (*PhyTick)(NetInterface *interface);
192 typedef void (*PhyEnableIrq)(NetInterface *interface);
193 typedef void (*PhyDisableIrq)(NetInterface *interface);
194 typedef void (*PhyEventHandler)(NetInterface *interface);
195 
196 //Ethernet switch driver abstraction layer
197 typedef error_t (*SwitchInit)(NetInterface *interface);
198 typedef void (*SwitchTick)(NetInterface *interface);
199 typedef void (*SwitchEnableIrq)(NetInterface *interface);
200 typedef void (*SwitchDisableIrq)(NetInterface *interface);
201 typedef void (*SwitchEventHandler)(NetInterface *interface);
202 
203 typedef error_t (*SwitchTagFrame)(NetInterface *interface, NetBuffer *buffer,
204  size_t *offset, NetTxAncillary *ancillary);
205 
206 typedef error_t (*SwitchUntagFrame)(NetInterface *interface, uint8_t **frame,
207  size_t *length, NetRxAncillary *ancillary);
208 
209 typedef bool_t (*SwitchGetLinkState)(NetInterface *interface, uint8_t port);
210 typedef uint32_t (*SwitchGetLinkSpeed)(NetInterface *interface, uint8_t port);
211 
213  uint8_t port);
214 
215 typedef void (*SwitchSetPortState)(NetInterface *interface, uint8_t port,
216  SwitchPortState state);
217 
219  uint8_t port);
220 
221 typedef void (*SwitchSetAgingTime)(NetInterface *interface, uint32_t agingTime);
222 
223 typedef void (*SwitchEnableIgmpSnooping)(NetInterface *interface,
224  bool_t enable);
225 
226 typedef void (*SwitchEnableMldSnooping)(NetInterface *interface,
227  bool_t enable);
228 
229 typedef void (*SwitchEnableRsvdMcastTable)(NetInterface *interface,
230  bool_t enable);
231 
232 typedef error_t (*SwitchAddFdbEntry)(NetInterface *interface,
233  const SwitchFdbEntry *entry);
234 
236  const SwitchFdbEntry *entry);
237 
238 typedef error_t (*SwitchGetFdbEntry)(NetInterface *interface, uint_t index,
239  SwitchFdbEntry *entry);
240 
241 typedef void (*SwitchFlushStaticFdbTable)(NetInterface *interface);
242 
243 typedef void (*SwitchFlushDynamicFdbTable)(NetInterface *interface,
244  uint8_t port);
245 
246 typedef void (*SwitchSetUnknownMcastFwdPorts)(NetInterface *interface,
247  bool_t enable, uint32_t forwardPorts);
248 
249 //SMI driver abstraction layer
250 typedef error_t (*SmiInit)(void);
251 
252 typedef void (*SmiWritePhyReg)(uint8_t opcode, uint8_t phyAddr,
253  uint8_t regAddr, uint16_t data);
254 
255 typedef uint16_t (*SmiReadPhyReg)(uint8_t opcode, uint8_t phyAddr,
256  uint8_t regAddr);
257 
258 //SPI driver abstraction layer
259 typedef error_t (*SpiInit)(void);
260 typedef error_t (*SpiSetMode)(uint_t mode);
261 typedef error_t (*SpiSetBitrate)(uint_t bitrate);
262 typedef void (*SpiAssertCs)(void);
263 typedef void (*SpiDeassertCs)(void);
264 typedef uint8_t (*SpiTransfer)(uint8_t data);
265 
266 typedef void (*SpiTransferMultipleBytes)(const uint8_t *txBuffer,
267  uint8_t *rxBuffer, size_t length);
268 
269 //UART driver abstraction layer
270 typedef error_t (*UartInit)(void);
271 typedef void (*UartEnableIrq)(void);
272 typedef void (*UartDisableIrq)(void);
273 typedef void (*UartStartTx)(void);
274 
275 //External interrupt line driver abstraction layer
276 typedef error_t (*ExtIntInit)(void);
277 typedef void (*ExtIntEnableIrq)(void);
278 typedef void (*ExtIntDisableIrq)(void);
279 
280 
281 /**
282  * @brief NIC driver
283  **/
284 
285 typedef struct
286 {
288  size_t mtu;
303 } NicDriver;
304 
305 
306 /**
307  * @brief Ethernet PHY driver
308  **/
309 
310 typedef struct
311 {
317 } PhyDriver;
318 
319 
320 /**
321  * @brief Ethernet switch driver
322  **/
323 
324 typedef struct
325 {
349 } SwitchDriver;
350 
351 
352 /**
353  * @brief SMI driver
354  **/
355 
356 typedef struct
357 {
361 } SmiDriver;
362 
363 
364 /**
365  * @brief SPI driver
366  **/
367 
368 typedef struct
369 {
377 } SpiDriver;
378 
379 
380 /**
381  * @brief UART driver
382  **/
383 
384 typedef struct
385 {
390 } UartDriver;
391 
392 
393 /**
394  * @brief External interrupt line driver
395  **/
396 
397 typedef struct
398 {
402 } ExtIntDriver;
403 
404 
405 //Tick counter to handle periodic operations
407 
408 //NIC abstraction layer
411 uint8_t nicGetSwitchPort(NetInterface *interface);
412 uint16_t nicGetVlanId(NetInterface *interface);
413 uint16_t nicGetVmanId(NetInterface *interface);
414 
416 
417 void nicTick(NetInterface *interface);
418 
419 error_t nicSendPacket(NetInterface *interface, const NetBuffer *buffer,
420  size_t offset, NetTxAncillary *ancillary);
421 
423 
424 void nicProcessPacket(NetInterface *interface, uint8_t *packet, size_t length,
425  NetRxAncillary *ancillary);
426 
427 void nicNotifyLinkChange(NetInterface *interface);
428 
429 //C++ guard
430 #ifdef __cplusplus
431 }
432 #endif
433 
434 #endif
uint8_t(* SpiTransfer)(uint8_t data)
Definition: nic.h:264
@ NIC_LINK_SPEED_1GBPS
Definition: nic.h:113
void nicTick(NetInterface *interface)
Network controller timer handler.
Definition: nic.c:251
SwitchEventHandler eventHandler
Definition: nic.h:330
ExtIntEnableIrq enableIrq
Definition: nic.h:400
SwitchDeleteFdbEntry deleteStaticFdbEntry
Definition: nic.h:343
uint8_t opcode
Definition: dns_common.h:188
void(* UartDisableIrq)(void)
Definition: nic.h:272
int bool_t
Definition: compiler_port.h:53
uint16_t(* SmiReadPhyReg)(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr)
Definition: nic.h:255
@ NIC_LINK_SPEED_UNKNOWN
Definition: nic.h:110
uint32_t destPorts
Definition: nic.h:152
@ NIC_TYPE_IPV6
IPv6 interface.
Definition: nic.h:86
size_t mtu
Definition: nic.h:288
NicWritePhyReg writePhyReg
Definition: nic.h:297
@ NIC_FULL_DUPLEX_MODE
Definition: nic.h:125
NicType type
Definition: nic.h:287
SwitchSetPortState setPortState
Definition: nic.h:336
@ SWITCH_PORT_STATE_LISTENING
Definition: nic.h:138
NicDuplexMode(* SwitchGetDuplexMode)(NetInterface *interface, uint8_t port)
Definition: nic.h:212
NicEnableIrq enableIrq
Definition: nic.h:291
SwitchSetUnknownMcastFwdPorts setUnknownMcastFwdPorts
Definition: nic.h:348
error_t(* SwitchAddFdbEntry)(NetInterface *interface, const SwitchFdbEntry *entry)
Definition: nic.h:232
SpiAssertCs assertCs
Definition: nic.h:373
ExtIntInit init
Definition: nic.h:399
@ SWITCH_PORT_STATE_DISABLED
Definition: nic.h:136
NicDisableIrq disableIrq
Definition: nic.h:292
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
error_t(* NicSendPacket)(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Definition: nic.h:177
NicUpdateMacConfig updateMacConfig
Definition: nic.h:296
Ethernet PHY driver.
Definition: nic.h:311
void(* SwitchSetUnknownMcastFwdPorts)(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Definition: nic.h:246
UART driver.
Definition: nic.h:385
uint8_t data[]
Definition: ethernet.h:222
SwitchTick tick
Definition: nic.h:327
External interrupt line driver.
Definition: nic.h:398
void(* SwitchEnableMldSnooping)(NetInterface *interface, bool_t enable)
Definition: nic.h:226
bool_t valid
Definition: nic.h:164
@ SWITCH_PORT_STATE_LEARNING
Definition: nic.h:139
SwitchGetPortState getPortState
Definition: nic.h:337
error_t(* SpiSetBitrate)(uint_t bitrate)
Definition: nic.h:261
void(* PhyDisableIrq)(NetInterface *interface)
Definition: nic.h:193
uint16_t(* NicReadPhyReg)(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr)
Definition: nic.h:186
SwitchAddFdbEntry addStaticFdbEntry
Definition: nic.h:342
SMI driver.
Definition: nic.h:357
error_t(* NicInit)(NetInterface *interface)
Definition: nic.h:171
void(* UartStartTx)(void)
Definition: nic.h:273
SwitchEnableIgmpSnooping enableIgmpSnooping
Definition: nic.h:339
SwitchFlushStaticFdbTable flushStaticFdbTable
Definition: nic.h:345
PhyInit init
Definition: nic.h:312
SwitchGetLinkState getLinkState
Definition: nic.h:333
SPI driver.
Definition: nic.h:369
void(* SwitchTick)(NetInterface *interface)
Definition: nic.h:198
void(* SwitchFlushStaticFdbTable)(NetInterface *interface)
Definition: nic.h:241
void(* PhyTick)(NetInterface *interface)
Definition: nic.h:191
SwitchGetDuplexMode getDuplexMode
Definition: nic.h:335
bool_t autoCrcStrip
Definition: nic.h:302
bool_t(* SwitchGetLinkState)(NetInterface *interface, uint8_t port)
Definition: nic.h:209
void(* PhyEnableIrq)(NetInterface *interface)
Definition: nic.h:192
NicInit init
Definition: nic.h:289
error_t(* NicUpdateMacConfig)(NetInterface *interface)
Definition: nic.h:181
SwitchGetLinkSpeed getLinkSpeed
Definition: nic.h:334
@ NIC_LINK_STATE_UP
Definition: nic.h:99
SwitchFlushDynamicFdbTable flushDynamicFdbTable
Definition: nic.h:347
error_t(* SwitchInit)(NetInterface *interface)
Definition: nic.h:197
void(* SpiDeassertCs)(void)
Definition: nic.h:263
UartDisableIrq disableIrq
Definition: nic.h:388
NetInterface * nicGetLogicalInterface(NetInterface *interface)
Retrieve logical interface.
Definition: nic.c:53
void(* SmiWritePhyReg)(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data)
Definition: nic.h:252
@ NIC_TYPE_LOOPBACK
Loopback interface.
Definition: nic.h:88
@ SWITCH_PORT_STATE_UNKNOWN
Definition: nic.h:135
systime_t nicTickCounter
Definition: nic.c:44
void(* SwitchEnableRsvdMcastTable)(NetInterface *interface, bool_t enable)
Definition: nic.h:229
SwitchDisableIrq disableIrq
Definition: nic.h:329
error_t nicSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet to the network controller.
Definition: nic.c:281
SmiWritePhyReg writePhyReg
Definition: nic.h:359
void(* NicEventHandler)(NetInterface *interface)
Definition: nic.h:175
SpiDeassertCs deassertCs
Definition: nic.h:374
VLAN entry.
Definition: nic.h:162
NicLinkSpeed
Link speed.
Definition: nic.h:109
error_t
Error codes.
Definition: error.h:43
SpiTransfer transfer
Definition: nic.h:375
NicType
NIC types.
Definition: nic.h:81
PhyDisableIrq disableIrq
Definition: nic.h:315
void(* SwitchDisableIrq)(NetInterface *interface)
Definition: nic.h:200
void(* SwitchEnableIgmpSnooping)(NetInterface *interface, bool_t enable)
Definition: nic.h:223
error_t(* SmiInit)(void)
Definition: nic.h:250
SwitchEnableIrq enableIrq
Definition: nic.h:328
NicLinkState
Link state.
Definition: nic.h:97
void(* SwitchFlushDynamicFdbTable)(NetInterface *interface, uint8_t port)
Definition: nic.h:243
#define txBuffer
#define NetRxAncillary
Definition: net_misc.h:40
#define NetInterface
Definition: net.h:36
@ NIC_LINK_SPEED_10MBPS
Definition: nic.h:111
error_t(* SwitchGetFdbEntry)(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Definition: nic.h:238
NicTick tick
Definition: nic.h:290
NicSendPacket sendPacket
Definition: nic.h:294
#define NetTxAncillary
Definition: net_misc.h:36
void(* ExtIntEnableIrq)(void)
Definition: nic.h:277
SpiSetBitrate setBitrate
Definition: nic.h:372
error_t(* SwitchUntagFrame)(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Definition: nic.h:206
SwitchUntagFrame untagFrame
Definition: nic.h:332
NicReadPhyReg readPhyReg
Definition: nic.h:298
error_t(* UartInit)(void)
Definition: nic.h:270
@ NIC_TYPE_UNKNOWN
Unknown interface type.
Definition: nic.h:82
SwitchPortState
Switch port state.
Definition: nic.h:134
void(* NicDisableIrq)(NetInterface *interface)
Definition: nic.h:174
NicEventHandler eventHandler
Definition: nic.h:293
uint8_t length
Definition: tcp.h:368
error_t(* SwitchTagFrame)(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Definition: nic.h:203
SwitchTagFrame tagFrame
Definition: nic.h:331
PhyEventHandler eventHandler
Definition: nic.h:316
SwitchSetAgingTime setAgingTime
Definition: nic.h:338
error_t nicUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
Definition: nic.c:353
error_t(* ExtIntInit)(void)
Definition: nic.h:276
#define rxBuffer
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
SwitchInit init
Definition: nic.h:326
SwitchEnableRsvdMcastTable enableRsvdMcastTable
Definition: nic.h:341
bool_t autoCrcCalc
Definition: nic.h:300
MacAddr
Definition: ethernet.h:195
@ SWITCH_PORT_STATE_BLOCKING
Definition: nic.h:137
@ NIC_LINK_STATE_DOWN
Definition: nic.h:98
UartInit init
Definition: nic.h:386
@ SWITCH_PORT_STATE_FORWARDING
Definition: nic.h:140
uint32_t systime_t
System time.
uint16_t port
Definition: dns_common.h:267
UartStartTx startTx
Definition: nic.h:389
@ NIC_TYPE_PPP
PPP interface.
Definition: nic.h:84
SpiInit init
Definition: nic.h:370
void(* NicWritePhyReg)(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data)
Definition: nic.h:183
SwitchGetFdbEntry getDynamicFdbEntry
Definition: nic.h:346
uint16_t fid
Definition: nic.h:165
error_t(* SpiInit)(void)
Definition: nic.h:259
uint16_t regAddr
void(* SwitchEventHandler)(NetInterface *interface)
Definition: nic.h:201
bool_t autoPadding
Definition: nic.h:299
Ethernet switch driver.
Definition: nic.h:325
uint16_t nicGetVmanId(NetInterface *interface)
Retrieve VMAN identifier.
Definition: nic.c:176
uint16_t vlanId
Definition: nic.h:163
void(* NicEnableIrq)(NetInterface *interface)
Definition: nic.h:173
void(* ExtIntDisableIrq)(void)
Definition: nic.h:278
void(* PhyEventHandler)(NetInterface *interface)
Definition: nic.h:194
bool_t nicIsParentInterface(NetInterface *interface, NetInterface *parent)
Test parent/child relationship between 2 interfaces.
Definition: nic.c:208
NicDuplexMode
Duplex mode.
Definition: nic.h:122
void(* SwitchSetAgingTime)(NetInterface *interface, uint32_t agingTime)
Definition: nic.h:221
MacAddr macAddr
Definition: nic.h:150
uint8_t srcPort
Definition: nic.h:151
@ NIC_HALF_DUPLEX_MODE
Definition: nic.h:124
SpiTransferMultipleBytes transferMultipleBytes
Definition: nic.h:376
NicUpdateMacAddrFilter updateMacAddrFilter
Definition: nic.h:295
bool_t autoCrcVerif
Definition: nic.h:301
NetInterface * nicGetPhysicalInterface(NetInterface *interface)
Retrieve physical interface.
Definition: nic.c:85
UartEnableIrq enableIrq
Definition: nic.h:387
void(* SpiAssertCs)(void)
Definition: nic.h:262
@ NIC_UNKNOWN_DUPLEX_MODE
Definition: nic.h:123
SmiInit init
Definition: nic.h:358
PhyTick tick
Definition: nic.h:313
uint32_t ports
Definition: nic.h:166
void nicProcessPacket(NetInterface *interface, uint8_t *packet, size_t length, NetRxAncillary *ancillary)
Handle a packet received by the network controller.
Definition: nic.c:392
@ NIC_TYPE_IPV4
IPv4 interface.
Definition: nic.h:85
SwitchPortState(* SwitchGetPortState)(NetInterface *interface, uint8_t port)
Definition: nic.h:218
@ NIC_LINK_SPEED_100MBPS
Definition: nic.h:112
SpiSetMode setMode
Definition: nic.h:371
void(* UartEnableIrq)(void)
Definition: nic.h:271
SwitchEnableMldSnooping enableMldSnooping
Definition: nic.h:340
ExtIntDisableIrq disableIrq
Definition: nic.h:401
PhyEnableIrq enableIrq
Definition: nic.h:314
uint16_t nicGetVlanId(NetInterface *interface)
Retrieve VLAN identifier.
Definition: nic.c:145
error_t(* SwitchDeleteFdbEntry)(NetInterface *interface, const SwitchFdbEntry *entry)
Definition: nic.h:235
@ NIC_TYPE_6LOWPAN
6LoWPAN interface
Definition: nic.h:87
unsigned int uint_t
Definition: compiler_port.h:50
TCP/IP stack core.
@ NIC_LINK_STATE_AUTO
Definition: nic.h:100
uint32_t(* SwitchGetLinkSpeed)(NetInterface *interface, uint8_t port)
Definition: nic.h:210
NIC driver.
Definition: nic.h:286
void(* NicTick)(NetInterface *interface)
Definition: nic.h:172
uint8_t nicGetSwitchPort(NetInterface *interface)
Retrieve switch port identifier.
Definition: nic.c:114
void(* SwitchSetPortState)(NetInterface *interface, uint8_t port, SwitchPortState state)
Definition: nic.h:215
error_t(* PhyInit)(NetInterface *interface)
Definition: nic.h:190
error_t(* SpiSetMode)(uint_t mode)
Definition: nic.h:260
SwitchGetFdbEntry getStaticFdbEntry
Definition: nic.h:344
void(* SwitchEnableIrq)(NetInterface *interface)
Definition: nic.h:199
Forwarding database entry.
Definition: nic.h:149
error_t(* NicUpdateMacAddrFilter)(NetInterface *interface)
Definition: nic.h:180
SmiReadPhyReg readPhyReg
Definition: nic.h:360
void(* SpiTransferMultipleBytes)(const uint8_t *txBuffer, uint8_t *rxBuffer, size_t length)
Definition: nic.h:266
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83