mac.h revision d62bc4badc1c1f1549c961cfb8b420e650e1272b
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * MAC Services Module * MAC Information (text emitted by modinfo(1m)) * MAC version identifier. This is used by mac_alloc() mac_register() to * verify that incompatible drivers don't register. * MAC-Type version identifier. This is used by mactype_alloc() and * mactype_register() to verify that incompatible MAC-Type plugins don't * Maximum MAC address length * There are three ranges of statistics values. 0 to 1 - MAC_STAT_MIN are * interface statistics maintained by the mac module. MAC_STAT_MIN to 1 - * MACTYPE_STAT_MIN are common MAC statistics defined by the mac module and * maintained by each driver. MACTYPE_STAT_MIN and above are statistics * defined by MAC-Type plugins and maintained by each driver. * Statistics maintained by the mac module, and possibly populated as link * Do not reorder, and add only to the end of this list. /* MIB-II stats (RFC 1213 and RFC 1573) */ * Immutable information. (This may not be modified after registration). * Future LSO capabilities can be added at the end of the mac_capab_lso_t. * When such capability is added to the GLDv3 framework, the size of the * mac_capab_lso_t it allocates and passes to the drivers increases. Older * drivers wil access only the (upper) sections of that structure, that is the * sections carrying the capabilities they understand. This ensures the * interface can be safely extended in a binary compatible way. /* Add future lso capabilities here */ * Information for legacy devices. * Notifications that the legacy device does not support. * dev_t of the legacy device; can be held to force attach. * MAC layer capabilities. These capabilities are handled by the drivers' * mc_capab_get() callbacks. Some capabilities require the driver to fill * in a given data structure, and others are simply boolean capabilities. * Note that capability values must be powers of 2 so that consumers and * providers of this interface can keep track of which capabilities they * care about by keeping a bitfield of these things around somewhere. /* add new capabilities here */ /* The following capabilities are specific to softmac. */ /* driver entry points */ * MAC driver entry point types. * Drivers must set all of these callbacks except for mc_resources, * mc_ioctl, and mc_getcapab, which are optional. If any of these optional * callbacks are set, their appropriate flags must be set in mc_callbacks. * Any future additions to this list must also be accompanied by an * associated mc_callbacks flag so that the framework can grow without * affecting the binary compatibility of the interface. * Flags for mc_callbacks. Requiring drivers to set the flags associated * with optional callbacks initialized in the structure allows the mac * module to add optional callbacks in the future without requiring drivers void *
m_driver;
/* Driver private data */ * MAC interface callback types. * MAC-Type plugin interfaces * mtops_unicst_verify() returns 0 if the given address is a valid * unicast address, or a non-zero errno otherwise. * mtops_multicst_verify() returns 0 if the given address is a * valid multicast address, or a non-zero errno otherwise. If the * media doesn't support multicast, ENOTSUP should be returned (for * mtops_sap_verify() returns B_TRUE if the given SAP is a valid * SAP value, or B_FALSE otherwise. * mtops_header() is used to allocate and construct a MAC header. * mtops_header_info() is used to gather information on a given MAC * mtops_pdata_verify() is used to verify the validity of MAC * plugin data. It is called by mac_register() if the driver has * supplied MAC plugin data, and also by mac_pdata_update() when * drivers update the data. * mtops_header_cook() is an optional callback that converts (or * "cooks") the given raw header (as sent by a raw DLPI consumer) * into one that is appropriate to send down to the MAC driver. * Following the example above, an Ethernet header sent down by a * DLPI consumer would be converted to whatever header the MAC * mtops_header_uncook() is an optional callback that does the * opposite of mtops_header_cook(). It "uncooks" a given MAC * header (as received from the driver) for consumption by raw DLPI * consumers. For example, for a non-Ethernet plugin that wants * raw DLPI consumers to be fooled into thinking that the device * provides Ethernet access, this callback would modify the given * mblk_t such that the MAC header is converted to an Ethernet * mtops_link_details() is an optional callback that provides * extended information about the link state. Its primary purpose * is to provide type-specific support for syslog contents on * link up events. If no implementation is provided, then a default * implementation will be used. * mtops_ops exists for the plugin to enumerate the optional callback * entrypoints it has defined. This allows the mac module to define * additional plugin entrypoints in mactype_ops_t without breaking backward * compatibility with old plugins. * Client interface functions. * Driver interface functions.