xref: /illumos-gate/usr/src/man/man9e/mac.9e (revision 6ff4183c538023f1acb277f9d3b05296bb816e66)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2019 Joyent, Inc.
13.\" Copyright 2020 RackTop Systems, Inc.
14.\" Copyright 2021 Oxide Computer Company
15.\"
16.Dd February 13, 2021
17.Dt MAC 9E
18.Os
19.Sh NAME
20.Nm mac ,
21.Nm GLDv3
22.Nd MAC networking device driver overview
23.Sh SYNOPSIS
24.In sys/mac_provider.h
25.In sys/mac_ether.h
26.Sh INTERFACE LEVEL
27illumos DDI specific
28.Sh DESCRIPTION
29The
30.Sy MAC
31framework provides a means for implementing high-performance networking
32device drivers.
33It is the successor to the GLD interfaces and is sometimes referred to as the
34GLDv3.
35The remainder of this manual introduces the aspects of writing devices drivers
36that leverage the MAC framework.
37While both the GLDv3 and MAC framework refer to the same thing, in this manual
38page we use the term the
39.Em MAC framework
40to refer to the device driver interface.
41.Pp
42MAC device drivers are character devices.
43They define the standard
44.Xr _init 9E ,
45.Xr _fini 9E ,
46and
47.Xr _info 9E
48entry points to initialize the module, as well as
49.Xr dev_ops 9S
50and
51.Xr cb_ops 9S
52structures.
53.Pp
54The main interface with MAC is through a series of callbacks defined in
55a
56.Xr mac_callbacks 9S
57structure.
58These callbacks control all the aspects of the device.
59They range from sending data, getting and setting of properties, controlling mac
60address filters, and also managing promiscuous mode.
61.Pp
62The MAC framework takes care of many aspects of the device driver's
63management.
64A device that uses the MAC framework does not have to worry about creating
65device nodes or implementing
66.Xr open 9E
67or
68.Xr close 9E
69routines.
70In addition, all of the work to interact with
71.Xr dlpi 7P
72is taken care of automatically and transparently.
73.Ss Initializing MAC Support
74For a device to be used in the framework, it must register with the
75framework and take specific actions during
76.Xr _init 9E ,
77.Xr attach 9E ,
78.Xr detach 9E ,
79and
80.Xr _fini 9E .
81.Pp
82All device drivers have to define a
83.Xr dev_ops 9S
84structure which is pointed to by a
85.Xr modldrv 9S
86structure and the corresponding NULL-terminated
87.Xr modlinkage 9S
88structure.
89The
90.Xr dev_ops 9S
91structure should have a
92.Xr cb_ops 9S
93structure defined for it; however, it does not need to implement any of
94the standard
95.Xr cb_ops 9S
96entry points.
97.Pp
98Normally, in a driver's
99.Xr _init 9E
100entry point, it passes its
101.Sy modlinkage
102structure directly to
103.Xr mod_install 9F .
104To properly register with MAC, the driver must call
105.Xr mac_init_ops 9F
106before it calls
107.Xr mod_install 9F .
108If for some reason the
109.Xr mod_install 9F
110function fails, then the driver must be removed by a call to
111.Xr mac_fini_ops 9F .
112.Pp
113Conversely, in the driver's
114.Xr _fini 9E
115routine, it should call
116.Xr mac_fini_ops 9F
117after it successfully calls
118.Xr mod_remove 9F .
119For an example of how to use the
120.Xr mac_init_ops 9F
121and
122.Xr mac_fini_ops 9F
123functions, see the examples section in
124.Xr mac_init_ops 9F .
125.Ss Registering with MAC
126Every instance of a device should register separately with MAC.
127To register with MAC, a driver must allocate a
128.Xr mac_register 9S
129structure, fill it in, and then call
130.Xr mac_register 9F .
131The
132.Sy mac_register_t
133structure contains information about the device and all of the required
134function pointers that will be used as callbacks by the framework.
135.Pp
136These steps should all be taken during a device's
137.Xr attach 9E
138entry point.
139It is recommended that the driver perform this sequence of steps after the
140device has finished its initialization of the chipset and interrupts, though
141interrupts should not be enabled at that point.
142After it calls
143.Xr mac_register 9F
144it will start receiving callbacks from the MAC framework.
145.Pp
146To allocate the registration structure, the driver should call
147.Xr mac_alloc 9F .
148Device drivers should generally always pass the symbol
149.Sy MAC_VERSION
150as the argument to
151.Xr mac_alloc 9F .
152Upon successful completion, the driver will receive a
153.Sy mac_register_t
154structure which it should fill in.
155The structure and its members are documented in
156.Xr mac_register 9S .
157.Pp
158The
159.Xr mac_callbacks 9S
160structure is not allocated as a part of the
161.Xr mac_register 9S
162structure.
163In general, device drivers declare this statically.
164See the
165.Sx MAC Callbacks
166section for more information on how to fill it out.
167.Pp
168Once the structure has been filled in, the driver should call
169.Xr mac_register 9F
170to register itself with MAC.
171The handle that it uses to register with should be part of the driver's soft
172state.
173It will be used in various other support functions and callbacks.
174.Pp
175If the call is successful, then the device driver
176should enable interrupts and finish any other initialization required.
177If the call to
178.Xr mac_register 9F
179failed, then it should unwind its initialization and should return
180.Sy DDI_FAILURE
181from its
182.Xr attach 9E
183routine.
184.Pp
185The driver does not need to hold onto an allocated
186.Xr mac_register 9S
187structure after it has called the
188.Xr mac_register 9F
189function.
190Whether the
191.Xr mac_register 9F
192function returns successfully or not, the driver may free its
193.Xr mac_register 9S
194structure by calling the
195.Xr mac_free 9F
196function.
197.Ss MAC Callbacks
198The MAC framework interacts with a device driver through a series of
199callbacks.
200These callbacks are described in their individual manual pages and the
201collection of callbacks is indicated in the
202.Xr mac_callbacks 9S
203manual page.
204This section does not focus on the specific functions, but rather on
205interactions between them and the rest of the device driver framework.
206.Pp
207A device driver should make no assumptions about when the various
208callbacks will be called and whether or not they will be called
209simultaneously.
210For example, a device driver may be asked to transmit data through a call to its
211.Xr mc_tx 9E
212entry point while it is being asked to get a device property through a
213call to its
214.Xr mc_getprop 9E
215entry point.
216As such, while some calls may be serialized to the device, such as setting
217properties, the device driver should always presume that all of its data needs
218to be protected with locks.
219While the device is holding locks, it is safe for it call the following MAC
220routines:
221.Bl -bullet -offset indent -compact
222.It
223.Xr mac_hcksum_get 9F
224.It
225.Xr mac_hcksum_set 9F
226.It
227.Xr mac_lso_get 9F
228.It
229.Xr mac_maxsdu_update 9F
230.It
231.Xr mac_prop_info_set_default_link_flowctrl 9F
232.It
233.Xr mac_prop_info_set_default_str 9F
234.It
235.Xr mac_prop_info_set_default_uint8 9F
236.It
237.Xr mac_prop_info_set_default_uint32 9F
238.It
239.Xr mac_prop_info_set_default_uint64 9F
240.It
241.Xr mac_prop_info_set_perm 9F
242.It
243.Xr mac_prop_info_set_range_uint32 9F
244.El
245.Pp
246Any other MAC related routines should not be called with locks held,
247such as
248.Xr mac_link_update 9F
249or
250.Xr mac_rx 9F .
251Other routines in the DDI may be called while locks are held; however,
252device driver writers should be careful about calling blocking routines
253while locks are held or in interrupt context, though it is generally
254legal to do so.
255.Ss Receiving Data
256A device driver will often receive data through the means of an
257interrupt.
258When that interrupt occurs, the device driver will receive one or more frames
259with optional metadata.
260Often each frame has a corresponding descriptor which has information about
261whether or not there were errors or whether or not the device successfully
262checksummed the packet.
263In addition to the per-packet flow described below, there are certain
264requirements that drivers must adhere to when programming the hardware
265to receive data.
266See the section
267.Sx RECEIVE DESCRIPTOR LAYOUT
268for more information.
269.Pp
270During a single interrupt, a device driver should process a fixed number
271of frames.
272For each frame the device driver should:
273.Bl -enum -offset indent
274.It
275First check whether or not the frame has errors.
276If errors were detected, then the frame should not be sent to the operating
277system.
278It is recommended that devices keep kstats (see
279.Xr kstat_create 9F
280for more information) and bump the counter whenever such an error is
281detected.
282If the device distinguishes between the types of errors, then separate kstats
283for each class of error are recommended.
284See the
285.Sx STATISTICS
286section for more information on the various error cases that should be
287considered.
288.It
289Once the frame has been determined to be valid, the device driver should
290transform the frame into a
291.Xr mblk 9S .
292See the section
293.Sx MBLKS AND DMA
294for more information on how to transform and prepare a message block.
295.It
296If the device supports hardware checksumming (see the
297.Sx CAPABILITIES
298section for more information on checksumming), then the device driver
299should set the corresponding checksumming information with a call to
300.Xr mac_hcksum_set 9F .
301.It
302It should then append this new message block to the
303.Em end
304of the message block chain, linking it to the
305.Sy b_next
306pointer.
307It is vitally important that all the frames be chained in the order that they
308were received.
309If the device driver mistakenly reorders frames, then it may cause performance
310impacts in the TCP stack and potentially impact application correctness.
311.El
312.Pp
313Once all the frames have been processed and assembled, the device driver
314should deliver them to the rest of the operating system by calling
315.Xr mac_rx 9F .
316The device driver should try to give as many mblk_t structures to the
317system at once.
318It
319.Em should not
320call
321.Xr mac_rx 9F
322once for every assembled mblk_t.
323.Pp
324The device driver must not hold any locks across the call to
325.Xr mac_rx 9F .
326When this function is called, received data will be pushed through the
327networking stack and some replies may be generated and given to the
328driver to send out.
329.Pp
330It is not the device driver's responsibility to determine whether or not
331the system can keep up with a driver's delivery rate of frames.
332The rest of the networking stack will handle issues related to keeping up
333appropriately and ensure that kernel memory is not exhausted by packets
334that are not being processed.
335.Pp
336Finally, the device driver should make sure that any other housekeeping
337activities required for the ring are taken care of such that more data
338can be received.
339.Ss Transmitting Data and Back Pressure
340A device driver will be asked to transmit a message block chain by
341having it's
342.Xr mc_tx 9E
343entry point called.
344While the driver is processing the message blocks, it may run out of resources.
345For example, a transmit descriptor ring may become full.
346At that point, the device driver should return the remaining unprocessed frames.
347The act of returning frames indicates that the device has asserted flow control.
348Once this has been done, no additional calls will be made to the
349driver's transmit entry point and the back pressure will be propagated
350throughout the rest of the networking stack.
351.Pp
352At some point in the future when resources have become available again,
353for example after an interrupt indicating that some portion of the
354transmit ring has been sent, then the device driver must notify the
355system that it can continue transmission.
356To do this, the driver should call
357.Xr mac_tx_update 9F .
358After that point, the driver will receive calls to its
359.Xr mc_tx 9E
360entry point again.
361As mentioned in the section on callbacks, the device driver should avoid holding
362any particular locks across the call to
363.Xr mac_tx_update 9F .
364.Ss Interrupt Coalescing
365For devices operating at higher data rates, interrupt coalescing is an
366important part of a well functioning device and may impact the
367performance of the device.
368Not all devices support interrupt coalescing.
369If interrupt coalescing is supported on the device, it is recommended that
370device driver writers provide private properties for their device to control the
371interrupt coalescing rate.
372This will make it much easier to perform experiments and observe the impact of
373different interrupt rates on the rest of the system.
374.Ss MAC Address Filter Management
375The MAC framework will attempt to use as many MAC address filters as a
376device has.
377To program a multicast address filter, the driver's
378.Xr mc_multicst 9E
379entry point will be called.
380If the device driver runs out of filters, it should not take any special action
381and just return the appropriate error as documented in the corresponding manual
382pages for the entry points.
383The framework will ensure that the device is placed in promiscuous mode
384if it needs to.
385.Ss Link Updates
386It is the responsibility of the device driver to keep track of the
387data link's state.
388Many devices provide a means of receiving an interrupt when the state of the
389link changes.
390When such a change happens, the driver should update its internal data
391structures and then call
392.Xr mac_link_update 9F
393to inform the MAC layer that this has occurred.
394If the device driver does not properly inform the system about link changes,
395then various features like link aggregations and other mechanisms that leverage
396the link state will not work correctly.
397.Ss Link Speed and Auto-negotiation
398Many networking devices support more than one possible speed that they
399can operate at.
400The selection of a speed is often performed through
401.Em auto-negotiation ,
402though some devices allow the user to control what speeds are advertised
403and used.
404.Pp
405Logically, there are two different sets of things that the device driver
406needs to keep track of while it's operating:
407.Bl -enum
408.It
409The supported speeds in hardware.
410.It
411The enabled speeds from the user.
412.El
413.Pp
414By default, when a link first comes up, the device driver should
415generally configure the link to support the common set of speeds and
416perform auto-negotiation.
417.Pp
418A user can control what speeds a device advertises via auto-negotiation
419and whether or not it performs auto-negotiation at all by using a series
420of properties that have
421.Sy _EN_
422in the name.
423These are read/write properties and there is one for each speed supported in the
424operating system.
425For a full list of them, see the
426.Sx PROPERTIES
427section.
428.Pp
429In addition to these properties, there is a corresponding set of
430properties with
431.Sy _ADV_
432in the name.
433These are similar to the
434.Sy _EN_
435family of properties, but they are read-only and indicate what the
436device has actually negotiated.
437While they are generally similar to the
438.Sy _EN_
439family of properties, they may change depending on power settings.
440See the
441.Sy Ethernet Link Properties
442section in
443.Xr dladm 1M
444for more information.
445.Pp
446It's worth discussing how these different values get used throughout the
447different entry points.
448The first entry point to consider is the
449.Xr mc_propinfo 9E
450entry point.
451For a given speed, the driver should consult whether or not the hardware
452supports this speed.
453If it does, it should fill in the default value that the hardware takes and
454whether or not the property is writable.
455The properties should also be updated to indicate whether or not it is writable.
456This holds for both the
457.Sy _EN_
458and
459.Sy _ADV_
460family of properties.
461.Pp
462The next entry point is
463.Xr mc_getprop 9E .
464Here, the device should first consult whether the given speed is
465supported.
466If it is not, then the driver should return
467.Er ENOTSUP .
468If it does, then it should return the current value of the property.
469.Pp
470The last property endpoint is the
471.Xr mc_setprop 9E
472entry point.
473Here, the same logic applies.
474Before the driver considers whether or not the property is writable, it should
475first check whether or not it's a supported property.
476If it's not, then it should return
477.Er ENOTSUP .
478Otherwise, it should proceed to check whether the property is writable,
479and if it is and a valid value, then it should update the property and
480restart the link's negotiation.
481.Pp
482Finally, there is the
483.Xr mc_getstat 9E
484entry point.
485Several of the statistics that are queried relate to auto-negotiation and
486hardware capabilities.
487When a statistic relates to the hardware supporting a given speed, the
488.Sy _EN_
489properties should be ignored.
490The only thing that should be consulted is what the hardware itself supports.
491Otherwise, the statistics should look at what is currently being advertised by
492the device.
493.Ss Unregistering from MAC
494During a driver's
495.Xr detach 9E
496routine, it should unregister the device instance from MAC by calling
497.Xr mac_unregister 9F
498on the handle that it originally called it on.
499If the call to
500.Xr mac_unregister 9F
501failed, then the device is likely still in use and the driver should
502fail the call to
503.Xr detach 9E .
504.Ss Interacting with Devices
505Administrators always interact with devices through the
506.Xr dladm 1M
507command line interface.
508The state of devices such as whether the link is considered
509.Sy up
510or
511.Sy down ,
512various link properties such as the
513.Sy MTU ,
514.Sy auto-negotiation
515state,
516and
517.Sy flow control
518state,
519are all exposed.
520It is also the preferred way that these properties are set and configured.
521.Pp
522While device tunables may be presented in a
523.Xr driver.conf 4
524file, it is recommended instead to expose such things through
525.Xr dladm 1M
526private properties, whether explicitly documented or not.
527.Sh CAPABILITIES
528Capabilities in the MAC Framework are optional features that a device
529supports which indicate various hardware features that the device
530supports.
531The two current capabilities that the system supports are related to being able
532to hardware perform large send offloads (LSO), often also known as TCP
533segmentation and the ability for hardware to calculate and verify the checksums
534present in IPv4, IPV6, and protocol headers such as TCP and UDP.
535.Pp
536The MAC framework will query a device for support of a capability
537through the
538.Xr mc_getcapab 9E
539function.
540Each capability has its own constant and may have corresponding data that goes
541along with it and a specific structure that the device is required to fill in.
542Note, the set of capabilities changes over time and there are also private
543capabilities in the system.
544Several of the capabilities are used in the implementation of the MAC framework.
545Others, like
546.Sy MAC_CAPAB_RINGS ,
547represent feature that have not been stabilized and thus both API and binary
548compatibility for them is not guaranteed.
549It is important that the device driver handles unknown capabilities correctly.
550For more information, see
551.Xr mc_getcapab 9E .
552.Pp
553The following capabilities are
554stable and defined in the system:
555.Ss MAC_CAPAB_HCKSUM
556The
557.Sy MAC_CAPAB_HCKSUM
558capability indicates to the system that the device driver supports some
559amount of checksumming.
560The specific data for this capability is a pointer to a
561.Sy uint32_t .
562To indicate no support for any kind of checksumming, the driver should
563either set this value to zero or simply return that it doesn't support
564the capability.
565.Pp
566Note, the values that the driver declares in this capability indicate
567what it can do when it transmits data.
568If the driver can only verify checksums when receiving data, then it should not
569indicate that it supports this capability.
570The following set of flags may be combined through a bitwise inclusive OR:
571.Bl -tag -width Ds
572.It Sy HCKSUM_INET_PARTIAL
573This indicates that the hardware can calculate a partial checksum for
574both IPv4 and IPv6 UDP and TCP packets; however, it requires the pseudo-header
575checksum be calculated for it.
576The pseudo-header checksum will be available for the mblk_t when calling
577.Xr mac_hcksum_get 9F .
578Note this does not imply that the hardware is capable of calculating
579the partial checksum for other L4 protocols or the IPv4 header checksum.
580That should be indicated with the
581.Sy HCKSUM_IPHDRCKSUM flag.
582.It Sy HCKSUM_INET_FULL_V4
583This indicates that the hardware will fully calculate the L4 checksum for
584outgoing IPv4 UDP or TCP packets only, and does not require a pseudo-header
585checksum.
586Note this does not imply that the hardware is capable of calculating the
587checksum for other L4 protocols or the IPv4 header checksum.
588That should be indicated with the
589.Sy HCKSUM_IPHDRCKSUM .
590.It Sy HCKSUM_INET_FULL_V6
591This indicates that the hardware will fully calculate the L4 checksum for
592outgoing IPv6 UDP or TCP packets only, and does not require a pseudo-header
593checksum.
594Note this does not imply that the hardware is capable of calculating the
595checksum for any other L4 protocols.
596.It Sy HCKSUM_IPHDRCKSUM
597This indicates that the hardware supports calculating the checksum for
598the IPv4 header itself.
599.El
600.Pp
601When in a driver's transmit function, the driver will be processing a
602single frame.
603It should call
604.Xr mac_hcksum_get 9F
605to see what checksum flags are set on it.
606Note that the flags that are set on it are different from the ones described
607above and are documented in its manual page.
608These flags indicate how the driver is expected to program the hardware and what
609checksumming is required.
610Not all frames will require hardware checksumming or will ask the hardware to
611checksum it.
612.Pp
613If a driver supports offloading the receive checksum and verification,
614it should check to see what the hardware indicated was verified.
615The driver should then call
616.Xr mac_hcksum_set 9F .
617The flags used are different from the ones above and are discussed in
618detail in the
619.Xr mac_hcksum_set 9F
620manual page.
621If there is no checksum information available or the driver does not support
622checksumming, then it should simply not call
623.Xr mac_hcksum_set 9F .
624.Pp
625Note that the checksum flags should be set on the first
626mblk_t that makes up a given message.
627In other words, if multiple mblk_t structures are linked together by the
628.Sy b_cont
629member to describe a single frame, then it should only be called on the
630first mblk_t of that set.
631However, each distinct message should have the checksum bits set on it, if
632applicable.
633In other words, each mblk_t that is linked together by the
634.Sy b_next
635pointer may have checksum flags set.
636.Pp
637It is recommended that device drivers provide a private property or
638.Xr driver.conf 4
639property to control whether or not checksumming is enabled for both rx
640and tx; however, the default disposition is recommended to be enabled
641for both.
642This way if hardware bugs are found in the checksumming implementation, they can
643be disabled without requiring software updates.
644The transmit property should be checked when determining how to reply to
645.Xr mc_getcapab 9E
646and the receive property should be checked in the context of the receive
647function.
648.Ss MAC_CAPAB_LSO
649The
650.Sy MAC_CAPAB_LSO
651capability indicates that the driver supports various forms of large
652send offload (LSO).
653The private data is a pointer to a
654.Ft mac_capab_lso_t
655structure.
656The system currently supports offloading TCP packets over both IPv4 and
657IPv6.
658This structure has the following members which are used to indicate
659various types of LSO support.
660.Bd -literal -offset indent
661t_uscalar_t		lso_flags;
662lso_basic_tcp_ivr4_t	lso_basic_tcp_ipv4;
663lso_basic_tcp_ipv6_t	lso_basic_tcp_ipv6;
664.Ed
665.Pp
666The
667.Fa lso_flags
668member is used to indicate which members are valid and should be
669considered.
670Each flag represents a different form of LSO.
671The member should be set to the bitwise inclusive OR of the following values:
672.Bl -tag -width Dv -offset indent
673.It Dv LSO_TX_BASIC_TCP_IPV4
674This indicates hardware support for performing TCP segmentation
675offloading over IPv4.
676When this flag is set, the
677.Fa lso_basic_tcp_ipv4
678member must be filled in.
679.It Dv LSO_TX_BASIC_TCP_IPV6
680This indicates hardware support for performing TCP segmentation
681offloading over IPv6.
682The IPv6 packet will have no extension headers present.
683When this flag is set, the
684.Fa lso_basic_tcp_ipv6
685member must be filled in.
686.El
687.Pp
688The
689.Fa lso_basic_tcp_ipv4
690member is a structure with the following members:
691.Bd -literal -offset indent
692t_uscalar_t	lso_max
693.Ed
694.Bd -filled -offset indent
695The
696.Fa lso_max
697member should be set to the maximum size of the TCP data
698payload that can be offloaded to the hardware.
699.Ed
700.Pp
701The
702.Fa lso_basic_tcp_ipv6
703member is a structure with the following members:
704.Bd -literal -offset indent
705t_uscalar_t	lso_max
706.Ed
707.Bd -filled -offset indent
708The
709.Fa lso_max
710member should be set to the maximum size of the TCP data
711payload that can be offloaded to the hardware.
712.Ed
713.Pp
714Like with checksumming, it is recommended that driver writers provide a
715means for disabling the support of LSO even if it is enabled by default.
716This deals with the case where issues that pop up for LSO may be worked
717around without requiring additional driver work.
718.Sh PROPERTIES
719Properties in the MAC framework represent aspects of a link.
720These include things like the link's current state and MTU.
721Many of the properties in the system are focused around auto-negotiation and
722controlling what link speeds are advertised.
723Information about properties is covered by three different device entry points.
724The
725.Xr mc_propinfo 9E
726entry point obtains metadata about the property.
727The
728.Xr mc_getprop 9E
729entry point obtains the property.
730The
731.Xr mc_setprop 9E
732entry point updates the property to a new value.
733.Pp
734Many of the properties listed below are read-only.
735Each property indicates whether it's read-only or it's read/write.
736However, driver writers may not implement the ability to set all writable
737properties.
738Many of these depend on the card itself.
739In particular, all properties that relate to auto-negotiation and are read/write
740may not be updated if the hardware in question does not support toggling what
741link speeds are auto-negotiated.
742While copper Ethernet often does not have this restriction, it often exists with
743various fiber standards and phys.
744.Pp
745The following properties are the subset of MAC framework properties that
746driver writers should be aware of and handle.
747While other properties exist in the system, driver writers should always return
748an error when a property not listed below is encountered.
749See
750.Xr mc_getprop 9E
751and
752.Xr mc_setprop 9E
753for more information on how to handle them.
754.Bl -hang -width Ds
755.It Sy MAC_PROP_DUPLEX
756.Bd -filled -compact
757Type:
758.Sy link_duplex_t |
759Permissions:
760.Sy Read-Only
761.Ed
762.Pp
763The
764.Sy MAC_PROP_DUPLEX
765property is used to indicate whether or not the link is duplex.
766A duplex link may have traffic flowing in both directions at the same time.
767The
768.Sy link_duplex_t
769is an enumeration which may be set to any of the following values:
770.Bl -tag -width Ds
771.It Sy LINK_DUPLEX_UNKNOWN
772The current state of the link is unknown.
773This may be because the link has not negotiated to a specific speed or it is
774down.
775.It Sy LINK_DUPLEX_HALF
776The link is running at half duplex.
777Communication may travel in only one direction on the link at a given time.
778.It Sy LINK_DUPLEX_FULL
779The link is running at full duplex.
780Communication may travel in both directions on the link simultaneously.
781.El
782.It Sy MAC_PROP_SPEED
783.Bd -filled -compact
784Type:
785.Sy uint64_t |
786Permissions:
787.Sy Read-Only
788.Ed
789.Pp
790The
791.Sy MAC_PROP_SPEED
792property stores the current link speed in bits per second.
793A link that is running at 100 MBit/s would store the value 100000000ULL.
794A link that is running at 40 Gbit/s would store the value 40000000000ULL.
795.It Sy MAC_PROP_STATUS
796.Bd -filled -compact
797Type:
798.Sy link_state_t |
799Permissions:
800.Sy Read-Only
801.Ed
802.Pp
803The
804.Sy MAC_PROP_STATUS
805property is used to indicate the current state of the link.
806It indicates whether the link is up or down.
807The
808.Sy link_state_t
809is an enumeration which may be set to any of the following values:
810.Bl -tag -width Ds
811.It Sy LINK_STATE_UNKNOWN
812The current state of the link is unknown.
813This may be because the driver's
814.Xr mc_start 9E
815endpoint has not been called so it has not attempted to start the link.
816.It Sy LINK_STATE_DOWN
817The link is down.
818This may be because of a negotiation problem, a cable problem, or some other
819device specific issue.
820.It Sy LINK_STATE_UP
821The link is up.
822If auto-negotiation is in use, it should have completed.
823Traffic should be able to flow over the link, barring other issues.
824.El
825.It Sy MAC_PROP_AUTONEG
826.Bd -filled -compact
827Type:
828.Sy uint8_t |
829Permissions:
830.Sy Read/Write
831.Ed
832.Pp
833The
834.Sy MAC_PROP_AUTONEG
835property indicates whether or not the device is currently configured to
836perform auto-negotiation.
837A value of
838.Sy 0
839indicates that auto-negotiation is disabled.
840A
841.Sy non-zero
842value indicates that auto-negotiation is enabled.
843Devices should generally default to enabling auto-negotiation.
844.Pp
845When getting this property, the device driver should return the current
846state.
847When setting this property, if the device supports operating in the requested
848mode, then the device driver should reset the link to negotiate to the new speed
849after updating any internal registers.
850.It Sy MAC_PROP_MTU
851.Bd -filled -compact
852Type:
853.Sy uint32_t |
854Permissions:
855.Sy Read/Write
856.Ed
857.Pp
858The
859.Sy MAC_PROP_MTU
860property determines the maximum transmission unit (MTU).
861This indicates the maximum size packet that the device can transmit, ignoring
862its own headers.
863For an Ethernet device, this would exclude the size of the Ethernet header and
864any VLAN headers that would be placed.
865It is up to the driver to ensure that any MTU values that it accepts when adding
866in its margin and header sizes does not exceed its maximum frame size.
867.Pp
868By default, drivers for Ethernet should initialize this value and the
869MTU to
870.Sy 1500 .
871When getting this property, the driver should return its current
872recorded MTU.
873When setting this property, the driver should first validate that it is within
874the device's valid range and then it must call
875.Xr mac_maxsdu_update 9F .
876Note that the call may fail.
877If the call completes successfully, the driver should update the hardware with
878the new value of the MTU and perform any other work needed to handle it.
879.Pp
880If the device does not support changing the MTU after the device's
881.Xr mc_start 9E
882entry point has been called, then driver writers should return
883.Er EBUSY .
884.It Sy MAC_PROP_FLOWCTRL
885.Bd -filled -compact
886Type:
887.Sy link_flowctrl_t |
888Permissions:
889.Sy Read/Write
890.Ed
891.Pp
892The
893.Sy MAC_PROP_FLOWCTRL
894property manages the configuration of pause frames as part of Ethernet
895flow control.
896Note, this only describes what this device will advertise.
897What is actually enabled may be different and is subject to the rules of
898auto-negotiation.
899The
900.Sy link_flowctrl_t
901is an enumeration that may be set to one of the following values:
902.Bl -tag -width Ds
903.It Sy LINK_FLOWCTRL_NONE
904Flow control is disabled.
905No pause frames should be generated or honored.
906.It Sy LINK_FLOWCTRL_RX
907The device can receive pause frames; however, it should not generate
908them.
909.It Sy LINK_FLOWCTRL_TX
910The device can generate pause frames; however, it does not support
911receiving them.
912.It Sy LINK_FLOWCTRL_BI
913The device supports both sending and receiving pause frames.
914.El
915.Pp
916When getting this property, the device driver should return the way that
917it has configured the device, not what the device has actually
918negotiated.
919When setting the property, it should update the hardware and allow the link to
920potentially perform auto-negotiation again.
921.It Sy MAC_PROP_EN_FEC_CAP
922.Bd -filled -compact
923Type:
924.Sy link_fec_t |
925Permissions:
926.Sy Read/Write
927.Ed
928.Pp
929The
930.Sy MAC_PROP_EN_FEC_CAP
931property indicates which Forward Error Correction (FEC) code is advertised
932by the device.
933.Pp
934The
935.Sy link_fec_t
936is an enumeration that may be a combination of the following bit values:
937.Bl -tag -width Ds
938.It Sy LINK_FEC_NONE
939No FEC over the link.
940.It Sy LINK_FEC_AUTO
941The FEC coding to use is auto-negotiated,
942.Sy LINK_FEC_AUTO
943cannot be set along with any of the other values.
944This is the default setting the device driver should use.
945.It Sy LINK_FEC_RS
946The link may use Reed-Solomon FEC coding.
947.It Sy LINK_FEC_BASE_R
948The link may use Base-R coding, also common referred to as FireCode.
949.El
950.Pp
951When setting the property, it should update the hardware with the requested, or
952combination of requested codings.
953If a particular combination of codings is not supported by the hardware,
954the device driver should return
955.Er EINVAL .
956When retrieving this property, the device driver should return the current
957value of the property.
958.It Sy MAC_PROP_ADV_FEC_CAP
959.Bd -filled -compact
960Type:
961.Sy link_fec_t |
962Permissions:
963.Sy Read-Only
964.Ed
965.Pp
966The
967.Sy MAC_PROP_ADV_FEC_CAP
968has the same values as
969.Sy MAC_PROP_EN_FEC_CAP .
970The property indicates which Forward Error Correction (FEC) code has been
971negotiated over the link.
972.El
973.Pp
974The remaining properties are all about various auto-negotiation link
975speeds.
976They fall into two different buckets: properties with
977.Sy _ADV_
978in the name and properties with
979.Sy _EN_
980in the name.
981For any given supported speed, there is one of each.
982The
983.Sy _EN_
984set of properties are read/write properties that control what should be
985advertised by the device.
986When these are retrieved, they should return the current value of the property.
987When they are set, they should change how the hardware advertises the specific
988speed and trigger any kind of link reset and auto-negotiation, if enabled, to
989occur.
990.Pp
991The
992.Sy _ADV_
993set of properties are read-only properties.
994They are meant to reflect what has actually been negotiated.
995These may be different from the
996.Sy _EN_
997family of properties, especially when different power management
998settings are at play.
999.Pp
1000See the
1001.Sx Link Speed and Auto-negotiation
1002section for more information.
1003.Pp
1004The properties are ordered in increasing link speed:
1005.Bl -hang -width Ds
1006.It Sy MAC_PROP_ADV_10HDX_CAP
1007.Bd -filled -compact
1008Type:
1009.Sy uint8_t |
1010Permissions:
1011.Sy Read-Only
1012.Ed
1013.Pp
1014The
1015.Sy MAC_PROP_ADV_10HDX_CAP
1016property describes whether or not 10 Mbit/s half-duplex support is
1017advertised.
1018.It Sy MAC_PROP_EN_10HDX_CAP
1019.Bd -filled -compact
1020Type:
1021.Sy uint8_t |
1022Permissions:
1023.Sy Read/Write
1024.Ed
1025.Pp
1026The
1027.Sy MAC_PROP_EN_10HDX_CAP
1028property describes whether or not 10 Mbit/s half-duplex support is
1029enabled.
1030.It Sy MAC_PROP_ADV_10FDX_CAP
1031.Bd -filled -compact
1032Type:
1033.Sy uint8_t |
1034Permissions:
1035.Sy Read-Only
1036.Ed
1037.Pp
1038The
1039.Sy MAC_PROP_ADV_10FDX_CAP
1040property describes whether or not 10 Mbit/s full-duplex support is
1041advertised.
1042.It Sy MAC_PROP_EN_10FDX_CAP
1043.Bd -filled -compact
1044Type:
1045.Sy uint8_t |
1046Permissions:
1047.Sy Read/Write
1048.Ed
1049.Pp
1050The
1051.Sy MAC_PROP_EN_10FDX_CAP
1052property describes whether or not 10 Mbit/s full-duplex support is
1053enabled.
1054.It Sy MAC_PROP_ADV_100HDX_CAP
1055.Bd -filled -compact
1056Type:
1057.Sy uint8_t |
1058Permissions:
1059.Sy Read-Only
1060.Ed
1061.Pp
1062The
1063.Sy MAC_PROP_ADV_100HDX_CAP
1064property describes whether or not 100 Mbit/s half-duplex support is
1065advertised.
1066.It Sy MAC_PROP_EN_100HDX_CAP
1067.Bd -filled -compact
1068Type:
1069.Sy uint8_t |
1070Permissions:
1071.Sy Read/Write
1072.Ed
1073.Pp
1074The
1075.Sy MAC_PROP_EN_100HDX_CAP
1076property describes whether or not 100 Mbit/s half-duplex support is
1077enabled.
1078.It Sy MAC_PROP_ADV_100FDX_CAP
1079.Bd -filled -compact
1080Type:
1081.Sy uint8_t |
1082Permissions:
1083.Sy Read-Only
1084.Ed
1085.Pp
1086The
1087.Sy MAC_PROP_ADV_100FDX_CAP
1088property describes whether or not 100 Mbit/s full-duplex support is
1089advertised.
1090.It Sy MAC_PROP_EN_100FDX_CAP
1091.Bd -filled -compact
1092Type:
1093.Sy uint8_t |
1094Permissions:
1095.Sy Read/Write
1096.Ed
1097.Pp
1098The
1099.Sy MAC_PROP_EN_100FDX_CAP
1100property describes whether or not 100 Mbit/s full-duplex support is
1101enabled.
1102.It Sy MAC_PROP_ADV_100T4_CAP
1103.Bd -filled -compact
1104Type:
1105.Sy uint8_t |
1106Permissions:
1107.Sy Read-Only
1108.Ed
1109.Pp
1110The
1111.Sy MAC_PROP_ADV_100T4_CAP
1112property describes whether or not 100 Mbit/s Ethernet using the
1113100BASE-T4 standard is
1114advertised.
1115.It Sy MAC_PROP_EN_100T4_CAP
1116.Bd -filled -compact
1117Type:
1118.Sy uint8_t |
1119Permissions:
1120.Sy Read/Write
1121.Ed
1122.Pp
1123The
1124.Sy MAC_PROP_ADV_100T4_CAP
1125property describes whether or not 100 Mbit/s Ethernet using the
1126100BASE-T4 standard is
1127enabled.
1128.It Sy MAC_PROP_ADV_1000HDX_CAP
1129.Bd -filled -compact
1130Type:
1131.Sy uint8_t |
1132Permissions:
1133.Sy Read-Only
1134.Ed
1135.Pp
1136The
1137.Sy MAC_PROP_ADV_1000HDX_CAP
1138property describes whether or not 1 Gbit/s half-duplex support is
1139advertised.
1140.It Sy MAC_PROP_EN_1000HDX_CAP
1141.Bd -filled -compact
1142Type:
1143.Sy uint8_t |
1144Permissions:
1145.Sy Read/Write
1146.Ed
1147.Pp
1148The
1149.Sy MAC_PROP_EN_1000HDX_CAP
1150property describes whether or not 1 Gbit/s half-duplex support is
1151enabled.
1152.It Sy MAC_PROP_ADV_1000FDX_CAP
1153.Bd -filled -compact
1154Type:
1155.Sy uint8_t |
1156Permissions:
1157.Sy Read-Only
1158.Ed
1159.Pp
1160The
1161.Sy MAC_PROP_ADV_1000FDX_CAP
1162property describes whether or not 1 Gbit/s full-duplex support is
1163advertised.
1164.It Sy MAC_PROP_EN_1000FDX_CAP
1165.Bd -filled -compact
1166Type:
1167.Sy uint8_t |
1168Permissions:
1169.Sy Read/Write
1170.Ed
1171.Pp
1172The
1173.Sy MAC_PROP_EN_1000FDX_CAP
1174property describes whether or not 1 Gbit/s full-duplex support is
1175enabled.
1176.It Sy MAC_PROP_ADV_2500FDX_CAP
1177.Bd -filled -compact
1178Type:
1179.Sy uint8_t |
1180Permissions:
1181.Sy Read-Only
1182.Ed
1183.Pp
1184The
1185.Sy MAC_PROP_ADV_2500FDX_CAP
1186property describes whether or not 2.5 Gbit/s full-duplex support is
1187advertised.
1188.It Sy MAC_PROP_EN_2500FDX_CAP
1189.Bd -filled -compact
1190Type:
1191.Sy uint8_t |
1192Permissions:
1193.Sy Read/Write
1194.Ed
1195.Pp
1196The
1197.Sy MAC_PROP_EN_2500FDX_CAP
1198property describes whether or not 2.5 Gbit/s full-duplex support is
1199enabled.
1200.It Sy MAC_PROP_ADV_5000FDX_CAP
1201.Bd -filled -compact
1202Type:
1203.Sy uint8_t |
1204Permissions:
1205.Sy Read-Only
1206.Ed
1207.Pp
1208The
1209.Sy MAC_PROP_ADV_5000FDX_CAP
1210property describes whether or not 5.0 Gbit/s full-duplex support is
1211advertised.
1212.It Sy MAC_PROP_EN_5000FDX_CAP
1213.Bd -filled -compact
1214Type:
1215.Sy uint8_t |
1216Permissions:
1217.Sy Read/Write
1218.Ed
1219.Pp
1220The
1221.Sy MAC_PROP_EN_5000FDX_CAP
1222property describes whether or not 5.0 Gbit/s full-duplex support is
1223enabled.
1224.It Sy MAC_PROP_ADV_10GFDX_CAP
1225.Bd -filled -compact
1226Type:
1227.Sy uint8_t |
1228Permissions:
1229.Sy Read-Only
1230.Ed
1231.Pp
1232The
1233.Sy MAC_PROP_ADV_10GFDX_CAP
1234property describes whether or not 10 Gbit/s full-duplex support is
1235advertised.
1236.It Sy MAC_PROP_EN_10GFDX_CAP
1237.Bd -filled -compact
1238Type:
1239.Sy uint8_t |
1240Permissions:
1241.Sy Read/Write
1242.Ed
1243.Pp
1244The
1245.Sy MAC_PROP_EN_10GFDX_CAP
1246property describes whether or not 10 Gbit/s full-duplex support is
1247enabled.
1248.It Sy MAC_PROP_ADV_40GFDX_CAP
1249.Bd -filled -compact
1250Type:
1251.Sy uint8_t |
1252Permissions:
1253.Sy Read-Only
1254.Ed
1255.Pp
1256The
1257.Sy MAC_PROP_ADV_40GFDX_CAP
1258property describes whether or not 40 Gbit/s full-duplex support is
1259advertised.
1260.It Sy MAC_PROP_EN_40GFDX_CAP
1261.Bd -filled -compact
1262Type:
1263.Sy uint8_t |
1264Permissions:
1265.Sy Read/Write
1266.Ed
1267.Pp
1268The
1269.Sy MAC_PROP_EN_40GFDX_CAP
1270property describes whether or not 40 Gbit/s full-duplex support is
1271enabled.
1272.It Sy MAC_PROP_ADV_100GFDX_CAP
1273.Bd -filled -compact
1274Type:
1275.Sy uint8_t |
1276Permissions:
1277.Sy Read-Only
1278.Ed
1279.Pp
1280The
1281.Sy MAC_PROP_ADV_100GFDX_CAP
1282property describes whether or not 100 Gbit/s full-duplex support is
1283advertised.
1284.It Sy MAC_PROP_EN_100GFDX_CAP
1285.Bd -filled -compact
1286Type:
1287.Sy uint8_t |
1288Permissions:
1289.Sy Read/Write
1290.Ed
1291.Pp
1292The
1293.Sy MAC_PROP_EN_100GFDX_CAP
1294property describes whether or not 100 Gbit/s full-duplex support is
1295enabled.
1296.El
1297.Ss Private Properties
1298In addition to the defined properties above, drivers are allowed to
1299define private properties.
1300These private properties are device-specific properties.
1301All private properties share the same constant,
1302.Sy MAC_PROP_PRIVATE .
1303Properties are distinguished by a name, which is a character string.
1304The list of such private properties is defined when registering with mac in the
1305.Sy m_priv_props
1306member of the
1307.Xr mac_register 9S
1308structure.
1309.Pp
1310The driver may define whatever semantics it wants for these private
1311properties.
1312They will not be listed when running
1313.Xr dladm 1M ,
1314unless explicitly requested by name.
1315All such properties should start with a leading underscore character and then
1316consist of alphanumeric ASCII characters and additional underscores or hyphens.
1317.Pp
1318Properties of type
1319.Sy MAC_PROP_PRIVATE
1320may show up in all three property related entry points:
1321.Xr mc_propinfo 9E ,
1322.Xr mc_getprop 9E ,
1323and
1324.Xr mc_setprop 9E .
1325Device drivers should tell the different properties apart by using the
1326.Xr strcmp 9F
1327function to compare it to the set of properties that it knows about.
1328When encountering properties that it doesn't know, it should treat them
1329like all other unknown properties.
1330.Sh STATISTICS
1331The MAC framework defines a couple different sets of statistics which
1332are based on various standards for devices to implement.
1333Statistics are retrieved through the
1334.Xr mc_getstat 9E
1335entry point.
1336There are both statistics that are required for all devices and then there is a
1337separate set of Ethernet specific statistics.
1338Not all devices will support every statistic.
1339In many cases, several device registers will need to be combined to create the
1340proper stat.
1341.Pp
1342In general, if the device is not keeping track of these statistics, then
1343it is recommended that the driver store these values as a
1344.Sy uint64_t
1345to ensure that overflow does not occur.
1346.Pp
1347If a device does not support a specific statistic, then it is fine to
1348return that it is not supported.
1349The same should be used for unrecognized statistics.
1350See
1351.Xr mc_getstat 9E
1352for more information on the proper way to handle these.
1353.Ss General Device Statistics
1354The following statistics are based on MIB-II statistics from both RFC
13551213 and RFC 1573.
1356.Bl -tag -width Ds
1357.It Sy MAC_STAT_IFSPEED
1358The device's current speed in bits per second.
1359.It Sy MAC_STAT_MULTIRCV
1360The total number of received multicast packets.
1361.It Sy MAC_STAT_BRDCSTRCV
1362The total number of received broadcast packets.
1363.It Sy MAC_STAT_MULTIXMT
1364The total number of transmitted multicast packets.
1365.It Sy MAC_STAT_BRDCSTXMT
1366The total number of received broadcast packets.
1367.It Sy MAC_STAT_NORCVBUF
1368The total number of packets discarded by the hardware due to a lack of
1369receive buffers.
1370.It Sy MAC_STAT_IERRORS
1371The total number of errors detected on input.
1372.It Sy MAC_STAT_UNKNOWNS
1373The total number of received packets that were discarded because they
1374were of an unknown protocol.
1375.It Sy MAC_STAT_NOXMTBUF
1376The total number of outgoing packets dropped due to a lack of transmit
1377buffers.
1378.It Sy MAC_STAT_OERRORS
1379The total number of outgoing packets that resulted in errors.
1380.It Sy MAC_STAT_COLLISIONS
1381Total number of collisions encountered by the transmitter.
1382.It Sy MAC_STAT_RBYTES
1383The total number of
1384.Sy bytes
1385received by the device, regardless of packet type.
1386.It Sy MAC_STAT_IPACKETS
1387The total number of
1388.Sy packets
1389received by the device, regardless of packet type.
1390.It Sy MAC_STAT_OBYTES
1391The total number of
1392.Sy bytes
1393transmitted by the device, regardless of packet type.
1394.It Sy MAC_STAT_OPACKETS
1395The total number of
1396.Sy packets
1397sent by the device, regardless of packet type.
1398.It Sy MAC_STAT_UNDERFLOWS
1399The total number of packets that were smaller than the minimum sized
1400packet for the device and were therefore dropped.
1401.It Sy MAC_STAT_OVERFLOWS
1402The total number of packets that were larger than the maximum sized
1403packet for the device and were therefore dropped.
1404.El
1405.Ss Ethernet Specific Statistics
1406The following statistics are specific to Ethernet devices.
1407They refer to values from RFC 1643 and include various MII/GMII specific stats.
1408Many of these are also defined in IEEE 802.3.
1409.Bl -tag -width Ds
1410.It Sy ETHER_STAT_ADV_CAP_1000FDX
1411Indicates that the device is advertising support for 1 Gbit/s
1412full-duplex operation.
1413.It Sy ETHER_STAT_ADV_CAP_1000HDX
1414Indicates that the device is advertising support for 1 Gbit/s
1415half-duplex operation.
1416.It Sy ETHER_STAT_ADV_CAP_100FDX
1417Indicates that the device is advertising support for 100 Mbit/s
1418full-duplex operation.
1419.It Sy ETHER_STAT_ADV_CAP_100GFDX
1420Indicates that the device is advertising support for 100 Gbit/s
1421full-duplex operation.
1422.It Sy ETHER_STAT_ADV_CAP_100HDX
1423Indicates that the device is advertising support for 100 Mbit/s
1424half-duplex operation.
1425.It Sy ETHER_STAT_ADV_CAP_100T4
1426Indicates that the device is advertising support for 100 Mbit/s
1427100BASE-T4 operation.
1428.It Sy ETHER_STAT_ADV_CAP_10FDX
1429Indicates that the device is advertising support for 10 Mbit/s
1430full-duplex operation.
1431.It Sy ETHER_STAT_ADV_CAP_10GFDX
1432Indicates that the device is advertising support for 10 Gbit/s
1433full-duplex operation.
1434.It Sy ETHER_STAT_ADV_CAP_10HDX
1435Indicates that the device is advertising support for 10 Mbit/s
1436half-duplex operation.
1437.It Sy ETHER_STAT_ADV_CAP_2500FDX
1438Indicates that the device is advertising support for 2.5 Gbit/s
1439full-duplex operation.
1440.It Sy ETHER_STAT_ADV_CAP_40GFDX
1441Indicates that the device is advertising support for 40 Gbit/s
1442full-duplex operation.
1443.It Sy ETHER_STAT_ADV_CAP_5000FDX
1444Indicates that the device is advertising support for 5.0 Gbit/s
1445full-duplex operation.
1446.It Sy ETHER_STAT_ADV_CAP_ASMPAUSE
1447Indicates that the device is advertising support for receiving pause
1448frames.
1449.It Sy ETHER_STAT_ADV_CAP_AUTONEG
1450Indicates that the device is advertising support for auto-negotiation.
1451.It Sy ETHER_STAT_ADV_CAP_PAUSE
1452Indicates that the device is advertising support for generating pause
1453frames.
1454.It Sy ETHER_STAT_ADV_REMFAULT
1455Indicates that the device is advertising support for detecting faults in
1456the remote link peer.
1457.It Sy ETHER_STAT_ALIGN_ERRORS
1458Indicates the number of times an alignment error was generated by the
1459Ethernet device.
1460This is a count of packets that were not an integral number of octets and failed
1461the FCS check.
1462.It Sy ETHER_STAT_CAP_1000FDX
1463Indicates the device supports 1 Gbit/s full-duplex operation.
1464.It Sy ETHER_STAT_CAP_1000HDX
1465Indicates the device supports 1 Gbit/s half-duplex operation.
1466.It Sy ETHER_STAT_CAP_100FDX
1467Indicates the device supports 100 Mbit/s full-duplex operation.
1468.It Sy ETHER_STAT_CAP_100GFDX
1469Indicates the device supports 100 Gbit/s full-duplex operation.
1470.It Sy ETHER_STAT_CAP_100HDX
1471Indicates the device supports 100 Mbit/s half-duplex operation.
1472.It Sy ETHER_STAT_CAP_100T4
1473Indicates the device supports 100 Mbit/s 100BASE-T4 operation.
1474.It Sy ETHER_STAT_CAP_10FDX
1475Indicates the device supports 10 Mbit/s full-duplex operation.
1476.It Sy ETHER_STAT_CAP_10GFDX
1477Indicates the device supports 10 Gbit/s full-duplex operation.
1478.It Sy ETHER_STAT_CAP_10HDX
1479Indicates the device supports 10 Mbit/s half-duplex operation.
1480.It Sy ETHER_STAT_CAP_2500FDX
1481Indicates the device supports 2.5 Gbit/s full-duplex operation.
1482.It Sy ETHER_STAT_CAP_40GFDX
1483Indicates the device supports 40 Gbit/s full-duplex operation.
1484.It Sy ETHER_STAT_CAP_5000FDX
1485Indicates the device supports 5.0 Gbit/s full-duplex operation.
1486.It Sy ETHER_STAT_CAP_ASMPAUSE
1487Indicates that the device supports the ability to receive pause frames.
1488.It Sy ETHER_STAT_CAP_AUTONEG
1489Indicates that the device supports the ability to perform link
1490auto-negotiation.
1491.It Sy ETHER_STAT_CAP_PAUSE
1492Indicates that the device supports the ability to transmit pause frames.
1493.It Sy ETHER_STAT_CAP_REMFAULT
1494Indicates that the device supports the ability of detecting a remote
1495fault in a link peer.
1496.It Sy ETHER_STAT_CARRIER_ERRORS
1497Indicates the number of times that the Ethernet carrier sense condition
1498was lost or not asserted.
1499.It Sy ETHER_STAT_DEFER_XMTS
1500Indicates the number of frames for which the device was unable to
1501transmit the frame due to being busy and had to try again.
1502.It Sy ETHER_STAT_EX_COLLISIONS
1503Indicates the number of frames that failed to send due to an excessive
1504number of collisions.
1505.It Sy ETHER_STAT_FCS_ERRORS
1506Indicates the number of times that a frame check sequence failed.
1507.It Sy ETHER_STAT_FIRST_COLLISIONS
1508Indicates the number of times that a frame was eventually transmitted
1509successfully, but only after a single collision.
1510.It Sy ETHER_STAT_JABBER_ERRORS
1511Indicates the number of frames that were received that were both larger
1512than the maximum packet size and failed the frame check sequence.
1513.It Sy ETHER_STAT_LINK_ASMPAUSE
1514Indicates whether the link is currently configured to accept pause
1515frames.
1516.It Sy ETHER_STAT_LINK_AUTONEG
1517Indicates whether the current link state is a result of
1518auto-negotiation.
1519.It Sy ETHER_STAT_LINK_DUPLEX
1520Indicates the current duplex state of the link.
1521The values used here should be the same as documented for
1522.Sy MAC_PROP_DUPLEX .
1523.It Sy ETHER_STAT_LINK_PAUSE
1524Indicates whether the link is currently configured to generate pause
1525frames.
1526.It Sy ETHER_STAT_LP_CAP_1000FDX
1527Indicates the remote device supports 1 Gbit/s full-duplex operation.
1528.It Sy ETHER_STAT_LP_CAP_1000HDX
1529Indicates the remote device supports 1 Gbit/s half-duplex operation.
1530.It Sy ETHER_STAT_LP_CAP_100FDX
1531Indicates the remote device supports 100 Mbit/s full-duplex operation.
1532.It Sy ETHER_STAT_LP_CAP_100GFDX
1533Indicates the remote device supports 100 Gbit/s full-duplex operation.
1534.It Sy ETHER_STAT_LP_CAP_100HDX
1535Indicates the remote device supports 100 Mbit/s half-duplex operation.
1536.It Sy ETHER_STAT_LP_CAP_100T4
1537Indicates the remote device supports 100 Mbit/s 100BASE-T4 operation.
1538.It Sy ETHER_STAT_LP_CAP_10FDX
1539Indicates the remote device supports 10 Mbit/s full-duplex operation.
1540.It Sy ETHER_STAT_LP_CAP_10GFDX
1541Indicates the remote device supports 10 Gbit/s full-duplex operation.
1542.It Sy ETHER_STAT_LP_CAP_10HDX
1543Indicates the remote device supports 10 Mbit/s half-duplex operation.
1544.It Sy ETHER_STAT_LP_CAP_2500FDX
1545Indicates the remote device supports 2.5 Gbit/s full-duplex operation.
1546.It Sy ETHER_STAT_LP_CAP_40GFDX
1547Indicates the remote device supports 40 Gbit/s full-duplex operation.
1548.It Sy ETHER_STAT_LP_CAP_5000FDX
1549Indicates the remote device supports 5.0 Gbit/s full-duplex operation.
1550.It Sy ETHER_STAT_LP_CAP_ASMPAUSE
1551Indicates that the remote device supports the ability to receive pause
1552frames.
1553.It Sy ETHER_STAT_LP_CAP_AUTONEG
1554Indicates that the remote device supports the ability to perform link
1555auto-negotiation.
1556.It Sy ETHER_STAT_LP_CAP_PAUSE
1557Indicates that the remote device supports the ability to transmit pause
1558frames.
1559.It Sy ETHER_STAT_LP_CAP_REMFAULT
1560Indicates that the remote device supports the ability of detecting a
1561remote fault in a link peer.
1562.It Sy ETHER_STAT_MACRCV_ERRORS
1563Indicates the number of times that the internal MAC layer encountered an
1564error when attempting to receive and process a frame.
1565.It Sy ETHER_STAT_MACXMT_ERRORS
1566Indicates the number of times that the internal MAC layer encountered an
1567error when attempting to process and transmit a frame.
1568.It Sy ETHER_STAT_MULTI_COLLISIONS
1569Indicates the number of times that a frame was eventually transmitted
1570successfully, but only after more than one collision.
1571.It Sy ETHER_STAT_SQE_ERRORS
1572Indicates the number of times that an SQE error occurred.
1573The specific conditions for this error are documented in IEEE 802.3.
1574.It Sy ETHER_STAT_TOOLONG_ERRORS
1575Indicates the number of frames that were received that were longer than
1576the maximum frame size supported by the device.
1577.It Sy ETHER_STAT_TOOSHORT_ERRORS
1578Indicates the number of frames that were received that were shorter than
1579the minimum frame size supported by the device.
1580.It Sy ETHER_STAT_TX_LATE_COLLISIONS
1581Indicates the number of times a collision was detected late on the
1582device.
1583.It Sy ETHER_STAT_XCVR_ADDR
1584Indicates the address of the MII/GMII receiver address.
1585.It Sy ETHER_STAT_XCVR_ID
1586Indicates the id of the MII/GMII receiver address.
1587.It Sy ETHER_STAT_XCVR_INUSE
1588Indicates what kind of receiver is in use.
1589The following values may be used:
1590.Bl -tag -width Ds
1591.It Sy XCVR_UNDEFINED
1592The receiver type is undefined by the hardware.
1593.It Sy XCVR_NONE
1594There is no receiver in use by the hardware.
1595.It Sy XCVR_10
1596The receiver supports 10BASE-T operation.
1597.It Sy XCVR_100T4
1598The receiver supports 100BASE-T4 operation.
1599.It Sy XCVR_100X
1600The receiver supports 100BASE-TX operation.
1601.It Sy XCVR_100T2
1602The receiver supports 100BASE-T2 operation.
1603.It Sy XCVR_1000X
1604The receiver supports 1000BASE-X operation.
1605This is used for all fiber receivers.
1606.It Sy XCVR_1000T
1607The receiver supports 1000BASE-T operation.
1608This is used for all copper receivers.
1609.El
1610.El
1611.Ss Device Specific kstats
1612In addition to the defined statistics above, if the device driver
1613maintains additional statistics or the device provides additional
1614statistics, it should create its own kstats through the
1615.Xr kstat_create 9F
1616function to allow operators to observe them.
1617.Sh RECEIVE DESCRIPTOR LAYOUT
1618One of the important things that a device driver must do is lay out DMA
1619memory, generally in a ring of descriptors, into which received Ethernet
1620frames will be placed.
1621When performing this, there are a few things that drivers should
1622generally do:
1623.Bl -enum -offset indent
1624.It
1625Drivers should lay out memory so that the IP header will be 4-byte
1626aligned.
1627The IP stack expects that the beginning of an IP header will be at a
16284-byte aligned address; however, a DMA allocation will be at a 4-
1629or 8-byte aligned address by default.
1630The IP hearder is at a 14 byte offset from the beginning of the Ethernet
1631frame, leaving the IP header at a 2-byte alignment if the Ethernet frame
1632starts at the beginning of the DMA buffer.
1633If VLAN tagging is in place, then each VLAN tag adds 4 bytes, which
1634doesn't change the alignment the IP header is found at.
1635.Pp
1636As a solution to this, the driver should program the device to start
1637placing the received Ethernet frame at two bytes off of the start of the
1638DMA buffer.
1639This will make sure that no matter whether or not VLAN tags are present,
1640that the IP header will be 4-byte aligned.
1641.It
1642Drivers should try to allocate the DMA memory used for receiving frames
1643as a continuous buffer.
1644If for some reason that would not be possible, the driver should try to
1645ensure that there is enough space for all of the initial Ethernet and
1646any possible layer three and layer four headers
1647.Pq such as IP, TCP, or UDP
1648in the initial descriptor.
1649.It
1650As discussed in the
1651.Sx MBLKS AND DMA
1652section, there are multiple strategies for managing the relationship
1653between DMA data, receive descriptors, and the operating system
1654representation of a packet in the
1655.Xr mblk 9S
1656structure.
1657Drivers must limit their resource consumption.
1658See the
1659.Sy Considerations
1660section of
1661.Sx MBLKS AND DMA
1662for more on this.
1663.El
1664.Sh TX STALL DETECTION, DEVICE RESETS, AND FAULT MANAGEMENT
1665Device drivers are the first line of defense for dealing with broken
1666devices and bugs in their firmware.
1667While most devices will rarely fail, it is important that when designing and
1668implementing the device driver that particular attention is paid in the design
1669with respect to RAS (Reliability, Availability, and Serviceability).
1670While everything described in this section is optional, it is highly recommended
1671that all new device drivers follow these guidelines.
1672.Pp
1673The Fault Management Architecture (FMA) provides facilities for
1674detecting and reporting various classes of defects and faults.
1675Specifically for networking device drivers, issues that should be
1676detected and reported include:
1677.Bl -bullet -offset indent
1678.It
1679Device internal uncorrectable errors
1680.It
1681Device internal correctable errors
1682.It
1683PCI and PCI Express transport errors
1684.It
1685Device temperature alarms
1686.It
1687Device transmission stalls
1688.It
1689Device communication timeouts
1690.It
1691High invalid interrupts
1692.El
1693.Pp
1694All such errors fall into three primary categories:
1695.Bl -enum -offset indent
1696.It
1697Errors detected by the Fault Management Architecture
1698.It
1699Errors detected by the device and indicated to the device driver
1700.It
1701Errors detected by the device driver
1702.El
1703.Ss Fault Management Setup and Teardown
1704Drivers should initialize support for the fault management framework by
1705calling
1706.Xr ddi_fm_init 9F
1707from their
1708.Xr attach 9E
1709routine.
1710By registering with the fault management framework, a device driver is given the
1711chance to detect and notice transport errors as well as report other errors that
1712exist.
1713While a device driver does not need to indicate that it is capable of all such
1714capabilities described in
1715.Xr ddi_fm_init 9F ,
1716we suggest that device drivers at least register the
1717.Sy DDI_FM_EREPORT_CAPABLE
1718so as to allow the driver to report issues that it detects.
1719.Pp
1720If the driver registers with the fault management framework during its
1721.Xr attach 9E
1722entry point, it must call
1723.Xr ddi_fm_fini 9F
1724during its
1725.Xr detach 9E
1726entry point.
1727.Ss Transport Errors
1728Many modern networking devices leverage PCI or PCI Express.
1729As such, there are two primary ways that device drivers access data: they either
1730memory map device registers and use routines like
1731.Xr ddi_get8 9F
1732and
1733.Xr ddi_put8 9F
1734or they use direct memory access (DMA).
1735New device drivers should always enable checking of the transport layer by
1736marking their support in the
1737.Xr ddi_device_acc_attr 9S
1738structure and using routines like
1739.Xr ddi_fm_acc_err_get 9F
1740and
1741.Xr ddi_fm_dma_err_get 9F
1742to detect if errors have occurred.
1743.Ss Device Indicated Errors
1744Many devices have capabilities to announce to a device driver that a
1745fatal correctable error or uncorrectable error has occurred.
1746Other devices have the ability to indicate that various physical issues have
1747occurred such as a fan failing or a temperature sensor having fired.
1748.Pp
1749Drivers should wire themselves to receive notifications when these
1750events occur.
1751The means and capabilities will vary from device to device.
1752For example, some devices will generate information about these notifications
1753through special interrupts.
1754Other devices may have a register that software can poll.
1755In the cases where polling is required, driver writers should try not to poll
1756too frequently and should generally only poll when the device is actively being
1757used, e.g. between calls to the
1758.Xr mc_start 9E
1759and
1760.Xr mc_stop 9E
1761entry points.
1762.Ss Driver Transmit Stall Detection
1763One of the primary responsibilities of a hardened device driver is to
1764perform transmit stall detection.
1765The core idea behind tx stall detection is that the driver should record when
1766it's getting activity related to when data has been successfully transmitted.
1767Most devices should be transmitting data on a regular basis as long as the link
1768is up.
1769If it is not, then this may indicate that the device is stuck and needs to be
1770reset.
1771At this time, the MAC framework does not provide any resources for performing
1772these checks; however, polling on each individual transmit ring for the last
1773completion time while something is actively being transmitted through the use of
1774routines such as
1775.Xr timeout 9F
1776may be a reasonable starting point.
1777.Ss Driver Command Timeout Detection
1778Each device is programmed in different ways.
1779Some devices are programmed through asynchronous commands while others are
1780programmed by writing directly to memory mapped registers.
1781If a device receives asynchronous replies to commands, then the device driver
1782should set reasonable timeouts for all such commands and plan on detecting them.
1783If a timeout occurs, the driver should presume that there is an issue with the
1784hardware and proceed to abort the command or reset the device.
1785.Pp
1786Many devices do not have such a communication mechanism.
1787However, whenever there is some activity where the device driver must wait, then
1788it should be prepared for the fact that the device may never get back to
1789it and react appropriately by performing some kind of device reset.
1790.Ss Reacting to Errors
1791When any of the above categories of errors has been triggered, the
1792behavior that the device driver should take depends on the kind of
1793error.
1794If a fatal error, for example, a transport error, a transmit stall was detected,
1795or the device indicated an uncorrectable error was detected, then it is
1796important that the driver take the following steps:
1797.Bl -enum -offset indent
1798.It
1799Set a flag in the device driver's state that indicates that it has hit
1800an error condition.
1801When this error condition flag is asserted, transmitted packets should be
1802accepted and dropped and actions that would require writing to the device state
1803should fail with an error.
1804This flag should remain until the device has been successfully restarted.
1805.It
1806If the error was not a transport error that was indicated by the fault
1807management architecture, e.g. a transport error that was detected, then
1808the device driver should post an
1809.Sy ereport
1810indicating what has occurred with the
1811.Xr ddi_fm_ereport_post 9F
1812function.
1813.It
1814The device driver should indicate that the device's service was lost
1815with a call to
1816.Xr ddi_fm_service_impact 9F
1817using the symbol
1818.Sy DDI_SERVICE_LOST .
1819.It
1820At this point the device driver should issue a device reset through some
1821device-specific means.
1822.It
1823When the device reset has been completed, then the device driver should
1824restore all of the programmed state to the device.
1825This includes things like the current MTU, advertised auto-negotiation speeds,
1826MAC address filters, and more.
1827.It
1828Finally, when service has been restored, the device driver should call
1829.Xr ddi_fm_service_impact 9F
1830using the symbol
1831.Sy DDI_SERVICE_RESTORED .
1832.El
1833.Pp
1834When a non-fatal error occurs, then the device driver should submit an
1835ereport and should optionally mark the device degraded using
1836.Xr ddi_fm_service_impact 9F
1837with the
1838.Sy DDI_SERVICE_DEGRADED
1839value depending on the nature of the problem that has occurred.
1840.Pp
1841Device drivers should never make the decision to remove a device from
1842service based on errors that have occurred nor should they panic the
1843system.
1844Rather, the device driver should always try to notify the operating system with
1845various ereports and allow its policy decisions to occur.
1846The decision to retire a device lies in the hands of the fault management
1847architecture.
1848It knows more about the operator's intent and the surrounding system's state
1849than the device driver itself does and it will make the call to offline and
1850retire the device if it is required.
1851.Ss Device Resets
1852When resetting a device, a device driver must exercise caution.
1853If a device driver has not been written to plan for a device reset, then it
1854may not correctly restore the device's state after such a reset.
1855Such state should be stored in the instance's private state data as the MAC
1856framework does not know about device resets and will not inform the
1857device again about the expected, programmed state.
1858.Pp
1859One wrinkle with device resets is that many networking cards show up as
1860multiple PCI functions on a single device, for example, each port may
1861show up as a separate function and thus have a separate instance of the
1862device driver attached.
1863When resetting a function, device driver writers should carefully read the
1864device programming manuals and verify whether or not a reset impacts only the
1865stalled function or if it impacts all function across the device.
1866.Pp
1867If the only way to reset a given function is through the device, then
1868this may require more coordination and work on the part of the device
1869driver to ensure that all the other instances are correctly restored.
1870In cases where this occurs, some devices offer ways of injecting
1871interrupts onto those other functions to notify them that this is
1872occurring.
1873.Sh MBLKS AND DMA
1874The networking stack manages framed data through the use of the
1875.Xr mblk 9S
1876structure.
1877The mblk allows for a single message to be made up of individual blocks.
1878Each part is linked together through its
1879.Sy b_cont
1880member.
1881However, it also allows for multiple messages to be chained together through the
1882use of the
1883.Sy b_next
1884member.
1885While the networking stack works with these structures, device drivers generally
1886work with DMA regions.
1887There are two different strategies that device drivers use for handling these
1888two different cases: copying and binding.
1889.Ss Copying Data
1890The first way that device drivers handle interfacing between the two is
1891by having two separate regions of memory.
1892One part is memory which has been allocated for DMA through a call to
1893.Xr ddi_dma_mem_alloc 9F
1894and the other is memory associated with the memory block.
1895.Pp
1896In this case, a driver will use
1897.Xr bcopy 9F
1898to copy memory between the two distinct regions.
1899When transmitting a packet, it will copy the memory from the mblk_t to the DMA
1900region.
1901When receiving memory, it will allocate a mblk_t through the
1902.Xr allocb 9F
1903routine, copy the memory across with
1904.Xr bcopy 9F ,
1905and then increment the mblk_t's
1906.Sy w_ptr
1907structure.
1908.Pp
1909If, when receiving, memory is not available for a new message block,
1910then the frame should be skipped and effectively dropped.
1911A kstat should be bumped when such an occasion occurs.
1912.Ss Binding Data
1913An alternative approach to copying data is to use DMA binding.
1914When using DMA binding, the OS takes care of mapping between DMA memory and
1915normal device memory.
1916The exact process is a bit different between transmit and receive.
1917.Pp
1918When transmitting a device driver has an mblk_t and needs to call the
1919.Xr ddi_dma_addr_bind_handle 9F
1920function to bind it to an already existing DMA handle.
1921At that point, it will receive various DMA cookies that it can use to obtain the
1922addresses to program the device with for transmitting data.
1923Once the transmit is done, the driver must then make sure to call
1924.Xr freemsg 9F
1925to release the data.
1926It must not call
1927.Xr freemsg 9F
1928before it receives an interrupt from the device indicating that the data
1929has been transmitted, otherwise it risks sending arbitrary kernel
1930memory.
1931.Pp
1932When receiving data, the device can perform a similar operation.
1933First, it must bind the DMA memory into the kernel's virtual memory address
1934space through a call to the
1935.Xr ddi_dma_addr_bind_handle 9F
1936function if it has not already.
1937Once it has, it must then call
1938.Xr desballoc 9F
1939to try and create a new mblk_t which leverages the associated memory.
1940It can then pass that mblk_t up to the stack.
1941.Ss Considerations
1942When deciding which of these options to use, there are many different
1943considerations that must be made.
1944The answer as to whether to bind memory or to copy data is not always simpler.
1945.Pp
1946The first thing to remember is that DMA resources may be finite on a
1947given platform.
1948Consider the case of receiving data.
1949A device driver that binds one of its receive descriptors may not get it back
1950for quite some time as it may be used by the kernel until an application
1951actually consumes it.
1952Device drivers that try to bind memory for receive, often work with the
1953constraint that they must be able to replace that DMA memory with another DMA
1954descriptor.
1955If they were not replaced, then eventually the device would not be able to
1956receive additional data into the ring.
1957.Pp
1958On the other hand, particularly for larger frames, copying every packet
1959from one buffer to another can be a source of additional latency and
1960memory waste in the system.
1961For larger copies, the cost of copying may dwarf any potential cost of
1962performing DMA binding.
1963.Pp
1964For device driver authors that are unsure of what to do, they should
1965first employ the copying method to simplify the act of writing the
1966device driver.
1967The copying method is simpler and also allows the device driver author not to
1968worry about allocated DMA memory that is still outstanding when it is asked to
1969unload.
1970.Pp
1971If device driver writers are worried about the cost, it is recommended
1972to make the decision as to whether or not to copy or bind DMA data
1973a separate private property for both transmitting and receiving.
1974That private property should indicate the size of the received frame at which
1975to switch from one format to the other.
1976This way, data can be gathered to determine what the impact of each method is on
1977a given platform.
1978.Sh SEE ALSO
1979.Xr dladm 1M ,
1980.Xr driver.conf 4 ,
1981.Xr ieee802.3 5 ,
1982.Xr dlpi 7P ,
1983.Xr _fini 9E ,
1984.Xr _info 9E ,
1985.Xr _init 9E ,
1986.Xr attach 9E ,
1987.Xr close 9E ,
1988.Xr detach 9E ,
1989.Xr mc_close 9E ,
1990.Xr mc_getcapab 9E ,
1991.Xr mc_getprop 9E ,
1992.Xr mc_getstat 9E ,
1993.Xr mc_multicst 9E  ,
1994.Xr mc_open 9E ,
1995.Xr mc_propinfo 9E  ,
1996.Xr mc_setpromisc 9E  ,
1997.Xr mc_setprop 9E ,
1998.Xr mc_start 9E ,
1999.Xr mc_stop 9E ,
2000.Xr mc_tx 9E ,
2001.Xr mc_unicst 9E  ,
2002.Xr open 9E ,
2003.Xr allocb 9F ,
2004.Xr bcopy 9F ,
2005.Xr ddi_dma_addr_bind_handle 9F ,
2006.Xr ddi_dma_mem_alloc 9F ,
2007.Xr ddi_fm_acc_err_get 9F ,
2008.Xr ddi_fm_dma_err_get 9F ,
2009.Xr ddi_fm_ereport_post 9F ,
2010.Xr ddi_fm_fini 9F ,
2011.Xr ddi_fm_init 9F ,
2012.Xr ddi_fm_service_impact 9F ,
2013.Xr ddi_get8 9F ,
2014.Xr ddi_put8 9F ,
2015.Xr desballoc 9F ,
2016.Xr freemsg 9F ,
2017.Xr kstat_create 9F ,
2018.Xr mac_alloc 9F ,
2019.Xr mac_fini_ops 9F ,
2020.Xr mac_free 9F ,
2021.Xr mac_hcksum_get 9F ,
2022.Xr mac_hcksum_set 9F ,
2023.Xr mac_init_ops 9F ,
2024.Xr mac_link_update 9F ,
2025.Xr mac_lso_get 9F ,
2026.Xr mac_maxsdu_update 9F ,
2027.Xr mac_prop_info_set_default_link_flowctrl 9F ,
2028.Xr mac_prop_info_set_default_str 9F ,
2029.Xr mac_prop_info_set_default_uint32 9F ,
2030.Xr mac_prop_info_set_default_uint64 9F ,
2031.Xr mac_prop_info_set_default_uint8 9F ,
2032.Xr mac_prop_info_set_perm 9F ,
2033.Xr mac_prop_info_set_range_uint32 9F ,
2034.Xr mac_register 9F ,
2035.Xr mac_rx 9F ,
2036.Xr mac_unregister 9F ,
2037.Xr mod_install 9F ,
2038.Xr mod_remove 9F ,
2039.Xr strcmp 9F ,
2040.Xr timeout 9F ,
2041.Xr cb_ops 9S ,
2042.Xr ddi_device_acc_attr 9S ,
2043.Xr dev_ops 9S ,
2044.Xr mac_callbacks 9S ,
2045.Xr mac_register 9S ,
2046.Xr mblk 9S ,
2047.Xr modldrv 9S ,
2048.Xr modlinkage 9S
2049.Rs
2050.%A McCloghrie, K.
2051.%A Rose, M.
2052.%T RFC 1213 Management Information Base for Network Management of
2053.%T TCP/IP-based internets: MIB-II
2054.%D March 1991
2055.Re
2056.Rs
2057.%A McCloghrie, K.
2058.%A Kastenholz, F.
2059.%T RFC 1573 Evolution of the Interfaces Group of MIB-II
2060.%D January 1994
2061.Re
2062.Rs
2063.%A Kastenholz, F.
2064.%T RFC 1643 Definitions of Managed Objects for the Ethernet-like
2065.%T Interface Types
2066.Re
2067