Atheros Powerline Toolkit

Atheros Communications, Ocala FL USA

Edited by

Charles Maier

int6000-utils-1.1.9

Abstract

Atheros Communications offers the Atheros Powerline Toolkit free of charge to their customers. The toolkit contains C Language source code, GNU Makefiles and Microsoft Solution files to compile dozens of useful command-line programs for hardware engineers, software developers verification engineers. It also includes example shell scripts that use toolkit programs, in various ways, to interrogate, control and manage Atheros HomePlug® AV powerline devices. Programs are simple and compact, making them suitable for use in embedded systems where resources may be limited.

This Toolkit is intended for Linux-like environments but includes a Visual Studio 2003 solution file and pre-compiled versions of most programs, ready to run on Microsoft Windows platforms, but Atheros does not offer technical support for Microsoft Windows. Linux and Windows applications share a common codebase but WinPcap™ must be installed in order to use Toolkit programs on Microsoft Windows platforms.

New users should read the entire first chapter of this document before starting to use the toolkit. This will probably answer most questions concerning installation, structure, content and application.

HomePlug® AV is a registered trademark of the HomePlug Powerline Aliance. Linux™ is a trademark of Linus Tovalds. Windows® is a registered trademark of Microsoft Communications. INT6000™, INT6300™, INT6400™ and AR7400™ are products of Atheros Communications.


Table of Contents

1. Toolkit Overview
Introduction
Background
Toolkit Distribution
Toolkit Installation on Linux
Toolkit Installation on GNU/Linux™
Toolkit Documentation on GNU/Linux
Toolkit Removal on GNU/Linux™
Toolkit Installation on Mac OS X
Toolkit Installation on Windows XP™
Toolkit Installation on Windows XP™
Setting the PATH variable
Toolkit Removal on Windows XP™
AV-ator™ Widget Installation on Windows
Widget Installation on Windows
Widget Removal on Windows
Toolkit Programs
Toolkit Folders
Toolkit Support
2. Hardware
Introduction
Device Form Factors
Device Communications
Device Configurations
Local Host to Local Device
Local Host to Remote Device
Local Host to Remote Host
Powerline Workstations
Host Hardware
Host Software
Network Configuration
Isolated Power-strip
Send-to-self Patch
3. Software
Introduction
Security Considerations
Platform Options
GNU/Linux
GNU/Linux with Libpcap
GNU/Linux with BPF
Mac OS X™ with BPF
Windows XP™ with Winpcap
GNU Makefiles on Linux
Stand-alone Compiling on GNU/Linux
Cross-Compiling on GNU/Linux
Compilation with Visual Studio .NET 2003
Microsoft Solution Files
Header Files
Compiler Constants
Platform Constants
Ethernet Constants
LibPcap, WinPcap and BPF
Structure Packing
Endian-ness
Packet Basics
Frame Encoding
API Message Handling
4. Firmware
Introduction
Firmware Components
Bootloader
Softloader
Memory Configuration Parameters
Runtime Firmware (MAC Software)
Parameter Information Block (PIB)
Architecture Overview
Firmware Boot Process
Boot from Host Configuration
Things to Remember
Every Little Bit Hurts
Liar! Liar! Pants on Fire!
Upgrade Device (INT6000/INT6300/INT6400)
Update Local Host (INT6000/INT6300/INT6400)
Boot from Host (INT6000)
Boot from Host (INT6300)
Boot from Host (INT6400)
5. Procedures
Introduction
Select an Interface on Linux
Select an Interface on Windows
Identify a Device
Browse the Network
Forming a Network
Configure a Device
Upgrade Firmware and PIB
Upgrade PIB Only
Start a Device
Test a Device
Program NVRAM
Trouble-shoot Problems
6. Scripting
Introduction
Linux Script Basics
Host Independence
Checking Device Connection
Random Device Identity
Actual Device Identity
Editing a PIB
Initialize a Device
Update a Device
Generating Powerline Traffic
Reading PHY Rates
User Interaction
7. Embedded Applications
Introduction
ADM5120™
Connections
USB-to-Serial Port Connection
Bootloader Menu
AMiLDA™
Compiling
Firmware Images
Downloading Images
Busybox™
Ramdisk
Atheros Toolkit
Web Interface
Atheros Toolkit
Integration
Configuration
HTTP Interface
8. Embedded API Reference
Introduction
External API Functions
ihpapi_InitializeDevice
ihpapi_UpdateDevice
ihpapi_ResetDevice
ihpapi_RxFrame
ihpapi_TxFrame
ihpapi_ManageEnetPHY
ihpapi_SetSDRAMConfig
ihpapi_GetVersionInfo
ihpapi_GetManufacturerInfo
ihpapi_SetKey
ihpapi_GetNetworkInfo
ihpapi_GetConnectionInfo
ihpapi_GetToneMapInfo
Internal API Functions
EncodeEthernetHeader
EncodeAtherosHeader
ihp_DecodeGetVersion
ihp_DecodeLinkStats
ihp_DecodeNetworkInfo
ihp_DecodeSetKey
ihp_DecodeMfgString
ihp_DecodeHostAction
ihp_DecodeResetDevice
ihp_DecodeResetToFactoryDefaults
ihp_DecodeSetSDRAMCfg
ihp_DecodeGetToneMapInfo
ihp_DecodeEthernetPHYSettings
ihp_DecodeGetRxToneMap
ihp_DecodeSetLEDBehavior
ihp_DecodeStartMAC
ihp_DecodeReadModule
ihp_DecodeWriteModule
ihp_DecodeWriteMemory
ihp_DecodeFlashNVM
ihp_DecodeGetNVM
ihp_SequenceReadModule
ihp_SequenceWriteModule
ihp_SequenceWriteMemory
ihp_FindFWHeader
9. Support Function Reference
Introduction
Command Line Functions
alert
assist
basespec
bytespec
checkfilename
dataspec
error
expect
getoptv
ipv4spec
ipv6spec
lookup
putoptv
synonym
uintspec
version
Ethernet Functions
channel
closechannel
openchannel
readpacket
sendpacket
Network Functions
NetworkBridges
NetworkDevices
Generic Functions
binout
checksum32
checksum_32
decout
endian
fdchecksum32
fdchecksum_32
filepart
hexdecode
hexdump
hexencode
hexin
hexout
hexstring
hexview
memdecr
memincr
memout
memswap
strdecr
strfbits
strincr
todigit
typename
Message Debug Functions
MMECode
MMEMode
MMEName
MMEPeek
Key Generation Functions
MACPasswords
HPAVKeyDAK
HPAVKeyNMK
HPAVKeyNID
HPAVKeyOut
SHA256Block
SHA256Fetch
SHA256Ident
SHA256Match
SHA256Print
SHA256Reset
SHA256Write
XML Editing Functions
xmledit
xmlfree
xmlnode
xmlopen
xmlscan
xmlschema
xmltree
Lexical Scanning Functions

List of Figures

1.1. WIndows Installer Dialogue
1.2. Control Panel System Dialogue
1.3. Control Panel Add/Remove Dialogue
1.4. The AV-ator Widget
4.1. Simple Network
4.2. Upgrade Device (INT6000/INT6300/INT6400)
4.3. Update Local Host (INT6000/INT6300/INT6400)
4.4. Boot from Host (INT6000)
4.5. Boot from Host (INT6300)
4.6. Boot from Host (INT6400)

List of Tables

4.1. Softloader/Bootloader MMEs
4.2. Device Identification

List of Examples

1.1. Toolkit Installation on GNU/Linux™
1.2. Toolkit Removal on GNU/Linux™
1.3. Setting the PATH variable on OS X™
1.4. Installing the Toolkit on Mac OS X™
2.1. “send-to-self” Patch Description
2.2. “send-to-self” Patch Application
2.3. “send-to-self” Patch Installation
2.4. “send-to-self” Patch Listing
3.1. The MAKEFILE constant
3.2. Stand-alone Compiling on GNU/Linux
3.3. Cross-compiling with make.def
3.4. Microsoft Visual Studio .NET 2003
3.5. Packing Structures with keyword “__packed”
3.6. Packing Structures with Attribute “packed”
3.7. Packing Structures with the Pragma “pack”
3.8. Packing Structures the Atheros Way
3.9. Frame Encoding by Offset
3.10. Frame Encoding by Address
3.11. Message Handling Loop
5.1. Selecting another Interface on Linux
5.2. Changing the Default Interface on Linux
5.3. Finding Interfaces on Linux
5.4. Selecting another Interface on Windows
5.5. Finding Interfaces on Windows
5.6. Device Identification
5.7. Inspecting Device Configuration
5.8. Display Network Information
5.9. Setting the Network Membership Key
5.10. Forming a Custom Network
5.11. Remote Network Configuration
5.12. Read a PIB File
5.13. Modify a PIB File
5.14. Save a PIB File
5.15. Upgrade Firmware and PIB
5.16. Upgrade local device PIB
5.17. Upgrade remote PIB
5.18. Start Firmware with int6kf
5.19. Start Firmware with int6kboot
5.20. Flash NVRAM with int6kf
5.21. Flash NVRAM with int6k
6.1. hardware.sh
6.2. firmware.sh
7.1. ADM5120™ Boot Menu
7.2. Using script download.sh
7.3. Using script flash.sh
8.1. Message Handling Loop
9.1. Enumerating Local Devices
9.2. Enumerating Network Devices
9.3. SHA256 Digest Computation
9.4. XML Source File
9.5. XML Edit Schema
9.6. XML Parse Tree