BCM.1> port ge en=0 ;Disable all GbE
BCM.1> tx 2 pbm=ge2,fe7 ;Transmit 2 packets out of both port ge2 and fe7
BCM.1> ps 0xf ;Show status of first 4 ports (ge0-ge3 or fe0-fe3 etc.)
BCM.1> vlan create 97 pbm=ge2-ge5 ;create VLAN 97 with member ports ge2–ge5
BCM.1> vlan add 73 pbm=xe,hg ;Add all xe and hg ports to vlan 73
BCM.1>
BCM.1> vlan create 85 pbm=ge5,hg1,cpu,xe0 ubm=ge9,xe1,hg0
BCM.2> port 0xff an=1
BCM.0> log file=/tmp/<logfilename>
BCM.0> log [on/off] ;To turn logging on/off
BCM.0> ps ge3
BCM.0> port ge3
BCM.1> port 4 ph= [Master | Slave | Auto]
BCM.1> show c ge1
BCM.0> combo ge23
To transmit 10 IEEE frames of 100-byte length with the specified source and destination MAC addresses out of ge0:
BCM.0> hm ieee ;Set the required header mode before tx
BCM.0> tx 10 pbm=ge0 length=100 sm=0x001122334455 dm=0xffffffffffff
To transmit 100 more of these frames:
BCM.0> tx 100 pbm=ge0
To transmit hex data from the file as an Ethernet frame 10 times from ge0 (CRC is appended automatically):
BCM.0> tx 10 pbm=ge0 file=pkt.hex
To start the packet watcher dumping all packets with decoded fields and log the last 5 packets:
BCM.1> PacketWatcher log 5 report +dec start
Reporting options of the packet watcher can be changed on the fly. To turn off dumping raw hex data in the packet:
BCM.1> pw report -rawBCM.0> pw
BCM.0> pw
BCM.0> l mac
BCM.0> l mac_ctrl
BCM.0> G mac_ctrl.xe0 ……(1)
BCM.0> g raw mac_ctrl.xe3 ……(2)
BCM.0> g mac_ctrl ……(3)
BCM.0> g chg mac_ctrl.xe3 ……(4)
In the above code commands,
(1)—Get register and field value of MAC_CTRL register for port xe0.
(2)—Get only hex value of mac_ctrl for xe3.
(3)—Get register value of MAC_CTRL for all ports.
(4)—Get value of mac_ctrl register if it has changed from default. Only changed fields are displayed.
Listreg <—> LISTmem
Getreg <—> Dump
Setreg <—> Write, Insert
Modreg <—> MODify
BCM.0> list vlan
d vlan Dump all valid (VALID bit is 1) entries in VLAN table.
d all vlan Dumps entire VLAN table.
d chg vlan Shows all VLAN entries that have changed from their default contents.
d vlan 200 25 Dumps 25 entries of VLAN table starting with 200.
BCM.1> d chg l2x
BCM.0> show params
BCM.0> phy info
BCM.0> phy ge7 3
It is also helpful to remember that PHY registers 0 and 1 always hold the control and status for each port, respectively:
BCM.0> phy ge5 0 0x8000 ; bit-15 to reset ge5
BCM.0> phy ge5 0 0x0200 ; bit-9 to start autoneg
BCM.0> dump pcic
The SwitchControl command controls the switch behavior by manipulating numerous control variables. Typing sc displays
a list of all switch controls and their current value. Needed switch behavior can be obtained by modifying relevant switch
controls for a port bit map. For example, to change the action taken by the switch when the IGMP packet arrives at port ge4,
use switch controls IgmpPktDrop or IgmpPktToCpu.
BCM.0> sc pbm=ge4 IgmpPktToCpu=1
Driver properties can be changed and saved in NVRAM by using the BCM Diag Shell command config.
BCM.0> config add counter_thread_pri=40 ;add and set a new property
BCM.0> config phy_automedium_ge0.0=0 ;change an existing property
BCM.0> config save ;save changes in NVRAM
BCM.0> config delete <name>
BCM.0> *:link off
BCM.0> *:counter off
BCM.0> *:l2mode off