Mobile Broadband Driver Development for Windows 7 Malayala Srinivasan (Srini) Senior Program Manager...
Transcript of Mobile Broadband Driver Development for Windows 7 Malayala Srinivasan (Srini) Senior Program Manager...
Mobile Broadband Driver Development for Windows 7
Malayala Srinivasan (Srini)Senior Program Manager LeadWireless WAN - Microsoft IDC [email protected]
Agenda
• Session Goals
• Mobile Broadband in Windows 7
• Driver Design Challenges
• Driver Development Stages
• Call to Action
Session Goals
• This session is targeted for the Mobile Broadband driver developer community and will:
• Introduce Mobile Broadband (MB) driver development for
Windows 7
• Identify and prepare for key driver design areas in Windows 7
• Help in getting ready for MB driver development in Windows 7
Terminology
• Mobile Broadband is also referred as • Wireless WAN• WWAN• MB
• VAN UI – View Available Networks UI is• Windows Vista’s “Connect to network” UI equivalent in
Windows 7• Launched either through “Connect To” or “Network Tray Icon”
• Mobile Broadband Driver is also referred as• IHV Miniport Driver• MB Driver• Miniport Driver
Mobile Broadband in Windows 7
• Driver developers must use the “Mobile Broadband Driver Model Specification” for Windows 7
• Supports packet-switched data connectivity over the Wireless WAN (3GPP / 3GPP2) devices
• Based on NDIS6.20 miniport driver model
• Control path designed for slow response devices (AT command based)
• Data path optimized for Wireless WAN devices
• New logo program for Mobile Broadband devices in Windows 7
• New APIs for Mobile Broadband user-mode application development in Windows 7
WWAN Miniport Driver
NDISUIO
Windows 7 Mobile Broadband Architecture
Provided by:
Microsoft
ISV
OEM
IHV
3rd Party Connection Manager
WWAN Service Profiles
WWAN Miniport DriverMB Miniport Driver
Use
r Mod
eKe
rnel
Mod
e
Mobile Broadband Driver Model
Mobile Broadband Driver Model
Command Line Interface
Command Line Interface
Mobile Broadband API
View Available Network UI Properties UI Connection Flow
Experience UI
Sess
ion
0
NDIS6.20 Data Path Optimizations for MB Devices
IHV Miniport Driver
NDIS 6.0
TCP/IP Stack
Send / Receive
802.3 Frames
NDIS 6.20
TCP/IP Stack
IHV Miniport Driver
Send / Receive
IP Frames
DHCP EmulationARP Emulation
Windows Vista Windows 7
Windows 7 IHV Miniport Drivers for Mobile Broadband can:• Take advantage of raw IP support in send/receive path• Eliminate DHCP and ARP spoofing in miniport drivers
Control Path Functionalities
• Mobile Broadband Driver Model defines the following control path functionalities for the IHV drivers
• Device State Management• Connectivity Management• Radio Control• SMS (Short Message Services)• PIN• Provisioned Contexts • Service Activation• Vendor Specific
Control Path for Mobile Broadband Drivers
• WWAN Service uses NDIS OIDs for control requests (SET or QUERY) to miniport drivers.
• Miniport drivers can respond asynchronously to WWAN Service.
• Device state changes can be notified to WWAN service using event notification by miniport drivers
Asynchronous Response
• Designed for slow responding AT command based devices
• Initiated by WWAN Service
• 2 Types : SET or QUERY
• RequestId is Non-NULL
WWAN Service
Miniport Driver
NdisOidRequest
Oid = OID_WWAN_CONNECTRequestHandle = 0x12345678
RequestId = 0x0000F00D…
Return
NDIS_STATUS_INDICATION_REQUIRED
NdisMIndicateStatusEx
StatusCode = NDIS_STATUS_WWAN_CONTEXT_STATE
DestinationHandle = 0x12345678RequestId = 0x0000F00D
ActivationState = WwanActivationStateActivated …
Device Responds
AT Cmd(s) to Device
Event Notification
• Used for device or network state changes
• Initiated by driver
• Request Id = NULL
WWAN Service
Miniport Driver
NdisMIndicateStatusEx
StatusCode = NDIS_STATUS_WWAN_CONTEXT_STATE
RequestId = 0x0ActivationState =
WwanActivationStateDeactivated …
Device / Networkstate change
MB Miniport Driver
WWAN Service
Custom IHV Features
• Framework provides vendor-specific OID for driver developers to implement IHV specific features
• WWAN Service provides a pass-through control path for Windows 7 applications to communicate with IHV drivers
3rd Party Apps / Connection Managers
OID
_WW
AN_V
END
OR_
SPEC
IFIC
ND
IS_S
TATU
S_W
WAN
_
VEN
DO
R_SP
ECIF
IC
Set V
endo
rSpe
cific
OnE
vent
Noti
ficati
on
Driver Design Challenges
OID Handler Implementation
• Understand AT commands and response from device.
• Responding to each OID may require sending multiple AT commands to device.
• Incorrect string processing in kernel mode may result in fatal failures. • See “Using Safe String Functions” in the WDK
http://msdn.microsoft.com/en-us/library/aa489552.aspx
• Partner with your Connection Manager application developer or firmware engineer to get more insight on AT command semantics.
• Some OID requests may require using device-specific AT commands.
• Some OID responses (e.g, network error code, service activation, and raw IP handling) may require firmware changes. Partner with your device firmware team to get firmware changed.
Asynchronous OID Handling
• WWAN Service may send multiple OIDs without waiting for the completion of the current OID request.
• Driver developers should design query OID handlers to send the requests to the device without serializing.
• For out-of-sequence device responses, use command tag in the response to associate the response with the corresponding request.
IHV and Operator-specific Commands
• Use OID_WWAN_VENDOR_SPECIFIC to implement custom features. For example: • SIM Tool Kit (STK) Commands• USSD Commands• Phonebook Commands• Voice Commands• Firmware-specific commands• And more …
• Use OID_WWAN_SERVICE_ACTIVATION to implement operator-specific service activation.
Staged Driver Development
Stage 0•Develop NDIS 6.0 driver or migrate from NDIS 5.x to NDIS 6.0 , if available•Use custom Connect / Disconnect Control OID•Test Send/Receive Path
Stage 1•Implement basic OIDs from MB Driver Model Spec.*•Test Connect / Disconnect experience with Windows 7 “VAN UI”•Make the AT command parsing implementation robust
Stage 2•Design and implement concurrent OID request handler.•Implement rest of the mandatory OIDs from MB Driver Model spec•Test PIN, roaming and profile related experience with Windows 7 UIs
Stage 3•Data Path: Migrate to NDIS 6.20 - Implement Raw IP support. Remove DHCP & ARP•Use MB Logo tests to find issues and fix them•Prepare for Mobile Broadband Device Logo
Driver Test Tools
Use existing Connection Manager Write simple connect /
disconnect app.
WwanDriverTestApp from WDK * Windows 7 VAN UI , Advance UI *
WwanDriverTestApp from WDK Windows 7 VAN UI , Advance UI Mobile Broadband Logo Tests
from WLK
WwanDriverTestApp from WDK Windows 7 VAN UI , Advance UI Mobile Broadband Logo Tests
from WLK
High Level TasksStage
* Available at the time of Windows 7 Beta
Test the driver in each stage
Development Best Practices
• Plan and implement the following items early in the development cycle of a Mobile Broadband driver :
• Log the AT commands and responses in a file. Helps in debugging and root cause analysis.
• Use Event Tracing to log configuration and network issues.• NdisWriteErrorLogEntry DDI for logging driver-related errors• NdisWriteEventLogEntry DDI for logging generic or network-related
issues • Use the optional description member “StringsList” to log meaningful and
actionable information regarding the error.
Call To Action
• Migrate existing NDIS 5.x mobile broadband drivers to NDIS 6.0• Helps in moving to NDIS 6.20-based Mobile Broadband Miniport model.• MB devices must be NDIS 6.20-based to get logo.
• Prepare for testing commercially deployed Mobile Broadband device solutions in Windows 7.
• Get ready for Windows 7-based driver development.• WDK will be available at the time of Windows 7 Beta.
• Review Mobile Broadband device logo requirements and send us feedback.
• Contact us at [email protected]
Resources• Mobile Broadband Logo Requirements on https://winqual.microsoft.com/
• Log in, click on the Logopoint link on the left side menu, and search for “MBN” requirements.
• WDK Documentation on MSDN• Porting NDIS 5.x Drivers to NDIS 6.0
http://msdn.microsoft.com/hi-in/library/ms795567(en-us).aspx• IP Helper
http://msdn.microsoft.com/hi-in/library/bb742902(en-us).aspx
• Check the Windows 7 Beta release for additional resources:• WDK documentation
• Mobile Broadband Driver Model Specification• Mobile Broadband Driver Test App (WwanDriverTestApp)• NDIS 6.20
• SDK documentation• Mobile Broadband API Specification
• Windows Logo Kit (WLK) • Mobile Broadband Logo Tests
• WHDC Web site at http://www.microsoft.com/whdc/default.mspx• Mobile Broadband Driver Development White Paper
Related SessionsSession Day / Time
NDIS 6.20 Overview Mon. 9:45-10:45 and Tues. 9:45-10:45
Unified Tracing and Network Diagnostics Framework Mon. 1:30-2:30 andWed. 11-12
Network Power Management in Windows 7 Tue. 5:15-6:15
Windows Logo Program Tests for NDIS Mon. 11-12Wed. 9:45-10:45
Lab: How to Debug an NDIS 6.20 Driver Mon. 2:45-3:45 and Wed. 9:45-10:45
Discussion: Porting Drivers to NDIS 6.20 Wed. 8:30-9:30
Extending Device Installation by Using Co-installers Mon. 4-5 andWed. 1:30-2:30
Using the Windows Feedback Loop to Deliver High-Quality Drivers Mon. 8:30-9:30 andWed. 8:30-9:30
Thank You!