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
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.
12 .\" Copyright 2016 Joyent, Inc.
20 .Nd networking device driver registration structure
22 .In sys/mac_provider.h
29 structure is used by GLDv3 networking device drivers implementing the
33 The structure is allocated by a call to
35 after which the various structure members should be set.
36 Once they have been set, the structure can be used by a GLDv3 device driver to
37 register with the MAC framework by calling the
42 has been called, the structure can be freed through a call to
45 .Bd -literal -offset indent
47 const char *m_type_ident;
53 mac_callbacks_t *m_callbacks;
64 member is set during a call to
66 Device drivers should not modify this field.
70 member identifies the kind of networking device that this driver
72 The following constants should be used to identify the device type:
74 .It Sy MAC_PLUGIN_IDENT_ETHER
75 The device driver implements IEEE 802.3 Ethernet.
80 value is a private value that the device driver may set and will be
81 provided as an argument in many of the
84 Most often this is set to the driver's soft state for a specific instance.
88 member should point to the device driver's
90 structure for that specific instance.
91 This structure is provided during the driver's
97 member should be set to zero.
98 The GLDv3 framework will determine the appropriate instance.
102 member should be set to a byte array that describes the source MAC
103 address of the device.
104 This is usually the default MAC address as programmed by the device manufacturer
105 in that instance of the device.
109 member is an optional property and should be set to
111 by most device drivers.
112 If set, this address will be the destination for outgoing frames.
116 member contains the GLDv3 entry points implemented by the device driver.
119 for a full explanation of the structure, its members, and their
123 for a broader picture of how the entry points are used.
127 property is the minimum service data unit.
128 It represents the minimum size packet that the device can transmit, ignoring its
130 Thus for an Ethernet device, this value would exclude the Ethernet header and
132 If this is set to zero, then that means that either the MAC protocol does not
133 require a minimum size or that the device driver and hardware will ensure that
134 any minimum size is taken care of.
138 property is the maximum service data unit.
139 It represents the maximum size packet that the device can transmit, ignoring its
141 For an Ethernet based device, this would exclude the size of the Ethernet
142 header and a VLAN headers.
143 This value is often called the maximum transmission unit (MTU).
147 member is used for data specific to the type specified in the
150 For all devices of type
151 .Sy MAC_PLUGIN_IDENT_ETHER ,
152 this should be set to
157 member indicates the size of the member
159 For all devices of type
160 .Sy MAC_PLUGIN_IDENT_ETHER ,
161 this should be set to 0.
165 member is an optional member that lists device-specific properties.
166 These properties will be queried through functions like
171 If the driver does not have any private properties, it should be set to
173 Otherwise, it should be set to a NULL-terminated array of character
174 strings where each entry is the name of a distinct property.
177 for more information on private properties.
182 indicates the amount of additional bytes of information that may be
183 included beyond the basic MAC header.
184 For example, with an Ethernet device, if the hardware supports a VLAN tag, then
185 this property would be set to the size of a VLAN tag, indicating that it
186 supported the additional bytes in a single packet beyond the Ethernet header and
194 .Xr mac_register 9F ,