[[PageOutline]] = Emissions Testing = == Wired Networking == === Gigabit Ethernet - Test modes === Often users ask us how they can make the wired network transmit for emissions testing purposes. Of the standard set of Gigabit Ethernet PHY registers the '''1000BaseT Control''' (R9) allows configuring one of 4 test modes by setting bits 13:15: * 0 - Normal Mode * 1 - Test Mode 1 - Transmit Waveform Test * 2 - Test Mode 2 - Transmit Jitter Test (MASTER mode) * 3 - Test Mode 3 - Transmit Jitter Test (SLAVE mode) * 4 - Test Mode 4 - Transmit Distortion Test You should consult the datasheet for the specific PHY being used for more information on these test modes. References: * http://lxr.free-electrons.com/source/include/uapi/linux/mii.h - linux header file showing standard register names and bit values * http://ftp.psu.ac.th/pub/scyld/mii-status.html * http://www.ieee802.org/3/ab/public/nov97/1gig.an.presentation1.pdf === MII register access in uboot === You 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: {{{ Ventana > mii info PHY 0x00: OUI = 0x5043, Model = 0x1D, Rev = 0x01, 100baseT, FDX Ventana > mii dump 0x00 0x05 5. (cde1) -- Autonegotiation partner abilities register -- (8000:8000) 5.15 = 1 next page able (4000:4000) 5.14 = 1 acknowledge (2000:0000) 5.13 = 0 remote fault (1000:0000) 5.12 = 0 (reserved) (0800:0800) 5.11 = 1 asymmetric pause able (0400:0400) 5.10 = 1 pause able (0200:0000) 5. 9 = 0 100BASE-T4 able (0100:0100) 5. 8 = 1 100BASE-X full duplex able (0080:0080) 5. 7 = 1 100BASE-TX able (0040:0040) 5. 6 = 1 10BASE-T full duplex able (0020:0020) 5. 5 = 1 10BASE-T able (001f:0001) 5. 4- 0 = 1 selector = IEEE 802.3 Ventana > mii read 0x00 0x09 0300 # set test mode 1 (set bit 13) Ventana > mii write 0x00 0x09 0x2300 Ventana > mii read 0x00 0x09 2300 # set test mode 2 (set bit 14) Ventana > mii write 0x00 0x09 0x4300 Ventana > mii read 0x00 0x09 4300 # set test mode 3 (set bit 13,14) Ventana > mii write 0x00 0x09 0x6300 Ventana > mii read 0x00 0x09 6300 # set test mode 4 (set bit 15) Ventana > mii write 0x00 0x09 0x8300 Ventana > mii read 0x00 0x09 8300 }}} * Note the 'dump' command describes the bits but only supports R0-R5 === MII register access in Linux === Many 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. The Linux API for this is the SIOCGMIIREG/SIOCSMIIREG ioctls. Attached is a simple application using these to read and write mii regs within linux. For example: {{{ root@OpenWrt:/# ./mii-reg eth0 0x9 eth0 phyid=0x00 reg=0x09 val=0x0300 root@OpenWrt:/# ./mii-reg eth0 0x9 0x2300 # set test mode 2 eth0 phyid=0x00 reg=0x09 val=0x2300 root@OpenWrt:/# [ 86.264882] libphy: 2188000.ethernet:00 - Link is Down [ 86.270141] br-lan: port 1(eth0) entered disabled state root@OpenWrt:/# ./mii-reg eth0 0x9 0x300 # set normal mode eth0 phyid=0x00 reg=0x09 val=0x0300 root@OpenWrt:/# [ 91.264923] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full }}} See [attachment:mii-reg.c] for source coe == Wireless Networking == === 802.11 !WiFi === ==== TX99 ==== TX99 support enables Specific Absorption Rate (SAR) testing. SAR 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. TX99 should only be enabled on systems undergoing certification testing and evaluation in a controlled environment. TX99 is supported within the wireless drivers and exists for the following: * madwifi - out of tree unsupported driver for Atheros ath5k 802.11abg radios * ath9k - since Linux 3.14 - mainline Linux mac80211 driver for ath9k 802.11abgn radios Examples: * ath9k: build kernel with CONFIG_ATH9K_TX99 {{{ # bring up a monitor mode device iw phy phy0 interface add moni0 type monitor ip link set dev moni0 up # set channel and rate # (see http://wireless.kernel.org/en/users/Documentation/iw#Modifying_transmit_bitrates) iw dev moni0 set channel 36 HT40+ iw set bitrates mcs-5 4 # set tx99 power and enable echo 10 > /sys/kernel/debug/ieee80211/phy0/ath9k/tx99_power echo 1 > /sys/kernel/debug/ieee80211/phy0/ath9k/tx99 }}}