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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
|
'\" 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 7D "Nov 10, 2005"
.SH NAME
gld \- Generic \fBLAN\fR Driver
.SH SYNOPSIS
.LP
.nf
\fB#include\fR \fB<sys/stropts.h>\fR
.fi
.LP
.nf
\fB#include\fR \fB<sys/stream.h>\fR
.fi
.LP
.nf
\fB#include\fR \fB<sys/dlpi.h>\fR
.fi
.LP
.nf
\fB#include\fR \fB<sys/gld.h>\fR
.fi
.SH INTERFACE LEVEL
.sp
.LP
Solaris architecture specific (Solaris DDI).
.SH DESCRIPTION
.sp
.LP
GLD is a multi-threaded, clonable, loadable kernel module providing support for
Solaris local area network (\fBLAN\fR) device drivers. \fBLAN\fR drivers in
Solaris are \fBSTREAMS\fR-based drivers that use the Data Link Provider
Interface (\fBDLPI\fR) to communicate with network protocol stacks. These
protocol stacks use the network drivers to send and receive packets on a local
area network. A network device driver must implement and adhere to the
requirements imposed by the DDI/DKI specification, \fBSTREAMS\fR specification,
DLPI specification, and programmatic interface of the device itself.
.sp
.LP
GLD implements most \fBSTREAMS\fR and DLPI functionality required of a Solaris
LAN driver. Several Solaris network drivers are implemented using GLD.
.sp
.LP
A Solaris network driver implemented using GLD comprises two distinct parts: a
generic component that deals with \fBSTREAMS\fR and DLPI interfaces, and a
device-specific component that deals with the particular hardware device. The
device-specific module indicates its dependency on the GLD module and registers
itself with GLD from within the driver's \fBattach\fR(9E) function. Once it is
successfully loaded, the driver is \fBDLPI\fR-compliant. The device-specific
part of the driver calls \fBgld\fR(9F) functions when it receives data or needs
some service from GLD. GLD makes calls into the \fBgld\fR(9E) entry points of
the device-specific driver through pointers provided to GLD by the
device-specific driver when it registered itself with GLD. The
\fBgld_mac_info\fR(9S) structure is the main data interface between GLD and the
device-specific driver.
.sp
.LP
The GLD facility currently supports devices of type \fBDL_ETHER\fR,
\fBDL_TPR\fR, and \fBDL_FDDI\fR. GLD drivers are expected to process
fully-formed MAC-layer packets and should not perform logical link control
(LLC) handling.
.LP
Note -
.sp
.RS 2
Support for the DL_TPR and DL_FDDI media types in GLD is obsolete and may be
removed in a future release of Solaris.
.RE
.sp
.LP
In some cases, it may be necessary or desirable to implement a full
DLPI-compliant driver without using the GLD facility. This is true for devices
that are not IEEE 802-style LAN devices, or where a device type or DLPI service
not supported by GLD is required.
.SS "Device Naming Constraints"
.sp
.LP
The name of the device-specific driver module must adhere to the naming
constraints outlined in the NOTES section of \fBdlpi\fR(7P).
.SS "Type DL_ETHER: Ethernet V2 and ISO 8802-3 (IEEE 802.3)"
.sp
.LP
For devices designated type \fBDL_ETHER\fR, GLD provides support for both
Ethernet V2 and ISO 8802-3 (IEEE 802.3) packet processing. Ethernet V2 enables
a data link service user to access and use any of a variety of conforming data
link service providers without special knowledge of the provider's protocol. A
service access point (\fBSAP\fR) is the point through which the user
communicates with the service provider.
.sp
.LP
SAP 0 denotes that the user wishes to use \fI802.3\fR mode. In transmission,
GLD checks the destination SAP value of the DL_UNITDATA_REQ and the SAP value
to which the stream is bound. If both are 0, the GLD computes the length of
the packet payload and transmits \fI802.3\fR frames having that length in the
MAC frame header type field. Such lengths will never exceed 1500.
.sp
.LP
All frames received from the media that have a type field in the range [0-1500]
are assumed to be \fI802.3\fR frames and are routed up all open streams that
are in \fI802.3\fR mode, (those streams bound to a SAP value in of 0. If more
than one stream is in \fI802.3\fR mode, the incoming frame is duplicated and
routed up each such stream.
.sp
.LP
Streams bound to a SAP value of 1536 or greater receive incoming packets
whose Ethernet MAC header type value exactly matches the value of the SAP to
which the stream is bound. SAP values in the range [1-1535] are undefined and
should not be used.
.SS "Types DL_TPR and DL_FDDI: SNAP Processing"
.LP
Note -
.sp
.RS 2
Support for the DL_TPR and DL_FDDI media types in GLD is obsolete and may be
removed in a future release of Solaris.
.RE
.sp
.LP
For media types DL_TPR and DL_FDDI, GLD implements minimal SNAP (Sub-Net
Access Protocol) processing for SAP values of 1536 or greater. A SAP value of
0 denotes that the user wishes to use LLC mode. SAP values in the range
[1-1535] have undefined semantics and should not be used.
.sp
.LP
\fBSNAP\fR headers are carried under LLC headers with destination SAP 0xAA. For
outgoing packets with SAP values greater than 1535, GLD creates an LLC+SNAP
header that always looks like:
.sp
.LP
``AA AA 03 00 00 00 XX XX''
.sp
.LP
where ``XX XX'' represents the 16-bit SAP, corresponding to the Ethernet V2
style ``type.'' This is the only class of SNAP header that is processed -
non-zero OUI fields, and LLC control fields other than 03 are considered to be
LLC packets with SAP 0xAA.
.sp
.LP
A DL_UNITDATA_REQ message specifying a destination SAP value of 0, passed
down a stream bound to SAP 0, is assumed to contain an LLC packet and
will not undergo SNAP processing.
.sp
.LP
Incoming packets are examined to ascertain whether they fall into the format
specified above. Packets that do will be passed to streams bound to the
packet's 16-bit SNAP type, as well as being passed to any stream in LLC mode
(those bound to a SAP value of 0).
.SS "Type DL_TPR: Source Routing"
.LP
Note -
.sp
.RS 2
Support for the DL_TPR media type in GLD is obsolete and may be removed in a
future release of Solaris.
.RE
.sp
.LP
For type \fBDL_TPR\fR devices, GLD implements minimal support for source
routing. Source routing enables a station that is sending a packet across a
bridged medium to specify (in the packet MAC header) routing information that
determines the route that the packet will take through the network.
.sp
.LP
Functionally, the source routing support provided by GLD learns routes,
solicits and responds to requests for information about possible multiple
routes and selects among the multiple routes that are available. It adds
\fIRouting Information Fields\fR to the MAC headers of outgoing packets and
recognizes such fields in incoming packets.
.sp
.LP
GLD's source routing support does not implement the full \fIRoute Determination
Entity\fR \fB(RDE)\fR specified in \fIISO 8802-2 (IEEE 802.2)\fR Section 9.
However, it is designed to interoperate with any such implementations that may
exist in the same (or a bridged) network.
.SS "Style 1 and 2 Providers"
.sp
.LP
GLD implements both Style 1 and Style 2 providers. A physical point of
attachment (\fBPPA\fR) is the point at which a system attaches itself to a
physical communication medium. All communication on that physical medium
funnels through the \fBPPA\fR. The Style 1 provider attaches the stream to a
particular \fBPPA\fR based on the major/minor device that has been opened. The
Style 2 provider requires the DLS user to explicitly identify the desired
\fBPPA\fR using \fBDL_ATTACH_REQ.\fR In this case, \fBopen\fR(9E) creates a
stream between the user and GLD and \fBDL_ATTACH_REQ\fR subsequently associates
a particular \fBPPA\fR with that stream. Style 2 is denoted by a minor number
of zero. If a device node whose minor number is not zero is opened, Style 1 is
indicated and the associated \fBPPA\fR is the minor number minus 1. In both
Style 1 and Style 2 opens, the device is cloned.
.SS "Implemented DLPI Primitives"
.sp
.LP
GLD implements the following DLPI primitives:
.sp
.LP
The \fBDL_INFO_REQ\fR primitive requests information about the DLPI stream. The
message consists of one \fBM_PROTO\fR message block. GLD returns
device-dependent values in the \fBDL_INFO_ACK\fR response to this request,
based on information the GLD-based driver specified in the
\fBgld_mac_info\fR(9S) structure passed to \fBgld_register()\fR. However GLD
returns the following values on behalf of all GLD-based drivers:
.RS +4
.TP
.ie t \(bu
.el o
The version is \fBDL_VERSION_2\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The service mode is \fBDL_CLDLS\fR \(em GLD implements connectionless-mode
service.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The provider style is \fBDL_STYLE1\fR or \fBDL_STYLE2,\fR depending on how the
stream was opened.
.RE
.sp
.LP
The \fBDL_ATTACH_REQ\fR primitive is called to associate a \fBPPA\fR with a
stream. This request is needed for Style 2 DLS providers to identify the
physical medium over which the communication will transpire. Upon completion,
the state changes from \fBDL_UNATTACHED\fR to \fBDL_UNBOUND.\fR The message
consists of one \fBM_PROTO\fR message block. This request may not be issued
when using the driver in Style 1 mode; streams opened using Style 1 are already
attached to a \fBPPA\fR by the time the open completes.
.sp
.LP
The \fBDL_DETACH_REQ\fR primitive requests to detach the \fBPPA\fR from the
stream. This is only allowed if the stream was opened using Style 2.
.sp
.LP
The \fBDL_BIND_REQ\fR and \fBDL_UNBIND_REQ\fR primitives bind and unbind a
\fBDLSAP\fR to the stream. The \fBPPA\fR associated with each stream will have
been initialized upon completion of the processing of the \fBDL_BIND_REQ.\fR
Multiple streams may be bound to the same \fBSAP\fR; each such stream receives
a copy of any packets received for that SAP.
.sp
.LP
The \fBDL_ENABMULTI_REQ\fR and \fBDL_DISABMULTI_REQ\fR primitives enable and
disable reception of individual multicast group addresses. A set of multicast
addresses may be iteratively created and modified on a per-stream basis using
these primitives. The stream must be attached to a \fBPPA\fR for these
primitives to be accepted.
.sp
.LP
The \fBDL_PROMISCON_REQ\fR and \fBDL_PROMISCOFF_REQ\fR primitives enable and
disable promiscuous mode on a per-stream basis, either at a physical level or
at the \fBSAP\fR level. The DL Provider will route all received messages on the
media to the DLS user until either a \fBDL_DETACH_REQ\fR or a
\fBDL_PROMISCOFF_REQ\fR is received or the stream is closed. Physical level
promiscuous mode may be specified for all packets on the medium or for
multicast packets only. The stream must be attached to a \fBPPA\fR for these
primitives to be accepted.
.sp
.LP
The \fBDL_UNITDATA_REQ\fR primitive is used to send data in a connectionless
transfer. Because this is an unacknowledged service, there is no guarantee of
delivery. The message consists of one \fBM_PROTO\fR message block followed by
one or more \fBM_DATA\fR blocks containing at least one byte of data.
.sp
.LP
The \fBDL_UNITDATA_IND\fR type is used when a packet is received and is to be
passed upstream. The packet is put into an \fBM_PROTO\fR message with the
primitive set to \fBDL_UNITDATA_IND\fR.
.sp
.LP
The \fBDL_PHYS_ADDR_REQ\fR primitive returns the MAC address currently
associated with the \fBPPA\fR attached to the stream, in the
\fBDL_PHYS_ADDR_ACK\fR primitive. When using style 2, this primitive is only
valid following a successful \fBDL_ATTACH_REQ\fR.
.sp
.LP
The \fBDL_SET_PHYS_ADDR_REQ\fR primitive changes the MAC address currently
associated with the \fBPPA\fR attached to the stream. This primitive affects
all other current and future streams attached to this device. Once changed, all
streams currently or subsequently opened and attached to this device will
obtain this new physical address. The new physical address will remain in
effect until this primitive is used to change the physical address again or the
driver is reloaded.
.sp
.LP
The \fBDL_GET_STATISTICS_REQ\fR primitive requests a
\fBDL_GET_STATISTICS_ACK\fR response containing statistics information
associated with the PPA attached to the stream. Style 2 streams must be
attached to a particular \fBPPA\fR using \fBDL_ATTACH_REQ\fR before this
primitive will be successful.
.sp
.LP
GLD supports the DL_NOTE_LINK_UP, DL_NOTE_LINK_DOWN and DL_NOTE_SPEED
notifications using the DL_NOTIFY_IND primitive. See \fBdlpi\fR(7P).
.SS "Implemented ioctl Functions"
.sp
.LP
GLD implements the \fBDLIOCRAW\fR ioctl described in \fBdlpi\fR(7P). For any
other ioctl command, GLD passes it to the device-specific driver's
\fBgldm_ioctl()\fR function as described in \fBgld\fR(9E).
.SS "Requirements on GLD Drivers"
.sp
.LP
GLD-based drivers must include the header file \fB<sys/gld.h>\fR\&.
.sp
.LP
GLD-based drivers must also specify a link dependency on "misc/gld". (See
the -N option in \fBld\fR(1)).
.sp
.LP
GLD implements the \fBopen\fR(9E) and \fBclose\fR(9E) functions and the
required \fBSTREAMS\fR \fBput\fR(9E) and \fBsrv\fR(9E) functions on behalf of
the device-specific driver. GLD also implements the \fBgetinfo\fR(9E) function
for the driver.
.sp
.LP
The \fBmi_idname\fR element of the \fBmodule_info\fR(9S) structure is a string
specifying the name of the driver. This must exactly match the name of the
driver module as it exists in the file system.
.sp
.LP
The read-side \fBqinit\fR(9S) structure should specify the following elements
as shown below:
.sp
.ne 2
.na
\fB\fBqi_putp\fR \fR
.ad
.RS 14n
\fINULL\fR
.RE
.sp
.ne 2
.na
\fB\fBqi_srvp\fR \fR
.ad
.RS 14n
\fBgld_rsrv\fR
.RE
.sp
.ne 2
.na
\fB\fBqi_qopen\fR \fR
.ad
.RS 14n
\fBgld_open\fR
.RE
.sp
.ne 2
.na
\fB\fBqi_qclose\fR \fR
.ad
.RS 14n
\fBgld_close\fR
.RE
.sp
.LP
The write-side \fBqinit\fR(9S) structure should specify the following elements
as shown below:
.sp
.ne 2
.na
\fB\fBqi_putp\fR \fR
.ad
.RS 14n
\fBgld_wput\fR
.RE
.sp
.ne 2
.na
\fB\fBqi_srvp\fR \fR
.ad
.RS 14n
\fBgld_wsrv\fR
.RE
.sp
.ne 2
.na
\fB\fBqi_qopen\fR \fR
.ad
.RS 14n
\fINULL\fR
.RE
.sp
.ne 2
.na
\fB\fBqi_qclose\fR \fR
.ad
.RS 14n
\fINULL\fR
.RE
.sp
.LP
The \fBdevo_getinfo\fR element of the \fBdev_ops\fR(9S) structure should
specify \fBgld_getinfo\fR as the \fBgetinfo\fR(9E) routine.
.sp
.LP
The driver's \fBattach\fR(9E) function does all the work of associating the
hardware-specific device driver with the GLD facility and preparing the device
and driver for use.
.sp
.LP
The \fBattach\fR(9E) function allocates a \fBgld_mac_info\fR(9S) (``macinfo'')
structure using \fBgld_mac_alloc()\fR. The driver usually needs to save more
information per device than is defined in the macinfo structure; it should
allocate the additional required data structure and save a pointer to it in the
\fBgldm_private\fR member of the \fBgld_mac_info\fR(9S) structure.
.sp
.LP
The \fBattach\fR(9E) routine must initialize the macinfo structure as described
in \fBgld_mac_info\fR(9S) and then call \fBgld_register()\fR to link the driver
with the GLD module. The driver should map registers if necessary and be fully
initialized and prepared to accept interrupts before calling
\fBgld_register()\fR. The \fBattach\fR(9E) function should add interrupts but
not enable the device to generate them. The driver should reset the hardware
before calling \fBgld_register()\fR to ensure it is quiescent; the device must
not be started or put into a state where it may generate an interrupt before
\fBgld_register()\fR is called. That will be done later when GLD calls the
driver's \fBgldm_start()\fR entry point described in \fBgld\fR(9E). Once
\fBgld_register()\fR succeeds, the \fBgld\fR(9E) entry points may be called by
GLD at any time.
.sp
.LP
The \fBattach\fR(9E) routine should return \fBDDI_SUCCESS\fR if
\fBgld_register()\fR succeeds. If \fBgld_register()\fR fails, it returns
\fBDDI_FAILURE\fR and the \fBattach\fR(9E) routine should deallocate any
resources it allocated before calling \fBgld_register()\fR and then also return
\fBDDI_FAILURE\fR. Under no circumstances should a failed macinfo structure be
reused; it should be deallocated using \fBgld_mac_free\fR().
.sp
.LP
The \fBdetach\fR(9E) function should attempt to unregister the driver from GLD.
This is done by calling \fBgld_unregister()\fR described in \fBgld\fR(9F). The
\fBdetach\fR(9E) routine can get a pointer to the needed \fBgld_mac_info\fR(9S)
structure from the device's private data using
\fBddi_get_driver_private\fR(9F). \fBgld_unregister\fR() checks certain
conditions that could require that the driver not be detached. If the checks
fail, \fBgld_unregister()\fR returns \fBDDI_FAILURE\fR, in which case the
driver's \fBdetach\fR(9E) routine must leave the device operational and return
\fBDDI_FAILURE\fR. If the checks succeed, \fBgld_unregister()\fR ensures that
the device interrupts are stopped, calling the driver's \fBgldm_stop()\fR
routine if necessary, unlinks the driver from the GLD framework, and returns
\fBDDI_SUCCESS\fR. In this case, the \fBdetach\fR(9E) routine should remove
interrupts, deallocate any data structures allocated in the \fBattach\fR(9E)
routine, using \fBgld_mac_free()\fR to deallocate the macinfo structure, and
return \fBDDI_SUCCESS\fR. It is important to remove the interrupt \fIbefore\fR
calling \fBgld_mac_free()\fR.
.SS "Network Statistics"
.sp
.LP
Solaris network drivers must implement statistics variables. GLD itself tallies
some network statistics, but other statistics must be counted by each GLD-based
driver. GLD provides support for GLD-based drivers to report a standard set of
network driver statistics. Statistics are reported by GLD using the
\fBkstat\fR(7D) and \fBkstat\fR(9S) mechanism. The \fBDL_GET_STATISTICS_REQ\fR
DLPI command may also be used to retrieve the current statistics counters. All
statistics are maintained as unsigned, and all are 32 bits unless otherwise
noted.
.sp
.LP
GLD maintains and reports the following statistics.
.sp
.ne 2
.na
\fB\fBrbytes64\fR \fR
.ad
.RS 15n
Total bytes successfully received on the interface (64 bits).
.RE
.sp
.ne 2
.na
\fB\fBrbytes\fR \fR
.ad
.RS 15n
Total bytes successfully received on the interface.
.RE
.sp
.ne 2
.na
\fB\fBobytes64\fR \fR
.ad
.RS 15n
Total bytes requested to be transmitted on the interface (64 bits).
.RE
.sp
.ne 2
.na
\fB\fBobytes\fR \fR
.ad
.RS 15n
Total bytes requested to be transmitted on the interface.
.RE
.sp
.ne 2
.na
\fB\fBipackets64\fR \fR
.ad
.RS 15n
Total packets successfully received on the interface (64 bits).
.RE
.sp
.ne 2
.na
\fB\fBipackets\fR \fR
.ad
.RS 15n
Total packets successfully received on the interface.
.RE
.sp
.ne 2
.na
\fB\fBopackets64\fR \fR
.ad
.RS 15n
Total packets requested to be transmitted on the interface (64 bits).
.RE
.sp
.ne 2
.na
\fB\fBopackets\fR \fR
.ad
.RS 15n
Total packets requested to be transmitted on the interface.
.RE
.sp
.ne 2
.na
\fB\fBmultircv\fR \fR
.ad
.RS 15n
Multicast packets successfully received, including group and functional
addresses (long).
.RE
.sp
.ne 2
.na
\fB\fBmultixmt\fR \fR
.ad
.RS 15n
Multicast packets requested to be transmitted, including group and functional
addresses (long).
.RE
.sp
.ne 2
.na
\fB\fBbrdcstrcv\fR \fR
.ad
.RS 15n
Broadcast packets successfully received (long).
.RE
.sp
.ne 2
.na
\fB\fBbrdcstxmt\fR \fR
.ad
.RS 15n
Broadcast packets requested to be transmitted (long).
.RE
.sp
.ne 2
.na
\fB\fBunknowns\fR \fR
.ad
.RS 15n
Valid received packets not accepted by any stream (long).
.RE
.sp
.ne 2
.na
\fB\fBnoxmtbuf\fR \fR
.ad
.RS 15n
Packets discarded on output because transmit buffer was busy, or no buffer
could be allocated for transmit (long).
.RE
.sp
.ne 2
.na
\fB\fBblocked\fR \fR
.ad
.RS 15n
Times a received packet could not be put up a stream because the queue was flow
controlled (long).
.RE
.sp
.ne 2
.na
\fB\fBxmtretry\fR \fR
.ad
.RS 15n
Times transmit was retried after having been delayed due to lack of resources
(long).
.RE
.sp
.ne 2
.na
\fB\fBpromisc\fR \fR
.ad
.RS 15n
Current ``promiscuous'' state of the interface (string).
.RE
.sp
.LP
The device dependent driver counts the following statistics, keeping track of
them in a private per-instance structure. When GLD is asked to report
statistics, it calls the driver's \fBgldm_get_stats()\fR entry point, as
described in \fBgld\fR(9E), to update the device-specific statistics in the
\fBgld_stats\fR(9S) structure. GLD then reports the updated statistics using
the named statistics variables below.
.sp
.ne 2
.na
\fB\fBifspeed\fR \fR
.ad
.RS 13n
Current estimated bandwidth of the interface in bits per second (64 bits).
.RE
.sp
.ne 2
.na
\fB\fBmedia\fR \fR
.ad
.RS 13n
Current media type in use by the device (string).
.RE
.sp
.ne 2
.na
\fB\fBintr\fR \fR
.ad
.RS 13n
Times interrupt handler was called and claimed the interrupt (long).
.RE
.sp
.ne 2
.na
\fB\fBnorcvbuf\fR \fR
.ad
.RS 13n
Times a valid incoming packet was known to have been discarded because no
buffer could be allocated for receive (long).
.RE
.sp
.ne 2
.na
\fB\fBierrors\fR \fR
.ad
.RS 13n
Total packets received that couldn't be processed because they contained errors
(long).
.RE
.sp
.ne 2
.na
\fB\fBoerrors\fR \fR
.ad
.RS 13n
Total packets that weren't successfully transmitted because of errors (long).
.RE
.sp
.ne 2
.na
\fB\fBmissed\fR \fR
.ad
.RS 13n
Packets known to have been dropped by the hardware on receive (long).
.RE
.sp
.ne 2
.na
\fB\fBuflo\fR \fR
.ad
.RS 13n
Times FIFO underflowed on transmit (long).
.RE
.sp
.ne 2
.na
\fB\fBoflo\fR \fR
.ad
.RS 13n
Times receiver overflowed during receive (long).
.RE
.sp
.LP
The following group of statistics applies to networks of type \fBDL_ETHER\fR;
these are maintained by device-specific drivers of that type, as above.
.sp
.ne 2
.na
\fB\fBalign_errors\fR \fR
.ad
.RS 23n
Packets received with framing errors (not an integral number of octets) (long).
.RE
.sp
.ne 2
.na
\fB\fBfcs_errors\fR \fR
.ad
.RS 23n
Packets received with CRC errors (long).
.RE
.sp
.ne 2
.na
\fB\fBduplex\fR \fR
.ad
.RS 23n
Current duplex mode of the interface (string).
.RE
.sp
.ne 2
.na
\fB\fBcarrier_errors\fR \fR
.ad
.RS 23n
Times carrier was lost or never detected on a transmission attempt (long).
.RE
.sp
.ne 2
.na
\fB\fBcollisions\fR \fR
.ad
.RS 23n
Ethernet collisions during transmit (long).
.RE
.sp
.ne 2
.na
\fB\fBex_collisions\fR \fR
.ad
.RS 23n
Frames where excess collisions occurred on transmit, causing transmit failure
(long).
.RE
.sp
.ne 2
.na
\fB\fBtx_late_collisions\fR \fR
.ad
.RS 23n
Times a transmit collision occurred late (after 512 bit times) (long).
.RE
.sp
.ne 2
.na
\fB\fBdefer_xmts\fR \fR
.ad
.RS 23n
Packets without collisions where first transmit attempt was delayed because the
medium was busy (long).
.RE
.sp
.ne 2
.na
\fB\fBfirst_collisions\fR \fR
.ad
.RS 23n
Packets successfully transmitted with exactly one collision.
.RE
.sp
.ne 2
.na
\fB\fBmulti_collisions\fR \fR
.ad
.RS 23n
Packets successfully transmitted with multiple collisions.
.RE
.sp
.ne 2
.na
\fB\fBsqe_errors\fR \fR
.ad
.RS 23n
Times SQE test error was reported.
.RE
.sp
.ne 2
.na
\fB\fBmacxmt_errors\fR \fR
.ad
.RS 23n
Packets encountering transmit MAC failures, except carrier and collision
failures.
.RE
.sp
.ne 2
.na
\fB\fBmacrcv_errors\fR \fR
.ad
.RS 23n
Packets received with MAC errors, except align, fcs, and toolong errors.
.RE
.sp
.ne 2
.na
\fB\fBtoolong_errors\fR \fR
.ad
.RS 23n
Packets received larger than the maximum permitted length.
.RE
.sp
.ne 2
.na
\fB\fBrunt_errors\fR \fR
.ad
.RS 23n
Packets received smaller than the minimum permitted length (long).
.RE
.sp
.LP
The following group of statistics applies to networks of type \fBDL_TPR\fR;
these are maintained by device-specific drivers of that type, as above.
.sp
.ne 2
.na
\fB\fBline_errors\fR \fR
.ad
.RS 24n
Packets received with non-data bits or FCS errors.
.RE
.sp
.ne 2
.na
\fB\fBburst_errors\fR \fR
.ad
.RS 24n
Times an absence of transitions for five half-bit timers was detected.
.RE
.sp
.ne 2
.na
\fB\fBsignal_losses\fR \fR
.ad
.RS 24n
Times loss of signal condition on the ring was detected.
.RE
.sp
.ne 2
.na
\fB\fBace_errors\fR \fR
.ad
.RS 24n
Times an AMP or SMP frame in which A is equal to C is equal to 0, was followed
by another such SMP frame without an intervening AMP frame.
.RE
.sp
.ne 2
.na
\fB\fBinternal_errors\fR \fR
.ad
.RS 24n
Times the station recognized an internal error.
.RE
.sp
.ne 2
.na
\fB\fBlost_frame_errors\fR \fR
.ad
.RS 24n
Times the TRR timer expired during transmit.
.RE
.sp
.ne 2
.na
\fB\fBframe_copied_errors\fR \fR
.ad
.RS 24n
Times a frame addressed to this station was received with the FS field A bit
set to 1.
.RE
.sp
.ne 2
.na
\fB\fBtoken_errors\fR \fR
.ad
.RS 24n
Times the station acting as the active monitor recognized an error condition
that needed a token transmitted.
.RE
.sp
.ne 2
.na
\fB\fBfreq_errors\fR \fR
.ad
.RS 24n
Times the frequency of the incoming signal differed from the expected
frequency.
.RE
.sp
.LP
The following group of statistics applies to networks of type \fBDL_FDDI\fR;
these are maintained by device-specific drivers of that type, as above.
.sp
.ne 2
.na
\fB\fBmac_errors\fR \fR
.ad
.RS 20n
Frames detected in error by this MAC that had not been detected in error by
another MAC.
.RE
.sp
.ne 2
.na
\fB\fBmac_lost_errors\fR \fR
.ad
.RS 20n
Frames received with format errors such that the frame was stripped.
.RE
.sp
.ne 2
.na
\fB\fBmac_tokens\fR \fR
.ad
.RS 20n
Number of tokens received (total of non-restricted and restricted).
.RE
.sp
.ne 2
.na
\fB\fBmac_tvx_expired\fR \fR
.ad
.RS 20n
Number of times that TVX has expired.
.RE
.sp
.ne 2
.na
\fB\fBmac_late\fR \fR
.ad
.RS 20n
Number of TRT expirations since this MAC was reset or a token was received.
.RE
.sp
.ne 2
.na
\fB\fBmac_ring_ops\fR \fR
.ad
.RS 20n
Number of times the ring has entered the ``Ring_Operational'' state from the
``Ring Not Operational'' state.
.RE
.SH FILES
.sp
.ne 2
.na
\fB\fB/kernel/misc/gld\fR \fR
.ad
.RS 21n
loadable kernel module
.RE
.SH SEE ALSO
.sp
.LP
\fBld\fR(1), \fBkstat\fR(7D), \fBdlpi\fR(7P), \fBattach\fR(9E), \fBgld\fR(9E),
\fBopen\fR(9E), \fBgld\fR(9F), \fBgld_mac_info\fR(9S), \fBgld_stats\fR(9S),
\fBkstat\fR(9S)
.sp
.LP
\fIWriting Device Drivers\fR
.SH WARNINGS
.sp
.LP
Contrary to the DLPI specification, GLD returns the device's correct address
length and broadcast address in \fBDL_INFO_ACK\fR even before the stream has
been attached to a \fBPPA\fR.
.sp
.LP
Promiscuous mode may only be entered by streams that are attached to a
\fBPPA\fR.
.sp
.LP
The physical address of a \fBPPA\fR may be changed by the superuser while other
streams are bound to the same PPA.
|