1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH GLD_MAC_INFO 9S "Jun 7, 2004"
.SH NAME
gld_mac_info \- Generic LAN Driver MAC info data structure
.SH SYNOPSIS
.nf
#include <sys/gld.h>
.fi
.SH INTERFACE LEVEL
illumos architecture specific (illumos DDI).
.SH DESCRIPTION
The Generic LAN Driver (GLD) Media Access Control (MAC) information
(\fBgld_mac_info\fR) structure is the main data interface between the
device-specific driver and GLD. It contains data required by GLD and a pointer
to an optional additional driver-specific information structure.
.sp
.LP
The \fBgld_mac_info\fR structure should be allocated using
\fBgld_mac_alloc()\fR and deallocated using \fBgld_mac_free()\fR. Drivers can
make no assumptions about the length of this structure, which might be
different in different releases of illumos and/or GLD. Structure members
private to GLD, not documented here, should not be set or read by the
device-specific driver.
.SH STRUCTURE MEMBERS
.in +2
.nf
caddr_t gldm_private; /* Driver private data */
int (*gldm_reset)(); /* Reset device */
int (*gldm_start)(); /* Start device */
int (*gldm_stop)(); /* Stop device */
int (*gldm_set_mac_addr)(); /* Set device phys addr */
int (*gldm_set_multicast)(); /* Set/delete */
/* multicast address */
int (*gldm_set_promiscuous)();
/* Set/reset promiscuous */
/* mode*/
int (*gldm_send)(); /* Transmit routine */
u_int (*gldm_intr)(); /* Interrupt handler */
int (*gldm_get_stats)(); /* Get device statistics */
int (*gldm_ioctl)(); /* Driver-specific ioctls */
char *gldm_ident; /* Driver identity string */
uint32_t gldm_type; /* Device type */
uint32_t gldm_minpkt; /* Minimum packet size */
/* accepted by driver */
uint32_t gldm_maxpkt; /* Maximum packet size */
/* accepted by driver */
uint32_t gldm_addrlen; /* Physical address */
/* length */
int32_t gldm_saplen; /* SAP length for */
/* DL_INFO_ACK */
unsigned char *gldm_broadcast_addr; /* Physical broadcast */
/* addr */
unsigned char *gldm_vendor_addr; /* Factory MAC address */
t_uscalar_t gldm_ppa; /* Physical Point of */
/* Attachment (PPA) number */
dev_info_t *gldm_devinfo; /* Pointer to device's */
/* dev_info node */
ddi_iblock_cookie_tgldm_cookie; /* Device's interrupt */
/* block cookie */
int gldm_margin /* accepted data beyond */
/*gldm_maxpkt */
uint32_t gldm_capabilities; /* Device capabilities */
.fi
.in -2
.sp
.sp
.LP
Below is a description of the members of the \fBgld_mac_info\fR structure that
are visible to the device driver.
.sp
.ne 2
.na
\fB\fBgldm_private\fR\fR
.ad
.RS 16n
This structure member is private to the device-specific driver and is not used
or modified by GLD. Conventionally, this is used as a pointer to private data,
pointing to a driver-defined and driver-allocated per-instance data structure.
.RE
.sp
.LP
The following group of structure members must be set by the driver before
calling \fBgld_register()\fR, and should not thereafter be modified by the
driver; \fBgld_register()\fR can use or cache the values of some of these
structure members, so changes made by the driver after calling
\fBgld_register()\fR might cause unpredicted results.
.sp
.ne 2
.na
\fB\fBgldm_reset\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_start\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_stop\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_set_mac_addr\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_set_multicast\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_set_promiscuous\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_send\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_intr\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_get_stats\fR\fR
.ad
.RS 24n
Pointer to driver entry point; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_ioctl\fR\fR
.ad
.RS 24n
Pointer to driver entry point; can be \fINULL\fR; see \fBgld\fR(9E).
.RE
.sp
.ne 2
.na
\fB\fBgldm_ident\fR\fR
.ad
.RS 24n
Pointer to a string containing a short description of the device. It is used to
identify the device in system messages.
.RE
.sp
.ne 2
.na
\fB\fBgldm_type\fR\fR
.ad
.RS 24n
The type of device the driver handles. The values currently supported by GLD
are \fBDL_ETHER\fR (IEEE 802.3 and Ethernet Bus), \fBDL_TPR\fR (IEEE 802.5
Token Passing Ring), and \fBDL_FDDI\fR (ISO 9314-2 Fibre Distributed Data
Interface). This structure member must be correctly set for GLD to function
properly.
.sp
Support for the DL_TPR and DL_FDDI media types is obsolete and may be removed
in a future release of illumos.
.RE
.sp
.ne 2
.na
\fB\fBgldm_minpkt\fR\fR
.ad
.RS 24n
Minimum \fIService\fR \fIData\fR \fIUnit\fR size \(em the minimum packet size,
not including the MAC header, that the device will transmit. This can be zero
if the device-specific driver can handle any required padding.
.RE
.sp
.ne 2
.na
\fB\fBgldm_maxpkt\fR\fR
.ad
.RS 24n
Maximum \fIService\fR \fIData\fR \fIUnit\fR size \(em the maximum size of
packet, not including the MAC header, that can be transmitted by the device.
For Ethernet, this number is 1500.
.RE
.sp
.ne 2
.na
\fB\fBgldm_addrlen\fR\fR
.ad
.RS 24n
The length in bytes of physical addresses handled by the device. For Ethernet,
Token Ring, and FDDI, the value of this structure member should be 6.
.RE
.sp
.ne 2
.na
\fB\fBgldm_saplen\fR\fR
.ad
.RS 24n
The length in bytes of the Service Access Point (SAP) address used by the
driver. For GLD-based drivers, this should always be set to -2, to indicate
that two-byte SAP values are supported and that the SAP appears \fIafter\fR the
physical address in a DLSAP address. See the description under ``Message
DL_INFO_ACK'' in the DLPI specification for more details.
.RE
.sp
.ne 2
.na
\fB\fBgldm_broadcast_addr\fR\fR
.ad
.RS 24n
Pointer to an array of bytes of length \fBgldm_addrlen\fR containing the
broadcast address to be used for transmit. The driver must allocate space to
hold the broadcast address, fill it in with the appropriate value, and set
\fBgldm_broadcast_addr\fR to point at it. For Ethernet, Token Ring, and FDDI,
the broadcast address is normally 0xFF-FF-FF-FF-FF-FF.
.RE
.sp
.ne 2
.na
\fB\fBgldm_vendor_addr\fR\fR
.ad
.RS 24n
Pointer to an array of bytes of length \fBgldm_addrlen\fR containing the
vendor-provided network physical address of the device. The driver must
allocate space to hold the address, fill it in with information read from the
device, and set \fBgldm_vendor_addr\fR to point at it.
.RE
.sp
.ne 2
.na
\fB\fBgldm_ppa\fR\fR
.ad
.RS 24n
The Physical Point of Attachment (PPA) number for this instance of the device.
Normally this should be set to the instance number, returned from
\fBddi_get_instance\fR(9F).
.RE
.sp
.ne 2
.na
\fB\fBgldm_devinfo\fR\fR
.ad
.RS 24n
Pointer to the \fBdev_info\fR node for this device.
.RE
.sp
.ne 2
.na
\fB\fBgldm_cookie\fR\fR
.ad
.RS 24n
The interrupt block cookie returned by \fBddi_get_iblock_cookie\fR(9F),
\fBddi_add_intr\fR(9F), \fBddi_get_soft_iblock_cookie\fR(9F), or
\fBddi_add_softintr\fR(9F). This must correspond to the device's receive
interrupt, from which \fBgld_recv()\fR is called.
.RE
.sp
.ne 2
.na
\fB\fBgldm_margin\fR\fR
.ad
.RS 24n
Drivers set this value to the amount of data in bytes that the device can
transmit beyond \fBgldm_maxpkt\fR. For example, if an Ethernet device can
handle packets whose payload section is no greater than 1522 bytes and the
\fBgldm_maxpkt\fR is set to 1500 (as is typical for Ethernet), then
\fBgldm_margin\fR is set to 22. The registered \fBgldm_margin\fR value is
reported in acknowledgements of the DLIOCMARGININFO ioctl (see \fBdlpi\fR(4P)).
.RE
.sp
.ne 2
.na
\fB\fBgldm_capabilities\fR\fR
.ad
.RS 24n
Bit-field of device capabilities. If the device is capable of reporting media
link state, the GLD_CAP_LINKSTATE bit should be set.
.RE
.SH SEE ALSO
.BR gld (4D),
.BR dlpi (4P),
.BR attach (9E),
.BR gld (9E),
.BR ddi_add_intr (9F),
.BR gld (9F),
.BR gld_stats (9S)
.sp
.LP
\fIWriting Device Drivers\fR
|