mii
mii - configure the MII parameters for a MII ports
SYNOPSIS
mii sub-command options
DESCRIPTION
The mii command is used to configure the MII-specific information on old-style IEEE 802.3 devices. New style MII AE devices defined in IEEE 802.3ae are managed by the miiae, mmd, and mmdRegister commands.
STANDARD OPTIONS
enableManualAuto
Negotiate true / false
If set to true, then as the MII register is written to hardware auto negotiation begins. (default = false)
miiRegister
MII Source register. Defined register values include:
Option |
Value |
Usage |
---|---|---|
miiControl |
0 |
(default) |
miiStatus |
1 |
|
miiPHYId1 |
2 |
|
miiPHYId2 |
3 |
|
miiAutoNegAdvertisement |
4 |
|
miiAutoNegLinkPartnerAbility |
5 |
|
miiAutoNegExpansion |
6 |
|
miiRegister7 |
7 |
|
miiRegister8 |
8 |
|
miiRegister9 |
9 |
|
miiRegister10 |
10 |
|
miiRegister11 |
11 |
|
miiRegister12 |
12 |
|
miiRegister13 |
13 |
|
miiRegister14 |
14 |
|
miiRegister15 |
15 |
|
miiMirror |
16 |
|
miiInterruptEnable |
17 |
|
miiInterruptStatus |
18 |
|
miiConfiguration |
19 |
|
miiChipStatus |
20 |
|
miiRegister21 |
21 |
|
miiRegister22 |
22 |
|
miiRegister23 |
23 |
|
miiRegister24 |
24 |
|
miiRegister25 |
25 |
|
miiRegister26 |
26 |
|
miiRegister27 |
27 |
|
miiRegister28 |
28 |
|
miiRegister29 |
29 |
|
miiRegister30 |
30 |
|
miiRegister31 |
31 |
|
phyAddress
Physical address of the MII register location. If set to -1, the default location is used. (default = -1)
readWrite
Sets the properties of the selected register. Possible properties include:
Option |
Value |
Usage |
---|---|---|
miiDisabled |
0 |
(default) |
miiReadOnly |
1 |
|
miiReadWrite |
2 |
|
miiSynchToCurrentState |
3 |
The register is read and written during operation. In addition, the read values are placed into the editable fields at the same time. |
registerValue
Value of the selected register. (default = 0000)
COMMANDS
The mii command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
mii cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the mii command.
mii config option value
Modify the MII configuration options of the port. If no option is specified, returns a list describing all of the available MII options (see STANDARD OPTIONS) for port.
mii get chasID cardID portID [index = $::mdioInternal]
Gets the current MII configuration of the port with id portID on card cardID, chassis chasID. Any of the three supported PHYs may be selected through the use of the index. The supported PHYs are:
Option |
Value |
Usage |
---|---|---|
mdioInternal |
0 |
(default) The internal PHY located on the Ixia card. |
mdioExternal1 |
1 |
The first defined external PHY. |
mdioExternal2 |
2 |
The second defined external PHY. |
Call this command before calling mii cget option value to get the value of the configuration option. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
- Network error between the client and the chassis
mii selectRegister select
After mii get chasID cardID portID has completed selects which register to fill the TCL parameters with. Specific errors are:
- No port has previously been selected with the mii.get method
- The port is not an Mii port, or a port with Mii capability
mii set chasID cardID portID [index = $::mdioInternal]
Sets the MII configuration of the port with id portID on card cardID, chassis chasID by reading the configuration option values set by the mii config option value command. Any of the three supported PHYs may be set through the use of the index. The supported PHYs are:
Option |
Value |
Usage |
---|---|---|
mdioInternal |
0 |
(default) The internal PHY located on the Ixia card. |
mdioExternal1 |
1 |
The first defined external PHY. |
mdioExternal2 |
2 |
The second defined external PHY. |
Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
- The configured parameters are not valid for this port
- The port is not an Mii port, or a port with Mii capability
mii setDefault
Sets to IxTclHal default values for all configuration options.
mii write chasID cardID portID
Writes the MII configuration of the port with id portID on card cardID, chassis chasID to the hardware. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
- Network error between the client and the chassis
- The port is not an Mii port, or a port with Mii capability
EXAMPLES
package require IxTclHal
# Connect to chassis and get chassis ID
set host localhost
set username user
# Check if we're running on UNIX - connect to the TCL Server
# which must be running on the chassis
if [isUNIX] {if [ixConnectToTclServer $host] {
ixPuts "Could not connect to $host"
return 1
}
}
# Now connect to the chassis
if [ixConnectToChassis $host] {
ixPuts $::ixErrorInfo
return 1
}
# Get the chassis ID to use in port lists
set chas [ixGetChassisID $host]
# Assuming that MII card is in slot 3
set card 3
set portList [list [list $chas $card 1]]
# Login before taking ownership
if [ixLogin $username] {
ixPuts $::ixErrorInfo
return 1
}
# Take ownership of the ports we'll use
if [ixTakeOwnership $portList] {
ixPuts $::ixErrorInfo
return 1
}
# Check for missing card
if {[card get $chas $card] != 0} \
{
ixPuts "Card $card does not exist"
exit
}
# Get the type of card and check if it's the correct type
set cardType [card cget -type]
if {$cardType != $::card10100Mii} \
{
ixPuts "Card $card is not a 10/100 MII card"
exit
}
# Set the options to default values
mii setDefault
# Get the current mii state from the card
mii get $chas $card 1
# Get the value of the control register (0)
mii selectRegister miiControl
set controlReg [mii cget -registerValue]
set msg [format "Register 00 value is %04x" $controlReg]
ixPuts $msg
# Set the mode on register 00 to Read/Write/Sync
mii config -readWrite miiSynchToCurrentState
# With bit 14 (loopback) on
set controlReg [expr $controlReg | 0x0400]
mii config -registerValue $controlReg
# set to ixTclHal
mii set $chas $card 1
# and write to hardware
set portList [list [list $chas $card 1]]
ixWritePortsToHardware portList
# Let go of the ports that we reserved
ixClearOwnership $portList
# Disconnect from the chassis we're using
ixDisconnectFromChassis $host
# If we're running on UNIX, disconnect from the TCL Server
if [isUNIX] {
ixDisconnectTclServer $host
}
SEE ALSO
port, miiae, mmd, mmdRegister.