Reliable Linux Wireless - Techniques for Debugging Wireless Module Integrations STEVE DEROSIER / CAL-SIERRA CONSULTING

Similar documents
sottotitolo Network Administration Milano, XX mese 20XX A.A. 2016/17 Federico Reghenzani, Alessandro Barenghi

LAS16-TR06 Remoteproc & rpmsg development. Bjorn Andersson

UNIVERSITY OF TRENTO Dipartimento di Ingegneria e Scienza dell Informazione Laboratory of Nomadic Communications

How to fix Usually Slightly Broken devices and drivers?

Pico Computing. M 501 / M 503 Getting Started Guide. March 7, Overview 1. 2 System Requirements 1. 3 Ubuntu Linux Configuration 2

. Making the Linux Kernel better. Wolfram Sang , FOSDEM 14

CIS c. University of Pennsylvania Zachary Goldberg. Notes

USB System Design in Sitara Devices Using Linux. [Part 4]: Verify USB in Linux sysfs Bin Liu (EP, Processors)

FPGA Manager. State of the Union. Moritz Fischer, National Instruments

Configuring Skywire CAT 4 LTE and CAT 1 LTE Modems for MBIM Mode on Windows 8 and 10

Firmware Reprogramming Guide

Tracing Lustre. New approach to debugging. ORNL is managed by UT-Battelle for the US Department of Energy

Debugging Usually Slightly Broken Devices and Drivers

User Guide M.2 Development Kit (DVK-SU C) Version 1.0

ECE 471 Embedded Systems Lecture 20

LotOS Framework. Getting Started Guide for Banana Pi. Copyright (C) 2015 ilbers GmbH Revision 1.1,

Laboratory of Nomadic Communication. Francesco Gringoli University of Trento

Device to Cloud. Software Hardware Know How

Virtualised USB Fuzzing using QEMU and Scapy

ezconfig User s Manual

If you experience issues at any point in the process, try checking our Troublshooting guide.

Iwconfig Wlan0 Key Error For Wireless Request Set Encode

The Ephemeral Smoking Gun

User Guide SU60-SIPT Development Kit (DVK-SU60-SIPT) Version 1.0

Get Hardware System info on Debian Linux / How to detecting hardware and servers model on GNU / Linux

Using kgdb and the kgdb Internals

Wind River. All Rights Reserved.

Quick Start Guide WB50NBT. Version 1.1

Development Environment Embedded Linux Primer Ch 1&2

ECE 471 Embedded Systems Lecture 12

UART Thou Mad? An Introduction to the UART Hardware Interface. Mickey Shkatov. Toby Kohlenberg

Skywire Software Developer s Guide

ECE 471 Embedded Systems Lecture 16

Porting Linux to a New Architecture

4G LTE CAT 4 Skywire User Manual

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / Version Description Date. 0.1 Initiate 2014-Jun-21

About the Need to Power Instrument the Linux Kernel

Porting Linux to a New Architecture

Configuring the BeagleBone Black s Ethernet Port for SSH Access

Linux in the connected car platform

DRIVER STATION v1.0 UTILITY LOADER Created: 22DEC2008 FIRST DRIVER STATION UTILITY LOADER RE-IMAGE INSTRUCTIONS

Quick Guide for Wake on WLAN

Packet: Data can be broken into distinct pieces or packets and then reassembled after delivery. Computers on the Internet communicate via packets.

Wiring an LED Guide for BeagleBone (Black/Green) Table of Contents. by Brian Fraser Last update: November 16, Target Linux Kernel: 4.

VERSION Lab 3: Link Layer

RNG-406Uv2. USB 3.0 to Gigabit Ethernet Cable

ECE 471 Embedded Systems Lecture 16

Dynamic secure firmware configuration. Dan Handley (Arm)

AT Command Version 2.1 Application Note. This document provides information for controlling Ameba through external UART.

int $0x32 // call interrupt number 50

Overview. Wait, which firmware? Threats Update methods request_firmware() hooking Regression testing Future work

Efficient and Large Scale Program Flow Tracing in Linux. Alexander Shishkin, Intel

AL361A-EVB-A1. Multi-channel Video Processor EVB. Datasheet. (HDMI/AHD-to-HDMI) 2017 by AverLogic Technologies, Corp. Version 1.0

Ubuntu Server Hardware Certification Test Case Guide

The State of Kernel Debugging Technology. Jason Wessel - Product Architect for WR Linux Core Runtime - Kernel.org KDB/KGDB Maintainer

USB Audio Cards with a Raspberry Pi

USB ZigBee Adapter. User Manual. 1.0, Dec 2011

HITB Amsterdam

Universal Communicator

Passthrough in QEMU/KVM on Linux

FFADO: firewire audio for Linux.

Debugging Kernel without Debugger

How to set up your wireless network

Appendix A - Configuring the WiFi Module Option

ESP8089 Driver Release Description

Full file at

Configuration Request Retry Status (CRS) Handling. Sinan Kaya

How to install Toshiba Satellite L40 B14 Wireless Adapter ( ID 0bda:8197 Realtek Semiconductor Corp. RTL8187B) on Ubuntu and Debian Linux

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

CSCI 6907 PROJECT PROPOSAL LIGHTS OUT MANAGEMENT

Patrick Doyle Principal Software Engineer, irobot 2017 Embedded Linux Conference, Portland OR

Bridge Cable User s Guide

viommu/arm: full emulation and virtio-iommu approaches Eric Auger KVM Forum 2017

ECE 471 Embedded Systems Lecture 30

CIS 505: Software Systems

Getting Started with the RN-XV WiFly

Extending Fixed Subsystems at the TLM Level: Experiences from the FPGA World

Debugging uclinux on Coldfire

USB System Design in Sitara Devices Using Linux. [Part 6]: Use USB in Device Mode Bin Liu (EP, Processors)

Wireless Networking. Dennis Rex SCALE 3X

ECE 435 Network Engineering Lecture 11

UART HCI Bluetooth Module for Linux BT860

Kernel Internals. Course Duration: 5 days. Pre-Requisites : Course Objective: Course Outline

USB 3.0 Dual Port Gigabit. Ethernet Cable

Introduction PCI Interface Booting PCI driver registration Other buses. Linux Device Drivers PCI Drivers

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3

ZFSM-201-KIT-1 Wireless UART Application User Guide

Installation Guide for Linux

Computer Networks Security: intro. CS Computer Systems Security

Full Linux on FPGA. Sven Gregori

ECE 471 Embedded Systems Lecture 15

IMPORTANT: PLEASE READ THESE INSTRUCTIONS COMPLETELY BEFORE PROCEEDING WITH THIS BETA UPGRADE

IP Addressing, monitoring and packet analyzing

Network Intrusion Detection Systems. Beyond packet filtering

Wireless Extensions for Linux

MZ Firmware Release Notes

MANAGING THE CAR CLOUD CONNECTION.

16-311: Getting Started with ROBOTC and the. LEGO Mindstorms NXT. Aurora Qian, Billy Zhu

DOMINO: A System to Detect Greedy Behavior in IEEE Hotspots

Sierra Radio Systems. WiFly Configuration. Quick Reference. Version 1.0

Transcription:

Reliable Linux Wireless - Techniques for Debugging Wireless Module Integrations STEVE DEROSIER / CAL-SIERRA CONSULTING

IntroducIon 50 minutes?! How to work with WiFi modules with the Linux kernel - especially misbehaving ones! Overview of Linux WiFi basic concepts - chips and stack Interfacing of devices Debugging tools HOW TO GET HELP!

Why Steve derosier? Steve derosier - Principle Consultant at Cal- Sierra ConsulIng LLC 10 years working with WiFi and the Linux- Wireless community 17 years working with Embedded Linux Contributed to OSS in many projects: binuils, buildroot, linux- wireless, linux- mtd, ALSA, others Linux- wireless: ath6kl, libertas_v, o11s, brcmfmac, others Special knowledge of Laird s Linux wireless plavorms

WiFi Chips Full- MAC vs SoY- MAC Firmware Interfaces Other pins BT coexistence

WiFi Chips Full- MAC vs SoY- MAC Firmware Interfaces Other pins BT coexistence Chips fall into two major categories: full- and soy- MAC Primary difference is where upper- level logic resides Full: in chip s firmware SoY- MAC: in Linux s mac80211 Not be`er/worse, just different tradeoffs

WiFi Chips Full- MAC vs SoY- MAC Firmware Interfaces Other pins BT coexistence Most chips must load firmware Even soy- MAC chips have firmware Blobs from vendors, typically in /lib/firmware Linux- firmware git Load as late as possible to avoid delays or boot issues

WiFi Chips Full- MAC vs SoY- MAC Firmware Interfaces Other pins BT coexistence Virtually every hardware bus interface is represented SDIO USB PCIe Most drivers have muliple h/w interfaces h/w bus driver handles the bus; use the API but don t handle it directly Usually a bus- neutral abstracion layer for messaging

WiFi Chips Full- MAC vs SoY- MAC Firmware Interfaces Other pins BT coexistence

WiFi Chips Full- MAC vs SoY- MAC Firmware Interfaces Other pins BT coexistence BT integrated in some chips, not in others Pins for for BT, oyen UART Pins for coex OYen ignored; needs setup

Linux WiFi Network Stack

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Two types: Full and SoY- MAC Bus interfaces SDIO USB PCIe

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Depends on the bus Uses standard Linux bus driver Types SDIO USB PCIe others

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Two types, Full and SoY MAC SoY uses mac80211 Uses the bus driver to talk to the hardware Usually a bus- independent abstracion layer to support muliple buses (eg ath6kl_core + ath6kl_sdio ath6kl_usb)

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Linux WiFi MAC driver Used by SoY- MAC devices Use: ieee80211_ops ieee80211_alloc_hw ieee80211_register_hw

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Main configuraion API used All drivers (Full and SoYMAC) use it Replaced wext

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Userspace interface to cfg80211 Along with cfg80211 replaces wext No more ioctls

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data Basic tools like `ip`, `iw` and so on wpa_supplicant Higher level tools like NetworkManager, conman, etc

Linux wireless stack (from bo`om up) Chip and bus Bus driver WiFi device driver mac80211 (SoY- MAC) cfg80211 nl80211 User- space management Data From the data- applicaion side, no different than Ethernet or other systems Open UDP or TCP sockets

Interfacing

Interfacing So you ve got a new device, what do you do? Plug it in, get the device IDs from the relevant bus tools Determine what driver it matches hotplug loads it or modprobe if necessary If none, maybe it s similar to another chip? Add the bus device IDs to the exising driver Write from scratch?!? (call me!) Get the basics working first, then move on to the other features

Device IDs `lspci - nn` : 01:00.0 Network controller [0280]: Qualcomm Atheros AR93xx Wireless Network Adapter [168c:0030] (rev 01) `lsusb - v` : Bus 002 Device 002: ID 148f:2770 Ralink Technology, Corp. RT2770 Wireless Adapter sdio, use sysfs: # cd /sys/bus/sdio/devices/mmc0:0001:1 # cat vendor 0x0271 # cat device 0x0301

Device IDs in drivers Find and add to code as necessary Example: ath6kl, AR6003 0x0271:0x301 drivers/net/wireless/ath/ath6kl/hif.h drivers/net/wireless/ath/ath6kl/sdio.c

Good result

Bad result Is it plugged in correctly? Is it powered (someimes a power enable pin)? Does it announce on bus? Does it fail to load firmware? Does it come up and look OK, but fails on `ifconfig wlan0 up`? Does it work OK, but won t connect to an open AP? Does it connect to open AP but other features won t work? Kill NetworkManager (or equivalent)

A hunch is creativity trying to tell you something

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark By default, debug config opions are disabled brcmfmac: CONFIG_BRCMDBG ath6kl: ATH6KL_DEBUG, ATH6KL_TRACING

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark Lots of debug prining to kernel log. Need to ++ debug print level and enable specific messages. ath6kl: `echo 0x00140000 > /sys/module/ ath6kl_core/parameters/debug_mask`

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark Different drivers have special module parameters. brcmfmac: debug - Sets debug level. The levels are defined in debug.h. Maintainer asks for kernel logs with debug level set to 0x1416, which shows driver- firmware interacions. feature_disable - Override feature detecion to avoid its use in driver. ignore_probe_fail - Allow post- mortem debugging if firmware crash happens during probe. Check the forensics file in debugfs.

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark Best place to check for existence, can walk the bus tree Shows you bound driver, etc

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark brcmfmac: revinfo - revision of h/w and firmware features - firmware features msgbuf_stats (pcie only) - stats counters of msgbuf layer counters (sdio) - stats counter of sdio bus layer console_interval (sdio) - period to obtain fw console content forensics (sdio) - dump fw console and trap info

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark Many drivers will dump firmware crashes to sysfs file brcmfmac: /sys/class/devcoredump

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark Kernel s funcion tracer Must enable Useful to dig through call- stacks and figure out what s going on live Also can profile the stack

trace- cmd Yrace

kernelshark Yrace

Debugging tools kconfig debug opions dmesg module parameters sysfs debugfs coredump Yrace Wireshark Device is working, but actual communicaion fails Do the packets go on the air? Is there something wrong with what s going on?

Wireshark

Geqng help linux- wireless list - need more than it doesn t work : enable debugging features send kernel logs with those debugging on be specific about hardware, device, firmware version, Linux version etc. be specific about what doesn t work and what you ve tried expect to include wireless captures

Links Linux- wireless wiki: h`ps://wireless.wiki.kernel.org/ Linux- firmware: h`ps://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux- firmware.git/ Linux wireless mailing list: h`ps://wireless.wiki.kernel.org/en/developers/mailinglists Help with iwlwifi: h`ps://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/debugging

STEVE DEROSIER steve@cal-sierra.com +1-916-203-5695