Data Structures for Drivers gldmacinfo(9S)
NAME
gldmacinfo - Generic LAN Driver MAC info data structure
SYNOPSIS
#include
INTERFACE LEVEL
Solaris architecture specific (Solaris DI).
DESCRIPTION
The Generic LAN Driver (GLD) Media Access Control (MAC)
information (gldmacinfo) structure is the main data inter-
face between the device-specific driver and GLD. It contains
data required by GLD and a pointer to an optional additional
driver-specific information structure.
The gldmacinfo structure should be allocated using
gldmacalloc() and deallocated using gldmacfree().
Drivers can make no assumptions about the length of this
structure, which might be different in different releases of
Solaris and/or GLD. Structure members private to GLD, not
documented here, should not be set or read by the device-
specific driver.
STRUCTURE MEMBERS
caddrt gldmprivate; /* Driver private data */
int (*gldmreset)(); /* Reset device */
int (*gldmstart)(); /* Start device */
int (*gldmstop)(); /* Stop device */
int (*gldmsetmacaddr)(); /* Set device phys addr */
int (*gldmsetmulticast)(); /* Set/delete */
/* multicast address */
int (*gldmsetpromiscuous)();
/* Set/reset promiscuous */
/* mode*/
int (*gldmsend)(); /* Transmit routine */
uint (*gldmintr)(); /* Interrupt handler */
int (*gldmgetstats)(); /* Get device statistics */
int (*gldmioctl)(); /* Driver-specific ioctls */
char *gldmident; /* Driver identity string */
uint32t gldmtype; /* Device type */
uint32t gldmminpkt; /* Minimum packet size */
/* accepted by driver */
uint32t gldmmaxpkt; /* Maximum packet size */
/* accepted by driver */
uint32t gldmaddrlen; /* Physical address */
/* length */
int32t gldmsaplen; /* SAP length for */
/* DLINFOACK */
unsigned char *gldmbroadcastaddr; /* Physical broadcast */
SunOS 5.11 Last change: 7 June 2004 1
Data Structures for Drivers gldmacinfo(9S)
/* addr */
unsigned char *gldmvendoraddr; /* Factory MAC address */
tuscalart gldmppa; /* Physical Point of */
/* Attachment (PA) number */
devinfot *gldmdevinfo; /* Pointer to device's */
/* devinfo node */
ddiiblockcookietgldmcookie; /* Device's interrupt */
/* block cookie */
int gldmmargin /* accepted data beyond */
/*gldmmaxpkt */
uint32t gldmcapabilities; /* Device capabilities */
Below is a description of the members of the gldmacinfo
structure that are visible to the device driver.
gldmprivate 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.
The following group of structure members must be set by the
driver before calling gldregister(), and should not
thereafter be modified by the driver; gldregister() can use
or cache the values of some of these structure members, so
changes made by the driver after calling gldregister()
might cause unpredicted results.
gldmreset Pointer to driver entry point; see
gld(9E).
gldmstart Pointer to driver entry point; see
gld(9E).
gldmstop Pointer to driver entry point; see
gld(9E).
gldmsetmacaddr Pointer to driver entry point; see
gld(9E).
gldmsetmulticast Pointer to driver entry point; see
gld(9E).
SunOS 5.11 Last change: 7 June 2004 2
Data Structures for Drivers gldmacinfo(9S)
gldmsetpromiscuous Pointer to driver entry point; see
gld(9E).
gldmsend Pointer to driver entry point; see
gld(9E).
gldmintr Pointer to driver entry point; see
gld(9E).
gldmgetstats Pointer to driver entry point; see
gld(9E).
gldmioctl Pointer to driver entry point; can
be NUL; see gld(9E).
gldmident Pointer to a string containing a
short description of the device. It
is used to identify the device in
system messages.
gldmtype The type of device the driver han-
dles. The values currently supported
by GLD are DLETHER (IE 802.3 and
Ethernet Bus), DLTPR (IE 802.5
Token Passing Ring), and DLFDI
(ISO 9314-2 Fibre Distributed Data
Interface). This structure member
must be correctly set for GLD to
function properly.
Support for the DLTPR and DLFDI
media types is obsolete and may be
removed in a future release of
Solaris.
gldmminpkt Minimum Service Data Unit size - 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.
gldmmaxpkt Maximum Service Data Unit size - the
maximum size of packet, not
SunOS 5.11 Last change: 7 June 2004 3
Data Structures for Drivers gldmacinfo(9S)
including the MAC header, that can
be transmitted by the device. For
Ethernet, this number is 1500.
gldmaddrlen The length in bytes of physical
addresses handled by the device. For
Ethernet, Token Ring, and FDI, the
value of this structure member
should be 6.
gldmsaplen 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 after the physical address
in a DLSAP address. See the descrip-
tion under ``Message DLINFOACK''
in the DLPI specification for more
details.
gldmbroadcastaddr Pointer to an array of bytes of
length gldmaddrlen 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 gldmbroadcastaddr
to point at it. For Ethernet, Token
Ring, and FDI, the broadcast
address is normally 0xF-F-F-F-
F-F.
gldmvendoraddr Pointer to an array of bytes of
length gldmaddrlen 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
gldmvendoraddr to point at it.
gldmppa The Physical Point of Attachment
(PA) number for this instance of
the device. Normally this should be
set to the instance number, returned
SunOS 5.11 Last change: 7 June 2004 4
Data Structures for Drivers gldmacinfo(9S)
from ddigetinstance(9F).
gldmdevinfo Pointer to the devinfo node for
this device.
gldmcookie The interrupt block cookie returned
by ddigetiblockcookie(9F),
ddiaddintr(9F),
ddigetsoftiblockcookie(9F), or
ddiaddsoftintr(9F). This must
correspond to the device's receive
interrupt, from which gldrecv() is
called.
gldmmargin Drivers set this value to the amount
of data in bytes that the device can
transmit beyond gldmmaxpkt. For
example, if an Ethernet device can
handle packets whose payload section
is no greater than 1522 bytes and
the gldmmaxpkt is set to 1500 (as
is typical for Ethernet), then
gldmmargin is set to 22. The
registered gldmmargin value is
reported in acknowledgements of the
DLIOCMARGININFO ioctl (see
dlpi(7P)).
gldmcapabilities Bit-field of device capabilities. If
the device is capable of reporting
media link state, the
GLDCAPLINKSTATE bit should be set.
SEE ALSO
gld(7D), dlpi(7P), attach(9E), gld(9E), ddiaddintr(9F),
gld(9F), gldstats(9S)
Writing Device Drivers
SunOS 5.11 Last change: 7 June 2004 5
|