?? readme
字號:
adm6996 kernel module provides transparent interface to ADM6996L control and stats registers.ProcFS interface~~~~~~~~~~~~~~~~Statistics:/proc/driver/adm6996 - adm switch statistics.ADM6996L version 3.1 by Nikki Chumakov--- Stats ---Port 0: DOWN 10M HD 802.3X NOCABLERX packets:0 bytes:0 TX packets:0 bytes:0errors:0 collisions:0 cable length:0 Port 1: UP 100M FD 802.3XRX packets:841 bytes:89490 TX packets:98 bytes:9896errors:0 collisions:0 cable length:0 Port 2: UP 100M FD 802.3XRX packets:2046 bytes:179160 TX packets:2255 bytes:271067errors:0 collisions:0 cable length:0 Port 3: DOWN 10M HD 802.3X NOCABLERX packets:0 bytes:0 TX packets:0 bytes:0errors:0 collisions:0 cable length:0 Port 4: DOWN 10M HD 802.3X NOCABLERX packets:0 bytes:0 TX packets:0 bytes:0errors:0 collisions:0 cable length:0 Port 5: UP 100M FD 802.3XRX packets:1414 bytes:181577 TX packets:2767 bytes:255578errors:0 collisions:0 cable length:0 Possible port flags:UP/DOWN - port status10M/100M - port speedFD/HD - full/half duplex802.3X - enabled flow control (only for full duplex ports)BP - enabled back pressure (only for half duplex ports)NOCABLE - ADM6996L detected that no TP cable present or cable is broken.When RX/TX/errors counted overflowed, the counter is resetting to zero and '(overflow)' string appended to after that counter only once.Example of overflowing TX bytes counter.First read:RX packets:1414 bytes:181577 TX packets:2767 bytes:255578Second read:RX packets:1414 bytes:181577 TX packets:2768 bytes:250 (overflow)Third read:RX packets:1414 bytes:181577 TX packets:2769 bytes:500Control interface:/proc/sys/dev/adm6996 - base directory for adm settingsport0/, port1/. port2/, port3/, port4/, port5/ - settings for particular switch ports. port0 - is for port marked 'WAN'. port1-4 - is for 'LAN' ports 1-4. port5 is internal port communicating with router and connected with eth0 interface.ports settings:~~~~~~~~~~~~~~~portX/auto-negotiation: auto negotiation function between 100TX-FD, 100TX-HD, 10TX-FD, 10TX-HD 1: enable, 0: disableportX/bandwidth - port threshold control. Possible values: full, 50M, 20M, 10M, 5M, 2M, 1M, 512K, 256K what means: full port bandwidth, 50Mbit/s, 20Mbit/s, and so on.portX/cont-recv - receive packet length conted on source port X. 1: enable, 0: disableportX/crossover - crossover auto MDIX enable. It let to connect hub and switches with usual TP cables. 1: enable, 0: disableportX/duplex - port duplex 1: full duplex, 0: half duplexportX/enable - port enable 1: enable, 0: disableportX/flow - 802.3x flow for full duplex and back pressure for half duplex control command ability. 1: enable, 0: disable.portX/fx - select FX mode (useless on WRT) 1: FX mode, 0: TP modeportX/mac-lock - lock first MAC address seen on port X. Use it if you want to prevent connection hubs and switches to port. 1: enable, 0: disable.portX/tos-over-vlan-prio - TOS over VLAN priority. 1: check TOS first, 0: check VLAN. portX/port-prio - port base priority. Values: 0-3portX/port-prio-enable - enable port based priority. 1: port base priority, 0: VLAN or TOS priority. Note: If this bit tunred on, then ADM6996L will not check TOS or VLAN as priority reference. ADM6996L will check port base priority only. ADM6996L default is bypass mode which checks port base priority only. If user want check VLAN tag priority then must set chip as Tag mode. portX/speed - port speed. 10: 10Mbit/s, 100: 100Mbit/sportX/tagging - output packet tagging. 0: Untag, 1: TagportX/vlan-group (read only) - active port VLAN ID. Values: 0-15.portX/vlan-group-mask - port VLAN ID mask. Actual mask is calculated fromthis value and shift register (adm6996/tag-shift) as: pvid = (mask >> tag_shift) & 0x0fgeneral switch settings:~~~~~~~~~~~~~~~~~~~~~~~aging - aging function. ADM6996L has a 300sec timer and MAC addresses will removed from address table if unused for such time. This is usefull for topology changes. Normally, disabling aging function is for security purpose. 1: enable, 0: disableback-pressure - OBSOLETE setting (there is error in ADM6996L documenation). Really back pressure is controled by portX/flow setting.smart-squelch - noise reduction on RX inputs. The receive squelch threshold level can be lowered for use in longer cable applications. 1: enable, 0: disableNB: ADM6996L is incomplete defining this function, so I'm not sure, if it is working.crc - input packets CRC checks 1: enable, 0: disableNB: another description of the same bit exists: jabber function - disables the transmitter if it attempts to transmit a longer than legal size packet - bit 4 of reg 10h.reg_10_bit_3 - 0, 1. reserved. It may be jabber function, but I not sure.polarity_error (read only) - if input polarity is reversed, the error condition will be automatically corrected and reported in bit 5 of reg 10hdrop-on-collisions - drop packets when excessive collisions happen 1: enable, 0: disabledrop-scheme - discard mode (drop scheme for Q0-3) Values: 0-3 for each priority queue Drop Scheme for each queue: 0 1 2 3 Utilization Drop : 0% 0% 25% 50%far-end-fault - Far end fault detection. 1: enable, 0: disablefwd-management-mac-1 - control reserved MAC 0180C2000010-0180C20000FFfwd-management-mac-2 - same for 0180C2000002-0180C200000Ffwd-management-mac-3 - 0180C2000001fwd-management-mac-4 - 0180C2000000 1: forward, 0: discardipg-bits - IPG leveling. Inter Packet Gap is the idle time between any two successive packets from the same port. 96bit - default. 92bit is for preventing packet lost when turn off Flow Control and clock P.P.M. value difference. 92: 92bits, 96: 96bitsmac-clone-reg30h - reg30h, bit5, 'Mac clone enable bit'. Meaning unclear.mac-clone-reg11h - MAC clone enable. 0: normal mode, learning MAC addresses from packet source address only, ADM6996L fill/search MAC table by source or destination addresses only. 1: MAC clone mode, learning with source address, VID0. ADM6996L fill/search MAC table by SA or DA with VID0. This bit let chip learn two same addresses with different VID0.mii-speed-double - port5 MII CLK maximum speed 0: 25MHZ, 1: 50MHZport-led - port 4 len mode 1: link/act/speed 0: link/act/dupcol/speedreplace-vid01-with-pvid - replaced packet VID0,1 by port VLAN ID. 1: enable, 0: disablespeed-led - dual speed hub led display Values: 0-1.storming - broadcast storming threshold. The broadcast packets over the rising threshold withing 50ms will be discarded by the treshold setting. The max packet number is 7490 in 100Base, 749 in 10Base. Values: 0-3 If all ports 100TX: val: 0 1 2 3 rising thrs. - 10% 20% 40% falling thrs. - 5% 10% 20% If not all ports 100TX: val: 0 1 2 3 rising thrs. - 1% 2% 4% falling thrs. - 0.5% 1% 2%tag-shift - tag shift for VLAN groupping Values: 0-7 see portX/vlan-mask fopr explanation tos-prio - mapped priority queue of tag (TOS) value 0-7 Values: 0-3 for each of 8 tags see comments for vlan-prio.trunk - enable port 3,4 as Trunk port 1: enable, 0: disable vlan-mode - vlan mode select 0: by-pass mode with port based VLAN 1: 802.1q based VLANvlan-prio - mapped priority queue of tag (VLAN) value 0-7 Values: 0-3 for each of 8 tags The weight ratio of priority queues is Q3:Q2:Q1:Q0 = 8:4:2:1 note: the default is port based priority for un-tag packet and non_IP frame.reg_2c_bit_11 - 0, 1. unknown. see vlan-groups comments.VLAN settings:~~~~~~~~~~~~~adm6996/vlan-groups/0adm6996/vlan-groups/1...adm6996/vlan-groups/15 Configures how vlans commutates to switch ports 0-5. 1: vlan is connected to port (enable packets output) 0: vlan is not connected. (note: ADM6996L docs refers to reg_2c_bit_11 here: "16 VLAN group: See Register 0x2c bit 11=0", but this bit marked reserved).VLAN settings description~~~~~~~~~~~~~~~~~~~~~~~~~ADM6996L supports bypass mode and untagged port as default settings while the chip is power on. (NB. WRT54 et driver is actually utilizing vlan mode anduntagged port). Thus, every packet with or without tag will be forwarding todestination port without and modification by ADM6996L. Meanwhile port-baseVLAN could be enabled according the PVID value (portX/vlan-group) of theconfiguration content of each port.ADM6996L also supports 16 802.1Q VLAN groups. If coming packet is non VLANpacket then ADM6996L will use PVID value as VLAN group reference, otherwise itwill use packet's VLAN value.User can define each port as Tag port or Untag port (portX/tagging). On taggedports ADM6996L honor input packets VLAN values (instead or port PVID value)and adds VLAN tag to the output packets.Priority description~~~~~~~~~~~~~~~~~~~~portX/tos-over-vlan-prioportX/port-prioportX/port-prio-enabletos-priovlan-prioADM6996L provides 4 priority queues Q0-3 with packet flow ratio 8:4:2:1. Thepriority function can be set thee ways as below:1. By port base: Set specific port to specific queue. ADM6996L only check theport priority and not check packet's content VLAN and TOS.2. By VLAN first: ADM6996L check VLAN priority first then IP TOS priority.3. By IP TOS first: ADM6996L check IP TOS priority first then VLAN priotity.If port set at VLAN/TOS priority but receiving packet without VLAN or TOSinformation then port base priority will be used.MAC Clone description~~~~~~~~~~~~~~~~~~~~~ mac-clone-reg11hmac-clone-reg30h (reserved?)If user's ISP vendor (cable modem) lock Registrations Card's ID (MAC address)then Router CPU must send this Lock Registration Card's ID to WAN port. Onecondition happen is there exist two same MAC ID on this Switch. One isoriginal Card and another one is CPU. This will make Switch learning tabletrouble.ADM6996L provide MAC Clone function that allows two same MAC address withdifferent VLAN ID0 on learning table. This will sovle lock registration card'sID issue.VLAN usage examples~~~~~~~~~~~~~~~~~~Let's we need to group 1-2 ports in VLAN#0, 3-4 in VLAN#1 and make port 0(WAN) tagged VLAN#0 + VLAN#1 port (say - we have 802.1q enabled router orswitch connected to port0). What we need to do is:1. reset tag-shift (just in case) echo 0 > /proc/sys/dev/adm6996/tag-shift 2. set PVID#0 to ports 1-2 echo 0 > /proc/sys/dev/adm6996/port1/vlan-group-mask echo 0 > /proc/sys/dev/adm6996/port2/vlan-group-mask3. set PVID#1 to ports 3-4 echo 1 > /proc/sys/dev/adm6996/port3/vlan-group-mask echo 1 > /proc/sys/dev/adm6996/port4/vlan-group-mask4 set ports 1-4 untagged and port 0 tagged. also set internal port 5 tagged (just in case) echo 0 > /proc/sys/dev/adm6996/port1/tagging echo 0 > /proc/sys/dev/adm6996/port2/tagging echo 0 > /proc/sys/dev/adm6996/port3/tagging echo 0 > /proc/sys/dev/adm6996/port4/tagging echo 1 > /proc/sys/dev/adm6996/port0/tagging echo 1 > /proc/sys/dev/adm6996/port5/tagging5. set switch mode to 802.1q (that's default, just in case) echo 1 > /proc/sys/dev/adm6996/vlan-mode6. set vlan#0 grouping to ports 0, 1-2 and to internal port 5 echo 1 1 1 0 0 1 > /proc/sys/dev/adm6996/vlan-groups/07. set vlan#1 ports groupping to ports 0, 3-4 and to internal port echo 1 0 0 1 1 1 > /proc/sys/dev/adm6996/vlan-groups/18. configure 802.1q inteface for vlan#0 vconfig add eth0 0 ifconfig vlan0 X.X.X.X netmask ....... broadcast ...... 8. configure 802.1q inteface for vlan#1 vconfig add eth0 1 ifconfig vlan1 X.X.X.X netmask ....... broadcast .......
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -