May 8, 20012 USB Client Driver Etiquette Jay Senior Windows Base Developer Microsoft.

Slides:



Advertisements
Similar presentations
Primary Author: Girish Verma Secondary Author(s): Navya Prabhakar Presenter: Navya Prabhakar Company/Organization: CircuitSutra USB Modeling Quick Start.
Advertisements

WDM 드라이버의 기본 구조 What is WDM?
May 17, USB Power Management Brad Hosler USB Engineering Manager Intel Corporation.
So, you think you need USB On-The-Go?. Agenda Introduction Embedded Host terminology OTG – Electrical – Protocol When to use OTG 2.
Presented by Team 3350 (T-BOTS).  Students should lead their teams in the building, design, and all other aspects of the robot.  Knowledge of the Kit.
Fidelity Test – Import and Export Introduction and Troubleshooting Matthew van Eerde, Windows Sound.
®® Microsoft Windows 7 Windows Tutorial 8 Connecting to Networks with Mobile Computing.
Lecture 19 Page 1 CS 111 Online Protecting Operating Systems Resources How do we use these various tools to protect actual OS resources? Memory? Files?
USB: Data Flow Sukesh Shenoy. USB implementation areas.
USB – An Overview Group 3 Kaushik Nandha Bikram What is the Universal Serial bus (USB)? Is a cable bus that supports data exchange between a host computer.
I/O Request Flaw in WDF Kernel-Mode Driver
COMPUTER BACKUP A disaster will happen to you one day…an accidentally deleted file, a new program that caused problems or a virus that wreaked havoc, wiping.
Operating Systems.
Distributing Drivers on Windows Update
October 10, USB 2.0 Software Roadmap & Architecture Update Robert Ingman Lead Program Manager Windows Division Microsoft Corp.
Desktop Security: Worms and Viruses Brian Arkills, C&C NDC-Sysmgt.
A walkthrough of the SageQuest Mobile Control Online & ESC integration.
Computer Settings and Printing Tips Pennsylvania’s Protection From Abuse Database.
May 8, USB 2.0 Support in Windows ® Operating Systems Fred Bhesania Microsoft.
© 2003 Microsoft Corporation. All rights reserved. 1 Agenda (Part One) In-box USB support  Windows in-box USB class driver support matrix across Operating.
© 2003 Microsoft Corporation. All rights reserved. 1 Jason Kace WDEG – USB Core Team USB Client Driver Tips And Tricks: Part Two.
Tutorial 11 Installing, Updating, and Configuring Software
May 10, 2012 Lloyd Moore, President/Owner. Quick Start Video Building Mobility 1.2 SDK Emulator Quirks Installing On A Device Summary Overview.
N3RS Station Description Using the Acom 2S1s. What is a 2S1? At N3RS, we have installed Acom 2S1 “Transceiver Commutators” at both operating tables. These.
Hard Drive Overview: The UltraMax Plus, MiniMax and eGo Firewire+ Drives Erik Collett Chinese Product Launch IOMEGA CONFIDENTIAL.
Guide Demo Program installation SOP ePAD SW PM. Before you start Check “Guide” version is latest ( or ) * follow next page Latest version.
Move Pictures From Your Mobile Phone to Your PC.  You never know when a photo opportunity is going to arise, which is why having a camera phone can be.
Installing Windows 2000 BY: Joshua Wilburn, Arnol Vaquero.
Please Note: Information contained in this document is considered LENOVO CONFIDENTIAL For Lenovo Internal Use Only Do Not Copy or Distribute!! For Lenovo.
October 10, USB Power Management Brad Hosler USB Engineering Manager Intel Corporation.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Microsoft Windows 7 - Illustrated Unit P Managing Hardware.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
Platform Architecture Lab USB Performance Analysis of Bulk Traffic Brian Leete
© 2004 Microsoft Corporation. All rights reserved. 1 Minifilter Generated IO’s.
Page 1 Printing & Terminal Services Lecture 8 Hassan Shuja 11/16/2004.
Intel Open Source Technology Center Lu Baolu 2015/09
Tutorial 12 Managing Hardware and Networks
WHQL Code Coverage Prototype Program Andy Wen. 2 Agenda What is Code Coverage Prototype Program? What is Code Coverage Prototype Program? A prototype.
Page 1 of 38 Lenovo Confidential Lenovo Confidential Lenovo Confidential Lenovo Confidential Lenovo Confidential Please Note: Information contained in.
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
© 2004 Microsoft Corporation. All rights reserved. 1 Processing IO Operations.
John Samuels October, Why Now?  Vista Problems  New Features  >4GB Memory Support  Experience.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
Using the AFRESH software Ruaraidh Dobson University of Aberdeen V1.0 27/04/2016.
After Construction Name: Per #:.
Welcome POS Synchronize Concept 08 Sept 2015.
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Managing Windows Devices
NDIS-WDM Miniport Drivers Larry Cleeton Program Manager Windows Networking And Communications Microsoft Corporation.
USB PHYISICAL LAYER PROTOCOL ENGINE LAYER APPLICATION LAYER
EE-587 Spring FEB 08 William Mullins

iSERIES PROGRAMMING/LOGGING TRAINING
Canon Printer Support Ireland Toll-Free Number:
bh
Howto fix Boot Device Not Found Error or Hard Drive Not Detected on HP PC’s? How to fix Boot Device Not Found Error or Hard Drive Not Detected on HP PC’s?
A Power Reset is one of the best methods to fix lots of problems associated with your HP laptop, like Windows not.
How To Fix AOL Desktop Update Error AOL Helpline Number
How to Fix a “Scanner Failure” Message Error when Copying, Scanning, or Faxing?
USB- Universal Serial Bus
Chapter 3: Windows7 Part 2.
Introduction to writing device drivers for Windows
Chapter 3: Windows7 Part 2.
Greg Bell Business Development Mgr Industrial & Security Markets
How to Fix HP Printer Scanning Problems Using Scan Doctor?
Performing A Software Update on the IFD
Downloading to the NXT requires the correct hardware setup
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

May 8, USB Client Driver Etiquette Jay Senior Windows Base Developer Microsoft

May 8, Agenda w What not to do: Wreak Havoc. How? w Proper setup methods w Fun with IRPs and URBs w USB specific issues w High-speed specific issues w Power management w Testing tips and tools

May 8, Installing Your Device w Two install apis – UpdateDriverForPlugAndPlayDevices u Used if device has been plugged in. – SetupCopyOEMInf u Used if the inf is not being copied by the install. w Includes and Needs pragmas – No recursion on W2K w No redistribution of system files - specify sourcediskfiles – USBhub is always present on the system, so no need to copy – USBhub no longer backward compatible on W2K. w New section suffixes:.ntx86,.ntia64, see DDK for more.

May 8, Driver Basics w Think in terms of multithreaded – How many times should an URB be submitted? We’ve seen the same one get submitted more than once. w Never make assumptions in filter drivers w Tear down symbolic links on surprise removal IRP – IoSetDeviceInterfaceState(&SymbolicLinkName, FALSE); w Synchronize requests with pnp – Wait for aborts to complete before completing remove. – IoReleaseRemoveLockAndWait is your friend. w Don't leave a DbgBreakPoint in production code!

May 8, Ping-Pong IRPs w Make sure not to recursively send ping-pong IRP w On hot unplug, requests will complete quickly. – Don’t spin tightly on requests when a device returns error. Make sure to wait a while before re-submitting. w When you create an IRP and specify a completion routine, don't call IoMarkIRPPending in the completion routine. – There’s no more stack locations. – There’s no more stack locations.

May 8, USB Hand Grenade w Freeing the URB/IRP while it is pending in the USB stack w Don't free anything attached to an active request w Concept of ownership – Just because IoCancelIRP called, doesn't mean that the IRP is yours yet – To guard, make sure to wait for completion routine to get hit w In IRP_MN_REMOVE, can wait forever for requests to complete – IoReleaseRemoveLockAndWait

May 8, Timing Out Requests w USB stack has no concept of timing out requests w Client driver's responsibility to timeout their own requests – Otherwise, the request might stay on the HW getting NAK'ed the whole time w Cancel after timeout case. – If you created the IRP, better have a completion routine! w USB specific Abort pipe – Keep track of outstanding requests and wait for requests to complete

May 8, Isochronous Devices w Need to be able to turn around requests quickly. w Put out two 4 ms frames -> Can’t keep up. w Submit two 32 ms frames and then party on one while it's pending -> Uh… Bad! w To get low latency use many small requests. w Proper solution: – Put down eight 4-ms requests.

May 8, Bus Interface w Available in W2K, WinME, and XP w Can be called at high IRQL w Expandable by specifying higher version number w IsDeviceHighSpeed w Example: – Is my device high speed? – Allows driver writer to write one driver

May 8, High-Speed USB w Making a device that works both 1.1 and 2.0. – Mostly only an issue when working with ISO. w Don't assume that there is still a max packet size of 64 bytes. – Retrieve it from endpoint descriptor. Potential max of 512 bytes. w Microframes - 8 microframes whereas there is only one frame on 1.1 – 32 packets would have gone in 32 frames previously. One frame is still 1 ms, but there are 8 microframes per frame. So queuing 32 packets will go over 4 frames.

May 8, Power Management on USB w Device States: – D0 is on – D2 is suspend. i.e. <= 500 uA – D3 is off w Once the hub PDO is not in D0, all requests will fail, so… – Cancel all pending requests before you send on the power down request to the hub PDO. w Don’t forget, power dispatch should at least have: – PoStartNextPowerIRP, – IoSkipCurrentIRPStackLocation – PoCallDriver

May 8, Selective Suspend w Allows bus to go to low power while PC is on w Allows processor to go to C3 and save battery w Understand the difference between system power down and selective power down – Track system power state, so that you don't power up without receiving a corresponding S0 IRP w USBhub does not power manage its PDOS – Whenever an idle IRP completes, must understand what power state you're in w See “SelSus” DDK example for more info

May 8, Testing Tips and Tools w Run the driver verifier! – More tests every day w Test devices – On all flavors - UHCI, OHCI and now EHCI. – On both XP and Win2K – While connected to an external hub u Slight electrical differences - overcurrent protection... w Test unplugging devices – While in use – While in low-power mode – While selectively suspended

May 8, Call to Action! w Use DDK tools like GenINF and CheckINF w Run appropriate WHQL HCT Kits on your devices – w The Windows XP DDK has the most recent sample code – DDK Developer / Product Support offers various support options w Contact the OEM / IHV Recon teams w Subscribe to the Windows Hardware Newsletter –