/*
* CDDL HEADER START
*
* 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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
*/
/*
* Copyright 2013, Nexenta Systems, Inc. All rights reserved.
* Copyright 2014 Pluribus Networks Inc.
* Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
*/
#include "igb_sw.h"
int
{
return (ECANCELED);
}
switch (stat) {
case MAC_STAT_IFSPEED:
break;
case MAC_STAT_MULTIRCV:
break;
case MAC_STAT_BRDCSTRCV:
break;
case MAC_STAT_MULTIXMT:
break;
case MAC_STAT_BRDCSTXMT:
break;
case MAC_STAT_NORCVBUF:
break;
case MAC_STAT_IERRORS:
igb->stat_algnerrc +
igb->stat_crcerrs +
break;
case MAC_STAT_NOXMTBUF:
*val = 0;
break;
case MAC_STAT_OERRORS:
break;
case MAC_STAT_COLLISIONS:
break;
case MAC_STAT_RBYTES:
/*
* The 64-bit register will reset whenever the upper
* 32 bits are read. So we need to read the lower
* 32 bits first, then read the upper 32 bits.
*/
break;
case MAC_STAT_IPACKETS:
break;
case MAC_STAT_OBYTES:
/*
* The 64-bit register will reset whenever the upper
* 32 bits are read. So we need to read the lower
* 32 bits first, then read the upper 32 bits.
*/
break;
case MAC_STAT_OPACKETS:
break;
/* RFC 1643 stats */
case ETHER_STAT_ALIGN_ERRORS:
break;
case ETHER_STAT_FCS_ERRORS:
break;
break;
break;
case ETHER_STAT_SQE_ERRORS:
break;
case ETHER_STAT_DEFER_XMTS:
break;
break;
case ETHER_STAT_EX_COLLISIONS:
break;
case ETHER_STAT_MACXMT_ERRORS:
break;
break;
break;
case ETHER_STAT_MACRCV_ERRORS:
break;
case ETHER_STAT_XCVR_ADDR:
/* The Internal PHY's MDI address for each MAC is 1 */
*val = 1;
break;
case ETHER_STAT_XCVR_ID:
break;
case ETHER_STAT_XCVR_INUSE:
switch (igb->link_speed) {
case SPEED_1000:
*val =
break;
case SPEED_100:
*val =
break;
case SPEED_10:
break;
default:
break;
}
break;
case ETHER_STAT_CAP_1000FDX:
break;
case ETHER_STAT_CAP_1000HDX:
break;
case ETHER_STAT_CAP_100FDX:
break;
case ETHER_STAT_CAP_100HDX:
break;
case ETHER_STAT_CAP_10FDX:
break;
case ETHER_STAT_CAP_10HDX:
break;
case ETHER_STAT_CAP_ASMPAUSE:
break;
case ETHER_STAT_CAP_PAUSE:
break;
case ETHER_STAT_CAP_AUTONEG:
break;
break;
break;
break;
break;
case ETHER_STAT_ADV_CAP_10FDX:
break;
case ETHER_STAT_ADV_CAP_10HDX:
break;
break;
case ETHER_STAT_ADV_CAP_PAUSE:
break;
break;
break;
break;
case ETHER_STAT_LP_CAP_100FDX:
break;
case ETHER_STAT_LP_CAP_100HDX:
break;
case ETHER_STAT_LP_CAP_10FDX:
break;
case ETHER_STAT_LP_CAP_10HDX:
break;
break;
case ETHER_STAT_LP_CAP_PAUSE:
break;
break;
case ETHER_STAT_LINK_ASMPAUSE:
break;
case ETHER_STAT_LINK_PAUSE:
break;
case ETHER_STAT_LINK_AUTONEG:
break;
case ETHER_STAT_LINK_DUPLEX:
break;
break;
case ETHER_STAT_CAP_REMFAULT:
break;
case ETHER_STAT_ADV_REMFAULT:
break;
case ETHER_STAT_LP_REMFAULT:
break;
case ETHER_STAT_JABBER_ERRORS:
break;
case ETHER_STAT_CAP_100T4:
break;
case ETHER_STAT_ADV_CAP_100T4:
break;
case ETHER_STAT_LP_CAP_100T4:
break;
default:
return (ENOTSUP);
}
return (EIO);
}
return (0);
}
/*
* was in when the interface was registered.
*/
int
{
return (ECANCELED);
}
return (EIO);
}
/*
* Enable and start the watchdog timer
*/
return (0);
}
/*
* that the interface can be unregistered.
*/
void
{
return;
}
/*
* Disable and stop the watchdog timer
*/
}
/*
* Set the promiscuity of the device.
*/
int
{
return (ECANCELED);
}
if (on)
else
return (EIO);
}
return (0);
}
/*
* addresses for which the device will receive packets.
*/
int
{
int result;
return (ECANCELED);
}
return (result);
}
/*
* Pass on M_IOCTL messages passed to the DLD, and support
* private IOCTLs for debugging and ndd.
*/
void
{
return;
}
case LB_GET_INFO_SIZE:
case LB_GET_INFO:
case LB_GET_MODE:
case LB_SET_MODE:
break;
default:
break;
}
/*
* Decide how to reply
*/
switch (status) {
default:
case IOC_INVAL:
/*
* Error, reply with a NAK and EINVAL or the specified error
*/
break;
case IOC_DONE:
/*
* OK, reply already sent
*/
break;
case IOC_ACK:
/*
* OK, reply with an ACK
*/
break;
case IOC_REPLY:
/*
* OK, send prepared reply as ACK or NAK
*/
break;
}
}
/*
* Add a MAC address to the target RX group.
*/
static int
{
int i, slot;
return (ECANCELED);
}
if (igb->unicst_avail == 0) {
/* no slots available */
return (ENOSPC);
}
/*
* The slots from 0 to igb->num_rx_groups are reserved slots which
* are 1 to 1 mapped with group index directly. The other slots are
* shared between the all of groups. While adding a MAC address,
* it will try to set the reserved slots first, then the shared slots.
*/
slot = -1;
/*
* The reserved slot for current group is used, find the free
* slots in the shared slots.
*/
slot = i;
break;
}
}
} else
if (slot == -1) {
/* no slots available in the shared slots */
return (ENOSPC);
}
/* Set VMDq according to the mode supported by hardware. */
igb->unicst_avail--;
return (0);
}
/*
* Remove a MAC address from the specified RX group.
*/
static int
{
int slot;
return (ECANCELED);
}
if (slot == -1) {
return (EINVAL);
}
return (EINVAL);
}
/* Clear the MAC ddress in the slot */
igb->unicst_avail++;
return (0);
}
/*
* Enable interrupt on the specificed rx ring.
*/
int
{
/* Interrupt enabling for MSI-X */
} else {
/* Interrupt enabling for MSI and legacy */
}
return (0);
}
/*
* Disable interrupt on the specificed rx ring.
*/
int
{
/* Interrupt disabling for MSI-X */
(E1000_EICR_RX_QUEUE0 << index));
} else {
/* Interrupt disabling for MSI and legacy */
}
return (0);
}
/*
* Get the global ring index by a ring index within a group.
*/
int
{
int i;
for (i = 0; i < igb->num_rx_rings; i++) {
rindex--;
if (rindex < 0)
return (i);
}
return (-1);
}
static int
{
return (0);
}
/*
* Callback funtion for MAC layer to register all rings.
*/
/* ARGSUSED */
void
{
switch (rtype) {
case MAC_RING_TYPE_RX: {
int global_index;
/*
* 'index' is the ring index within the group.
* We need the global ring index by searching in group.
*/
ASSERT(global_index >= 0);
}
break;
}
case MAC_RING_TYPE_TX: {
}
break;
}
default:
break;
}
}
void
{
switch (rtype) {
case MAC_RING_TYPE_RX: {
break;
}
case MAC_RING_TYPE_TX:
break;
default:
break;
}
}
/*
* Obtain the MAC's capabilities and associated data from
* the driver.
*/
{
switch (cap) {
case MAC_CAPAB_HCKSUM: {
/*
* We advertise our capabilities only if tx hcksum offload is
* enabled. On receive, the stack will accept checksummed
* packets anyway, even if we haven't said we can deliver
* them.
*/
if (!igb->tx_hcksum_enable)
return (B_FALSE);
break;
}
case MAC_CAPAB_LSO: {
if (igb->lso_enable) {
break;
} else {
return (B_FALSE);
}
}
case MAC_CAPAB_RINGS: {
case MAC_RING_TYPE_RX:
break;
case MAC_RING_TYPE_TX:
break;
default:
break;
}
break;
}
default:
return (B_FALSE);
}
return (B_TRUE);
}
int
{
int err = 0;
return (ECANCELED);
}
/*
* All en_* parameters are locked (read-only)
* while the device is in any sort of loopback mode.
*/
return (EBUSY);
}
switch (pr_num) {
case MAC_PROP_EN_1000FDX_CAP:
break;
}
goto setup_link;
case MAC_PROP_EN_100FDX_CAP:
break;
}
goto setup_link;
case MAC_PROP_EN_100HDX_CAP:
break;
}
goto setup_link;
case MAC_PROP_EN_10FDX_CAP:
break;
}
goto setup_link;
case MAC_PROP_EN_10HDX_CAP:
break;
}
goto setup_link;
case MAC_PROP_AUTONEG:
break;
}
goto setup_link;
case MAC_PROP_FLOWCTRL:
switch (flow_control) {
default:
break;
case LINK_FLOWCTRL_NONE:
break;
case LINK_FLOWCTRL_RX:
break;
case LINK_FLOWCTRL_TX:
break;
case LINK_FLOWCTRL_BI:
break;
}
if (err == 0) {
}
break;
case MAC_PROP_ADV_1000FDX_CAP:
case MAC_PROP_ADV_1000HDX_CAP:
case MAC_PROP_ADV_100T4_CAP:
case MAC_PROP_ADV_100FDX_CAP:
case MAC_PROP_ADV_100HDX_CAP:
case MAC_PROP_ADV_10FDX_CAP:
case MAC_PROP_ADV_10HDX_CAP:
case MAC_PROP_EN_1000HDX_CAP:
case MAC_PROP_EN_100T4_CAP:
case MAC_PROP_STATUS:
case MAC_PROP_SPEED:
case MAC_PROP_DUPLEX:
break;
case MAC_PROP_MTU:
/* adapter must be stopped for an MTU change */
break;
}
err = 0;
break;
}
break;
}
if (err == 0) {
sizeof (struct ether_vlan_header) + ETHERFCSL;
/*
* Set rx buffer size
*/
/*
* Set tx buffer size
*/
}
break;
case MAC_PROP_PRIVATE:
break;
default:
break;
}
return (EIO);
}
return (err);
}
int
{
int err = 0;
switch (pr_num) {
case MAC_PROP_DUPLEX:
break;
case MAC_PROP_SPEED:
break;
case MAC_PROP_AUTONEG:
break;
case MAC_PROP_FLOWCTRL:
case e1000_fc_none:
break;
case e1000_fc_rx_pause:
break;
case e1000_fc_tx_pause:
break;
case e1000_fc_full:
break;
}
break;
case MAC_PROP_ADV_1000FDX_CAP:
break;
case MAC_PROP_EN_1000FDX_CAP:
break;
case MAC_PROP_ADV_1000HDX_CAP:
break;
case MAC_PROP_EN_1000HDX_CAP:
break;
case MAC_PROP_ADV_100T4_CAP:
break;
case MAC_PROP_EN_100T4_CAP:
break;
case MAC_PROP_ADV_100FDX_CAP:
break;
case MAC_PROP_EN_100FDX_CAP:
break;
case MAC_PROP_ADV_100HDX_CAP:
break;
case MAC_PROP_EN_100HDX_CAP:
break;
case MAC_PROP_ADV_10FDX_CAP:
break;
case MAC_PROP_EN_10FDX_CAP:
break;
case MAC_PROP_ADV_10HDX_CAP:
break;
case MAC_PROP_EN_10HDX_CAP:
break;
case MAC_PROP_PRIVATE:
break;
default:
break;
}
return (err);
}
void
{
switch (pr_num) {
case MAC_PROP_DUPLEX:
case MAC_PROP_SPEED:
case MAC_PROP_ADV_1000FDX_CAP:
case MAC_PROP_ADV_1000HDX_CAP:
case MAC_PROP_EN_1000HDX_CAP:
case MAC_PROP_ADV_100T4_CAP:
case MAC_PROP_EN_100T4_CAP:
break;
case MAC_PROP_EN_1000FDX_CAP:
} else {
((phy_ext_status & IEEE_ESR_1000T_FD_CAPS) ||
}
break;
case MAC_PROP_ADV_100FDX_CAP:
case MAC_PROP_EN_100FDX_CAP:
} else {
((phy_status & MII_SR_100X_FD_CAPS) ||
}
break;
case MAC_PROP_ADV_100HDX_CAP:
case MAC_PROP_EN_100HDX_CAP:
} else {
((phy_status & MII_SR_100X_HD_CAPS) ||
}
break;
case MAC_PROP_ADV_10FDX_CAP:
case MAC_PROP_EN_10FDX_CAP:
} else {
}
break;
case MAC_PROP_ADV_10HDX_CAP:
case MAC_PROP_EN_10HDX_CAP:
} else {
}
break;
case MAC_PROP_AUTONEG:
} else {
}
break;
case MAC_PROP_FLOWCTRL:
break;
case MAC_PROP_MTU:
break;
case MAC_PROP_PRIVATE:
break;
}
}
{
/*
* All en_* parameters are locked (read-only) while
* the device is in any sort of loopback mode ...
*/
switch (pr_num) {
case MAC_PROP_EN_1000FDX_CAP:
case MAC_PROP_EN_1000HDX_CAP:
case MAC_PROP_EN_100T4_CAP:
case MAC_PROP_EN_100FDX_CAP:
case MAC_PROP_EN_100HDX_CAP:
case MAC_PROP_EN_10FDX_CAP:
case MAC_PROP_EN_10HDX_CAP:
case MAC_PROP_AUTONEG:
case MAC_PROP_FLOWCTRL:
return (B_TRUE);
}
return (B_FALSE);
}
/* ARGSUSED */
int
{
int err = 0;
long result;
int i;
return (EINVAL);
switch (result) {
case 0:
case 1:
/*
* Add new mac.type values (or use < instead)
* as new cards offer up EEE.
*/
case e1000_i350:
/* Must set this prior to the set call. */
result) != E1000_SUCCESS)
break;
case e1000_i354:
/* Must set this prior to the set call. */
result) != E1000_SUCCESS)
break;
default:
return (ENXIO);
}
break;
default:
/* FALLTHRU */
}
return (err);
}
return (err);
}
if (result < MIN_TX_COPY_THRESHOLD ||
else {
}
return (err);
}
return (err);
}
if (result < MIN_TX_RECYCLE_THRESHOLD ||
else {
}
return (err);
}
return (err);
}
if (result < MIN_TX_OVERLOAD_THRESHOLD ||
else {
}
return (err);
}
return (err);
}
if (result < MIN_TX_RESCHED_THRESHOLD ||
else {
}
return (err);
}
return (err);
}
if (result < MIN_RX_COPY_THRESHOLD ||
else {
}
return (err);
}
return (err);
}
if (result < MIN_RX_LIMIT_PER_INTR ||
else {
}
return (err);
}
return (err);
}
else {
for (i = 0; i < MAX_NUM_EITR; i++)
igb->intr_throttling[i] =
igb->intr_throttling[0];
/* Set interrupt throttling rate */
igb->intr_throttling[i]);
}
return (err);
}
return (ENOTSUP);
}
int
void *pr_val)
{
int value;
/*
* For now, only supported on I350. Add new mac.type values
* (or use < instead) as new cards offer up EEE.
*/
case e1000_i350:
case e1000_i354:
break;
default:
value = 0;
}
} else {
return (ENOTSUP);
}
return (0);
}
void
{
int value;
return;
} else {
return;
}
}