2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GLD_MAC_INFO 9S "Jun 7, 2004"
8 gld_mac_info \- Generic LAN Driver MAC info data structure
18 Solaris architecture specific (Solaris DDI).
22 The Generic LAN Driver (GLD) Media Access Control (MAC) information
23 (\fBgld_mac_info\fR) structure is the main data interface between the
24 device-specific driver and GLD. It contains data required by GLD and a pointer
25 to an optional additional driver-specific information structure.
28 The \fBgld_mac_info\fR structure should be allocated using
29 \fBgld_mac_alloc()\fR and deallocated using \fBgld_mac_free()\fR. Drivers can
30 make no assumptions about the length of this structure, which might be
31 different in different releases of Solaris and/or GLD. Structure members
32 private to GLD, not documented here, should not be set or read by the
33 device-specific driver.
38 caddr_t gldm_private; /* Driver private data */
39 int (*gldm_reset)(); /* Reset device */
40 int (*gldm_start)(); /* Start device */
41 int (*gldm_stop)(); /* Stop device */
42 int (*gldm_set_mac_addr)(); /* Set device phys addr */
43 int (*gldm_set_multicast)(); /* Set/delete */
44 /* multicast address */
45 int (*gldm_set_promiscuous)();
46 /* Set/reset promiscuous */
48 int (*gldm_send)(); /* Transmit routine */
49 u_int (*gldm_intr)(); /* Interrupt handler */
50 int (*gldm_get_stats)(); /* Get device statistics */
51 int (*gldm_ioctl)(); /* Driver-specific ioctls */
52 char *gldm_ident; /* Driver identity string */
53 uint32_t gldm_type; /* Device type */
54 uint32_t gldm_minpkt; /* Minimum packet size */
55 /* accepted by driver */
56 uint32_t gldm_maxpkt; /* Maximum packet size */
57 /* accepted by driver */
58 uint32_t gldm_addrlen; /* Physical address */
60 int32_t gldm_saplen; /* SAP length for */
62 unsigned char *gldm_broadcast_addr; /* Physical broadcast */
64 unsigned char *gldm_vendor_addr; /* Factory MAC address */
65 t_uscalar_t gldm_ppa; /* Physical Point of */
66 /* Attachment (PPA) number */
67 dev_info_t *gldm_devinfo; /* Pointer to device's */
69 ddi_iblock_cookie_tgldm_cookie; /* Device's interrupt */
71 int gldm_margin /* accepted data beyond */
73 uint32_t gldm_capabilities; /* Device capabilities */
80 Below is a description of the members of the \fBgld_mac_info\fR structure that
81 are visible to the device driver.
85 \fB\fBgldm_private\fR\fR
88 This structure member is private to the device-specific driver and is not used
89 or modified by GLD. Conventionally, this is used as a pointer to private data,
90 pointing to a driver-defined and driver-allocated per-instance data structure.
95 The following group of structure members must be set by the driver before
96 calling \fBgld_register()\fR, and should not thereafter be modified by the
97 driver; \fBgld_register()\fR can use or cache the values of some of these
98 structure members, so changes made by the driver after calling
99 \fBgld_register()\fR might cause unpredicted results.
103 \fB\fBgldm_reset\fR\fR
106 Pointer to driver entry point; see \fBgld\fR(9E).
112 \fB\fBgldm_start\fR\fR
115 Pointer to driver entry point; see \fBgld\fR(9E).
121 \fB\fBgldm_stop\fR\fR
124 Pointer to driver entry point; see \fBgld\fR(9E).
130 \fB\fBgldm_set_mac_addr\fR\fR
133 Pointer to driver entry point; see \fBgld\fR(9E).
139 \fB\fBgldm_set_multicast\fR\fR
142 Pointer to driver entry point; see \fBgld\fR(9E).
148 \fB\fBgldm_set_promiscuous\fR\fR
151 Pointer to driver entry point; see \fBgld\fR(9E).
157 \fB\fBgldm_send\fR\fR
160 Pointer to driver entry point; see \fBgld\fR(9E).
166 \fB\fBgldm_intr\fR\fR
169 Pointer to driver entry point; see \fBgld\fR(9E).
175 \fB\fBgldm_get_stats\fR\fR
178 Pointer to driver entry point; see \fBgld\fR(9E).
184 \fB\fBgldm_ioctl\fR\fR
187 Pointer to driver entry point; can be \fINULL\fR; see \fBgld\fR(9E).
193 \fB\fBgldm_ident\fR\fR
196 Pointer to a string containing a short description of the device. It is used to
197 identify the device in system messages.
203 \fB\fBgldm_type\fR\fR
206 The type of device the driver handles. The values currently supported by GLD
207 are \fBDL_ETHER\fR (IEEE 802.3 and Ethernet Bus), \fBDL_TPR\fR (IEEE 802.5
208 Token Passing Ring), and \fBDL_FDDI\fR (ISO 9314-2 Fibre Distributed Data
209 Interface). This structure member must be correctly set for GLD to function
212 Support for the DL_TPR and DL_FDDI media types is obsolete and may be removed
213 in a future release of Solaris.
219 \fB\fBgldm_minpkt\fR\fR
222 Minimum \fIService\fR \fIData\fR \fIUnit\fR size \(em the minimum packet size,
223 not including the MAC header, that the device will transmit. This can be zero
224 if the device-specific driver can handle any required padding.
230 \fB\fBgldm_maxpkt\fR\fR
233 Maximum \fIService\fR \fIData\fR \fIUnit\fR size \(em the maximum size of
234 packet, not including the MAC header, that can be transmitted by the device.
235 For Ethernet, this number is 1500.
241 \fB\fBgldm_addrlen\fR\fR
244 The length in bytes of physical addresses handled by the device. For Ethernet,
245 Token Ring, and FDDI, the value of this structure member should be 6.
251 \fB\fBgldm_saplen\fR\fR
254 The length in bytes of the Service Access Point (SAP) address used by the
255 driver. For GLD-based drivers, this should always be set to -2, to indicate
256 that two-byte SAP values are supported and that the SAP appears \fIafter\fR the
257 physical address in a DLSAP address. See the description under ``Message
258 DL_INFO_ACK'' in the DLPI specification for more details.
264 \fB\fBgldm_broadcast_addr\fR\fR
267 Pointer to an array of bytes of length \fBgldm_addrlen\fR containing the
268 broadcast address to be used for transmit. The driver must allocate space to
269 hold the broadcast address, fill it in with the appropriate value, and set
270 \fBgldm_broadcast_addr\fR to point at it. For Ethernet, Token Ring, and FDDI,
271 the broadcast address is normally 0xFF-FF-FF-FF-FF-FF.
277 \fB\fBgldm_vendor_addr\fR\fR
280 Pointer to an array of bytes of length \fBgldm_addrlen\fR containing the
281 vendor-provided network physical address of the device. The driver must
282 allocate space to hold the address, fill it in with information read from the
283 device, and set \fBgldm_vendor_addr\fR to point at it.
292 The Physical Point of Attachment (PPA) number for this instance of the device.
293 Normally this should be set to the instance number, returned from
294 \fBddi_get_instance\fR(9F).
300 \fB\fBgldm_devinfo\fR\fR
303 Pointer to the \fBdev_info\fR node for this device.
309 \fB\fBgldm_cookie\fR\fR
312 The interrupt block cookie returned by \fBddi_get_iblock_cookie\fR(9F),
313 \fBddi_add_intr\fR(9F), \fBddi_get_soft_iblock_cookie\fR(9F), or
314 \fBddi_add_softintr\fR(9F). This must correspond to the device's receive
315 interrupt, from which \fBgld_recv()\fR is called.
321 \fB\fBgldm_margin\fR\fR
324 Drivers set this value to the amount of data in bytes that the device can
325 transmit beyond \fBgldm_maxpkt\fR. For example, if an Ethernet device can
326 handle packets whose payload section is no greater than 1522 bytes and the
327 \fBgldm_maxpkt\fR is set to 1500 (as is typical for Ethernet), then
328 \fBgldm_margin\fR is set to 22. The registered \fBgldm_margin\fR value is
329 reported in acknowledgements of the DLIOCMARGININFO ioctl (see \fBdlpi\fR(7P)).
335 \fB\fBgldm_capabilities\fR\fR
338 Bit-field of device capabilities. If the device is capable of reporting media
339 link state, the GLD_CAP_LINKSTATE bit should be set.
345 \fBgld\fR(7D), \fBdlpi\fR(7P), \fBattach\fR(9E), \fBgld\fR(9E),
346 \fBddi_add_intr\fR(9F), \fBgld\fR(9F), \fBgld_stats\fR(9S)
349 \fIWriting Device Drivers\fR