Changes between Initial Version and Version 1 of conformance_testing


Ignore:
Timestamp:
10/22/2017 05:28:45 AM (2 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • conformance_testing

    v1 v1  
     1[[PageOutline]]
     2
     3= Emissions Testing =
     4
     5== Wired Networking ==
     6
     7=== Gigabit Ethernet - Test modes ===
     8Often users ask us how they can make the wired network transmit for emissions testing purposes.
     9
     10Of the standard set of Gigabit Ethernet PHY registers the '''1000BaseT Control''' (R9) allows configuring one of 4 test modes by setting bits 13:15:
     11 * 0 - Normal Mode
     12 * 1 - Test Mode 1 - Transmit Waveform Test
     13 * 2 - Test Mode 2 - Transmit Jitter Test (MASTER mode)
     14 * 3 - Test Mode 3 - Transmit Jitter Test (SLAVE mode)
     15 * 4 - Test Mode 4 - Transmit Distortion Test
     16
     17You should consult the datasheet for the specific PHY being used for more information on these test modes.
     18
     19References:
     20 * http://lxr.free-electrons.com/source/include/uapi/linux/mii.h - linux header file showing standard register names and bit values
     21 * http://ftp.psu.ac.th/pub/scyld/mii-status.html
     22 * http://www.ieee802.org/3/ab/public/nov97/1gig.an.presentation1.pdf
     23
     24
     25=== MII register access in uboot ===
     26You can read and write PHY registers from uboot via the '''mii''' command as the following example shows using a Ventana board to access eth0's PHY:
     27{{{
     28Ventana > mii info
     29PHY 0x00: OUI = 0x5043, Model = 0x1D, Rev = 0x01, 100baseT, FDX
     30Ventana > mii dump 0x00 0x05
     315.     (cde1)                 -- Autonegotiation partner abilities register --
     32  (8000:8000) 5.15    =     1    next page able
     33  (4000:4000) 5.14    =     1    acknowledge
     34  (2000:0000) 5.13    =     0    remote fault
     35  (1000:0000) 5.12    =     0    (reserved)
     36  (0800:0800) 5.11    =     1    asymmetric pause able
     37  (0400:0400) 5.10    =     1    pause able
     38  (0200:0000) 5. 9    =     0    100BASE-T4 able
     39  (0100:0100) 5. 8    =     1    100BASE-X full duplex able
     40  (0080:0080) 5. 7    =     1    100BASE-TX able
     41  (0040:0040) 5. 6    =     1    10BASE-T full duplex able
     42  (0020:0020) 5. 5    =     1    10BASE-T able
     43  (001f:0001) 5. 4- 0 =     1    selector = IEEE 802.3
     44Ventana > mii read 0x00 0x09
     450300
     46# set test mode 1 (set bit 13)
     47Ventana > mii write 0x00 0x09 0x2300
     48Ventana > mii read 0x00 0x09       
     492300
     50# set test mode 2 (set bit 14)
     51Ventana > mii write 0x00 0x09 0x4300
     52Ventana > mii read 0x00 0x09       
     534300
     54# set test mode 3 (set bit 13,14)
     55Ventana > mii write 0x00 0x09 0x6300
     56Ventana > mii read 0x00 0x09       
     576300
     58# set test mode 4 (set bit 15)
     59Ventana > mii write 0x00 0x09 0x8300
     60Ventana > mii read 0x00 0x09       
     618300
     62}}}
     63 * Note the 'dump' command describes the bits but only supports R0-R5
     64
     65
     66=== MII register access in Linux ===
     67Many programs such as mii-tool and ethtool read and write MII regs, but don't expose a usage that lets you specify registers and/or values.
     68
     69The Linux API for this is the SIOCGMIIREG/SIOCSMIIREG ioctls. Attached is a simple application using these to read and write mii regs within linux.
     70
     71For example:
     72{{{
     73root@OpenWrt:/# ./mii-reg eth0 0x9
     74eth0 phyid=0x00 reg=0x09 val=0x0300
     75root@OpenWrt:/# ./mii-reg eth0 0x9 0x2300  # set test mode 2
     76eth0 phyid=0x00 reg=0x09 val=0x2300
     77root@OpenWrt:/# [   86.264882] libphy: 2188000.ethernet:00 - Link is Down
     78[   86.270141] br-lan: port 1(eth0) entered disabled state
     79
     80root@OpenWrt:/# ./mii-reg eth0 0x9 0x300 # set normal mode
     81eth0 phyid=0x00 reg=0x09 val=0x0300
     82root@OpenWrt:/# [   91.264923] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
     83}}}
     84
     85See [attachment:mii-reg.c] for source coe
     86
     87
     88== Wireless Networking ==
     89
     90=== 802.11 !WiFi ===
     91
     92==== TX99 ====
     93TX99 support enables Specific Absorption Rate (SAR) testing.
     94
     95SAR is the unit of measurement for the amount of radio frequency(RF) absorbed by the body when using a wireless device. The RF exposure limits used are expressed in the terms of SAR, which is a measure of the electric and magnetic field strength and power density for transmitters operating at frequencies from 300 kHz to 100 GHz. Regulatory bodies around the world require that wireless device be evaluated to meet the RF exposure limits set forth in the governmental SAR regulations.
     96
     97TX99 should only be enabled on systems undergoing certification testing and evaluation in a controlled environment.
     98
     99TX99 is supported within the wireless drivers and exists for the following:
     100 * madwifi - out of tree unsupported driver for Atheros ath5k 802.11abg radios
     101 * ath9k - since Linux 3.14 - mainline Linux mac80211 driver for ath9k 802.11abgn radios
     102
     103Examples:
     104 * ath9k: build kernel with CONFIG_ATH9K_TX99
     105{{{
     106# bring up a monitor mode device
     107iw phy phy0 interface add moni0 type monitor
     108ip link set dev moni0 up
     109
     110# set channel and rate
     111# (see http://wireless.kernel.org/en/users/Documentation/iw#Modifying_transmit_bitrates)
     112iw dev moni0 set channel 36 HT40+
     113iw set bitrates mcs-5 4
     114
     115# set tx99 power and enable
     116echo 10 > /sys/kernel/debug/ieee80211/phy0/ath9k/tx99_power
     117echo 1  > /sys/kernel/debug/ieee80211/phy0/ath9k/tx99
     118}}}