/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "bge_impl.h"
/*
* Property names
*/
/*
* synchronize the adv* and en* parameters.
*
* parameters. The usage of ndd for setting adv parameters will
* synchronize all the en parameters with the bge parameters,
* implicitly disabling any settings made via dladm.
*/
static void
{
}
{
/*
* If there is a driver.conf setting for the prop, we use
* it to initialise the parameter. If it exists but is
* out of range, it's ignored.
*/
return (B_TRUE);
}
return (B_FALSE);
}
else \
}
static void
{
int propval;
/*
* initialize values to those from driver.conf (if available)
* or the default value otherwise.
*/
if (DEVICE_5906_SERIES_CHIPSETS(bgep)) {
} else {
}
if (flags & CHIP_FLAG_SERDES) {
bgep->param_adv_100fdx = 0;
bgep->param_adv_100hdx = 0;
bgep->param_adv_10fdx = 0;
bgep->param_adv_10hdx = 0;
} else {
}
}
int
{
int duplex;
int speed;
/*
* initialize from .conf file, if appropriate.
*/
/*
* check the OBP property "supported-network-types"
*/
bgep->param_adv_autoneg = 0;
bgep->param_adv_1000fdx = 0;
bgep->param_adv_1000hdx = 0;
bgep->param_adv_100fdx = 0;
bgep->param_adv_100hdx = 0;
bgep->param_adv_10fdx = 0;
bgep->param_adv_10hdx = 0;
continue;
}
}
}
}
/*
* The link speed may be forced to 10, 100 or 1000 Mbps using
* the property "transfer-speed". This may be done in OBP by
* using the command "apply transfer-speed=<speed> <device>".
* The speed may be 10, 100 or 1000 - any other value will be
* ignored. Note that this does *enables* autonegotiation, but
* restricts it to the speed specified by the property.
*/
switch (speed) {
case 1000:
bgep->param_adv_100fdx = 0;
bgep->param_adv_100hdx = 0;
bgep->param_adv_10fdx = 0;
bgep->param_adv_10hdx = 0;
break;
case 100:
bgep->param_adv_1000fdx = 0;
bgep->param_adv_1000hdx = 0;
bgep->param_adv_10fdx = 0;
bgep->param_adv_10hdx = 0;
break;
case 10:
bgep->param_adv_1000fdx = 0;
bgep->param_adv_1000hdx = 0;
bgep->param_adv_100fdx = 0;
bgep->param_adv_100hdx = 0;
break;
default:
break;
}
}
/*
* Also check the "speed" and "full-duplex" properties. Setting
* these properties will override all other settings and *disable*
* autonegotiation, so both should be specified if either one is.
* Otherwise, the unspecified parameter will be set to a default
* value (1000Mb/s, full-duplex).
*/
bgep->param_adv_autoneg = 0;
switch (speed) {
case 1000:
default:
bgep->param_adv_100fdx = 0;
bgep->param_adv_100hdx = 0;
bgep->param_adv_10fdx = 0;
bgep->param_adv_10hdx = 0;
break;
case 100:
bgep->param_adv_1000fdx = 0;
bgep->param_adv_1000hdx = 0;
bgep->param_adv_10fdx = 0;
bgep->param_adv_10hdx = 0;
break;
case 10:
bgep->param_adv_1000fdx = 0;
bgep->param_adv_1000hdx = 0;
bgep->param_adv_100fdx = 0;
bgep->param_adv_100hdx = 0;
break;
}
switch (duplex) {
default:
case 1:
bgep->param_adv_1000hdx = 0;
bgep->param_adv_100hdx = 0;
bgep->param_adv_10hdx = 0;
break;
case 0:
bgep->param_adv_1000fdx = 0;
bgep->param_adv_100fdx = 0;
bgep->param_adv_10fdx = 0;
break;
}
}
return (0);
}