ixgbe_ndd.c revision 9da57d7b0ddd8d73b676ce12c040362132cdd538
/*
* CDDL HEADER START
*
* Copyright(c) 2007-2008 Intel Corporation. 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:
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When using or redistributing this file, you may do so under the
* License only. No other modification of this header is permitted.
*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms of the CDDL.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "ixgbe_sw.h"
/* Function prototypes */
static int ixgbe_nd_param_load(ixgbe_t *);
static void ixgbe_nd_get_param_val(nd_param_t *);
/*
* Notes:
* status of the parameter:
* '-' => read-only
* '!' => invisible!
*
* For writable parameters, we check for a driver property with the
* same name; if found, and its value is in range, we initialise
* the parameter from the property, overriding the default in the
* table below.
*
* A NULL in the <name> field terminates the array.
*
* The <info> field is used here to provide the index of the
* parameter to be initialised; thus it doesn't matter whether
* this table is kept ordered or not.
*
* The <info> field in the per-instance copy, on the other hand,
* is used to count assignments so that we can tell when a magic
* parameter has been set via ndd (see ixgbe_nd_set()).
*/
static const nd_param_t nd_template[] = {
/* ixgbe info min max init r/w+name */
/* Our hardware capabilities */
/* Our advertised capabilities */
/* Partner's advertised capabilities */
/* Current operating modes */
/* Terminator */
};
/*
* ixgbe_nd_get - Ndd get parameter values.
*/
static int
{
return (0);
}
/*
* ixgbe_nd_set - Ndd set parameter values.
*/
static int
{
long new_value;
char *end;
return (EINVAL);
return (EINVAL);
return (0);
}
/*
* ixgbe_nd_param_load - Ndd load parameter values.
*/
static int
{
const nd_param_t *tmpnd;
nd_param_t *nd;
char *nm;
int value;
/*
* Copy the template from nd_template[] into the
* proper slot in the per-instance parameters,
* then register the parameter with nd_load()
*/
switch (*nm) {
default:
break;
case '?':
break;
}
}
switch (*nm) {
default:
case '!':
continue;
case '+':
case '?':
break;
case '-':
break;
}
goto nd_fail;
/*
* If the parameter is writable, and there's a property
* with the same name, and its value is in range, we use
* it to initialise the parameter. If it exists but is
* out of range, it's ignored.
*/
}
}
return (IXGBE_SUCCESS);
"ixgbe_nd_param_load: failed at index %d [info %d]",
return (IXGBE_FAILURE);
}
/*
* ixgbe_nd_get_param_val - Get parameter values.
*/
static void
{
case PARAM_LINK_STATUS:
break;
case PARAM_LINK_SPEED:
break;
case PARAM_LINK_DUPLEX:
break;
default:
break;
}
}
/*
* ixgbe_nd_set_param_val - Set parameter values.
*/
static void
{
return;
}
case PARAM_ADV_AUTONEG_CAP:
case PARAM_ADV_10000FDX_CAP:
case PARAM_ADV_1000FDX_CAP:
case PARAM_ADV_100FDX_CAP:
break;
default:
break;
}
}
/*
* ixgbe_nd_init - Init for ndd support.
*/
int
{
/*
* Register all the per-instance properties, initialising
* them from the table above or from driver properties set
* in the .conf file
*/
return (IXGBE_FAILURE);
return (IXGBE_SUCCESS);
}
/*
* ixgbe_nd_cleanup - Free the Named Dispatch Table by calling nd_free
*/
void
{
}
/*
* ixgbe_nd_ioctl - Ndd ioctl.
*/
enum ioc_reply
{
int cmd;
switch (cmd) {
default:
/* NOTREACHED */
return (IOC_INVAL);
case ND_GET:
/*
* If nd_getset() returns B_FALSE, the command was
* not valid (e.g. unknown name), so we just tell the
* top-level ioctl code to send a NAK (with code EINVAL).
*
* Otherwise, nd_getset() will have built the reply to
* be sent (but not actually sent it), so we tell the
* caller to send the prepared reply.
*/
case ND_SET:
/*
* All adv_* parameters are locked (read-only) while
* the device is in any sort of loopback mode ...
*/
return (IOC_INVAL);
}
}
}