The GLD MAC information (gld_mac_info) 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.
Allocate the gld_mac_info structure using gld_mac_alloc() and deallocate it using gld_mac_free(). Drivers must not make any assumptions about the length of this structure, which might vary in different releases of Solaris, GLD, or both. Structure members private to GLD, not documented here, should not be set or read by the device-specific driver.
The gld_mac_info(9S) structure contains the following fields.
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 addr */ int (*gldm_set_promiscuous)(); /* Set/reset promiscuous mode */ int (*gldm_send)(); /* Transmit routine */ uint_t (*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_t gldm_cookie; /* Device's interrupt */ /* block cookie */
The gldm_private structure member is visible to the device driver; it is also 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 gld_register(), and should not thereafter be modified by the driver. Because gld_register() might use or cache the values of some of these structure members, changes made by the driver after calling gld_register() might cause unpredictable results.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; see the gld(9E) man page.
Pointer to driver entry point; is allowed to be NULL; see the gld(9E) man page.
Pointer to a string containing a short description of the device. It is used to identify the device in system messages.
Type of device the driver handles. The values currently supported by GLD are DL_ETHER (ISO 8802-3 (IEEE 802.3) and Ethernet Bus), DL_TPR (IEEE 802.5 Token Passing Ring), and DL_FDDI (ISO 9314-2 Fibre Distributed Data Interface). This structure member must be correctly set for GLD to function properly.
Minimum Service Data Unit size—the minimum packet size, not including the MAC header, that the device will transmit. This size is allowed to be zero if the device-specific driver handles any required padding.
Maximum Service Data Unit size — the maximum size of packet, not including the MAC header, that can be transmitted by the device. For Ethernet, this number is 1500.
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.
The length in bytes of the SAP address used by the driver. For GLD-based drivers, this should always be set to -2, to indicate that 2-byte SAP values are supported and that the SAP appears after the physical address in a DLSAP address. See Appendix A.2, “Message DL_INFO_ACK,” in the DLPI specification for more details.
Pointer to an array of bytes of length gldm_addrlen containing the broadcast address to be used for transmit. The driver must provide space to hold the broadcast address, fill it in with the appropriate value, and set gldm_broadcast_addr to point to it. For Ethernet, Token Ring, and FDDI, the broadcast address is normally 0xFF-FF-FF-FF-FF-FF.
Pointer to an array of bytes of length gldm_addrlen containing the vendor-provided network physical address of the device. The driver must provide space to hold the address, fill it in with information read from the device, and set gldm_vendor_addr to point to it.
PPA number for this instance of the device. This should always be set to the instance number returned from ddi_get_instance(9F).
Pointer to the dev_info node for this device.
Interrupt block cookie returned by ddi_get_iblock_cookie(9F), ddi_add_intr(9F), ddi_get_soft_iblock_cookie(9F), or ddi_add_softintr(9F). This must correspond to the device's receive-interrupt, from which gld_recv() is called.