shaun miles thesis

114
Analysis and Modelling of the Windows mLAN Driver A thesis submitted in partial fulfilment of the requirements for the degree of BACHELOR OF SCIENCE I!H HONO"RS IN CO#$"!ER SCIENCE Rhodes "ni%ersit& '(() B& Shaun #iles Super%ised b& $rofessor Ri*hard Foss

Upload: anonymous-rrgvqj

Post on 08-Jul-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 1/114

Analysis and Modelling

of the Windows mLAN Driver

A thesis submitted in partial fulfilment of the requirements for 

the degree of 

BACHELOR OF SCIENCE

I!H

HONO"RS IN CO#$"!ER SCIENCE

Rhodes "ni%ersit&

'(()

B&

Shaun #iles

Super%ised b&

$rofessor Ri*hard Foss

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 2/114

List of Figures

Abstract

!he purpose of this thesis is to e+pose the inner,-or.ings of the indo-s musi*Lo*al Area Net-or. /mLAN0 dri%er to aid in further resear*h of the mLAN s&stem1

mLAN represents an inno%ati%e en%ironment for net-or.ed high,speed transmission

of real,time audio and #I2I streams1 mLAN e+tends the IEEE 3456 ar*hite*ture7

-hi*h en*apsulates the essential features of a net-or.ed real,time multimedia s&stem1

An e+ploration of the mLAN ar*hite*ture and the indo-s 2ri%er #odel gi%es us

insight into the *ore *on*epts *entral to the *reation of the mLAN dri%er1 !he

indo-s 2ri%er #odel is the required form a dri%er must follo-1 2ri%erStudio is a

dri%er de%elopment tool that en*apsulates the indo-s 2ri%er #odel in a C88 librar&

frame-or.1 A d&nami* and stati* anal&sis of the mLAN dri%er is performed using the

indo-s 2ri%er #odel and the 2ri%erStudio frame-or. as referen*e1 !his

understanding -ill be e+pressed b& de%eloping an ob9e*t model of the mLAN dri%er7

and the do*umentation of the I:O Control *odes1

i

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 3/114

List of Figures

Acknowledgments

I -ould li.e to than. m& super%isor7 $rof1 Ri*hard Foss for his limitless help1 Alsothan.s to #ele.am !sega&e -ho spent man& hours helping me7 and gi%ing insights

into the -onderful nature of dri%ers1

ii

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 4/114

List of Figures

Table of Contents

ABSTRACT..............................................................................................................................................I

ACN!WL"D#M"NTS......................................................................................................................II

LIST !$ $I#%R"S................................................................................................................................&

'. INTR!D%CTI!N...............................................................................................................................'

313 $ROBLE# S!A!E#EN!1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111113

31' $RO;EC! #O!I<A!ION1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111113314 2OC"#EN! S!R"C!"RE111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'

(. M%SIC L!CAL AR"A N"TW!R.................................................................................................)

'13 IEEE 345611111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111162.1.1 The IEEE 1394 Architecture...................................................................................................4

2.1.2 Virtual and Physical Devices..................................................................................................6 

2.1.3 Summery ! "ire#ire "eatures................................................................................................$

'1' !HE #LAN E=!ENSION1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111>

2.2.1 The IE% 61$$3 S&eci!icatin..................................................................................................92.2.2 Data Transmissin................................................................................................................1'

'14 CHA$!ER  S"##AR?11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111113(

*. T+" WIND!WS DRI&"R M!D"L...............................................................................................''

413 I N!RO2"C!ION11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111133

41' O$ERA!IN@ S?S!E# CO#$ONEN!S11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111343.2.1 Plu( and Play )ana(er........................................................................................................13

3.2.2 P#er )ana(er....................................................................................................................14

3.2.3. I*+ )ana(er........................................................................................................................1,

414 I:O R E"ES! $ACE!S11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111133.3.1 I-P Data Structure................................................................................................................16 

3.3.2 I*+ Stac...............................................................................................................................1/ 

3.3.3 I-P 0ueues...........................................................................................................................1$3.3.4 I*+ %ntrl %des.................................................................................................................1$

416 2RI<ER  AN2 2E<ICE OB;EC!S111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111353.4.1 Driver +ect........................................................................................................................19

3.4.2 Device +ects......................................................................................................................2'

41) E N!R? R O"!INES11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111''3.,.1 DriverEntry...........................................................................................................................22

3.,.2 AddDevice.............................................................................................................................23

3.,.3 Dis&atch -utines.................................................................................................................23

3.,.4 StartI+..................................................................................................................................2,

41 CHA$!ER  S"##AR?1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111')

). C!M,%WAR" DRI&"RST%DI!................................................................................................ ..(-

613 2RI<ER 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'D4.1.1 DriverEntry...........................................................................................................................2/ 

4.1.2 Dis&atch"ilter.......................................................................................................................2$

4.1.3 AddDevice.............................................................................................................................2$

61' 2E<ICE AN2 S"BCLASS $ N$2E<ICE1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'>

614 LOER 2E<ICE AN2 S"BCLASS $ N$LOER 2E<ICE1111111111111111111111111111111111111111111111111111111111111111'5616 NON,2RI<ER  FRA#EOR  CLASSES1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111143

4.4.1 Ir&.......................................................................................................................................31

4.4.2 Driver)ana(e0ueue..........................................................................................................32

61) 2RI<ER S!"2IOS  ERNEL S!REA#IN@ SER<ICES FRA#EOR 111111111111111111111111111111111111111111111111114'61 CO#$ILIN@ A 2RI<ER 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111146

61D <ERSIONIN@ ISS"ES111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114661> CHA$!ER  S"##AR?11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114)

. !B/"CT0!RI"NT"D M!D"L !$ T+" MLAN DRI&"R.............................................. ......... ..*-

iii

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 5/114

List of Figures

)13 #E!HO2OLO@? OF ANAL?SIS11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114)1' O<ER<IE OF !HE CLASS S!R"C!"RE111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114D)1'13 E N!R? $OIN!S11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114>

,.2.2 ernel Streamin( )inidriver................................................................................................4'

,.2.3 I+%T Dis&atchin(...............................................................................................................43

)14 CHA$!ER  S"##AR?111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111164

-. I!CTL ANAL1SIS AND A,I D"SI#N...........................................................................................))

13 #LAN 2RI<ER  IOC!L CO2ES1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111666.1.1 IEEE 1394 ased mA5 I+%T cdes.................................................................................4,

6.1.2 Stream ased mA5 I+%T cdes.......................................................................................49

6.1.3 61$$3 ased mA5 I+%T cdes.........................................................................................,1

6.1.4 ASI+ ased mA5 I+%T cdes..........................................................................................,3

6.1., D) Streamin( ased mA5 I+%T cdes........................................................................,,

1' I#$LE#EN!A!ION ISS"ES11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)D14 CHA$!ER  S"##AR?1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)>

2. C!NCL%SI!N..................................................................................................................................3

D13 $RO;EC! S"##AR?11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)5

D1' F"!"RE E=!ENSIONS111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111(

4. R"$"R"NC"S...................................................................................................................................-'

A,,"NDI5.............................................................................................................................................-(

A1 IOC!L ANAL?SIS AN2 2OC"#EN!A!ION11111111111111111111111111111111111111111111111111111111111111111111111111111111111111' IEEE 1394 ased mlan I+%T cdes...................................................................................... ......62

 Ischrnus Stream ased mlan I+%T cdes.......................................................................... ..../2

 IE% 61$$3 ased mlan I+%T cdes.................................................................................. ......... ./6 

 ASI+ ased mlan I+%T cdes................................................................................................ .....$3

B1 A NAL?SIS AN2 2OC"#EN!A!ION OF 2A!A S!R"C!"RES "SE211111111111111111111111111111111111111111111111111111>D IEEE 1394 ased structs................................................................................................................$/ 

 Ischrnus Stream ased structs..................................................................................................94

 IE% 61$$3 ased structs................................................................................................................94Sundry structs cntained #ithin main structs..............................................................................1''

i%

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 6/114

List of Figures

List of Figures

Figure '13 IEEE 3456 $roto*ol La&ersGGGGGGGGGGGGGGGGG111115

Figure '1' IEEE 3456 $eer,!o,$eer Communi*ationGGGGGGGGGGGG13(

Figure 413 La&ered 2ri%er Ar*hite*tureGGGGGGGGGGGGGGGGG113)

Figure 41' I:O Request $a*.et Stru*tureGGGGGGGGGGGGGGGGG1'(

Figure 414 IR$ Stru*ture Relating to Sta*. Lo*ationsGGGGGGGGGGGG'3

Figure 416 2RI<EROB;EC! Stru*tureGGGGGGGGGGGGGGGGG'4

Figure 41) 2e%i*e ob9e*t *reationGGGGGGGGGGGGGGGGG111GG'6

Figure 41 Relationship bet-een I:O manager and IR$ pro*essingGGGGGG111'D

Figure 613 2ri%erStudio ClassesGGGGGGGGGGGGGGGGGGGG1'5Figure 61' H&potheti*al 2ri%er Sta*.GGGGGGGGGGGGGGGGGG144

Figure 614 IR$ %ersus Irp usageGGGGGGGGGGGGGGGGGGG1114)

Figure 616 A<Stream Ar*hite*tural O%er%ie-GGGGGGGGGGGGGG1114

Figure 61) 2ri%erStudio ernel Streaming Frame-or.GGGGGGGGGGG14

Figure )13 Ob9e*t #odel of mLAN 2ri%erGGGGGGGGGGGGGGGG16(

Figure )1' !he 2ri%erEntr& RoutineGGGGGGGGGGGGGGGGGG11163

Figure )14 !he Add2e%i*e RoutineGGGGGGGGGGGGGGGGGGG6'

Figure )16 !he 2ispat*hFilter RoutineGGGGGGGGGGGGGGGGG11164

Figure )1) !he mLAN ernel Streaming #inidri%er Class 2iagramGGGGG111166

Figure )1 Sequen*e 2iagram for Creating #inidri%erGGGGGGGGGGG116)

Figure )1D Sequen*e 2iagram of IOC!L 2ispat*hingGGGGGGGGGGG1116

Figure 13 Code e+*erpt from mlbusdr%io*tl1hJGGGGGGGGGGGGG1116D

Figure 1' ASIO Finite State 2iagramGGGGGGGGGGGGGGGGG111)D

Figure 14 E+tra*t from mlanbus1INFGGGGGGGGGGGGGGGGGG)5

Figure 16 ernel Streaming Ar*hite*tureGGGGGGGGGGGGGGGG1(

%

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 7/114

>1 Referen*es

1. Introduction

1.1 Problem Statement 

!he musi* Lo*al Area Net-or. /mLAN0 is a proprietar& te*hnolog& that ?amaha

 began de%eloping in 3554 KAE Notes7 '(()1 IEEE 3456 /Fire-ire0 -as *hosen as the

net-or.ing te*hnolog& for mLAN1 !he ob9e*ti%e of mLAN is to repla*e the m&riad of 

*ables7 plugs and MinM7 MoutM and MthroughM so*.ets on s&nthesiers7 mi+ers and other 

A:< equipment -ith a single *onne*tor1 !he mLAN s&stem represents a solid ad%an*e

in terms of net-or.ed real,time multimedia s&stems1 It is *hara*terised b& t-o

important features in real,time multimedia s&stems high band-idth and lo- laten*&1

Importan*e is atta*hed to resear*h -ithin the indo-s *onte+t7 as indo-s

represents a more *ommer*iall& %iable mar.eting option1 !he dri%er is responsible for 

the $C intera*ting -ith the self,managed Fire-ire bus7 -hi*h has mLAN e+tended

nodes interfa*ing to audio studio equipment1 !he $C7 through the dri%er7 be*omes a

 po-erful tool as it *an engage in *onne*tion management7 and audio re*ording and

 pla&ba*.7 a%ailable as an appli*ation suit that *omes -ith the s&stem1 In%estigation

into the full potential or the pursuing of other ideas -ithin the mLAN s&stem *an be

done through the use of appli*ations1

1.2 Project Motivation

!he aim of the pro9e*t is to *riti*all& anal&se the indo-s mLAN dri%er -ith regardsto an ob9e*t oriented approa*h1 In an effort to streamline the de%elopment of 

appli*ations for resear*h purposes7 or the possible modifi*ation of the mLAN dri%er7

an understanding of the dri%er is required1 !his understanding -ill be represented

-ith use of an ob9e*t oriented model1

3

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 8/114

>1 Referen*es

1.3 Document Structure

Chapter t-o *o%ers the mLAN s&stem1 !his entails e+amining the underl&ing

te*hnolog& in use b& the mLAN s&stem1 !he IEEE 3456 bus ar*hite*ture and the IEC

3>>4 spe*ifi*ation for audio and data transmission are the te*hnologies *o%ered1 !he

reasons supporting the features7 as to -h& the te*hnologies -ere *hosen7 are

dis*ussed1

!here are not a lot of approa*hes to dri%er de%elopment7 -hi*h is a -holl& intri*ate

and *ompli*ated pro*ess1 One is *onstri*ted in de%eloping a dri%er b& the operating

s&stem and the t&pe of dri%er it requires to interfa*e -ith the hard-are1 !o be more

spe*ifi*7 ea*h operating s&stem has a model in -hi*h dri%ers must fit to interfa*e -ith

the hard-are1 In this instan*e7 the fo*us of *hapter three -ill be on the usage of the

indo-s 2ri%er #odel /2#0 in dri%er de%elopment1

Chapter four e+tends the pre%ious *hapter as the mLAN dri%er ma.es use of a

 proprietar& 2ri%er 2e%elopment !ool from Compu-are *alled 2ri%erStudio1 !his

ma.es use of the 2#7 and in essen*e uses the indo-s 2ri%er 2e%elopment it to

 build a dri%er1 2ri%erStudio represents a frame-or. of C88 libraries and *lasses that

en*apsulate dri%er de%elopment1 It is rele%ant in e+amining the frame-or. model of 

*lasses in order to understand the ob9e*t model of the mLAN dri%er7 and ho- the& fit

into the 2#1

Chapter fi%e introdu*es the e+trapolated model of the mLAN dri%er7 e+plaining the

usage of the *lasses and ho- the& fit into the 2ri%erStudio frame-or.1 A des*ription

of the methodolog& of anal&sis used in abstra*ting the ob9e*t model and *lass

intera*tions is presented1 !his *hapter in%ol%es an o%er%ie- of the *lass model

stru*ture7 the *lasses in%ol%ed and ho- the& relate to ea*h other1 !his ta.es a

*on*eptual loo. at the underl&ing dri%er te*hnolog& used b& the mLAN dri%er7 su*h

the indo-s ernel Streaming ar*hite*ture1

Chapter si+ dis*usses the -or. done to do*ument the I:O Control /IOC!L0 *odes of 

the dri%er1 !he IOC!L *odes represent the *ore fun*tionalit& of the dri%er7 as a

'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 9/114

>1 Referen*es

ma9orit& of the pro*essing o**urs in response to IOC!L *alls to the dri%er1 It is

through the IOC!L *odes that appli*ations *an *ommuni*ate -ith the dri%er1

Finall&7 *hapter se%en *on*ludes the paper1

4

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 10/114

>1 Referen*es

2. Music Local Area Network

?amaha began de%eloping a s&stem to pro%ide single *able *onne*tions bet-een the

arra&s of standard audio studio equipment in an attempt to standardise digital audio

data transmission1 IEEE 3456 /Fire-ire0 -as *hosen as the foundation on top of 

-hi*h to build the mLAN s&stem7 for it addressed the man& aspe*ts required of the

 proposed s&stem1 !he mLAN s&stem *an operate independentl& of a *entral ser%er or 

a host *ontroller7 not requiring the use or the po-er of a *omputer1 Responsibilit& of 

management and *ontrol of the bus is automati* and falls to sele*ted nodes on the bus1

"sing the *omputer as a tool to %isuall& model the bus and to manage the *onne*tion

of nodes7 it e+tends the fun*tionalit& of the mLAN s&stem1 !his *hapter briefl&

introdu*es the mLAN s&stem b& firstl& *o%ering the underl&ing te*hnolog&1 !his

deals -ith rele%ant IEEE 3456 and IEC 3>>4 *on*epts1 Finall&7 the mLAN

e+tensions to those te*hnologies are presented1

2.1 IEEE 1394

2.1.1 The I 1!"# Architecture

IEEE 3456 is a spe*ifi*ation that defines a serial bus ar*hite*ture -ith a *ommon set

of *ore features that is an e+tension to the Control and Status Registers /CSR0

ar*hite*ture KAnderson7 35551 !he CSR is a standard definition to permit easier 

implementation of soft-are7 and allo-s interoperabilit& bet-een Fire-ire on different

 platforms1 It is based on the ISO:IEC 34'34 spe*ifi*ation that standardises the offsetlo*ations -ithin the initial register address spa*e1 !he CSR spe*ifies the arrangement

of an addressable spa*e range *ontaining data stru*tures that identif& the *omponents

of the bus7 be it a bus7 a bridge or a node7 the *omponents state and other information1

A node is *ontained -ithin the module and this represents a logi*al entit&1 A unit is a

fun*tional sub*omponent of a node7 for e+ample7 a 3456 node *ould ha%e a <ideo and

an Audio unit7 ea*h operated and *ontrolled independentl& b& its o-n soft-are1 Ea*h

node has its o-n Control and Status Registers /CSRs07 as -ell as spa*e for bus

6

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 11/114

>1 Referen*es

dependant registers7 defined b& IEEE 3456 KAnderson7 35551 !hese registers allo-

for interoperabilit& bet-een Fire-ire implementations on different hard-are

 platforms7 for easier implementation of the soft-are7 and bridging bet-een different

 buses t&pes using the same CSR ar*hite*ture1 !here is also a *onfiguration RO# for 

identif&ing the %endor and node spe*ifi* details1 "p to 4 nodes *an sit on one bus7

e+*ept that a data item *an be passed a ma+imum distan*e of 3 hops1 Buses ha%e

unique I2s -hi*h allo- for 3('6 buses theoreti*all& bridged together7 although there

are other ph&si*al limitations su*h as the ma+imum *abling distan*e KAE Notes7

'(()1

Ea*h bus has *ertain features that one node must handle /one that is *apable07 these

 being the bus management aspe*ts of the bus1 A single node7 the determined root

node7 has the responsibilit& of *ommen*ing *ommuni*ation -ith the other nodes b&

sending *&*le start pa*.ets7 s&n*hronising the nodes1 Other responsibilities in*lude the

iso*hronous resour*e manager and the bus manager1 Bus *onfiguration is automati*

and o**urs upon the dete*tion of a ne- node or the disappearan*e of a node7 or a bus

reset1 !he root is identified automati*all&7 as -ell as the responsibilities allo*ated to

*apable nodes nearest the root KAE Notes7 '(()1 !he Fire-ire bus7 as a result7

manages all aspe*ts of the bus itself1

Fire-ire supports t-o means of data transmission1 One is as&n*hronous transfers

-hi*h do not require a *onstant transfer rate7 and targeted to spe*ifi* unique node

addresses1 !he other is iso*hronous transfers that require a transfer of data at *onstant

inter%als1 !he data is broad*ast on a *hannel instead of to a unique node address7

allo-ing one or more nodes to pi*. up on that *hannel1 !his transfer t&pe requires

regular bus a**ess and thus has a higher bus band-idth priorit& KAE Notes7 '(()1

In figure '137 an o%er%ie- of the IEEE 3456 proto*ol la&ers is sho-n1 !he proto*ol

la&ers are a representation of the *ommuni*ation fun*tionalit& of a Fire-ire node7

simplif&ing and en*apsulating the inherent *on*epts KAE Notes7 '(()1 !he $h&si*al

la&er pro%ides the ph&si*al interfa*e to the serial bus7 re*ei%ing and transmitting bits

on the bus1 !he lin. la&er is an interfa*e for both iso*hronous and as&n*hronous data

transa*tions1 For as&n*hronous transa*tions7 the lin. la&er pro%ides the interfa*e

 bet-een the transa*tion la&er and the ph&si*al la&er1 !he lin. la&er for iso*hronous

)

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 12/114

>1 Referen*es

transa*tions interfa*es the appli*ation le%el and the ph&si*al la&er1 !he transa*tion

la&er is responsible for translating as&n*hronous transa*tions into the appropriate

requests1

$ig6re (.'7 I""" '*3) ,roto8ol Layers 9Anderson: '333;

2.1.2 $irtual and %h&sical 'e(ices

A *omputer must ha%e a dri%er to .no- ho- to interfa*e to an& atta*hed hard-are

de%i*e1 IEEE 3456 is a bus7 su*h that ea*h de%i*e on the bus is seen as a node1 A host

*ontroller /the *ard that allo-s the *omputer to *onne*t to the bus0 must appear as a

node in order for the *omputer to intera*t -ith the bus K#*enie7 '((41 In terms of 

the operating s&stem intera*ting -ith the bus7 it does so through the use of a bus

dri%er and a host *ontroller1 A bus dri%er is responsible for interpreting requests to

*ommuni*ate -ith the Fire-ire bus from an appli*ation or a *lient dri%er1 !he host

*ontroller *ontrols the ph&si*al I:O operations bet-een the $CI bus and the IEEE3456 bus1

A node on the IEEE 3456 bus needs a dri%er to tell the $C ho- to intera*t -ith the

de%i*e1 !here *an onl& be one dri%er for a host *ontroller in a $C7 limiting the number 

of *on*urrent dri%ers using the bus to one1 A host *ontroller is required for ph&si*al

a**ess to the bus7 and if onl& one dri%er *an use the bus at a time then the potential of 

IEEE 3456 te*hnolog& is limited K#*enie7 '((41 !he indo-s =$ and later 

%ersions of the 3456 bus dri%er allo- a user to enumerate de%i*es through the 3456

Appli*ation

!ransa*tion La&er 

As&n*hronous Iso*hronous

Lin. La&er 

$h&si*al La&er 

Bus #anagement

La&er 

Bus #anager 

Iso*hronous

Resour*e#anager 

C&*le #aster 

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 13/114

>1 Referen*es

 bus using *ustom de%i*e I2s1 !hese de%i*es do not ha%e to *orrelate to real hard-are7

and therefore allo- the use of %irtual de%i*es1 <irtual IEEE 3456 de%i*es represent

*onsiderable -or. in re*tif&ing the limitation of peer,to,peer 3456 *ommuni*ation1 A

%irtual de%i*e represents a logi*al de%i*e that has the same fun*tionalit& and

 pri%ileges as ph&si*al de%i*es1 It has an address spa*e and *an engage in

*ommuni*ation -ith nodes on the bus7 and nodes on the bus *an *ommuni*ate -ith

the %irtual de%i*e1 !he diagram belo- presents the use of enumerated %irtual Fire-ire

de%i*es bet-een t-o $Cs o%er a Fire-ire bus1 !he $lug and $la& manager /Refer to

Chapter 40 *an be used to enumerate a %irtual de%i*e su*h that it appears as a ph&si*al

de%i*e1 !he o%als are to dra- attention to the implementation of a ne- dri%er sta*. 

implemented to a*hie%e the usage of %irtual de%i*es1 !he same dri%er sta*. is

appli*able for a $C,to,Fire-ire bus *ommuni*ation1

$ig6re (.(7 I""" '*3) ,eer0To0,eer Comm6ni8ation 9M8en<ie: (==*;

D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 14/114

>1 Referen*es

2.1.! )ummer& of Firewire Features

Features responsible for the usage of Fire-ire as the mLAN s&stem are as follo-s

• High speed bus -ith s*alable performan*e

!he throughput speed of the bus satisfies the high band-idth of an& real,

time audio pro*essing s&stem7 allo-ing a net-or. of man& de%i*es

*apable of transmitting and re*ei%ing streams of audio data1

• $lug and pla& support

!he bus or*hestrates the automati* *onfiguration of ne-l& added de%i*es1

Ea*h time a de%i*e is added or remo%ed the bus automati*all& re,

enumerates itself7 forming a ne- bus topolog&1 !his is done independentl&

and -ithout the inter%ention of a host s&stem1

• Eliminate host pro*essor:memor& bottlene*.

$ro*essing an& amount of multimedia data requires a robust s&stem to

handle the large and time,dependant flo- of data1 B& eliminating the need

for a *entral ser%er the bus is free to automati*all& dire*t the transfer of 

data bet-een the de%i*es7 thereb& remo%ing a potential bottlene*.1 !his is

supported b& the use of peer,to,peer transa*tions

• Support for Iso*hronous data streams

Fire-ire pro%ides support for iso*hronous pa*.et streaming7 satisf&ing the

need for a *onstant transfer rate in an audio s&stem1 !his is a high,priorit&

transfer mode that guarantees deli%er& of data at *onstant rate1

2.2 The mLA e!ten"ion

!he mLAN s&stem e+tends the IEEE 3456 CSR ar*hite*ture b& implementing se%eral

different registers and b& using a series of appli*ation le%el *hips KAE Notes7 '(()1

!he *hips7 ASICs /Appli*ation Spe*ifi* Integrated Chips07 pro%ide an interfa*e

 bet-een the IEEE 3456 node and the studio equipment1 !hese *hips interfa*e -ith

different IEEE 3456 proto*ol la&ers to integrate different fun*tionalit&1 !heir 

 parti*ular *on*ern is translating in*oming and outgoing stream and *ontrol

information bet-een the studio equipment and the lin. la&er of the IEEE 3456 node1

>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 15/114

>1 Referen*es

!his en*apsulates the formatting and timing of audio data7 based on the IEC 3>>4

spe*ifi*ation1

In terms of the dri%er7 #i*rosoft ships lo- le%el dri%ers for all the ma9or de%i*e and

 bus t&pes for the %endor,supplied dri%ers to ma.e use of1 !hese %endor dri%ers form

*lient dri%ers that pro%ide a**ess to the %endor spe*ifi* fun*tionalit& of the de%i*e1

!he indo-s mLAN dri%er is a *lient Fire-ire dri%er that ma.es use of the indo-s

supplied IEEE 3456 dri%er1 !he mLAN dri%er is able to manipulate the "nit 2ire*tor&

/in the CSR0 of the host *ontroller %ia the underl&ing IEEE 3456 dri%er to ma.e it

appear as a mLAN de%i*e1

2.2.1 The IC *1++! ),ecification

IEC 3>>4 is a set of standards that are related to the transmission of audio7 musi* and

multimedia o%er IEEE 3456 KAE Notes7 '(()1 !he mLAN te*hnolog& uses t-o of 

these standards1 Firstl&7 mLAN uses IEC 3>>4,3 for the general pa*.et format7

dataflo- and *onne*tion management7 and general transmission rules for *ommand

*ontrols1 Spe*ifi*all&7 these are en*apsulated in the definitions of the Fun*tion Control$roto*ol /FC$07 the Common Iso*hronous $a*.et /CI$0 format and the Conne*tion

#anagement $ro*edures /C#$0 KHaig7 '(('1

Se*ondl&7 there is IEC 3>>4,7 a standard based on a set of do*uments presented to

the IEEE 3456 !rade Asso*iation /3456 !A0 b& ?amaha1 ?amaha introdu*ed the

*on*ept and spe*ifi*ations for mLAN7 -hi*h des*ribed a spe*ifi*ation for the

transmission of audio and musi* data KAE Notes7 '(()1 !hus began a 3456 !A

do*ument des*ribing the Audio and #usi* 2ata !ransmission $roto*ol /A:#

$roto*ol01 !his do*ument -as adopted as an IEC /International Ele*trote*hni*al

Commission0 standards spe*ifi*ation1

!he spe*ifi*ation *ontrols the transfer bit,rate7 the en*apsulation and e+tra*tion of 

audio and #I2I data into sequen*es7 and the *onstru*tion of the Common

Iso*hronous $roto*ol /CI$0 pa*.ets1 !hese CI$ pa*.ets /*omprising a CI$ header and

se%eral CI$ data blo*.s0 ma.e up the pa&load data of the iso*hronous pa*.ets that in

turn form the iso*hronous streams1 !he CI$ formatting is based on the IEC 3>>4,3

5

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 16/114

>1 Referen*es

spe*ifi*ation for data flo- and *onne*tion management KAE Notes7 '(()1 !he

 pa&load of the CI$ pa*.et is the A#>'6 /> bit label and '6 bit Audio:#usi* data0

 blo*. format gi%en b& the IEC 3>>4, spe*ifi*ation1 !he CI$ header *ontains data

that pro%ides a me*hanism for s&n*hronising the reassembl& of the audio:musi* data1

2.2.2 'ata Transmission

!he iso*hronous pa*.ets are *onstru*ted b& the IEEE 3456 node Lin. La&er1 $a*.ets

are identified b& a *hannel number that has a single *orresponding stream1 Ea*h

 pa*.et -ithin a stream *omprises se%eral data blo*.s7 -hi*h are made up of a number 

of quadlets /6,b&te blo*.s0 KAE Notes7 '(()1 Sequen*es are designated b& the series

of quadlets *orresponding to a position in ea*h data blo*. of that pa*.et1 Sequen*es

and plugs are *ore to the fun*tionalit& of the mLAN s&stem7 in that ea*h sequen*e is

issued from an output plug and gathered b& an input plug KAE Notes7 '(()1 A plug is

an abstra*tion formed b& the Enabler7 representing the input and output *apabilities of 

the studio equipment1 !he Enabler is soft-are on the *omputer that intera*ts -ith the

!ransporters /de%i*e,spe*ifi* enumeration of the plugs0 and allo-s *onne*tion a

management1 It is the plugs that the studio equipment *an send and re*ei%e data on the bus1

2.3 #ha$ter Summar% 

Fire-ire is a fle+ible bus ar*hite*ture that is ideall& suited to real,time s&stems7 as

time,dependant data *an be transferred in a deterministi* manner1 !hrough e+tensions

to the ar*hite*ture7 the potential of Fire-ire is realised1 One su*h e+tension is the

mLAN usage of integrated *hips to a*hie%e the required audio and *ontrol

requirements for a real,time multimedia s&stem1 Anal&sing the mLAN dri%er -ill gi%e

insights into the usage of te*hnologies presented in this *hapter1 In order to understand

the dri%er7 the indo-s dri%er model ar*hite*ture is presented in the ne+t *hapter1

3(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 17/114

>1 Referen*es

!. The -indows 'ri(er Model

3.1 Intro&uction

!he indo-s 2ri%er #odel /2#0 is a frame-or. for designing and de%eloping

dri%ers for N! based indo-s platforms1 2# dri%ers ha%e -ell,defined

responsibilities in fa*ilitating I:O operations for appli*ations and other dri%ers KOne&7

'((41

 

2# dri%ers are .ernel,mode dri%ers that share man& of the design goals of the

-indo-s operating s&stem1 B& *oding a dri%er in C and a%oiding using the standard C

runtime libraries7 the dri%er be*omes portable among the indo-s platforms1 !here is

a .ernel mode run,time librar& a%ailable for dri%ers to ma.e use of -hi*h in*ludes

string and list management routines1 Also ta.ing *are not to use data t&pes that are

sie dependant on the platform -ill ensure portabilit&1 Ha%ing the abilit& to

d&nami*all& *onfigure the hard-are requires the dri%er to be more fle+ible1 !his

implies that the de%i*e and its dri%er support $lug and $la&1 !he dri%er also has to be

able to *ope -ith being interrupted b& other e%ents7 and suffer less pro*essing time

-ithout lo*.ing up the s&stem K#S2N7 '(()1

!he *ore *on*ept of the 2# is the dri%er sta*.1 A**ording to One&7 the indo-s

operating s&stem *omes -ith base dri%ers that ta.e *are of generi* I:O operations for 

standard hard-are de%i*es1 In this ar*hite*ture7 a dri%er is supported b& a *hain of 

other dri%ers belo- it1 !his is mo%ing a-a& from monolithi* dri%ers7 -hi*h handle

e%er& a*tion bet-een an appli*ation ma.ing a request of a hard-are de%i*e and the

appli*ation re*ei%ing the desired response1 !he la&ered approa*h is su*h that at ea*h

le%el of the sta*. a dri%er in that sta*. has the opportunit& to a*t on a request being

sent do-n1 If the dri%er *annot fulfil the request it -ill pass the request do-n the sta*. 

until the request *an be satisfied1 !he results are then passed ba*. up the sta*. and

 ba*. to the appli*ation that made the request1 !his approa*h allo-s dri%ers to fo*us on

a small area of fun*tionalit& and spe*ialisation KOne&7 '((41

33

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 18/114

>1 Referen*es

Figure 413 illustrates a h&potheti*al dri%er sta*.7 sho-ing the different t&pes of dri%ers

a sta*. *ould ha%e1 Our fo*us is on the .ernel,mode dri%ers7 and there is a need to

*larif& their fun*tions1 !he .ernel,mode *lient dri%er handles requests from an

appli*ation %ia the in4' A$I1 !he *lass dri%er7 usuall& supplied b& #i*rosoft7

 pro%ides the s&stem,required but hard-are,independent support for a *lass of de%i*e1

!he mini*lass dri%er is usuall& supplied b& the hard-are %endor to integrate an&

unique fun*tionalit& their de%i*e ma& ha%e1 !he port dri%er /or in some *ases7 the host

*ontroller or host adapter dri%er0 supplies required I:O operations on underl&ing

 ph&si*al de%i*es or busses *onne*ted to the de%i*e1 On*e again7 the miniport dri%er is

tailored for %endor spe*ifi* operations1 !he hard-are bus dri%er is supplied b&

#i*rosoft and should not be repla*ed1

$ig6re *.'7 Layered Driver Ar8hite8t6re 9MSDN: (==;

3'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 19/114

>1 Referen*es

An appli*ation tr&ing to ma.e use of a hard-are de%i*e -ill do so through the in4'

A$I1 It is the bridge bet-een the user and .ernel mode1 In the .ernel mode7 a thread or 

a dri%er has a**ess to s&stem memor& and hard-are K#S2N7 '(()1 In order for an

appli*ation to a**ess these s&stem resour*es7 their requests ha%e to be mediated b& the

.ernel *omponents1 !here are t-o important *on*epts that ha%e to be dealt -ith here7

one being the dri%er *ommuni*ation *hannel and the other being the .ernel mode

operating s&stem *omponents1 !he .ernel mode s&stem *ommuni*ates -ith the dri%er 

sta*. through I:O Request $a*.ets /IR$s01 !hese are reusable ob9e*ts that ha%e a

 predefined and unique *ode identif&ing them and their fun*tion1 !his -ill be *o%ered

in more depth later in this *hapter1

3.2 '$eratin( S%"tem #om$onent"

!he operating s&stem has *ertain *omponents that monitor and allo*ate s&stem

resour*es as the& are required1 !here are three *ore *omponents that are rele%ant to

dri%ers fun*tioning -ithin the .ernel mode spa*e1 !hese are the $n$ manager7 the I:O

manager and the $o-er manager1 Another *omponent rele%ant to the fun*tioning of 

the .ernel but spe*ifi*all& for .ernel,mode dri%ers is the ob9e*t manager1 !he Ob9e*t#anager stores and manages all s&stem ob9e*ts7 in*luding de%i*e and dri%er ob9e*ts1

!he I:O #anager ma.es use of the Ob9e*t #anager to a**ess and store the ob9e*ts it

uses K#S2N7 '(()1

!.2.1 %lug and %la& Manager 

!he $n$ manager is firstl& responsible for identif&ing the de%i*e that has been added

to the s&stems en%ironment1 Ea*h de%i*e is registered -ith a @"I27 ma.ing it

identifiable to the OS1 As part of the indo-s OS7 a registr& .eeps tra*. of %endor 

spe*ifi* de%i*e hard-are7 identifiable through a unique identifier *alled a @"I2

/@lobal "nique I201 !he @"I2 is a 3'>bit de%i*e identifier that is published for use

in the I! industr&7 *reating a unique asso*iation identif&ing the de%i*e -ith a @"I2

KOne&7 35551 !hat means ea*h de%i*e is registered -ith a @"I27 ma.ing it

identifiable to the OS7 allo-ing the OS to load the *orre*t dri%er1 A dri%er is released

34

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 20/114

>1 Referen*es

-ith an INF file *ontaining the @"I2 of the *lass of de%i*e the dri%er is responsible

for7 as -ell as other dri%er related information1

!he $n$ manager rea*ts to a ne-l& dete*ted de%i*e b& sear*hing for the *orre*t dri%er 

to load if it has not alread& been loaded1 If the $n$ #anager *annot find the de%i*e it

-ill as. the user to pro%ide the s&stem -ith lo*ations for it to sear*h1 It responds to

run time hard-are e%ents7 for instan*e the addition or remo%al of a de%i*e from a bus

K#S2N7 '(()1

Resour*e requirements for de%i*es are determined b& the $n$ #anager and are

allo*ated appropriatel&1 2&nami* re*onfiguration of the hard-are resour*e allo*ation

*an ta.e pla*e as required1 Hard-are resour*es in*lude assignable7 addressable bus

 paths that allo- de%i*es and s&stem pro*essors to *ommuni*ate -ith ea*h other1 !he

$n$ #anager handles po-er requests su*h as stopping or starting the de%i*e7

indi*ating the intention to remo%e a de%i*e7 and responds to other po-er related

e%ents1 !hese requests are sent %ia the I:O #anager in IR$s using po-er fun*tion

*odes1

Finall&7 the $n$ #anager is responsible for enumerating a ne-l& added de%i*e7 and

an& subsequent de%i*es that the dri%er *ontrols on its bus1 !his means that the de%i*e

ob9e*t stored in s&stem memor& is lin.ed to the dri%er b& *alling the dri%er 

 AddDevice routine and passing it the pointer to the de%i*e ob9e*t1 !he $n$ #anager 

.eeps tra*. of -hi*h de%i*es are a*ti%e through a list of the 2e%i*e Ob9e*ts1 2e%i*e

ob9e*ts -ill be addressed further on in the *hapter K#S2N7 '(()1

!.2.2 %ower Manager 

!he $o-er #anager is responsible for maintaining different po-er states for the

entire s&stem and the *onne*ted *omponents1 At *ertain times a de%i*e *an sit idle

allo-ing the po-er state to be lo-ered7 so that the effi*ien*& of the po-er usage *an

 be in*reased1 !his is a*hie%ed through different po-er poli*ies -hi*h *an be a*ted on

depending on the use of the de%i*e1 !he $o-er #anager7 %ia the I:O #anager7 *an

send po-er fun*tion *odes *ontained in an IR$ to the rele%ant dri%er1 2ri%ers should

36

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 21/114

>1 Referen*es

implement the required po-er fun*tionalit& in terms of handling the IR$s that are

sent to it K#S2N7 '(()1

!.2.!. I/ Manager 

!he I:O #anager forms part of the I:O #odel for the indo-s operating s&stem1 !he

I:O #anagers fun*tion is to fa*ilitate I:O *ommuni*ation bet-een an appli*ation and

a de%i*e %ia a dri%er sta*.1 !his *ommuni*ation stream *entres on the usage of IR$s

to formulate a request to the dri%er sta*. that indire*tl& *ontrols the de%i*e1 !hese

IR$s are routed to the dri%er sta*. -here ea*h dri%er has the *han*e to respond to the

IR$ until the request is satisfied1 Higher le%el dri%ers brea. the IR$ into smaller 

requests and route them to lo-er le%el dri%ers appropriatel& KCant7 35551

!he I:O #anager also defines a set of required and optional routines that dri%ers

should implement1 Further7 ea*h dri%er should ha%e a handler routine for ea*h IR$ of 

that set7 -hi*h are basi*all& entr& points into the dri%er *ode and thus allo-s the

dri%er to rea*t to a request1 In the table belo-7 an e+ample of a small set of IR$ ma9or 

fun*tion *odes that ha%e to be implemented7 -ith their IN4' fun*tion that -illresult in the rele%ant IR$ being dispat*hed KCant7 35551

in4' Fun*tion IR$ #a9or Code Base 2ri%er Routine

CreateFile IR$#;CREA!E Create

CloseHandle IR$#;CLOSE Close

ReadFile IR$#;REA2 Read

riteFile IR$#;RI!E rite

2e%i*eIoControl IR$#;2E<ICECON!ROL 2e%i*eControl

!he I:O #anager .no-s impli*itl& -hat entr& routines there are for ea*h dri%er7 andthis is a*hie%ed b& the I:O #anager .eeping a list of 2ri%er Ob9e*ts1 A dri%er ob9e*t is

equated -ith a $h&si*al 2e%i*e Ob9e*t /$2O01 A dri%er ob9e*t is *reated b& the I:O

#anager -hen a dri%er is first loaded and installed1 2uring the dri%er initialisation7

the dri%er ob9e*t is passed to the first dri%er entr& routine *alled DriverEntry7 -hi*h

then asso*iates its other entr& routines -ith the dri%er ob9e*t K#S2N7 '(()1

!he IN4' A$I *ommuni*ates -ith the I:O manager7 -hi*h builds the appropriate

request to be sent to the *orre*t dri%er1 !he dri%er is represented b& a dri%er ob9e*t7

3)

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 22/114

>1 Referen*es

-hile a de%i*e that belongs to the dri%er is represented as a de%i*e ob9e*t1 !hese

ob9e*ts are stored in s&stem memor&7 and are *reated b& the s&stem as the& are

needed1 On the re*eipt of an I:O request7 the I:O manager .no-s the target de%i*e of 

the request /from the DeviceI%ntrl  *all of the appli*ation0 and requests from the

ob9e*t manager a pointer to the dri%er ob9e*t responsible for the de%i*e1 An IR$ is sent

to the dispat*h routine of the dri%er ob9e*t7 -hi*h then pi*.s out -hi*h de%i*e it is

targeted at and routes the IR$ there1

3.3 I)' *e+ue"t Pac,et"

!he *ore fun*tion of a dri%er is to respond to I:O requests from the s&stem or 

appli*ation1 !he dri%er handles the request b& pro*essing the IR$ if the dri%er *annot

do that then it passes the IR$ to the dri%er belo- it in the sta*.1 Ea*h dri%er in the

sta*. should be read& to re*ei%e an& IR$ and handle an& error1

!.!.1 I0% 'ata )tructure

IR$s are essentiall& data stru*tures that *ontain *ertain fields7 defining the t&pe of 

a*tion to be performed1 Ea*h IR$ has an a*tion defined b& a fun*tion *ode1 !here are

t-o t&pes of fun*tion *odes for an a*tion1 One is a ma9or fun*tion *ode -hi*h

indi*ates the main a*tion7 -hile the minor fun*tion *ode further spe*ifies the a*tion1

hen an appli*ation sends a request for a *ertain operation from a dri%er *ontrolled

de%i*e7 the I:O #anager a**esses the ob9e*t manager in order to resol%e the request

K#S2N7 '(()1 !he ob9e*t manager is a *ore s&stem *omponent that manages all

stored s&stem *reated ob9e*ts and data stru*tures7 .eeping pointers to their lo*ations1

!he request -ill -ant to ma.e use of some ser%i*e offered b& a de%i*e and the ob9e*t

manager returns a pointer to the de%i*e ob9e*t1

From here the I:O #anager builds and allo*ates memor& for the IR$7 and initialises

*ertain fields -hi*h relate to the positions of dri%ers in the I:O sta*.1 !he IR$ is

 passed to the top of the rele%ant dri%er sta*.1 !he dri%er then a**esses the I:O sta*. to

determine the *urrent operation it has to *omplete1

3

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 23/114

>1 Referen*es

$ig6re *.(7 I>! Re?6est ,a8@et Str68t6re 9!ney: (==*;

!.!.2 I/ )tack

hen an IR$ is *reated7 an arra& of IOS!ACLOCA!ION stru*tures are *reated

and asso*iated -ith that IR$ KOne&7 '((41 Ea*h sta*. lo*ation represents one of the

dri%ers that -ill pro*ess the IR$7 basi*all& defining the dri%er sta*.1 Ea*h stru*ture

*ontains the fun*tion *odes and parameters that des*ribe the a*tion of the IR$1 !he I:O

sta*. lo*ation *an also sa%e *onte+tual information about the operation of the *urrent

dri%er1 !his -a& the dri%ers *an a*t on different le%els7 allo-ing the in*remental

*ompletion of the tas.1

3D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 24/114

>1 Referen*es

$ig6re *.*7 IR, Str68t6re Relating to Sta8@ Lo8ations 9Cant: '333;

It falls to the *urrent dri%er to a**ess its asso*iated I:O sta*. lo*ation stru*ture7

thereb& a**essing the IR$ fun*tion *ode and its parameters1 hen the dri%er is done

-ith the pro*essing7 the dri%er in*rements the I:O sta*. pointer to the ne+t sta*. 

lo*ation and then passes the IR$ to the ne+t dri%er K#S2N7 '(()1

!.!.! I0% ueues

Sin*e the s&stem supports as&n*hronous requests -ithin a multitas.ing and

multithreaded *onte+t7 dri%ers ma& not be able to finish pro*essing the *urrent IR$

 before another arri%es1 2# dri%ers should then support dri%er queues7 -hi*h the

I:O #anager asso*iates -ith ea*h de%i*e ob9e*t a dri%er *reates K#S2N7 '(()1 !he

lo-er,end dri%ers that support the I:O operations of a de%i*e suppl& a StartI+ routine1

IR$s that are queued b& a dri%er using the I:O #anagers support routine7 are then

queued to the StartI+ routine1

!.!.# I/ Control Codes

2ue to the nature of this pro9e*t7 an understanding of I:O Control Codes /IOC!Ls0 is

important in the *ore features of an& dri%er1 I:O *ontrol *odes are a *ommuni*ation

*hannel bet-een user,mode appli*ations and dri%ers K#S2N7 '(()1 !&pi*all&7

IOC!Ls are sent to dri%ers b& appli*ations using the DeviceI%ntrl *all1 hen this

happens7 the I:O #anager *reates an IR$ *on*erning de%i*e or internal de%i*e *ontrol7

in*luding the IOC!L *ode1 !his results in the IR$ being sent to the upper,most dri%er 

in the sta*.1 !his allo-s &our dri%er to respond to an IOC!L sent b& an appli*ation1

IR$

IOS!ACLOCA!ION

IOS!ACLOCA!ION

IOS!ACLOCA!ION

IOS!ACLOCA!ION

Header 

Sta*. 

Lo*ations Current

Sta*.

Lo*ation

#2LAddress IO Status

3>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 25/114

>1 Referen*es

3.4 Driver an& Device 'bject"

!hese ob9e*ts form the *ore representation of the 2# ar*hite*ture for the OS1 !he&

represent the dri%er and the de%i*es under the dri%ers *ontrol7 and store information

rele%ant to the dri%ers operation1 An in depth e+planation of these ob9e*ts is required

to further understand the 2# ar*hite*ture1

!.#.1 'ri(er /bect

!he I:O #anager *reates a dri%er ob9e*t for ea*h dri%er that has been loaded and

installed1 !he& are defined using 2RI<EROB;EC! stru*tures1 !he dri%er ob9e*t

represents the dri%er itself and *ontains a list of pointers to all the de%i*e ob9e*ts of 

the de%i*es under the *ontrol of the dri%er KOne&7 '((41

!he dri%er ob9e*t sets the pointers to dri%er entr&,point fun*tions during dri%er 

initialisation1 For a dri%er to re*ei%e IR$s7 it needs to *ontain the *orresponding entr&

 point to the IR$ handler routine1 For instan*e7 to re*ei%e an IR$ ma9or *ode of $N$

there has to be a $N$ dispat*h routine published b& the dri%er ob9e*t so that the I:O

manager .no-s the lo*ation of the fun*tion to dispat*h the IR$ to1 Ea*h entr& point

*orresponds to an IR$ ma9or and minor fun*tion *ode1 If a dri%er manages its o-n

IR$ queue then the dri%er ob9e*t should *ontain an entr& point to a StartI+ routine1

For non,persistent dri%ers7 an entr& point to the 7nlad routine *an be *alled to free

up s&stem resour*es K#S2N7 '(()1

35

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 26/114

>1 Referen*es

$ig6re *.)7 DRI&"R!B/"CT Str68t6re 9MSDN: (==;

Figure 416 depi*ts a t&pi*al dri%er ob9e*t *ontaining the a**essible fields of the data

stru*ture1 $tr2e%i*eOb9e*t is the pointer to the list of de%i*e ob9e*ts for -hi*h the

dri%er is responsible1 !he I:O #anager uses this list to *onne*t the de%i*es together1

$tr2ri%erE+tension *ontains the address of the AddDevice routine the $n$ #anager 

-ill use to add and enumerate ne- de%i*es under the *ontrol of the dri%er1 !he

222ispat*h=== entr& points *orrespond to ea*h of the ma9or IR$ *odes the dri%er 

-ill handle1

!.#.2 'e(ice /bects

!he operating s&stem represents de%i*es using de%i*e ob9e*ts1 !hese are the target for 

all fun*tional operations1 !he dri%er ob9e*t holds pointers to the routines *ontained in

the de%i*e ob9e*t1 !here are usuall& multiple de%i*e ob9e*ts for a de%i*e7 one for ea*h

dri%er in the sta*. KOne&7 35551

!he de%i*e ob9e*t uses a stru*ture *alled 2E<ICEOB;EC! to represent itself7 -hi*h

is managed b& the Ob9e*t #anager1 Ea*h ob9e*t *an be named and as result has a

handle to easil& a**ess it1 Additionall&7 ea*h de%i*e ob9e*t has dedi*ated s&stem

storage spa*e for maintaining de%i*e state and storing other dri%er related data

stru*tures1 !his spa*e is represented in another data stru*ture *alled the dri%er 

e+tension7 parti*ular to a dri%er and -ill in*orporate all the de%i*es that it is

'(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 27/114

>1 Referen*es

responsible for K#S2N7 '(()1 !he I:O #anagers  I%reateDevice and

 I%reateDeviceSecure routines allo*ate non,paged memor& for the de%i*e ob9e*t and

e+tension1 E%er& standard dri%er routine that re*ei%es an IR$ *an also a**ess the

dri%er e+tension %ia the pointer to the de%i*e ob9e*t *ontained -ithin the IR$1

$ig6re *.7 Devi8e oe8t 8reation 9MSDN: (==;

!o *reate a de%i*e ob9e*t7 the dri%er *alls the  AddDevice routine1 !he a*tual ob9e*t is

*reated through a s&stem *all I%reateDevice7 -hi*h then initialises the ob9e*t1 !he

de%i*e ob9e*t has *ertain properties defined through a**essible fields7 as sho-n abo%e1

!hese properties des*ribe ho- the de%i*e ob9e*t intera*ts -ith the s&stem1 !here are

different t&pes of de%i*es7 -ith a *orresponding t&pe of dri%er7 ea*h intera*ting -ith

the s&stem in a different manner1 Se*urit& and e+*lusi%it& aspe*ts of the de%i*e and

the dri%er are defined here K#S2N7 '(()1

!here are three .inds of 2# de%i*e ob9e*ts

• $h&si*al 2e%i*e Ob9e*t /$2O0

• Fun*tional 2e%i*e Ob9e*t /F2O0

• Filter 2e%i*e Ob9e*t /Filter 2O0

'3

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 28/114

>1 Referen*es

!he $2O represents and is *reated b& a bus dri%er7 -ith *ertain responsibilities and

fun*tions1 !hese in*lude enumerating and administrating the de%i*es on the bus7

responding to $n$ and $o-er IR$s1

!he F2O is the fun*tional dri%ers de%i*e ob9e*t7 -hi*h is the main dri%er for the

de%i*e1 Its purpose is to pro%ide an interfa*e to the operation of the de%i*e1

A Filter 2O is an optional dri%er that *an modif& the beha%iour of the dri%er 

depending on -hat is required1 For instan*e7 if &ou -anted to monitor the fun*tioning

of the de%i*e7 or &ou -anted the de%i*e to *onform to e+pe*ted spe*ifi*ations7 this

-ould be done using a filter dri%er K#S2N7 '(()1

3.- Entr% *outine"

As established abo%e7 IR$s are the *ommuni*ation streams from an appli*ation to a

de%i*e in order a**ess its resour*es KOne&7 35551 Entr& routines are the entr& points

into the dri%er *ode1 !he& represent the different fun*tionalit& of the dri%er b&

implementing standard routines1 !hese standard routines are *alled under different

*ir*umstan*es7 and are required to pro%ide the fun*tionalit& for -hi*h the& are named1!he amount of required routines in*reases as the amount of fun*tionalit& and support

the dri%er is designed to implement1 Lo-er,end dri%ers7 those that dire*tl& *ontrol

a**ess to the de%i*es resour*es -ill ha%e more required routines than the higher,end

dri%ers1

!.3.1 'ri(erntr&

As dis*ussed earlier7 the DriverEntry routine is *alled b& the I:O #anager the first

time a dri%er is loaded and installed b& the s&stem K#S2N7 '(()1 An& initialisation

is ta.en *are of here7 setting up an& required parameters1 !he main purpose of the

 DriverEntry routine is to fill in %arious pointers to fun*tions in the dri%er ob9e*t1

!hese are pointers to the other subroutines of the dri%er1 !he I:O #anager ma.es use

of these pointers -hen it builds an IR$1 !he subroutines represent the other entr&

 points to the dri%er7 in*luding the dispat*h routines7 -hi*h re*ei%e and dispat*h IR$s1

''

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 29/114

>1 Referen*es

A pointer to the dri%er ob9e*t is passed as a parameter of the  DriverEntry  routine

-hen the dri%er is first loaded1

!.3.2 Add'e(ice

!he  AddDevice routines responsibilit& is to *reate and initialise the dri%ers

representation of the de%i*e ob9e*t for ea*h de%i*e enumerated b& the $n$ #anager 

K#S2N7 '(()1  AddDevice  routines are *alled during s&stem initialiation /-hen

de%i*es are first enumerated07 and an& time a ne- de%i*e is enumerated -hile the

s&stem is running1 2uring de%i*e ob9e*t *reation7 an asso*iation bet-een the dri%er 

ob9e*t and the ne- de%i*e ob9e*t is *reated1 #emor& is allo*ated for the de%i*e ob9e*t

 b& the .ernel s&stem7 and a pointer to the ob9e*t is passed as a parameter of the

 AddDevice routine1 !he dri%er must pro%ide storage7 usuall& in the de%i*e e+tension

of a de%i*e ob9e*t7 for pointers to *ertain ob9e*ts obtained from the I:O manager or 

other s&stem *omponents1

!.3.! 'is,atch 0outines

In order for a dri%er to pro*ess an IR$7 it must ha%e handler *ode for that IR$ K#S2N7

'(()1 2ispat*h routines are supplied to handle one or more IR$ ma9or fun*tion

*odes1 !he dri%ers 2RI<EROB;EC! stru*ture has -ithin it a dispat*h table that

holds the dispat*h routines supplied b& the  DriverEntry  routine1 !he I:O #anager 

uses the pointer to the rele%ant dispat*h routine to dispat*h the IR$ for pro*essing1

!he e+a*t fun*tionalit& a dispat*h routine should pro%ide depends on the I:O fun*tion

*ode it handles7 on the dri%ers position in the sta*.7 and on the t&pe of ph&si*al

de%i*e it supports1 !his is -here the dri%er de*ides ho- to pro*ess the IR$7 or pass it

on do-n the sta*.1 !his is an integral part of the dri%ers fun*tionalit& in handling

IR$s1 !here are *ertain dispat*h routines a dri%er must support1 !hese routines *an be

supported as far as the dri%er requires1

'4

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 30/114

>1 Referen*es

$ig6re *.-7 Relationshi etween I>! manager and IR, ro8essing

!he abo%e figure is a sequen*e diagram e+pressing the relationship bet-een the I:O

manager and the dri%ers IR$ pro*essing me*hanism1 Firstl&7 the I:O manager -ill

respond to an appli*ations request for an I:O operation7 or some request that has to be

handled b& a *lient dri%er1 As an aside7 the $n$ manager *an generate its o-n IR$s

although it has to go through the I:O manager1 An I:O operation is al-a&s dire*ted at a

de%i*e ob9e*t7 represented as a handle in user,mode1 !he I:O manager finds the dri%er 

ob9e*t responsible for the de%i*e to get the de%i*e ob9e*t1 !he ob9e*t manager is in

*harge of managing s&stem ob9e*ts7 and -ill return a pointer to an ob9e*t should a

request be made1 !he I:O manager then builds an IR$7 spe*if&ing the rele%ant fields

and in parti*ular7 using the dri%er and de%i*e ob9e*t pointers in spe*if&ing the target

for the I:O operation1 !he lo*ation of the dispat*h routine is e+tra*ted from the dri%er 

ob9e*ts table of dispat*h routines7 and is used to *all the routine to pass it the IR$1

!he dri%er -ill route the IR$ to the target de%i*es IR$ handler routine for that IR$

ma9or fun*tion *ode to be pro*essed1

'6

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 31/114

>1 Referen*es

!.3.# )tartI/

!he StartI+ routine is used e+*lusi%el& -ith an IR$ queue7 and is *alled in response

to an IR$ being read& in the queue for serialised IR$ pro*essing1 In higher,end dri%ers

this ma& inhibit performan*e7 and ma& fa*e *ertain inoperabilit& fa*tors K#S2N7

'(()1 !he pro*essing of IR$s ma& be slo-er due to the StartI routine be*oming a

 bottlene*.1 It is re*ommended that higher,end dri%ers use internal queues1

For lo-er,end dri%ers7 the support of the StartI routine be*omes the foremost fo*us7

espe*iall& -hen *onsidering that StartI is responsible for starting an& I:O operation

on a ph&si*al de%i*e K#S2N7 '(()1 Control o%er the pro*essing of IR$s *an be

instituted b& *reating queues for their different fun*tion *odes1 Serialising the

in*oming IR$s *an in*rease the throughput pro*essing of I:O requests1

3. #ha$ter Summar% 

Follo-ing the indo-s 2ri%er #odel is e+pli*itl& required for an& .ernel,mode

dri%er7 ensuring a reliable ar*hite*ture for the representation of dri%ers and de*oupled

modularised dri%er sta*. for I:O operations1 !his separation and spe*ialisation of 

dri%ers is inherentl& more fle+ible and sturd& than the lega*& monolithi* dri%er 

approa*h1 In terms of de%elopment7 dri%ers *an be -ritten to ta.e ad%antage of 

established dri%ers supplied b& #i*rosoft for generi* I:O operations on standard

de%i*e hard-are1 !here is still a proportion of non,*ore dri%er *ode that the 2#

requires of the dri%er to implement for administrati%e purposes1 !his is *ode that most

dri%ers are required pro%ide7 spe*ifi*all& the handling of IR$s the dri%er ma& not

e+pli*itl& need1 !he ne+t *hapter deals -ith a dri%er de%elopment tool that smoothes

the dri%er produ*tion pro*ess b& pro%iding a frame-or. of *lasses to neatl&

en*apsulate required generi* dri%er fun*tionalit&1

')

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 32/114

>1 Referen*es

#. Com,uware 'ri(er)tudio

!he de%elopment of the indo-s mLAN dri%er -as done -ith the help of a

 proprietar& 2ri%er 2e%elopment En%ironment *alled 2ri%erStudio1 An& .ernel,mode

dri%er has to *onform to the 2# and support $lug and $la& fun*tionalit&1 So there

is basi* fun*tionalit& that an& and e%er& dri%er should implement1 In order to

streamline and optimise the de%elopment of a dri%er7 Compu-are de%eloped

2ri%erStudio to -or. in *on9un*tion -ith #i*rosoft <isual Studio1 2ri%erStudio is a

C88 *lass librar& that forms a frame-or. for dri%er de%elopment K2ri%erStudio7

'((61 It is an ob9e*t,oriented approa*h to -riting dri%ers7 -ith the 2ri%erStudio

*lasses denoted b& a leading P1 !his also allo-s for *ode generation of *lasses and

features of the required aspe*ts of a dri%er1 !his in%ol%es the use of spe*ial *lasses to

en*apsulate the *on*epts inherent in dri%er -riting7 forming a hierar*h& of *lasses1

Ho-e%er7 a de%eloper *an de%iate from the stru*tured frame-or. supplied b&

2ri%erStudio if the dri%ers fun*tionalit& requires spe*ial support1

$ig6re ).'7 DriverSt6dio Classes 9DriverSt6dio: (==);

!he abo%e diagram depi*ts a subset of the 2ri%erStudio *lasses used b& the mLAN

dri%er1 !he frame-or. is a *olle*tion of ob9e*ts and *lasses that form a foundation and

a s.eleton for the qui*. and effi*ient de%elopment of a dri%er1 !he *lasses and ob9e*ts

are built spe*ifi*all& to *losel& model the 2# ar*hite*ture1 !he *lasses that dri%er 

-riters use to deri%e their o-n *lasses for their dri%ers *ontain fun*tionalit& and

Stream#inidri%er 

StreamAdapter 

Stream

2e%i*e

$np2e%i*e

Lo-er2e%i*e

$npLo-er2e%i*e

Filter2e%i*e

2ri%er Registr&e&

File

"string

List

InterLo*.edList

SpinLo*. 

Irp

IOor.Item

!imer 

Driver $ramewor@ %tilities

ernel Streaming

'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 33/114

>1 Referen*es

resour*es to allo- for the integration of the dri%er into the frame-or.1 !he ob9e*ts

 pro%ide fun*tionalit& to allo- for the ease of -or.ing -ith data stru*tures -ithin the

dri%er *onte+t1 !he purpose of the frame-or. is to pro%ide a model for the

*ommuni*ation bet-een the different *omponents7 -hi*h en*apsulates the flo- of 

data required to fa*ilitate the fun*tioning of the dri%er1 !here are *ertain *lasses that

require sub*lasses to be deri%ed from them7 in order for the dri%er to pro%ide spe*ifi*

fun*tionalit&1

4.1 /Driver 

!he dri%er ob9e*t is implemented b& the *lass 2ri%er7 -hi*h *ontains the entr&

 points into a dri%er1 It is the *lass responsible for initialiing the dri%er7 and for 

dire*ting I:O requests to the de%i*e ob9e*ts to -hi*h the& are targeted1 It is an abstra*t

*lass that requires that a *lass be deri%ed from it and *ertain member fun*tions be

o%erridden1 Ea*h dri%er built using the frame-or. distinguishes one *lass as the

dri%er *lass7 su*h that onl& one instan*e of 2ri%er *an e+ist for a dri%er1 2ri%er has

a ma*ro member fun*tion *alled  DE%A-E8D-IVE-8%ASS   -hi*h must appear 

e+a*tl& on*e7 outside of an& fun*tion1 !his sets up the frame-or. for the *lass deri%edfrom 2ri%er1 !he ma*ro d&nami*all& allo*ates an instan*e of the spe*ified *lass

from the non,paged pool1 B& default the *lass librar& frame-or. routes and handles

the IR$s for pro*essing1 !his *an be *hanged b& o%erriding the  Dis&atch"ilter 

member fun*tion7 and informing the frame-or. that it should use this method1

#.1.1 'ri(erntr&

All *lasses deri%ed from 2ri%er must implement this member fun*tion1 2ri%ers

 DriverEntry differs slightl& from that spe*ified b& #S2N1 In the #S2N

do*umentation there are t-o parameters7 a pointer to the 2RI<EROB;EC! stru*ture

*reated b& the I:O #anager and a pointer to a string *ontaining the path to the dri%ers

registr& .e&1 2ri%ers DriverEntry  9ust ta.es the registr& path parameter7 loads and

%alidates the path1 "sing the registr& path7 member %ariables *an be updated -ith

%alues stored in that .e&1 An& initialiation of the dri%er ob9e*t -ill ta.e pla*e here1

For e+ample7 e+pli*it use of the Dis&atch"ilter  routine *an be set up here1

'D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 34/114

>1 Referen*es

#.1.2 'is,atchFilter 

If the  Dis&atch"ilter  routine has been enabled in the frame-or.7 then all in*oming

IR$s to the dri%er -ill be routed to this routine first1 !his member fun*tion allo-s the

 prepro*essing of IR$s7 as -ell as the entr& point for IR$s1 !his allo-s the dri%er to

monitor all the I:O requests from a single point1 E%er& IR$ has to be pro*essed7

returning the status of the *ompleted IR$ to the I:O #anager1

#.1.! Add'e(ice

!he $n$ #anager7 b& -a& of the I:O #anager7 prompts the frame-or. to *all

 AddDevice -hen a ne- de%i*e that the dri%er is responsible for is dete*ted1 It re*ei%es

a pointer to the de%i*e ob9e*t *reated b& the s&stem to represent the ne-l& dete*ted

de%i*e1 !his is generall& the $2O *reated b& the s&stem to .eep tra*. of the

enumerated de%i*es1 !he  AddDevice  member fun*tion usuall& *reates the dri%ers

fun*tional representation of the ph&si*al de%i*e *alled the F2O1 !he F2O is *reated

using the $2O /the ph&si*al representation of the de%i*e07 and is usuall& represented

 b& an instan*e of a sub*lass of $np2e%i*e1 !he F2O has the responsibilit& of being

the re*ipient of the IR$s sent b& the s&stem or the dri%ers dispat*h routine1 An

asso*iation bet-een the $2O and F2O is formed b& *reating an instan*e of a

$npLo-er2e%i*e ob9e*t1 !his -ill be *o%ered later on in this *hapter1

4.2 /Device an& "ubcla"" /Pn$Device

As mentioned in the pre%ious *hapter7 a de%i*e ob9e*t represents the %irtual or 

 ph&si*al de%i*e that is the target of I:O operations1 2e%i*e is the base *lass from

-hi*h ne- *lasses are defined7 and instan*es *reated1 !he member fun*tions of 

2e%i*e model s&stem ser%i*es that deal -ith de%i*e ob9e*ts1 $np2e%i*e is a

sub*lass of 2e%i*e that has e+tra support for $n$ dri%ers1 It is a *lass that requires

*ertain member fun*tions to be o%erridden1 A dri%er -riter *an set different poli*ies

regarding $n$ and $o-er management1 !hese poli*ies allo- the handling of $n$ and

'>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 35/114

>1 Referen*es

$o-er related IR$s in spe*ifi* -a&s7 responding to a *ertain set of minor fun*tion

*odes1

It is the responsibilit& of the de%i*e ob9e*t to pro%ide handler member fun*tions in

response to IR$s dire*ted at it1 !he IR$s that get dispat*hed to the de%i*e ob9e*t ha%e

to be handled in a -a& that satisfies the request1 An IR$ *ould *ontain a request for 

the dri%er to handle some I:O operation7 a $n$ or a $o-er state *hange1 #ember 

fun*tions -ithin the 2e%i*e and $np2e%i*e *lass streamline the handling of the

IR$s1 !he *lasses also ha%e member fun*tions a%ailable for the s&stem /%ia the

frame-or.0 to inform the de%i*e ob9e*t of the resour*es under its *ontrol1 Other 

member fun*tions are for the release of these resour*es1 ithin the *onstru*tor of the

sub*lass of $np2e%i*e7 it is *riti*al to atta*h the $npLo-er2e%i*e ob9e*t to the

de%i*e ob9e*t to register a *lear path of *ommuni*ation1 hen this is done7 the

frame-or. alerts the I:O manager to the addition of the lo-er de%i*e ob9e*t to the

dri%er sta*.1

It is through the de%i*e ob9e*t that the frame-or. defines the upper edge of the dri%er1

!he upper edge of the dri%er is the part of the dri%er that pro%ides an interfa*e

 bet-een the s&stem and the lo-er edge7 -ith *ommuni*ation through the use of IR$s1

!he lo-er edge dri%er is usuall& an interfa*e dire*tl& to the hard-are or to another 

dri%er1 !he lo-er edge de%i*e ob9e*ts are distinguished as being un,o-ned b& the

dri%er *lass7 -hi*h pro%ides a different fun*tionalit& set and allo-s the de*oupling of 

the dri%er sta*.1 !he lo-er edge dri%er is the frame-or.s representation of the

dri%ers lo-er do-n in the dri%er sta*.1 !hese ob9e*ts are des*ribed in the ne+t se*tion1

4.3 /Lo0erDevice an& "ubcla"" /Pn$Lo0erDevice

!he indo-s 2ri%er #odel is a la&ered ar*hite*ture1 Lo- le%el dri%ers interfa*e to

the hard-are and pro%ide a**ess to its resour*es1 Intermediate le%el dri%ers pro%ide

additional translation and support for requests1 High le%el dri%ers handle the initial

I:O requests and begin the pro*essing of the IR$s K2ri%erStudio7 '((61 2ri%ers that

re*ei%e an I:O request ha%e the option of handling the IR$ and pro*essing it7 or 

 passing it on do-n the sta*.7 either in the form of the original request7 or as a set of 

'5

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 36/114

>1 Referen*es

ne- requests1 In this -a& dri%ers *an *ommuni*ate -ith other dri%ers and *an ma.e

use of ser%i*es a%ailable from other dri%ers rather than redundantl& implementing

e%er&thing again1 Requests are al-a&s addressed to a de%i*e ob9e*t -ithin the dri%er7

although the request ma& ha%e to go through se%eral dri%ers before rea*hing the

target1 !he lo-er de%i*e ob9e*t is that s&stem de%i*e ob9e*t that re*ei%es and

 pro*esses the hard-are le%el I:O requests1 !he main purpose of the lo-er edge dri%er 

*lass is to de*ouple the upper and lo-er edge of a de%i*e7 allo-ing the la&ering of 

dri%ers1 !he result is that dri%ers ha%e a limited set of fun*tions for -hi*h the& are

responsible1

$ig6re ).(7 +yotheti8al Driver Sta8@ 

!he abo%e diagram illustrates the usage of a lo-er de%i*e ob9e*t -ithin a sta*.7

further sho-ing the benefit of the la&ered ar*hite*ture1

$npLo-er2e%i*e is a sub*lass deri%ed from Lo-er2e%i*e that en*apsulates e+tra

$n$ fun*tionalit&1 If a dri%er is 2# *ompliant /supports $n$ and $o-er 

#anagement0 then the lo-er de%i*e ob9e*t -ill be of t&pe $npLo-er2e%i*e1 !he

$2O is modelled b& the *lass $npLo-er2e%i*e K2ri%erStudio7 '((61 !here are

t-o -a&s to *reate and initialise a lo-er de%i*e instan*e one -a& is to pass the $2O

and the F2O pointers as parameters to the *onstru*tor7 and the other -a& is to use a

*onstru*tor -ithout an& parameters and *all the  Initialie  member fun*tion1 !he

 Initialie routine ta.es the F2O pointer and the $2O7 -here the $2O is the de%i*e

ob9e*t passed b& the s&stem -hen it *alled the AddDevice routine1 hen the dri%er 

*reates an instan*e of a sub*lass of $np2e%i*e7 the $2O is a parameter of the

Client dri%er for

3456 *ameraClient dri%er for

3456 s*anner 

3456bus1s&s

oh*i34561s&s

HAL of Fire-ire bus

Lo-er 2e%i*e

"pper 2e%i*e

4(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 37/114

>1 Referen*es

*onstru*tor that is used to initialise the instan*e of $npLo-er2e%i*e1 !he F2O

 pointer is that of the 2e%i*e sub*lass instan*e1 2uring the lo-er de%i*e *reation and

initialisation the $2O is atta*hed to the F2O7 returning the pointer to the de%i*e

ob9e*t that -as atta*hed1 It is then the responsibilit& of the $np2e%i*e sub*lass

*onstru*tor to *all a member fun*tion Set#erDevice1

4.4 onDriver rame0or, cla""e"

!hese groups of *lasses represent the *ontainer and utilit& *lasses that pro%ide

stru*tured support for de%eloping .ernel,mode dri%ers1 !o program .ernel,mode or 

s&stem *omponents7 the *orre*t usage of ob9e*ts and data t&pes is required1 !hese

*lasses model s&stem data t&pes and ob9e*ts7 and required generi* dri%er fun*tionalit&

and e+pose a high le%el abstra*tion for use b& the dri%er1 !hese *lasses are de%eloped

spe*ifi*all& for use b& dri%ers of the 2ri%erStudio frame-or.7 in*orporating tedious

 but ne*essar& fun*tionalit&1 !he InterLo*.edList *lass7 for instan*e7 pro%ides an

implementation of doubl& lin.ed lists that *an be serialised and uses a built in spin

lo*. to enable safe a**ess to the list1 Another e+ample of useful fun*tionalit& is the

Ioor.Item -hi*h en*apsulates a s&stem request to e+e*ute a *allba*.7 allo-ing thequeuing of a -or. item that -ill get e+e*uted b& the s&stems -or.er thread1

#.#.1 4Ir,

!he Irp *lass abstra*ts the IR$ sent b& I:O manager and simplifies its use1 An IR$ is

a *omple+ data stru*ture that leads to *ode for intera*ting -ith an IR$ to be as

*omple+1 !he differen*e in use is illustrated b& the *ode snippet belo-7 sho-ing the

easil& readable usage of the Irp ob9e*t %ersus the relati%el& *omple+ C equi%alent1

// Straight C versionPIRP pIrp;IO_STACK_LOCATION pStack;

43

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 38/114

>1 Referen*es

pStack = IoGetCurrentIrpStackLocation(pIrp);switc (pStack!"Para#eters$%e&iceIoContro'$IoContro'Coe)  $ $ $* 

// Using class libraryKIrp I(pIrp);switc (I$Ioct'Coe())  $ $ $*

$ig6re ).*7 IR, vers6s Ir 6sage 9DriverSt6dio: (==);

!he Irp *lass pro%ides eas& to use a**essors for in%ol%ed operations to a**ess the

%arious fields of the IR$1 Simple operations are pro%ided for generi* operations on the

IR$7 *losel& modelling the beha%iour of the IR$1

#.#.2 4'ri(erManageueue

It is the responsibilit& of the dri%er to implement a queue for I:O requests7 should the

dri%er require serialised IR$ pro*essing1 !he 2ri%er#anageueue frame-or. *lass

 pro%ides a utilit& *lass for the serialised queuing of in*oming IR$s1 Con*eptuall&7 all

in*oming IR$s are routed to the queue to -ait for -hen the dri%er is read& to pro*ess

the ne+t IR$1 !his sa%es the dri%er -riters the e+tra effort of implementing a -or.ing

queue1

4.- DriverStu&io" /ernel Streamin( Service" rame0or,

ernel Streaming /S0 ser%i*es support .ernel,mode pro*essing of data streams for 

audio and for other t&pes of *ontinuous media K#S2N7 '(()1 !he *urrent indo-s

 pro%ided multimedia streaming dri%er in use that en*apsulates S ser%i*es is the

A<Stream minidri%er1 In order to utilise this ser%i*e7 &ou ha%e to de%elop a minidri%er 

that runs as an A<Stream minidri%er1 Belo- is a diagram sho-ing the S

ar*hite*ture1

4'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 39/114

>1 Referen*es

$ig6re ).)7 A&Stream Ar8hite8t6ral !verview 9MSDN: (==;

!he port *lass dri%er pro%ides an implementation of a S filter dri%er7 en*apsulating

the model of .ernel,mode nodes pro*essing a stream bet-een a start and end point1

!he Stream *lass dri%er is pro%ided for ba*.-ard *ompatibilit& -ith S 31( %ersion

%ideo dri%ers1

2ri%erStudio pro%ides a frame-or. of *lasses for en*apsulating the fun*tionalit& of 

the S Ar*hite*ture7 sho-n belo- in the ob9e*t model of the frame-or.1 !hese

*lasses are Stream#inidri%er7 StreamAdapter and Stream1

$ig6re ).7 DriverSt6dio ernel Streaming $ramewor@ 

As a benefit of using the 2ri%erStudio frame-or.7 dri%er -riters do not ha%e to -orr&

about the spe*ifi*s of the underl&ing S ar*hite*ture1 It is required that there is a

deri%ation of the three *lasses that ma.e up the ar*hite*ture1 !he #inidri%er *lass is

responsible for the *ontrol of the stream adapter *lass1 In essen*e the #inidri%er *an

 be %ie-ed as a filter dri%er7 be*ause it a*ts on behalf of the mLAN dri%er to pro*essdata streams1 An adapter is in turn responsible for *ontrol of a stream resour*e1 !he

44

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 40/114

>1 Referen*es

adapter *lass *ontrols an indi%idual ph&si*al hard-are de%i*e or la&ered soft-are

*omponents abo%e a hard-are dri%er1 !he minidri%er and adapter ob9e*ts pro%ide

*ontrol o%er the de%i*e dri%er and hard-are -hile the stream ob9e*t pro%ides *ontrol

and data handling for an indi%idual media stream1 Spe*ifi*all&7 the stream *lass is

-here stream *ontrol7 stream properties7 and stream data buffers are managed

K2ri%erStudio7 '((61

4. #om$ilin( a &river 

Although 2ri%erStudio is a dri%er de%elopment tool7 it still requires the indo-s

22 build utilit& to *ompile dri%ers1 !he 22 is required to be used b& all .ernel,

mode dri%ers as it builds the dri%er sour*e *ode -ith .ernel,spe*ifi* headers7 libraries7

*ompilers and lin.ers1 !he build utilit& *an be run from the <isual Studio I2E or a

*ommand prompt1 !he frame-or. generates the SO+RC,S  and -AK,.IL, files that

are used b& the build utilit& -hen a ne- dri%er pro9e*t is *reated7 lea%ing

*ustomisation up to the de%elopers1 !hese files *ontain the lo*ation of the %arious

sour*e files7 the libraries to be lin.ed and the intended output used in the *ompilation1

Building a dri%er is a *riti*al e%ent7 as it has to be optimised to the platform /for e+ample7 +> 4',bit or IA6 6,bit builds0 it is intended for1 !hus the usage of the

*orre*t build options /of the *orre*t 22 %ersion0 for the target platform is ne*essar&

for the dri%er to *ompile and fun*tion *orre*tl&1

4. 5er"ionin( I""ue"

It is important to note that the 2ri%erStudio frame-or. is a de%elopment tool that

en*apsulates the 2# ar*hite*ture1 It ma.es s&stem *alls and uses s&stem ob9e*ts7

though the frame-or. e+poses a high le%el of abstra*tion1 !he *lasses of the

frame-or. are based on the 2# and are de%eloped to use the re*ommended

te*hniques1 #i*rosoft allo-s de%elopers to *reate dri%ers for their operating s&stems

 b& pro%iding the indo-s 2ri%er 2e%elopment it /2207 and it is the 22 that is

responsible for the building of the dri%er1 !he 22 is %ersioned b& release and

operating s&stem7 and do*uments the 2#7 pro%iding a design guide for de%eloping

dri%ers1 !hrough ea*h subsequent update to the operating s&stem /for e+ample7 the

46

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 41/114

>1 Referen*es

indo-s =$ Ser%i*e $a*. '0 and the 227 a *hange in the 2# or #i*rosoft *ore

dri%ers ma& o**ur1 !his *hange has to be refle*ted in the 2ri%erStudio frame-or.7 and

it ma& be that different %ersions of 2ri%eror.s /the spe*ifi* module for dri%er 

de%elopment0 -ill be in*ompatible1 Consequentl&7 *ode -ritten for a dri%er using an

earlier %ersion of 2ri%erStudio and the indo-s 22 ma& not *ompile -ith later 

%ersions unless modifi*ation of the *ode o**urs1

4.6 #ha$ter Summar% 

!his *hapter has e+plained the usefulness of using a frame-or. li.e 2ri%erStudio in

dri%er de%elopment1 It is also fundamental to understanding the anal&sis of the mLAN

dri%er1 !he rele%ant *on*epts ha%e been *o%ered to allo- the ne+t *hapter to begin

e+plaining the anal&sis of the dri%er1 It is e%ident from the pre%ious t-o *hapters that

the relationship bet-een the 2# and the 2ri%erStudio frame-or.7 as the

en*apsulation of a *omple+ model for dri%ers is simplified using *lass libraries1

4)

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 42/114

>1 Referen*es

3. /bect5oriented model of the mLAN dri(er 

!his *hapter introdu*es the model of the mLAN dri%er7 e+plaining the usage of the

*lasses and ho- the& fit into the 2ri%erStudio frame-or.1 Firstl& a brief des*ription

of the methodolog& of anal&sis used in abstra*ting the ob9e*t model and *lass

intera*tions is presented1 Follo-ing that is an o%er%ie- of the *lass model stru*ture7

the *lasses in%ol%ed and ho- the& relate to ea*h other1 !his ta.es a *on*eptual loo. at

the underl&ing dri%er te*hnolog& used b& the mLAN dri%er1

-.1 Metho&olo(% o7 anal%"i"

!he purpose of the pre%ious 2ri%erStudio *hapter is to pro%ide an understanding of 

the frame-or. used to *reate the mLAN dri%er1 2ri%erStudio *ontains different

modules7 pro%iding de%elopment tools7 e+tensi%e testing utilities and a po-erful

debugger *alled SoftI*e1 SoftI*e requires that building the dri%er is done using the

22 *he*.ed buildJ option7 -hi*h in*ludes debug information into the build1

SoftI*e is able to *on%ert that debug information and the sour*e *ode into a s&mbol

table that allo-s the debugger to step through ea*h line of *ode7 e+amining the %alue

of e%er& %ariable and the memor& allo*ation1

!he ob9e*t model *an be e+trapolated from the sour*e *ode b& e+amining the *lasses

used for the dri%er and de%i*es7 and relating their usage to the 2ri%erStudio

frame-or.1 !his does not present a *hallenge7 but the main fo*us of the pro9e*t7 is in

essen*e to model the intera*tion bet-een the *lasses7 and in parti*ular the ser%i*ing of 

I:O requests1 SoftI*e be*omes a %aluable tool in performing anal&sis of the dri%er 

sour*e *ode7 allo-ing the e+tra*tion of sequen*e diagrams through qui*. and a**urate

anal&sis1 !he usage of data stru*tures and ob9e*ts -ill be*ome *learer through

tra*.ing IOC!L requests from an appli*ation to the dri%er *ode1 !he alternati%e is

manuall& reading the *ode to do*ument the dri%er1

4

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 43/114

>1 Referen*es

-.2 'vervie0 o7 the #la"" Structure

!he ob9e*t,oriented model of the mLAN dri%er is represented in the *lass diagram

 belo-1 !his is the mLAN dri%er7 and in its *ompiled form is *alled mlanbus1s&sJ1

From a high le%el7 the dri%er *an be %ie-ed as a .ernel *omponent7 sin*e it resides in

s&stem addressable memor& spa*e and operates in the .ernel,mode1 It *an onl& be

a**essed b& user,mode appli*ations %ia the IN4' A$I7 -hi*h e+poses dri%er 

fun*tionalit& through IOC!L *odes1

$ig6re .'7 !e8t Model of mLAN Driver

!he *lass that is *on*eptuall& seen b& the s&stem as the dri%er is the CmLanBus2ri%er 

*lass7 -hi*h inherits from the 2ri%er *lass of the frame-or.1 !his is the *lass that*ontains the entr& points into the dri%er *ode1 !hese -ill be *o%ered in a later se*tion

-ith the aid of sequen*e diagrams1 E%er& time the s&stem dete*ts a ne- de%i*e under 

the *ontrol of the dri%er7 it *alls the AddDevice routine of the dri%er *ode1 !he dri%er 

then instantiates a ne- de%i*e ob9e*t of t&pe CmLanBus7 passing it the pointer to the

s&stem,*reated de%i*e ob9e*t obtained from the AddDevice routine1 "pon the *reation

of the de%i*e *lass ob9e*t7 it needs to initialise its lo-er de%i*e ob9e*t of t&pe

$npLo-er2e%i*e1 !his represents the dri%er te*hnolog& on -hi*h the mLAN dri%er 

sits1 !he a*tual me*hani*s of this is handled b& the frame-or. and the I:O manager1

4D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 44/114

>1 Referen*es

!he #inidri%er ob9e*t is a data stru*ture representing another dri%er for ma.ing use of 

ernel Streaming ser%i*es7 modelling the 2ri%erStudio S ar*hite*ture1

CmLan2ri%er#anagedueue is the *lass that ma.es up a dri%er,managed IR$

queue1 !he rest of the *lasses /Ioor.Item and Registr&e&0 are in*luded as

indi*ation of ho- the mLAN dri%er ma.es use of the frame-or.s utilit& *lasses1

-.2.1 Entr% $oint"

!here are three entr& points into the dri%er *ode7 these being the  DriverEntry:

 AddDevice and Dis&atch"ilter routines. !he DriverEntry routine is *alled -hen the

dri%er is first loaded7 gi%ing the dri%er a *han*e to initialise the dri%er state1 !his is

depi*ted belo- in the sequen*e diagram1 2ri%er state %ariables are retrie%ed from the

s&stem registr&7 stored from the last time the dri%er -as loaded1 !he frame-or.s

dispat*h filter me*hanism is enabled1

$ig6re .(7 The Driver"ntry Ro6tine

!he ne+t entr& point is the AddDevice routine7 -hi*h is *alled in response to a ne-

de%i*e being dete*ted1 !his *reates and initialises a de%i*e *lass ob9e*t7 -hi*h in turn

initialises its atta*hed lo-er,de%i*e ob9e*t1 2uring initialisation of the de%i*e *lass

ob9e*t7 the relati%e $o-er and $n$ poli*ies are set1 !hese poli*ies go%ern the -a& the

4>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 45/114

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 46/114

>1 Referen*es

$ig6re .)7 The Disat8h$ilter Ro6tine

3.2.2 4ernel )treaming Minidri(er 

As mentioned abo%e7 the mLAN dri%er ma.es use of a ernel Streaming #inidri%er 

to *ontrol the iso*hronous streaming bet-een the $C and a node on the Fire-ire bus1

It is a dri%er *reated -ith 2ri%erStudio based on the indo-s ernel Streaming

ar*hite*ture1 Belo- is a *lass diagram depi*ting the mLAN spe*ifi* implementation

of the frame-or.s S ar*hite*ture1 !he member fun*tions and %ariables7 for the most

 part7 are left out be*ause the& ha%e no dire*t bearing on this dis*ussion1

6(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 47/114

>1 Referen*es

$ig6re .7 The mLAN ernel Streaming Minidriver Class Diagram

!he CmLanStrm2ri%er *lass is the inherited Stream#inidri%er *lass used to pro%ide

the entr& points of the dri%er1 !he frame-or. responds to the I:O managers *all to

*reate a ne- de%i*e b& *alling +n%reateAda&ter 7 -hi*h *reates the

CmLanStrmAdapter ob9e*t and initialises it1 !he CmLanStrmAdapter ob9e*t *ontains

ob9e*ts representing all possible t&pes of streams that it *an handle7 and -ill

instantiate the required stream *lass1 !he stream *hild *lasses are all inherited from

the same parent *lass7 requiring upon *reation to *all Initialie;ase%lass to set up the

stream parameters1 !hese stream *lasses represent the #I2I and audio data streams

that e+ist in mLANs iso*hronous streaming1 "nfortunatel& #i*rosofts IEEE 3456

dri%er does not support the bridging of multiple busses due to limitations in the

representation of the bus number of the dri%er1 As a result7 the bridge streams are notfull& implemented7 merel& pro%iding a s.eleton for future -or. -hen support for 

multiple busses is implemented1

63

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 48/114

>1 Referen*es

$ig6re .-7 Se?6en8e Diagram for Creating Minidriver

!he diagram abo%e models the intera*tion bet-een the mLAN dri%er and the S

minidri%er in response to an appli*ation based request to begin streaming1 !he points

 before number four in the sequen*e diagram is generi* IOC!L pro*essing7 -hile

 points fi%e to nine represent the request for bus resour*es1 In those requests7

 parameters for the stream are initialised1 $oints ten to fifteen represent the steps ta.en

to *reate the minidri%er ob9e*t1 Essentiall&7 the minidri%er is *alled to be *reated b&

the s&stem *all of I%reateDevice7 -hi*h is required to *ontrol an iso*hronous stream1

!his is *reated b& the de%i*e ob9e*t and stored in dri%er ob9e*t for dispat*hing

 purposes1 !he minidri%er ob9e*t is remo%ed -hen a $n$ IR$ updating the state of the

de%i*e to be remo%edJ is re*ei%ed or the stream it is responsible for *eases

streaming1

3.2.! I/CTL 'is,atching

6'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 49/114

>1 Referen*es

IOC!L *odes are spe*ified -hen using the IR$#;2E<ICECON!ROL ma9or 

fun*tion *ode of the IR$1 As a result7 the dri%er *an pi*. out the IOC!L b& ha%ing a

handler routine for the IR$ that s-it*hes the IOC!L *ode and *alls the appropriate

IOC!L handler routine1

$ig6re .27 Se?6en8e Diagram of I!CTL Disat8hing

!his is a generi* IOC!L dispat*hing me*hanism -hi*h is rele%ant in understanding

the *ommuni*ation aspe*ts of a dri%er1 !here is no need to e+pli*itl& return

information7 as the input and output buffers are *ontained in the IR$7 -hi*h the I:O

manager returns to the appli*ation1

-.3 #ha$ter Summar% 

After dis*ussing the stru*ture of the dri%er7 relating it to the 2# and the

2ri%erStudio frame-or.7 it is no- appropriate to mo%e onto the *hapter *on*erning

the anal&sis and the do*umenting of the IOC!L *odes1

64

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 50/114

>1 Referen*es

*. I/CTL Anal&sis and A%I design

!his *hapter represents the -or. done to do*ument the IOC!L *odes and the

respe*ti%e handler routines of the mLAN dri%er1 !he purpose of this is to pro%ide

information *on*erning the IOC!Ls in order to propagate understanding of ho- the

IOC!Ls -or. and their intended usage1 Firstl&7 an o%er%ie- of the usage and form of 

IOC!Ls in regard to the mLAN dri%er is gi%en1 2ue to the number of IOC!L *odes7 it

is prudent to group them a**ording to their underl&ing fun*tion1 Ea*h group is

identified and e+plained1 Follo-ing that is a brief se*tion des*ribing the issues

surrounding the anal&sis of the dri%er1

 

.1 mLA &river I'#TL co&e"

!he mLAN dri%er implements IOC!L fun*tion *odes in the *ustom range from '(6>

to 6(5)1 !he %alues from ( to '(6> are reser%ed for use b& #i*rosoft K#S2N7 '(()1

!his allo-s independent hard-are %endors and other t&pes of *ompanies that -rite

dri%ers to pro%ide spe*ialised IOC!L for their dri%ers7 and remo%es an& o%erlapping

that might e+ist for de%i*es of a similar t&pe1 !he enumeration of the IOC!L *odes for 

the mLAN dri%er *an be found in mlbusdr%io*tl1hJ1 Belo- is an e+ample of a ma*ro

for IOC!Ls7 defining the name of the *ontrol *ode1

/e0ine  IOCTL_-LAN_ALLOCAT,_STR,A- CTL_CO%,(.IL,_%,1IC,_+NKNO2N3

456443 -,T7O%_8+..,R,%3 .IL,_AN9_ACC,SS)

/e0ine  IOCTL_-LAN_AS9NC_LOCK CTL_CO%,(.IL,_%,1IC,_+NKNO2N3 45:43

-,T7O%_8+..,R,%3 .IL,_AN9_ACC,SS)

$ig6re -.'7 Code eE8ert from Fml6sdrvio8tl.hG

!he first parameter spe*ifies the t&pe of de%i*e the IOC!L is targeted at1 #i*rosoft

has a list of de%i*e t&pes predefined b& the operating s&stem7 of -hi*h ea*h de%i*e

t&pe has its o-n asso*iated set of fun*tion *odes1 !he usage of .IL,_%,1IC,_+NKO2N

in this *ase is be*ause a mLAN de%i*e must ma.e use of *ustom IOC!L fun*tion

*odes and no de%i*e similar to the mLAN de%i*e e+ists1 !he se*ond parameter is the

fun*tion *ode of the IOC!L7 -hi*h gi%es the a*tion of the IOC!L1 !his is important7as it is used in differentiating bet-een different IOC!L *odes for the same de%i*e

66

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 51/114

>1 Referen*es

t&pe1 !he third parameter spe*ifies ho- buffers are passed for I:O and file s&stem

*ontrols1 Input and output buffers are used to store and a**ess the data *ontained in

the IR$1 !o re*ap7 IR$s ha%e fields for the input and output buffers used in the

 pro*essing of the IOC!L and the data that is returned to the appli*ation1 !his is the

IR$ that the IO manager *reates to *ommuni*ate -ith the dri%er1 !he fourth parameter 

des*ribes the a**ess le%el that the IOC!L handler routine has o%er the IR$1

!he mLAN dri%er pro%ides and implements 4 different IOC!L *odes and their 

respe*ti%e handler routines1 2ue to spa*e limitations in this -rite up7 the IOC!L

*odes are too length& to be dealt -ith indi%iduall& and -ill be grouped b& their *ore

fun*tionalit&1 For e+ample7 all 3>>4 related IOC!LS -ill be grouped together1 !his

is not a fair representation of the IOC!L *odes as ea*h IOC!L handles a spe*ifi*

a*tion1 For the do*umentation of ea*h spe*ifi* IOC!L7 please refer to the Appendi+1

!here are fi%e groups into -hi*h ea*h IOC!L *ode *an be *ategorised1 For ea*h of 

these groups a brief dis*ussion des*ribing the intentions of the IOC!L *odes -ill be

gi%en7 follo-ed b& detailed do*umentation of one IOC!L *ode from that group1

*.1.1 I 1!"# based mLAN I/CTL codes

!hese IOC!Ls are implementations of IEEE 3456 *lass *alls based on the IEEE 3456

 bus dri%er1 !he& are *hara*terised b& their fun*tion and *ommuni*ation -ith the IEEE

3456 bus dri%er1 Belo- is a table *ontaining the IOC!L *odes in this group -ith a

 brief des*ription1

I!CTL 8ode Des8rition

IOCTL_-LAN_A%%R,SS_RANG,_NOTI.9

Returns the node address of the

sour*e of an I:O operation on the

spe*ified address range

IOCTL_-LAN_S,T_A%%R,SSSets the address of the allo*ated

address range

IOCTL_-LAN_G,T_A%%R,SSRetrie%es the address of the node of

the allo*ated address range

IOCTL_-LAN_.R,,_A%%R,SS_RANG,Frees a pre%iousl& allo*ated address

range

IOCTL_-LAN_AS9NC_LOCK

$erforms a lo*.ed as&n*hronous

operation on the indi*ateddestination address

6)

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 52/114

>1 Referen*es

IOCTL_-LAN_AS9NC_R,A%$erforms an as&n*hronous read

operation from the sour*e address

IOCTL_-LAN_AS9NC_2RIT,

$erforms an as&n*hronous -rite

operation on the indi*ated

destination address

IOCTL_-LAN_8+S_R,S,T_NOTI.9 aits for a bus reset to o**ur IOCTL_-LAN_8+S_R,S,T Initiates a bus resetIOCTL_-LAN_G,T_A%%R_.RO-_%,1IC,_O8<,CT  Not implementedIOCTL_-LAN_G,T_LOCAL_7OST_IN.O Returns lo*al host informationIOCTL_-LAN_G,T_SP,,%_TOPOLOG9_-APS Obsolete

IOCTL_-LAN_S,N%_P79_CON.IG_PACK,TSends $H? *onfig pa*.et request to

the 3456 bus dri%er IOCTL_-LAN_G,T_LOCAL_NO%,_A%%R,SS Returns the lo*al node address

IOCTL_-LAN_G,T_C7ANN,LS_A1AILA8L,Returns the band-idth and *hannels

*urrentl& a%ailableIOCTL_-LAN_ALLOCAT,_C7ANN,L

Allo*ates the spe*ified *hannelIOCTL_-LAN_R,L,AS,_C7ANN,L Releases the allo*ated *hannel

IOCTL_-LAN_G,T_8AN%2I%T7_A1AILA8L,Returns the band-idth and *hannels

*urrentl& a%ailableIOCTL_-LAN_ALLOCAT,_8AN%2I%T7 Allo*ates the spe*ified band-idthIOCTL_-LAN_R,L,AS,_8AN%2I%T7 Releases the allo*ated band-idth

!he mLAN dri%er must do additional pro*essing in the IOC!L handler routine7 rather 

than submit the request straight to the underl&ing IEEE 3456 bus dri%er1 !here are

some IOC!L *alls that do not *ommuni*ate -ith the Fire-ire dri%er7 but instead a*t

on or use IEEE 3456 related data stru*tures1 It is through this additional pro*essing

that the inherent fun*tionalit& of the mLAN dri%er be*omes apparent7 as -ell as the

la&ered nature of the 2# ar*hite*ture1 In order to *ommuni*ate -ith the Fire-ire

dri%er7 an IRB has to be *onstru*ted -ith a fun*tion *ode spe*ified7 the IRB pa*.aged

into an IR$7 and submitted to the Fire-ire dri%er1 !he a*tual me*hanism uses a pointer 

to an IRB that is passed to the IR$7 allo-ing /upon *ompletion of the IR$0 the

response data to be e+tra*ted from the IRB1 !he fun*tion *ode di*tates the data

stru*ture to be used7 as it is forms a union -ith the IRB1 @enerall& the pa*.ets sent to

the bus tend to be transmitted as&n*hronousl&7 as the& are *ontrol pa*.ets1

!he usage of this group of IOC!LS *an be further *ategorised into sub groups that

either allo*ate or de,allo*ate IEEE 3456 resour*es7 modif& or return dri%er state

information7 initiate an as&n*hronous request7 or setup a notifi*ation of some e%ent1 In

order to effe*ti%el& use the Fire-ire bus7 *ertain *onfiguration and dri%er state

information has to be .no-n b& the appli*ation1 !his -ill be used in subsequent

6

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 53/114

>1 Referen*es

requests of Fire-ire resour*es1 For instan*e7 the appli*ation has to .no- the bus speed

in order to request band-idth resour*es1 A resour*e7 in this *ase7 is something

*ontrolled b& the Fire-ire dri%er1 For the mLAN dri%er to ma.e use of the resour*e7

an appropriate request has to be sent to the Fire-ire dri%er1 If there are enough free

resour*es to allo*ate7 a handle to the requested resour*e is returned1 If the resour*e is

no longer used7 it should be de,allo*ated and be returned to the pool of free resour*es1

An address range7 *hannel number7 and band-idth are resour*es that are allo*ated to

the mLAN dri%er b& the IEEE 3456 bus dri%er1 !hese need to be allo*ated before an&

as&n*hronous requests *an be made1 !here are times -hen an appli*ation needs to be

notified of an e%ent that ta.es pla*e independent of an& determinable fa*tors1 I:O

operations on an allo*ated address range or a bus reset are t-o instan*es of e%ents that

an appli*ation -ould -ant to be a-are of1 A request for notifi*ation -ill return a

 pointer to an e%ent ob9e*t7 -hi*h *an be polled to *he*. if the e%ent has transpired1 It

is ad%isable to setup a -aiting thread to a%oid lo*.ing up the appli*ation1

An in,depth e+planation of an IOC!L *ode handler routine from the IEEE 3456 group

-ill ser%e as an e+ample7 to gi%e a template for those *ontained in the appendi+1 !he

*ode7 IOC!L#LANALLOCA!EA22RESSRAN@E7 is *hosen as an e+ample1

@i%en belo- is the e+tra*t of the IOC!L e+planation from the appendi+1 First is the

spe*ifi*ation of the input buffer7 follo-ed b& the output buffer1 It depends on the

IOC!L as to -hat data stru*tures or data primiti%es are used as input and output1 In

this *ase it is a pointer to an ALLOCAT,_A%%R,SS_RANG, stru*t1

Follo-ing that is a te+tual des*ription of the IOC!L7 gi%ing a brief o%er%ie- of the

intended a*tion to be performed1 Belo- the des*ription is a diagram representing a

h&brid bet-een a ard and #ellor Stru*tured 2ata 2iagram Kard7 et al7 35>)7 and

Larr& Constantines 2ata Flo- 2iagram1 It is h&bridised be*ause neither method

neatl& en*apsulates the IOC!L handler7 but rather ta.ing elements from both methods

and *ombining them &ields a *learer pi*ture1 !he entire diagram *an be %ie-ed as

 pro*ess instead of ea*h full *ir*le7 as in the ard and #ellor approa*h1 !he dotted

*ir*le still represents a trigger for the pro*ess7 responding to the IR$ dispat*h routine1

!he parallel lines represent a data store7 *ommon to both methods of modelling1 Ea*h

full *ir*le represents a sub,pro*ess that a*ts on a data store1 !he dotted lines represent

the flo- of the trigger7 -hile the solid lines represent the flo- of data and *ontrol1

After the stru*tured data diagram is the abo%ementioned data stru*ture used as input

6D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 54/114

>1 Referen*es

and output in the IOC!L *all1 Note that the data stru*tures are do*umented in a

separate se*tion of the appendi+1

Input Buffer

A $ointer to an ALLOCAT,_A%%R,SS_RANG, stru*t1

Output Buffer

A pointer to the same ALLOCAT,_A%%R,SS_RANG, stru*t1

!e+tual 2es*ription

!he stru*t spe*ifies the address range that -ill be allo*ated in Host Controller address

spa*e b& the IEEE 3456 bus dri%er1 An address range has to be allo*ated before the

host *ontroller *an respond to an& *ommuni*ation from that node1 !he mLAN dri%er 

sends an IRB *ontaining the address range to the 3456 dri%er1 !he IRB fun*tion *ode

is that of R,+,ST_ALLOCAT,_A%%R,SS_RANG, 1 A handle to the address range is

returned1

t>pee0 struct _ALLOCAT,_A%%R,SS_RANG,   IN +LONG 0u'A''ocate.'a?s;  IN +LONG 0u'.'a?s;  IN +LONG nLen?t;  IN +LONG -a5Se?#entSi@e;  IN +LONG 0u'AccessT>pe;  IN +LONG 0u'Noti0icationOptions;  O+T A%%R,SS_O..S,T ReuireB:DO00set;  O+T 7AN%L, AressRan?e;  IN +C7AR %ataEBF;* ALLOCAT,_A%%R,SS_RANG,3 PALLOCAT,_A%%R,SS_RANG,;

6>

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 55/114

>1 Referen*es

In this parti*ular IOC!L *all7 the "CHAR 2ataK3 field of the data stru*ture spe*ifies

the beginning of the address range to be used1 !he "LON@ nLength field spe*ifies

ho- long the address range -ill be1 In the IOC!L handler routine a buffer in s&stem

memor& is *reated to hold the address range1 !his is used in the IRB union stru*t1 !he

rest of the input fields are there to spe*if& parameters to be used in the IRB1 !hese

relate to memor& management7 *ompletion notifi*ation and broad*ast features of the

as&n*hronous request1 !he Fire-ire dri%er returns a handle to the allo*ated address

range and an A22RESSOFFSE! stru*t that *ontains the IEEE 3456 node address1

!he information is a%ailable from the stru*t that -as used as input to the IOC!L1

*.1.2 )tream based mLAN I/CTL codes

!he onl& differen*e bet-een this group of IOC!Ls and the pre%ious is that these

IOC!Ls deal -ith the iso*hronous nature of the mLAN s&stem1 As before7 some of 

these IOC!L handler routines do not *ommuni*ate -ith the IEEE 3456 dri%er7 the&

are grouped here b& the manner in -hi*h the& intera*t -ith stream related stru*ts used

 b& the mLAN dri%er1 !he main fo*us of this group is the management of stream data

stru*tures used to represent a stream7 and the sequen*es that ma.e up a stream1 Astream is %ie-ed as another IEEE 3456 resour*e1 Li.e an& other resour*e7 it has to be

allo*ated before it *an be used7 and de,allo*ated -hen it is not in use1 An allo*ated

stream e+ists in t-o states7 started and stopped1 !here are IOC!Ls that handle these

a*tions7 as -ell as return stream spe*ifi* information1 !he table belo- *ontains the

 brief des*ription of the IOC!Ls *ontained in this group1

I!CTL 8ode Des8ritionIOCTL_-LAN_START_STR,A- Starts the allo*ated streamIOCTL_-LAN_STOP_STR,A- Stops the allo*ated streamIOCTL_-LAN_G,T_STR,A-_IN.O Returns information of the streamIOCTL_-LAN_.R,,_STR,A- Frees the allo*ated streamIOCTL_-LAN_G,T_%RI1,R_1,RSION Returns the dri%er %ersion

IOCTL_-LAN_CONN,CT_S,+,NC,S_TO_%,1IC,SCreates the *onne*tion map of 

sequen*esIOCTL_-LAN_S,T_S9T_SO+RC, Sets the bus master field

!his groups IOC!L sho-*ase is the IOC!L#LANALLOCA!ES!REA#

handler routine1 Follo-ing the same format as abo%e7 the IOC!L ma.es use of the

65

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 56/114

>1 Referen*es

-LAN_ISOC7_PARA- stru*t1 !he mLAN dri%er *ommuni*ates -ith the IEEE 3456 bus

dri%er se%eral times to request Fire-ire resour*es1 !hese are requests for allo*ating a

*hannel7 band-idth7 and a resour*e handle for transa*tions1 !he resour*e handle is

required for requesting and atta*hing buffers to the stream1 In terms of the input

required for the IOC!L7 t-o mLAN stru*ts form fields of the input stru*t used to pass

information for use in the requests1

Input Buffer

!he input buffer uses a -LAN_ISOC7_PARA- stru*t7 -hi*h spe*ifies the t&pe of the

stream to be used1

Output Buffer

!he same stru*t is returned7 spe*if&ing the allo*ated stream information1

!e+tual 2es*ription

!he request responds to the need to allo*ate an iso*hronous stream resour*e spe*ified

 b& the input stru*t1 It goes through se%eral steps to allo*ate a stream resour*e1 It

*reates the spe*ified stream t&pe7 and gets a *hannel from the underl&ing 3456 bus

dri%er1 !he IRB fun*tion *odes submitted to the Fire-ire dri%er are as follo-s

R,+,ST_ISOC7_ALLOCAT,_8AN%2I%T73 R,+,ST_ISOC7_ALLOCAT,_C7ANN,L3

R,+,ST_ISOC7_ALLOCAT,_R,SO+RC,S3 R,+,ST_ISOC7_ATTAC7_8+..,RS1 Inside

the stru*t7 a pointer is pro%ided to a -LAN_STR,A-_STAT+S stru*t7 -hi*h *ontains the

information about the allo*ated stream1

t>pee0 struct _-LAN_ISOC7_PARA- O+T 7AN%L, Strea#;

O+T -LAN_STR,A-_STAT+S Strea#Status;O+T +LONG ,rrorCoe;

)(

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 57/114

>1 Referen*es

O+T +LONG a8it#apC'ientE-LAN_-AH_N+-_S,+,NC,S  +LONG_8ITSIJ,F;

IN -LAN_STR,A-_CON.IG #LANStrea#Con0i?;IN -LAN_%ATA_.I,L%_CON.IG #LAN%ata.ie'Con0i?;

* -LAN_ISOC7_PARA-3 P-LAN_ISOC7_PARA-;

!he -LAN_STR,A-_CON.IG   stru*t des*ribes the required stream *onfiguration7 in

 parti*ular the bus speed7 stream t&pe7 *hannel7 and buffer related information1 !he

-LAN_%ATA_.I,L%_CON.IG stru*t des*ribes the intended *onfiguration of the stream

data7 and -ill be returned -ith e+tra information *on*erning the indi%idual sequen*es1

A third stru*t7 -LAN_STR,A-_STAT+S 7 returns information about the allo*ated stream

and indi%idual sequen*e status1 !he primar& field in the -LAN_ISOC7_PARA- stru*t is

the handle to the allo*ated stream1 !he stream handle is required for an& subsequent

stream related operation1

*.1.! *1++! based mLAN I/CTL codes

!he IEC 3>>4 based group of IOC!L *odes are *hara*terised b& the underl&ing use

of the 3>>4 proto*ol dri%er and the 3>>4 spe*ifi* stru*ts that the& a*t on1 Similar to

the use of the IEEE 3456 bus dri%er7 the IOC!L handler routines utilises the

fun*tionalit& of the 3>>4 proto*ol dri%er and ha%e to build an A<3>>4Request7

spe*if&ing the fun*tion *ode and setting the *orre*t data for input1 !he request is

submitted to a pro*ess responsible for building a suitable IR$ and sending it to the

3>>4 proto*ol dri%er1 It is possible to further di%ide this group into three sub groups

featuring

•  Notifi*ation requests

• Fun*tion Control $roto*ol /FC$0 pa*.et requests

• $lug related requests

!he notifi*ation sub,group sets up *allba*. routines to -ait for the spe*ified e%ent to

o**ur1

!he Fun*tion Control $roto*ol sub,group allo-s the sendJ and getJ of request and

response FC$ pa*.ets to and from the bus1 An FC$ pa*.et is an A<:C *ommand or 

response en*apsulated in a FC$ frame1 !he FC$ pa*.et is then re*ei%ed from or 

transmitted to a de%i*e on the bus b& the IEEE 3456 dri%e %ia the IEC 3>>4 proto*oldri%er1

)3

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 58/114

>1 Referen*es

!he last sub,group has to do -ith plug,related requests su*h as *reating and deleting a

 plug7 *onne*ting and dis*onne*ting plugs7 and setting and getting plug state

information1 !he IOC!Ls are briefl& des*ribed belo-1

I!CTL 8odes Des8ritionIOCTL_-LAN_B66_G,T_PL+G_7AN%L, Returns a handle to the spe*ified plugIOCTL_-LAN_B66_CR,AT,_PL+G Returns a handle to a ne-l& *reated plug

IOCTL_-LAN_B66_PL+G_NOTI.9

Returns an e%ent handle that indi*ates

-hen an operation is performed on the

 plugIOCTL_-LAN_B66_%,L,T,_PL+G 2eletes a plugIOCTL_-LAN_B66_%ISCONN,CT_PL+G 2is*onne*ts the spe*ified *onne*tion

IOCTL_-LAN_B66_G,T_.CP_R,+,STReturns the ne+t FC$ request pa*.et from

the queue

IOCTL_-LAN_B66_G,T_.CP_R,SPONS,Returns the ne+t FC$ response pa*.et

from the queueIOCTL_-LAN_B66_G,T_PL+G_STAT, Returns the state of the spe*ified plugIOCTL_-LAN_B66_S,N%_.CP_R,+,ST Sends FC$ request to the de%i*e

IOCTL_-LAN_B66_S,T_.CP_NOTI.9Registers a *lient dri%er notifi*ation of 

FC$ requests or responsesIOCTL_-LAN_B66_S,N%_.CP_R,SPONS, Sends FC$ response to the de%i*eIOCTL_-LAN_B66_S,T_PL+G Changes transmission settings for a plug

An e+ample from this group is the IOC!L#LAN3>>4CONNEC!$L"@

handler routine1 !he input buffer re*ei%es a pointer to a C-P_CONN,CT stru*t7 -ith the

same stru*t being returned1 Of the input stru*ts used for the %arious IOC!L *alls7

those that ma.e use of the 3>>4 proto*ol dri%er mirror e+isting 3>>4 data

stru*tures1 !he C-P_CONN,CT stru*t is no e+*eption and pro%ides handles to the input

and output plugs that are intended to be *onne*ted1 !-o other 3>>4 stru*ts are used

to spe*if& the *onne*tion t&pe and data format to be used in the streams1 !hese are the

C-P_CONN,CT_T9P, and the CIP_%ATA_.OR-AT stru*ts1 !he output of the IOC!L *all

is a handle to a plug *onne*tion1

Input Buffer

!he input buffer ta.es a C-P_CONN,CT stru*t1

Output Buffer

!he same stru*t is returned1

)'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 59/114

>1 Referen*es

!e+tual 2es*ription

!he request is for-arded to the underl&ing 3>>4 proto*ol dri%er7 using the handles of 

 plugs *ontained in the input stru*t to spe*if& -hi*h plugs to *onne*t1 A fun*tion *ode

ofA&B66_Connect

is used1 A handle to the *onne*tion is returned1

t>pee0 struct _C-P_CONN,CT

  IN 7AN%L, OutputP'u?;IN 7AN%L, InputP'u?;IN C-P_CONN,CT_T9P, T>pe; IN CIP_%ATA_.OR-AT .or#at; 

O+T 7AN%L, Connect; * C-P_CONN,CT3 PC-P_CONN,CT;

*.1.# A)I/ based mLAN I/CTL codes

!he ne+t group of IOC!Ls7 sho-n belo-7 is the ASIO based *alls7 -hi*h is a mLAN

implementation of ASIO fun*tionalit&1

I!CTL 8odes Des8rition

IOCTL_-LAN_ASIO_INIT

Returns the *urrent state information of 

the ASIO dri%er and ASIO streams7 and

initialises the dri%er IOCTL_-LAN_ASIO_.R,, Frees up ASIO allo*ated buffersIOCTL_-LAN_ASIO_ALLOC Allo*ates ASIO buffers and resour*esIOCTL_-LAN_ASIO_STOP Stops the ASIO dri%er IOCTL_-LAN_ASIO_CL,AN+P Remo%es ASIO related ob9e*ts

IOCTL_-LAN_ASIO_IN.OReturns the *urrent state information of 

the ASIO dri%er and ASIO streamsIOCTL_-LAN_ASIO_R,S,T Resets the ASIO dri%er 

)4

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e3>>4

$roto*ol

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 60/114

>1 Referen*es

ASIO /Audio Streaming Input Output0 is an A$I that pro%ides the basis for an audio

streaming dri%er to ma.e use of multiple *hannels7 o%er*oming limitations of 

#i*rosoft supplied audio streaming dri%ers1 !he *lasses *an be o%erridden su*h that

the needed fun*tionalit& *an be e+tra*ted1 !he mLAN dri%er uses the ASIO *lasses to

*reate a *lient ASIO dri%er for use b& appli*ations requiring audio re*ording and

 pla&ba*. *apabilities1 !he follo-ing diagram sho-s the finite state ma*hine diagram

of the dri%er7 illustrating the operation states and the operation that *hanges the state1

!here are four states aded: Initialised: Pre&ared  and -unnin( 1 !he adin(   state

implies the dri%er *ode is a**essible b& the appli*ation or ASIO *lient1 !he operating

state is  Initialised  -hen the dri%er is allo*ated b& the appli*ation and *an a**ept

inquiries1 !he  Pre&ared  state is attained -hen buffers are allo*ated and is read& to

mo%e to the -unnin(  state1 !he -unnin(  state signifies that the hard-are is a*ti%e and

streaming is ta.ing pla*e1

$ig6re -.(7 ASI! $inite State Diagram 9ASI!: (==;

!he IOC!L *alls mirror the operations that *hange states of the ASIO dri%er1 !here is

an INI! IOC!L *all that initialises the ASIO dri%er -ith mLAN spe*ifi* information7

and returns e%ent ob9e*ts to be used b& the ASIO *lient1 !he ALLOC IOC!L allo*ates

 buffers to be used b& the appli*ation7 hard-are and dri%er7 -hile the FREE IOC!L

releases those buffers1 !he CLEAN"$ IOC!L returns the ASIO dri%er to the  aded 

)6

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 61/114

>1 Referen*es

state1 !here are other IOC!L *odes that spe*if& an ASIO reset7 and retrie%e

information about the ASIO dri%er1 !he IOC!L that -ill ser%e as this se*tions

e+ample is IOC!L#LANASIOS!AR!1 !he input stru*t is a single field

spe*if&ing the result of the operation of the *all1 !here is onl& e%er one ASIO dri%er to

 be used b& an appli*ation or ASIO *lient7 though ea*h stream *an be asso*iated -ith a

set of ASIO buffers1 !his IOC!L *all *lears the buffers before re*ording begins1 !he

ASIO dri%er is s&n*hronised -ith the mLAN dri%er b& pointing both dri%ers to same

 position in the buffer1 !he ASIO dri%er state is then set to -unnin( 1

Input Buffer

!he input buffer ta.es a -LAN_ASIO_CO--AN%_PARA-  stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request starts ASIO pro*essing7 s&n*hronising -ith the ASIO dri%er1

t>pee0 struct _-LAN_ASIO_CO--AN%_PARA- +LONG errorCoe;

* -LAN_ASIO_CO--AN%_PARA-3 P-LAN_ASIO_CO--AN%_PARA-;

*.1.3 -'M )treaming based mLAN I/CTL codes

!his group of IOC!Ls is implemented for the e+press use b& the 2# Streaming

#inidri%ers1 !he IOC!Ls are used -ith the IR$IN!ERNAL2E<ICECON!ROL

*ode1 !his is for inter,dri%er *ommuni*ation1 Ea*h minidri%er ob9e*t is *reated in

order to *ontrol a stream resour*e1 !he minidri%er ob9e*t is *reated -hen there is a

request to start streaming7 and o-nership is gi%en to the mLAN bus dri%er1 In essen*e7

the minidri%er be*omes a *hild de%i*e of the mLAN bus dri%er7 establishing another 

le%el in the dri%er sta*.1

))

IR$IR$

2ispat*hfor IOC!L

*odes

IOC!LHandler

RoutineCalls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 62/114

>1 Referen*es

hen the mLAN bus dri%er is required to *reate an e+tra *hild de%i*e to *ontrol a

stream7 it ma.es a s&stem *all I%reateDevice. !his *reates a de%i*e ob9e*t in s&stem

memor& and returns a pointer to the ne-l& *reated de%i*e ob9e*t1 !he *reator of the

de%i*e ob9e*t is responsible for maintaining the ob9e*t7 su*h as deleting it -hen it is

no longer required1 !he dri%er that is used to *reate the ob9e*t is determined b&

 parameters *ontained in the I%reateDevice *all1 Spe*if&ing the de%i*e t&pe -ill let

the I:O manager .no- -hat de%i*e ob9e*t to *reate7 and -ill initialise the appropriate

2E<ICEOB;EC! fields1

After this *all7 the I:O manager -ill ha%e a dri%er ob9e*t and de%i*e ob9e*t stored in

s&stem memor& /refer to Chapter 401 It -ill .no- -hat dri%er to load b& the t&pe

spe*ified in the *reation *all and b& a**essing the mLAN dri%er INF file1 !he INF file

spe*ifies dri%er related information to be stored in the registr&7 as is used b& the $n$

manager -hen a dri%er is first loaded1 !he INF file also spe*ifies the dri%ers to be

used for ea*h de%i*e the dri%er is responsible for1 In this -a&7 the mLAN dri%er 

 publishes its usage of the 2# Stream minidri%ers1 An e+tra*t from the INF file is

sho-n belo-1 !he Versin se*tion spe*ifies the t&pe of de%i*e and @"I2 of the *lass

of de%i*e7 and the %ersion of the dri%er1 !he man;us se*tion publishes the de%i*es

the dri%er is responsible for /a mLAN de%i*e and the streams01

E1ersionFC'ass=-,%IAC'assG+I%=De:c!e!BBce!M0cB!4644MeB4B6*Pro&ier=#Lan8us$Pro&ier%ri&er1er=4B44D3B$B$$4Cata'o?.i'e=#Lan8us$cat

E#Lan8usF#Lan8us$%e&ice%esc=#Lan8us$INSTALL3 1B:D-LAN_8+S

#Lan-I%IStr#%e&ice%esc=#L-I%IStr#3 -LAN_8+SCO-PATI8L,-I%ISTR,A-#Lan-I%IOutStr#%e&ice%esc=#L-I%IStr#3 -LAN_8+S-I%IO+TSTR,A-

#Lan-I%IInStr#%e&ice%esc=#L-I%IStr#3 -LAN_8+S-I%IINSTR,A-#LanAuioOutStr#%e&ice%esc4B=#LAuioStr#3-LAN_8+SA+%IOO+TSTR,A-QA%APT,R_4B#LanAuioOutStr#%e&ice%esc4=#LAuioStr#3-LAN_8+SA+%IOO+TSTR,A-QA%APT,R_4#LanAuioOutStr#%e&ice%esc4=#LAuioStr#3-LAN_8+SA+%IOO+TSTR,A-QA%APT,R_4#LanAuioOutStr#%e&ice%esc4D=#LAuioStr#3-LAN_8+SA+%IOO+TSTR,A-QA%APT,R_4D#LanAuioInStr#%e&ice%esc4B=#LAuioStr#3 -LAN_8+SA+%IOINSTR,A-QA%APT,R_4B#LanAuioInStr#%e&ice%esc4=#LAuioStr#3 -LAN_8+SA+%IOINSTR,A-QA%APT,R_4#LanAuioInStr#%e&ice%esc4=#LAuioStr#3 -LAN_8+SA+%IOINSTR,A-QA%APT,R_4#LanAuioInStr#%e&ice%esc4D=#LAuioStr#3 -LAN_8+SA+%IOINSTR,A-QA%APT,R_4D

$ig6re -.*7 "Etra8t from mlan6s.IN$

!he 2# Streaming #inidri%er *reated b& ?amaha is a separate 2ri%erStudio

 pro9e*t1 It is based on the C88 frame-or. of *lasses that en*apsulates the indo-s

)

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 63/114

>1 Referen*es

ernel Streaming Ar*hite*ture /See Chapter 4 for an e+planation of the S Streaming

Ar*hite*ture01 In terms of this implementation7 the mLAN bus dri%er forms the

frame-or.s lo-er de%i*e ob9e*t *lass for the adapter1 !his is to establish *lear lines

of *ommuni*ation -ithin the dri%er sta*.1 !he diagram belo- des*ribes the

intera*tion of the three ernel Streaming *lasses -ith the mLAN dri%er1

$ig6re -.)7 ernel Streaming Ar8hite8t6re

!he lo-er le%el dri%ers and hard-are represents those dri%ers at the bottom of thesta*. *losest to the HAL7 responsible for re*ei%ing from and transmitting data onto

the IEEE 3456 bus1 Although the mLAN dri%er is the lo-er de%i*e for the 2#

Streaming minidri%er in the 2ri%erStudio frame-or.7 *on*eptuall& the mLAN dri%er 

o-ns and is responsible for the Streaming minidri%er1

.2 Im$lementation I""ue"

As dis*ussed in the 2ri%erStudio *hapter7 %ersioning issues *an halt progress in

 building a dri%er through in*ompatibilit& issues1 !he sour*e *ode of the mLAN dri%er 

-as released and built using %ersion '1D of 2ri%erStudio1 Current anal&sis of the

dri%er is done using the latest %ersion 41'7 follo-ing se%eral *hanges to the 2#1 As

a result7 a fundamental *hange in the underl&ing fun*tioning of at least one *lass

/rele%ant to its usage0 is found7 lea%ing the *lass obsolete1 !o build the dri%er -ith the

*urrent %ersion of 2ri%erStudio requires that the depre*ated *lasses in the *ode be

repla*ed -ith the ne- *lasses1 !his requires the modifi*ation of the dri%er sour*e

)D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 64/114

>1 Referen*es

*ode1 !his -as unsu**essful as a number of *riti*al errors -ere found during this

stage7 unfortunatel& further -or. required more time and -as out of the s*ope of the

 pro9e*t1

!he purpose of rebuilding the dri%er is to in*lude debugging information7 and in

 parti*ular is to use the *he*.ed buildJ option of the 221 !his results in state

information about %ariables and memor& allo*ation being readil& a%ailable to

debugger s&stems1 In terms of the 2ri%erStudio en%ironment7 a po-erful debugger 

s&stem *alled SoftI*e is able to translate debug information in*luded in the *he*.ed

 buildJ option into a s&mbol table1 !his allo-s SoftI*e to step through the e+e*ution of 

the dri%er *ode line b& line and tra*. %ariable state information and memor&

allo*ation1 !his pro%ides a po-erful tool for anal&sis of the operation of dri%er *ode1

La*.ing the use of the po-erful debugger tool7 anal&sis of the IOC!L *ode handler 

routines is *arried out manuall&7 e+amining the sour*e *ode7 requiring more time

double *he*.ing the anal&sis1

.3 #ha$ter Summar% 

!he anal&sis of the mLAN dri%er is *omplete7 although there remain areas la*.ing in

*larit& that *an be resol%ed a**uratel& through the use of a po-er debugger1 It -ould

 be more *on*lusi%e if that form of anal&sis -as *arried out7 unfortunatel& due to

limitations of time and the s*ope of the pro9e*t7 it -as not1 !he IOC!L *odes *an be

grouped b& the underl&ing usage of data stru*tures and requests made7 -hi*h neatl&

sho-s the modularisation of the dri%er1 !hese modules represent a *ore area of 

fun*tionalit& of the mLAN s&stem b& -a& of the dri%er1

)>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 65/114

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 66/114

>1 Referen*es

!he ob9e*t model of the mLAN dri%er relates to the 2# through the use of the

2ri%erStudio frame-or.1 In *hapter fi%e7 the stru*ture of the dri%er is presented1 From

this7 it is possible to understand ho- the *lasses *onform to the 2#1 It is

unfortunate that the ideal methodolog& of anal&sis *ould not ha%e been pursued1 !his

limits the anal&sis7 -here *larit& is sa*rifi*ed through the manual approa*h of 

anal&sis7 -hi*h *an be resol%ed a**uratel& through the use of a po-er debugger1 It

-ould be more *on*lusi%e if that form of anal&sis -as *arried out7 unfortunatel& due

to the in*ompatibilit& issues e+perien*ed and the limitations of time and the s*ope of 

the pro9e*t7 it -as not1

.2 uture E!ten"ion"

As a possible e+tension7 modif&ing the dri%er su*h that it builds should &ield

interesting results through further anal&sis1 !he dri%er -ould then be read& to be

modified to further in%estigate the potentialit& of the mLAN s&stem in audio

streaming1 Further e+tensions -ould be to in%estigate the possibilit& of e+tending the

dri%er to be *ompatible -ith the ne+t %ersion of the indo-s operating s&stem7 or to

in%estigate the usage of %ideo streaming should and A< *apable de%i*e be de%eloped1A further e+tension is to port the dri%er to the ne- dri%er ar*hite*ture that -ill be seen

in the ne+t %ersion of the indo-s operating s&stem1

(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 67/114

>1 Referen*es

+. 0eferences

KAE Notes7 '(() Audio Engineering Course Notes7 '(()

KAnderson7 3555 Anderson7 21 "ireire System Architecture< IEEE1394a: 'nd 

Edition7 #indshare In*17 Addison,esle&7 3555

KASIO7 '(() Steinberg7 Audi Streamin( In&ut +ut&ut 2.1 SD: '(()

KCant7 3555 Cant7 C1 ritin( ind#s D) Device Drivers: RQ2 Boo.s7

La-ren*e7 3555

K2ri%erStudio7 '((6 Compu-are Corporation7 2ri%erStudio <ersion 41'7 '((6

KHaig7 '((' Haig7 21 "ire#ire ;reaut ;= Driver: Honours !hesis7 Rhodes"ni%ersit&7 '(('

K#*enie7 '((4 #*enie7 B1 1394 5de>Tar(eted Asynchrnus Trans!ers 

KOnline http::---1-d,41*om:ar*hi%e: 3456Node!ransfers1htm7 '((4

K#S2N7 '(() #i*rosoft 2e%elopers Net-or. /#S2N0 Librar&7 April '(()

KOne&7 3555 One&7 1 Pr(rammin( the )icrs!t ind#s Driver )del:

#i*rosoft $ress7 ashington7 3555

KOne&7 '((4 One&7 1 Pr(rammin( the )icrs!t ind#s Driver )del 7 'nd 

Edition7 E,BOO  '((4

Kard7 et al7 35>) ard7 $1 and #ellor7 S1 Structured Devel&ment !r -eal>Time

Systems: $renti*e,Hall7 In*17 Ne- ;erse&7 35>)

3

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 68/114

>1 Referen*es

A,,endi7 

 A. I'#TL anal%"i" an& &ocumentation8

Ea*h IOC!L has a spe*ifi*ation of the input and output requirement for the IR$s

 buffer1 !he a*tual des*ription of ea*h stru*t is detailed in $art B of the Appendi+1

!here is a brief te+tual des*ription of -hat the IOC!L handler routine does1

Belo- the des*ription is a diagram representing a h&brid bet-een a ard and #ellor

Stru*tured 2ata 2iagram7 and Larr& Constantines 2ata Flo- 2iagram1 It is

h&bridised be*ause neither method neatl& en*apsulates the IOC!L handler7 but rather

ta.ing elements from both methods and *ombining them &ields a *learer pi*ture1 !he

entire diagram *an be %ie-ed as pro*ess instead of ea*h full *ir*le7 as in the ard and

#ellor approa*h1 !he dotted *ir*le still represents a trigger for the pro*ess7responding to the IR$ dispat*h routine1 !he parallel lines represent a data store7

*ommon to both methods of modelling1 Ea*h full *ir*le represents a sub,pro*ess that

a*ts on a data store1 !he dotted lines represent the flo- of the trigger7 -hile the solid

lines represent the flo- of data and *ontrol1

I 1!"# based mlan I/CTL codes

I!CTLMLANALL!CAT"ADDR"SSRAN#"

Input BufferA $ointer to an ALLOCAT,_A%%R,SS_RANG, stru*t1

Output Buffer

A pointer to the same ALLOCAT,_A%%R,SS_RANG, stru*t1

!e+tual 2es*ription

!he stru*t spe*ifies the address range that -ill be allo*ated in Host Controller address

spa*e b& the IEEE 3456 bus dri%er1 An address range has to be allo*ated before the

host *ontroller *an respond to an& *ommuni*ation from that node1 !he mLAN dri%er

sends an IRB *ontaining the address range to the 3456 dri%er1 !he IRB fun*tion *ode

is that of R,+,ST_ALLOCAT,_A%%R,SS_RANG, 1 A handle to the address range is

returned1

'

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 69/114

>1 Referen*es

I!CTLMLANADDR"SSRAN#"N!TI$1

Input Buffer

A pointer to an A%%R,SS_RANG,_NOTI.9 stru*t1

Output BufferA pointer to the same A%%R,SS_RANG,_NOTI.9 stru*t is returned7 -hi*h -ill need a

separate thread to -ait for the *ompleted IR$1

!e+tual 2es*ription

!he request adds the IR$ to a notifi*ation queue for the allo*ated address ranges1 !he

*allba*. routine is signalled -hen an I:O operation is dete*ted on that address range1

!he *allba*. routine *ompletes the IR$ and fills in the node address of the sour*e for

that I:O transa*tion1

I!CTLMLANS"TADDR"SS

Input Buffer

A pointer to a S,T_A%%R,SS_%ATA  stru*t1

Output Buffer

 Nothing is returned1

!e+tual 2es*ription

!his request *opies the data *ontained -ithin the input stru*t to the node spe*ified b&

the allo*ated address range handle1

I!CTLMLAN#"TADDR"SS

4

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

IR$IR$2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Address

Range

Callba*. 

Calls

Appli*ation

thread

-aiting for

IR$ status

Signals

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 70/114

>1 Referen*es

Input Buffer

A pointer to a G,T_A%%R,SS_%ATA  stru*t1

Output Buffer

A pointer to the same G,T_A%%R,SS_%ATA stru*t is returned1

!e+tual 2es*ription

!he request returns the node address and the data *ontained -ithin that address

spe*ified b& the allo*ated address range handle1 

I!CTLMLAN$R""ADDR"SSRAN#"

Input Buffer

A 7AN%L, to the intended address range1

Output Buffer

 Nothing is returned1

!e+tual 2es*ription

!he IOC!L handler routine -ill tr& to free the address range b& sending an IRB*ontaining the address range to the 3456 dri%er1 !he IRB fun*tion *ode is that of

R,+,ST_.R,,_A%%R,SS_RANG, 1

I!CTLMLANAS1NCL!C 

Input Buffer

A pointer to an AS9NC_LOCK stru*t1

6

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e3456 bus

2ri%er 

Calls

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 71/114

>1 Referen*es

Output Buffer

A pointer to the same AS9NC_LOCK stru*t is returned1

!e+tual 2es*ription

!he IOC!L *ode is used to perform a lo*.ed as&n*hronous operation on the indi*ated

destination address1 !his is a*hie%ed b& summiting an IRB to the 3456 dri%er -ith afun*tion *ode of R,+,ST_AS9NC_LOCK$

I!CTLMLANAS1NCR"AD

Input Buffer

A pointer to an AS9NC_R,A% stru*t1

Output BufferA pointer to the same AS9NC_R,A% stru*t is returned1

!e+tual 2es*ription

!he IOC!L *ode is used to perform an as&n*hronous read operation on the indi*ated

destination address1 !his is a*hie%ed b& summiting an IRB to the 3456 dri%er -ith a

fun*tion *ode of R,+,ST_AS9NC_R,A% 1

)

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus2ri%er 

Calls

CallsCalls

IR$

IRB

IR$

IR$

2ispat*hfor IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB toFire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 72/114

>1 Referen*es

I!CTLMLANAS1NCWRIT"

Input Buffer

A pointer to an AS9NC_2RIT, stru*t1

Output Buffer Nothing is returned1

!e+tual 2es*ription

!he IOC!L *ode is used to perform an as&n*hronous -rite operation on the indi*ated

destination address1 !his is a*hie%ed b& summiting an IRB to the 3456 dri%er -ith a

fun*tion *ode of R,+,ST_AS9NC_2RIT, 1

I!CTLMLANB%SR"S"TN!TI$1

Input Buffer

A pointer to a -LAN_8+S_R,S,T_NOTI.9 stru*t1

Output Buffer

A pointer to the same -LAN_8+S_R,S,T_NOTI.9 stru*t is returned1

!e+tual 2es*ription

!he request sends the IR$ to a bus reset notifi*ation queue7 -hi*h -ill be signalled b&the dri%er -hen a bus reset o**urs1 !he stru*t is returned -ith the node address of the

de%i*e that *aused the reset1

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

@et Node

Address

Complete

Calls

Appli*ation

thread-aiting for

IR$ status

Signals

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 73/114

>1 Referen*es

I!CTLMLANB%SR"S"T

Input Buffer

A "LON@ t&pe1

Output Buffer Nothing is returned1

!e+tual 2es*ription

!he input t&pe is to spe*if& the reset flags of the IRB that -ill be sent to the 3456

dri%er1 !he IRB has a fun*tion *ode of R,+,ST_8+S_R,S,T1 !his initiates a bus reset1

I!CTLMLAN#"TL!CAL+!STIN$!

Input Buffer

A pointer to a G,T_LOCAL_7OST_IN.OR-ATION  stru*t1

Output Buffer

A pointer to the same G,T_LOCAL_7OST_IN.OR-ATION  stru*t is returned1

!e+tual 2es*ription

!his re*ei%es a request for the lo*al host information7 -hi*h is attained b&

*onstru*ting an IRB -ith a fun*tion *ode of R,+,ST_G,T_LOCAL_7OST_IN.O 1 !hestru*t stores the input data as -ell as the host information -hen it is re*ei%ed1

D

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 74/114

>1 Referen*es

I!CTLMLANS"ND,+1C!N$I#,AC"T

Input Buffer

A pointer to a P79_CON.IG+RATION_PACK,T stru*t1

Output Buffer Nothing is returned1

!e+tual 2es*ription

!he handler for-ards a send $H? *onfig pa*.et request to the 3456 bus dri%er1 !he

IRB fun*tion *ode is R,+,ST_S,N%_P79_CON.IG_PACK,T$  

I!CTLMLAN#"TL!CALN!D"ADDR"SS

Input Buffer

A pointer to a G,T_LOCAL_NO%,_A%%R,SS stru*t1

Output Buffer

A pointer to the same G,T_LOCAL_NO%,_A%%R,SS stru*t is returned1

!e+tual 2es*ription

!his request returns the lo*al host node bus and node number1

I!CTLMLAN#"TC+ANN"LSA&AILABL"

Input Buffer

!his IOC!L *ode uses no input1

>

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 75/114

>1 Referen*es

Output Buffer

!his returns a LARG,_INT,G,R stru*t /refer to #S2N for spe*ifi*ation01

!e+tual 2es*ription

It ma.es a request that returns the band-idth and *hannels *urrentl& a%ailable on theIEEE 3456 bus1 !he returning information spe*ifies a 6,bit number -ith a high and

lo- part of 4',bits ea*h1 !he IRB has a fun*tion *ode ofR,+,ST_ISOC7_+,R9_R,SO+RC,S$

I!CTLMLANALL!CAT"C+ANN"L

Input Buffer

A "LON@ t&pe1

Output Buffer

!his it returns the same t&pe1

!e+tual 2es*ription

!his is to spe*if& the requested *hannel number1 !he request is for-arded to the 3456

 bus dri%er7 -hi*h allo*ates an iso*hronous *hannel to be used in subsequent

operations1 !he IRB fun*tion *ode is R,+,ST_ISOC7_ALLOCAT,_C7ANN,L$

5

Calls

Calls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er2e%i*e

3456 bus

2ri%er 

Calls

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!LHandler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 76/114

>1 Referen*es

I!CTLMLANR"L"AS"C+ANN"L

Input Buffer

A "LON@ t&pe1

Output Buffer

 No return %alue1

!e+tual 2es*ription

!his is to spe*if& the *hannel number to release1 !he request is for-arded to the 3456

 bus dri%er7 -hi*h releases an iso*hronous *hannel that -as pre%iousl& allo*ated1 !he

IRB fun*tion *ode is R,+,ST_ISOC7_.R,,_C7ANN,L$

I!CTLMLAN#"TBANDWIDT+A&AILABL"

Input Buffer

!here is no required input for this IO!CL *ode1

Output Buffer

A "LON@ t&pe1

!e+tual 2es*ription

!he request returns the band-idth and *hannels *urrentl& a%ailable on the IEEE 3456

 bus1 It returns to the appli*ation the a%ailable band-idth as e+pressed in b&tes periso*hronous frame1 !he IRB fun*tion *ode is R,+,ST_ISOC7_+,R9_R,SO+RC,S$

D(

CallsCalls

IR$

IRB

IR$

IR$

2ispat*hfor IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB toFire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 77/114

>1 Referen*es

I!CTLMLANALL!CAT"BANDWIDT+

Input Buffer

A "LON@ t&pe1

Output BufferIt returns a handle to use to refer to the band-idth resour*e1

!e+tual 2es*ription

!his is to spe*if& the ma+ b&tes per frame requestedJ1 !he request allo*ates

iso*hronous band-idth to be used in subsequent operations1 !he IRB fun*tion *ode isR,+,ST_ISOC7_ALLOCAT,_8AN%2I%T7$

I!CTLMLANR"L"AS"BANDWIDT+

Input Buffer

!he input buffer ta.es the handle that -as used as a referen*e to the allo*ated

 band-idth1

Output Buffer

!here is no output returned1

!e+tual 2es*ription

!he request releases the iso*hronous band-idth that -as pre%iousl& allo*ated1 !he

IRB has a fun*tion *ode of R,+,ST_ISOC7_.R,,_8AN%2I%T7$

D3

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 78/114

>1 Referen*es

Isochronous )tream based mlan I/CTL codes

I!CTLMLANALL!CAT"STR"AM

Input Buffer!he input buffer uses a -LAN_ISOC7_PARA- stru*t7 -hi*h spe*ifies the t&pe of the

stream to be used1

Output Buffer

!he same stru*t is returned7 spe*if&ing the allo*ated stream information1

!e+tual 2es*ription

!he request responds to the need to allo*ate an iso*hronous stream resour*e spe*ified

 b& the input stru*t1 It goes through se%eral steps to allo*ate a stream resour*e1 It

*reates the spe*ified stream t&pe7 and gets a *hannel from the underl&ing 3456 bus

dri%er1 !he IRB fun*tion *odes submitted to the Fire-ire dri%er are as follo-sR,+,ST_ISOC7_ALLOCAT,_8AN%2I%T73 R,+,ST_ISOC7_ALLOCAT,_C7ANN,L3

R,+,ST_ISOC7_ALLOCAT,_R,SO+RC,S3 R,+,ST_ISOC7_ATTAC7_8+..,RS1 Inside

the stru*t7 a pointer is pro%ided to a -LAN_STR,A-_STAT+S  stru*t7 -hi*h *ontains the

information about the allo*ated stream1

I!CTLMLANSTARTSTR"AM

Input Buffer

!he input buffer ta.es a -LAN_STR,A-_CO--AN%_PARA- stru*t7 -hi*h *ontains the

allo*ated stream resour*e handle1

Output Buffer

A pointer to the same stru*t is returned1

!e+tual 2es*ription

!he request uses the allo*ated stream handle from the allo*ate stream IOC!L7 *he*.s

if it is a send or re*ei%e stream7 and then starts the stream1 IRBs -ith fun*tion *odes

D'

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 79/114

>1 Referen*es

of R,+,ST_ISOC7_+,R9_C9CL,_TI-, and R,+,ST_ISOC7_TALKLIST,N

/depends on send or re*ei%e streams0 are used1

I!CTLMLANC!NN"CTS"H%"NC"ST!D"&IC"S

Input Buffer

!he input buffer uses a -LAN_ISOC7_PARA- stru*t7 *ontaining a handle to the stream1

Output Buffer

A pointer to the same stru*t is returned1

!e+tual 2es*ription!he request uses the in*oming handle of the stream that -as pre%iousl& allo*ated to

 pro*ess ea*h sequen*e1 It *he*.s to see if the sequen*e t&pe has *hanged and sets up

the *urrent *onne*tion map1

I!CTLMLANS"TS1TS!%RC"

Input Buffer

!he input buffer uses a -LAN_ISOC7_PARA- stru*t1

Output Buffer

!he request returns a pointer to the same stru*t1

D4

CallsCalls

IR$

IRB

IR$

IR$2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

SubmitIRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 80/114

>1 Referen*es

!e+tual 2es*ription

!he request is used to set the S?! sour*e asso*iated -ith the stream information

stru*t1 !he allo*ated stream has to be a sending stream for this to -or.7 and sets the

S?! for the stream1 If the stream is not the *lo*. master it gets the S?! %alue from

the *orresponding re*ei%e stream1

I!CTLMLANST!,STR"AM

Input Buffer!he input buffer uses a -LAN_STR,A-_CO--AN%_PARA- stru*t1

Output Buffer

!he request returns a pointer to the same stru*t1

!e+tual 2es*ription

!he request stops the stream spe*ified b& the handle in the stru*t1 !he stream has to

ha%e all sequen*es free of use7 in other -ords7 the sequen*es ha%e to be finished

streaming1 !he same stru*t is returned regardless of -hether the fun*tion su**eeds or

fails1 !he IRB uses a fun*tion *ode of R,+,ST_ISOC7_STOP$

D6

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

Calls

Signals

Signals

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus2ri%er 

Stop the

Stream

minidri%er 

Remo%e

#inidri%er

ob9e*t

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 81/114

>1 Referen*es

I!CTLMLAN#"TSTR"AMIN$!

Input Buffer

!he input buffer uses a -LAN_ISOC7_PARA- stru*t1

Output Buffer!he request returns a pointer to the same stru*t1

!e+tual 2es*ription

!he request updates the status information of the allo*ated stream7 in*luding -hi*h

sequen*es are in use1

I!CTLMLAN$R""STR"AM

Input Buffer

!he input buffer uses a -LAN_STR,A-_CO--AN%_PARA- stru*t1

Output Buffer

!he request returns a pointer to the same stru*t1

!e+tual 2es*ription

!he request frees up the memor& allo*ated for the stream1 !he stream has to be

stopped first before freeing up the stream1 IRBs are dispat*hed -ith fun*tion *odes ofR,+,ST_ISOC7_%,TAC7_8+..,RS3 R,+,ST_ISOC7_.R,,_R,SO+RC,S3

R,+,ST_ISOC7_.R,,_C7ANN,L and R,+,ST_ISOC7_.R,,_8AN%2I%T7 1

D)

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

CallsCalls

IR$

IRB

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit

IRB to

Fire-ire

 bus dri%er 

Lo-er

2e%i*e

3456 bus

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 82/114

>1 Referen*es

I!CTLMLAN#"TDRI&"R&"RSI!N

Input Buffer

!here is no required input1

Output BufferA "LON@ t&pe is returned spe*if&ing the dri%er interfa*e %ersion1

!e+tual 2es*ription

!his request returns the dri%er %ersion1

IC *1++! based mlan I/CTL codes

I!CTLMLAN-'44*C!NN"CT,L%#

Input Buffer

!he input buffer ta.es a C-P_CONN,CT stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request is for-arded to the underl&ing 3>>4 proto*ol dri%er7 using the handles of 

 plugs *ontained in the input stru*t to spe*if& -hi*h plugs to *onne*t7 using a fun*tion

*ode of A&B66_Connect1 A handle to the *onne*tion is returned1

D

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Calls

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 83/114

>1 Referen*es

I!CTLMLAN-'44*CR"AT",L%#

Input Buffer

!he input buffer ta.es a C-P_CR,AT,_PL+G stru*t1

Output Buffer!he same stru*t is returned1

!e+tual 2es*ription

!he request is sent to 3>>4 proto*ol dri%er to *reate a plug7 using a fun*tion *ode of

A&B66_CreateP'u?1 A handle to the plug is returned in the stru*t1

I!CTLMLAN-'44*,L%#N!TI$1

Input Buffer

!he input buffer ta.es a -LAN_C-P_PL+G_NOTI.9 stru*t1

Output Buffer

!he notifi*ation routine returns the same stru*t -hen it is signalled to run1

!e+tual 2es*ription

!he request adds the IR$ to a queue for notifi*ation from the 3>>4 proto*ol dri%er

that monitors a**ess to the plug and then returns information in the stru*t1

DD

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol

2ri%er 

Calls

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

#onitor 

$lugs

Callba*. 

Calls

Appli*ation

thread

-aiting for

IR$ status

Signals

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 84/114

>1 Referen*es

I!CTLMLAN-'44*D"L"T",L%#

Input Buffer

!he input buffer ta.es a C-P_%,L,T,_PL+G stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request tells the 3>>4 proto*ol dri%er to delete the plug /as a handle in the

stru*t07 using a fun*tion *ode of A&B66_%e'eteP'u? 1

I!CTLMLAN-'44*DISC!NN"CT,L%#

Input Buffer

!he input buffer ta.es a C-P_%ISCONN,CT stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request e+tra*ts the handle to the plug *onne*tion from the input stru*t1 !he

*onne*tion is released b& ma.ing the appropriate *all to the underl&ing 3>>4 proto*ol dri%er7 using a fun*tion *ode of A&B66_%isconnect 1

D>

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*hfor IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol

2ri%er 

Calls

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e3>>4

$roto*ol

2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 85/114

>1 Referen*es

I!CTLMLAN-'44*#"T$C,R"H%"ST 

Input Buffer

!he input buffer ta.es a -LAN_.CP_G,T_R,+,ST  stru*t1

Output Buffer!he same stru*t is returned7 but if the as&n*hronous method of *ommuni*ating -ith

the 3>>4 proto*ol dri%er then the IR$ is sent to *ompletion status queue routine1 !his

routine -ill return the stru*t -hen that *ompletion routine fires1

!e+tual 2es*ription

!he request uses the 3>>4 get FC$ request of the 3>>4 dri%er7 using a fun*tion *ode

of A&B66_Get.cpReeuest 1

I!CTLMLAN-'44*#"T$C,R"S,!NS"

Input Buffer

!he input buffer ta.es a -LAN_.CP_G,T_R,SPONS, stru*t1

Output Buffer

!he same stru*t is returned7 but if the as&n*hronous method of *ommuni*ating -ith

the 3>>4 proto*ol dri%er then the IR$ is sent to *ompletion status queue routine1 !his

routine -ill return the stru*t -hen that *ompletion routine fires1

!e+tual 2es*ription

!he request uses the 3>>4 get FC$ response of the 3>>4 dri%er7 using a fun*tion

*ode of A&B66_Get.cpResponse 1

D5

IR$IR$

2ispat*hfor IOC!L

*odes

IOC!L

Handler

Routine

@et F*p

RequestComplete

Calls

Appli*ation

thread

-aiting for

IR$ status

Signals

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

HandlerRoutine

@et F*p

Response

Complete

Calls

Appli*ation

thread

-aiting for

IR$ status

Signals

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 86/114

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 87/114

>1 Referen*es

I!CTLMLAN-'44*S"ND$C,R"H%"ST

Input Buffer

!he input buffer ta.es a -LAN_.CP_S,N%_R,+,ST stru*t1

Output Buffer!he same stru*t is returned1

!e+tual 2es*ription

!he request uses the 3>>4 send FC$ request A<request of the 3>>4 dri%er7 using a

fun*tion *ode of A&B66_Sen.cpReuest 1

I!CTLMLAN-'44*S"ND$C,R"S,!NS"

Input Buffer

!he input buffer ta.es a -LAN_.CP_S,N%_R,SPONS,  stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request uses the 3>>4 send FC$ response A<request of the 3>>4 dri%er7 using

a fun*tion *ode of A&B66_Sen.cpResponse 1

>3

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol

2ri%er 

Calls

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 88/114

>1 Referen*es

I!CTLMLAN-'44*S"T$C,N!TI$1

Input Buffer

!he input buffer ta.es a S,T_.CP_NOTI.9 stru*t1

Output Buffer!he same stru*t is returned1

!e+tual 2es*ription

!he request uses the 3>>4 set FC$ notif& A<request of the 3>>4 dri%er7 using a

fun*tion *ode of A&B66_Set.cpNoti0> 1

I!CTLMLAN-'44*S"T,L%#

Input Buffer

!he input buffer ta.es a C-P_S,T_PL+G stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request uses the 3>>4 set plug A<request of the 3>>4 dri%er7 using a fun*tion

*ode of A&B66_Setp'u?1

>'

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

Routine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol

2ri%er 

Calls

CallsCalls

IR$

A< 3>>4 Request

IR$

IR$

2ispat*h

for IOC!L

*odes

IOC!L

HandlerRoutine

Submit SRB

to 3>>4

$roto*ol

2ri%er 

Lo-er

2e%i*e

3>>4

$roto*ol2ri%er 

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 89/114

>1 Referen*es

A)I/ based mlan I/CTL codes

I!CTLMLANASI!IN$!

Input Buffer

!he input buffer ta.es a -LAN_ASIO_INIT_PARA-  stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request finds an output stream that has ASIO sequen*es7 regardless of it being a

send or re*ei%e stream1 It e+tra*ts information about that stream it finds to put into the

input stru*t1 It does not modif& the dri%er state1

I!CTLMLANASI!INIT

Input Buffer

!he input buffer ta.es a -LAN_ASIO_INIT_PARA-  stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request finds an output stream that has ASIO sequen*es7 regardless of it being a

send or re*ei%e stream1 It e+tra*ts information about that stream it finds to put into the

input stru*t1 It *reates the handles to e%ent related fields so the appli*ation *an be

a-are of *hanges of the ASIO dri%er state1 !he mLAN dri%er sets the state of theASIO dri%er to be a*ti%e1

>4

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!L

Handler

RoutineCalls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 90/114

>1 Referen*es

I!CTLMLANASI!ALL!C

Input Buffer

!he input buffer ta.es a -LAN_ASIO_ALLOC_PARA- stru*t1

Output Buffer

!he same stru*t is returned1

!e+tual 2es*ription

!he request -ill allo*ate the requested number of *hannels for use b& the ASIO *lient

sitting in user mode1 !he sequen*es -ill be identified as ASIO sequen*es7 and input

and output buffers -ill be allo*ated1

I!CTLMLANASI!$R""

Input Buffer

!he input buffer ta.es a -LAN_ASIO_CO--AN%_PARA- stru*t1

Output Buffer!he same stru*t is returned1

!e+tual 2es*ription

!he request frees up an& pre%iousl& allo*ated buffers and ASIO data stru*tures7 and

remo%es the sequen*es identified as ASIO sequen*es1 !hese sequen*es *an no- be

used as an& other t&pe of sequen*e1

I!CTLMLANASI!START

Input Buffer

!he input buffer ta.es a -LAN_ASIO_CO--AN%_PARA- stru*t1

Output Buffer!he same stru*t is returned1

>6

IR$IR$

2ispat*hfor IOC!L

*odes

IOC!LHandler

RoutineCalls

IR$IR$

2ispat*h

for IOC!L*odes

IOC!L

HandlerRoutine

Calls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 91/114

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 92/114

>1 Referen*es

I!CTLMLANASI!R"S"T

Input Buffer

!here is nothing for input1

Output Buffer

!here is nothing for output1

!e+tual 2es*ription

!he request -ill spe*if& an ASIO reset e%ent -hi*h -ill be handled -hen it is

*on%enient1

!solete I!CTL 8odes

I!CTLMLAN#"TADDR$R!MD"&IC"!B/"CT

Input Buffer

 N:A

Output Buffer

 N:A

!e+tual 2es*ription

!his is not implemented1

I!CTLMLAN#"TS,""DT!,!L!#1MA,S

Input Buffer

$ointer to a G,T_SP,,%_TOPOLOG9_-APS stru*t

Output Buffer

If it does -or.7 then it returns the same stru*t

!e+tual 2es*ription

!he IOC!L *ode handler uses an underl&ing request to the 3456 bus dri%er that is

obsolete from indo-s '((( on-ards1

>

IR$IR$

2ispat*h

for IOC!L

*odes

IOC!LHandler

RoutineCalls

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 93/114

>1 Referen*es

. Anal%"i" an& &ocumentation o7 &ata "tructure" u"e&8

!he stru*ts sho-n belo- ma& *ontain other stru*ts7 refer from page 3(3 on-ards to

%ie- their *ontents1

I 1!"# based structs

ALL!CAT"ADDR"SSRAN#"

t>pee0 struct _ALLOCAT,_A%%R,SS_RANG,   IN +LONG 0u'A''ocate.'a?s;  IN +LONG 0u'.'a?s;  IN +LONG nLen?t;  IN +LONG -a5Se?#entSi@e;  IN +LONG 0u'AccessT>pe;

  IN +LONG 0u'Noti0icationOptions;  O+T A%%R,SS_O..S,T ReuireB:DO00set;  O+T 7AN%L, AressRan?e;  IN +C7AR %ataEBF;* ALLOCAT,_A%%R,SS_RANG,3 PALLOCAT,_A%%R,SS_RANG,;

f6lAllo8ate$lags

Contains a flag that indi*ates the t&pe of address s*heme1

f6l$lags

Spe*ifies -hether the address ranges use big,endian b&te order1

nLength

Spe*ifies the number of the IEEE 3456 addresses to allo*ate1

MaESegmentSi<e

Spe*ifies the ma+imum sie for ea*h range of addresses the bus dri%er

allo*ates1

f6lA88essTye

Spe*ifies a**ess t&pe using one or more of the follo-ing flags1

f6lNotifi8ation!tions

Spe*ifies -hi*h as&n*hronous I:O request t&pes -ill trigger the bus dri%er to

the notif& the de%i*e dri%er upon *ompletion1

Re?6ired'*3)!ffset

Spe*ifies a hard,*oded address in the *omputers IEEE 3456 address spa*e1

hAddressRangeSpe*ifies the handle to use -hen freeing the allo*ated address ranges1

Data9';

$ro%ides the beginning address of the ba*.ing store for the allo*ated address

range1 !he IEEE 3456 bus dri%er maps all as&n*hronous requests to this

address spa*e1

K#S2N7 '(()

ADDR"SSRAN#"N!TI$1

t>pee0 struct _A%%R,SS_RANG,_NOTI.9IN 7AN%L, AressRan?e;O+T +LONG u'O00set;

>D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 94/114

>1 Referen*es

O+T +LONG 0u'Noti0icationOptions;IN O+T +LONG nLen?t;O+T NO%,_A%%R,SS NoeAress;O+T +C7AR %ataEBF;

* A%%R,SS_RANG,_NOTI.93 PA%%R,SS_RANG,_NOTI.9;

hAddressRangeSpe*ifies the handle to the allo*ated address range1

6l!ffset

Spe*ifies the offset for the notifi*ation1

f6lNotifi8ation!tions

Spe*ifies the reason for the notifi*ation1

nLength

Spe*ifies the length for the notifi*ation1

NodeAddress

!he address of the sour*e node1

Data9';

Returns a fresh *op& of the data from the notifi*ation IR$1

S"TADDR"SSDATA

t>pee0 struct _S,T_A%%R,SS_%ATA   IN 7AN%L, AressRan?e;  IN +LONG nLen?t;  IN +LONG u'O00set;  IN +C7AR %ataEBF;* S,T_A%%R,SS_%ATA3 PS,T_A%%R,SS_%ATA;

hAddressRange Contains a handle that spe*ifies the IEEE 3456 addresses to -hi*h the data is

-ritten1

nLength 

Indi*ates the length in b&tes of the data in the buffer spe*ified b& the Data 

member1

6l!ffset 

Indi*ates the offset into the buffer at Data -here the data is lo*ated1

Data 

Contains a data buffer that holds the data that the SetAddress2ata -rites to the

IEEE 3456 address range spe*ified in member hAddressRange1

K#S2N7 '(()

#"TADDR"SSDATA

t>pee0 struct _G,T_A%%R,SS_%ATA   IN 7AN%L, AressRan?e;  IN +LONG nLen?t;  IN +LONG u'O00set;  O+T NO%,_A%%R,SS NoeAress;  O+T +C7AR %ataEBF;* G,T_A%%R,SS_%ATA3 PG,T_A%%R,SS_%ATA;

hAddressRange 

>>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 95/114

>1 Referen*es

Contains a handle that spe*ifies the IEEE 3456 addresses -here the data to

retrie%e is stored1

nLength 

Indi*ates the length in b&tes of the data in the buffer spe*ified b& the Data member1

6l!ffset 

Indi*ates the offset into the buffer at Data -here the retrie%ed data is lo*ated1

Data 

Contains a data buffer -here the @etAddress2ata routine stores the data

retrie%ed from the IEEE 3456 address range spe*ified in member

hAddressRange1

K#S2N7 '(()

AS1NCL!C 

t>pee0 struct _AS9NC_LOCK   IN +LONG MRaw-oe;  IN +LONG MGetGeneration;  IN IO_A%%R,SS %estinationAress;  IN +LONG nNu#MerO0Ar?8>tes;  IN +LONG nNu#MerO0%ata8>tes;  IN +LONG 0u'TransactionT>pe;  IN +LONG 0u'.'a?s;  IN +LONG Ar?u#entsEF;  IN +LONG %ata1a'uesEF;  IN +LONG u'Generation;

  IN +LONG 8u00erEF;* AS9NC_LOCK3 PAS9NC_LOCK;

RawMode 

Indi*ates7 if !R"E7 that bus and node number spe*ified in the

DestinationAddress  -ill be used1 If FALSE7 the %alues in

DestinationAddress  are ignored1 !his flag must be set to !R"E -hen the

*aller sends an as&n*hronous read request to a %irtual diagnosti* dri%er

/3456%de%1s&s01

#et#eneration  

Indi*ates7 -hen !R"E7 that the generation *ount -ill automati*all& be set to

the *urrent generation *ount1 If FALSE7 the 6l#eneration member holds thegeneration *ount1

DestinationAddress  

Contains a stru*ture of t&pe I!ADDR"SS that spe*ifies the 3456 6,bit

destination address for this read operation1 Caller must fill in the

IADestination!ffset member of stru*ture1 !he bus dri%er fills in the

IADestinationID member1

nN6mer!fArgBytes 

Spe*ifies the number of argument b&tes used in performing this lo*.

operation1 #a& be ero7 6 or >1 See the f6lTransa8tionTye member for

details

nN6mer!fDataBytes 

>5

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 96/114

>1 Referen*es

Spe*ifies the number of data b&tes used in performing this lo*. operation1

#a& be 6 or >1 See the f6lTransa8tionTye member for details1

f6lTransa8tionTye 

Spe*ifies -hi*h atomi* transa*tion to e+e*ute on the 3456 node1

nBlo8@Si<e Spe*ifies the sie of ea*h indi%idual blo*. -ithin the data stream1 If the %alue

assigned to this parameter is ero7 the bus dri%er brea.s up the stream into

 pa*.ets that are the ma+imum pa*.et sie1

f6l$lags 

Spe*ifies the settings for this operation that are different from the default

settings1

Arg6ments 

Contains a bitmap that indi*ates -hi*h bits to *hange in DestinationAddress 1

Data&al6es 

Contains the bit %alues to be assigned to DestinationAddress  in the bit

 positions spe*ified b& the bitmas. in Arg6ments16l#eneration 

Spe*ifies the bus reset generation *ount1 If the generation *ount spe*ified does

not mat*h the a*tual generation of the bus7 this request is returned -ith a status

of S!A!"SIN<ALI2@ENERA!ION1

B6ffer 

Contains a buffer to store the results of the operation1 Caller must ensure that

the buffer *ontains at least nN6mer!fDataBytes b&tes of data1

K#S2N7 '(()

AS1NCR"AD

t>pee0 struct _AS9NC_R,A%   IN +LONG MRaw-oe;  IN +LONG MGetGeneration;  IN IO_A%%R,SS %estinationAress;  IN +LONG nNu#MerO08>tesToRea;  IN +LONG n8'ockSi@e;  IN +LONG 0u'.'a?s;  IN +LONG u'Generation;  O+T +C7AR %ataEBF;* AS9NC_R,A%3 PAS9NC_R,A%;

RawMode 

Indi*ates7 if !R"E7 that bus and node number spe*ified in the

DestinationAddress  -ill be used1 If FALSE7 the %alues in

DestinationAddress  are ignored1 !his flag must be set to !R"E -hen the

*aller sends an as&n*hronous read request to a %irtual diagnosti* dri%er

/3456%de%1s&s01

#et#eneration  

Indi*ates7 -hen !R"E7 that the generation *ount -ill automati*all& be set to

the *urrent generation *ount1 If FALSE7 the generation *ount -ill be ta.en

from the 6l#eneration %ariable1

DestinationAddress  

5(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 97/114

>1 Referen*es

Contains a stru*ture of t&pe I!ADDR"SS that spe*ifies the 3456 6,bit

destination address for this read operation1 Caller must fill in the

IADestination!ffset member of stru*ture1 !he bus dri%er fills in the

IADestinationID member1

nN6mer!fBytesToRead 

Spe*ifies the number of b&tes to read1nBlo8@Si<e 

Spe*ifies the sie of ea*h indi%idual blo*. -ithin the data stream1 If the %alue

assigned to this parameter is ero7 the bus dri%er brea.s up the stream into

 pa*.ets that are the ma+imum pa*.et sie1

f6l$lags 

Spe*ifies the settings for this operation that are different from the default

settings1

6l#eneration 

Spe*ifies the bus reset generation *ount1 If the generation *ount spe*ified does

not mat*h the a*tual generation of the bus7 this request is returned -ith a status

of S!A!"SIN<ALI2@ENERA!ION1Data 

Contains a buffer to store the results of the as&n*hronous read operation1

Caller must ensure that the buffer *ontains at least nN6mer!fBytesToRead 

 b&tes of data1

K#S2N7 '(()

AS1NCWRIT"

t>pee0 struct _AS9NC_2RIT,

  IN +LONG MRaw-oe;  IN +LONG MGetGeneration;  IN IO_A%%R,SS %estinationAress;  IN +LONG nNu#MerO08>tesTo2rite;  IN +LONG n8'ockSi@e;  IN +LONG 0u'.'a?s;  IN +LONG u'Generation;  IN +C7AR %ataEBF;* AS9NC_2RIT,3 PAS9NC_2RIT,;

RawMode 

Indi*ates7 if !R"E7 that bus and node number spe*ified in the

DestinationAddress  -ill be used1 If FALSE7 the %alues inDestinationAddress  are ignored1

#et#eneration  

Indi*ates7 -hen !R"E7 that the generation *ount -ill automati*all& be set to

the *urrent generation *ount1 If FALSE7 the generation *ount -ill be ta.en

from the 6l#eneration %ariable1

DestinationAddress  

Contains a stru*ture of t&pe I!ADDR"SS that spe*ifies the 3456 6,bit

destination address for this -rite operation1 Caller must fill in the

IADestination!ffset member of stru*ture1 !he bus dri%er fills in the

IADestinationID member1

nN6mer!fBytesToWrite Spe*ifies the number of b&tes to -rite1

53

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 98/114

>1 Referen*es

nBlo8@Si<e 

Spe*ifies the sie of ea*h indi%idual blo*. -ithin the data stream1 If the %alue

assigned to this parameter is ero7 the bus dri%er brea.s up the stream into

 pa*.ets that are the ma+imum pa*.et sie1

f6l$lags 

Spe*ifies the settings for this operation that are different from the defaultsettings1

6l#eneration 

Spe*ifies the bus reset generation *ount1 If the generation *ount spe*ified does

not mat*h the a*tual generation of the bus7 this request is returned -ith a status

of S!A!"SIN<ALI2@ENERA!ION1

Data 

Contains a buffer to store the results of the as&n*hronous -rite operation1

Caller must ensure that the buffer *ontains at least nN6mer!fBytesToRead 

 b&tes of data1

K#S2N7 '(()

MLANB%SR"S"TN!TI$1

t>pee0 struct _-LAN_8+S_R,S,T_NOTI.9in NO%,_A%%R,SS Loca'NoeAress;

*-LAN_8+S_R,S,T_NOTI.93 P-LAN_8+S_R,S,T_NOTI.9;

Lo8alNodeAddress

!he address of the node that should be notified of the bus reset e%ent1

#"TL!CAL+!STIN$!RMATI!N

t>pee0 struct _G,T_LOCAL_7OST_IN.OR-ATION   O+T +LONG Status;  IN +LONG nLe&e';  IN +LONG u'8u00erSi@e;  IN O+T +C7AR In0or#ationEBF;* G,T_LOCAL_7OST_IN.OR-ATION3 PG,T_LOCAL_7OST_IN.OR-ATION;

Stat6s 

Indi*ates7 on output7 the status *ode set b& the #etLo8al+ostInformation 

routine1

nLevel Spe*ifies -hat le%el of information requested in this *all1

6lB6fferSi<e 

Indi*ates the sie in b&tes of the buffer at Information1

Information 

$oints to a buffer -here the #etLo8al+ostInformation routine stores the

lo*al host information1

K#S2N7 '(()

#"TS,""DT!,!L!#1MA,S

t>pee0 struct _G,T_SP,,%_TOPOLOG9_-APS O+T SP,,%_-AP spee-ap;

5'

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 99/114

>1 Referen*es

O+T TOPOLOG9_-AP topo'o?>-ap;* G,T_SP,,%_TOPOLOG9_-APS3 PG,T_SP,,%_TOPOLOG9_-APS;

seedMa

Stores an IEEE 3456 bus speed map1

toologyMa

"sed to store an IEEE 3456 bus topolog& map1

,+1C!N$I#%RATI!N,AC"T

t>pee0 struct _P79_CON.IG+RATION_PACK,T   IN +LONG PCP_P>s_I%;

IN +LONG PCP_Packet_I%;IN +LONG PCP_Gap_Count;IN +LONG PCP_Set_Gap_CountB;IN +LONG PCP_.orce_RootB;IN +LONG PCP_Reser&eB6;

IN +LONG PCP_Reser&e6;IN +LONG PCP_In&erse;* P79_CON.IG+RATION_PACK,T3 PP79_CON.IG+RATION_PACK,T;

,C,,hysID 

Spe*ifies the node address of the root1 !his member *ontains bits (,) of b&te (

of the pa*.et1

,C,,a8@etID 

!his member must be $H?$ACE!I2CONFI@"RA!ION to indi*ate it is

a $H? *onfiguration pa*.et1 !his member *ontains bits ,D of b&te ( of the

 pa*.et1

,C,#aCo6nt If the ,C,Set#aCo6nt bit is set7 the $H? register gap*ount field is set

to this %alue1 !his member *ontains bits (,) of b&te 3 of the pa*.et1

,C,Set#aCo6nt 

If this bit is set7 the $H? register gap*ount field is set to ,C,#aCo6nt1

!his member *ontains bit of b&te 3 of the pa*.et1

,C,$or8eRoot 

If set7 the *aller be*omes the root node1 !his member *ontains bit D of b&te 3

of the pa*.et1

,C,Reserved' 

Reser%ed1 !his member *ontains bits (,D of b&te ' of the pa*.et1

,C,Reserved( Reser%ed1 !his member *ontains bits (,D of b&te 4 of the pa*.et1

,C,Inverse 

Spe*ifies the logi*al in%erse of the first quadlet of the pa*.et1

K#S2N7 '(()

#"TL!CALN!D"ADDR"SS

t>pee0 struct _G,T_LOCAL_NO%,_A%%R,SSO+T NO%,_A%%R,SS Loca'NoeAress;

*G,T_LOCAL_NO%,_A%%R,SS3 PG,T_LOCAL_NO%,_A%%R,SS;

Lo8alNodeAddress

54

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 100/114

>1 Referen*es

Spe*ifies the 3(,bit bus number and ,bit node number that ser%e as the node

address for a 3456 node1

Isochronous )tream based structs

MLANIS!C+,ARAM

t>pee0 struct _-LAN_ISOC7_PARA- O+T 7AN%L, Strea#;O+T -LAN_STR,A-_STAT+S Strea#Status;O+T +LONG ,rrorCoe;O+T +LONG a8it#apC'ientE-LAN_-AH_N+-_S,+,NC,S

+LONG_8ITSIJ,F;IN -LAN_STR,A-_CON.IG #LANStrea#Con0i?;IN -LAN_%ATA_.I,L%_CON.IG #LAN%ata.ie'Con0i?;

* -LAN_ISOC7_PARA-3 P-LAN_ISOC7_PARA-;

hStream

!he handle to the stream resour*e that -as allo*ted1

StreamStat6s

!he stru*t that *ontains the status of ea*h sequen*e1

"rrorCode

!he status *ode from the IOC!L1

aBitmaClient9MLANMA5N%MS"H%"NC"S > %L!N#BITSI";

 Not sure1mLANStreamConfig

A stru*t that *ontains spe*ifi* information about that stream1

mLANData$ieldConfig

A stru*t that *ontains audio spe*ifi* information about the sequen*es1

MLANSTR"AMC!MMAND,ARAM

t>pee0 struct _-LAN_STR,A-_CO--AN%_PARA- IN 7AN%L, Strea#;O+T +LONG ,rrorCoe;

* -LAN_STR,A-_CO--AN%_PARA-3 P-LAN_STR,A-_CO--AN%_PARA-;

hStream

!he handle to the allo*ated stream resour*e1

"rrorCode

!he error *ode of the status from the *ompleted IOC!L

IC *1++! based structs

CM,C!NN"CT

t>pee0 struct _C-P_CONN,CT

56

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 101/114

>1 Referen*es

IN 7AN%L, OutputP'u?;IN 7AN%L, InputP'u?;IN C-P_CONN,CT_T9P, T>pe; IN CIP_%ATA_.OR-AT .or#at; O+T 7AN%L, Connect; 

* C-P_CONN,CT3 PC-P_CONN,CT;

h!6t6t,l6g

Output plug handle1

hIn6t,l6g

Input plug handle1

Tye

Requested *onne*t t&pe1

$ormat

Requested data format transmission onl&1

hConne8t

Returned *onne*t handle1

CM,CR"AT",L%#

t>pee0 struct _C-P_CR,AT,_PL+G

  IN C-P_PL+G_T9P, P'u?T>pe;IN A1_PCR Pcr;IN PC-P_NOTI.9_RO+TIN, p0nNoti0>;IN P1OI% Conte5t;O+T +LONG P'u?Nu#;O+T 7AN%L, P'u?;

* C-P_CR,AT,_PL+G3 PC-P_CR,AT,_PL+G;

,l6gTye

!&pe of plug to *reate1

,8r

$CR Settings1

fnNotify

 Notifi*ation Routine for Register1

ConteEt

 Notifi*ation Conte+t1

,l6gN6m

$lug Number1h,l6g

$lug Handle1

MLANCM,,L%#N!TI$1

t>pee0 struct _-LAN_C-P_PL+G_NOTI.9 O+T +LONG State;O+T +LONG P'u?Nu#;O+T +LONG P'u?T>pe;O+T A1_PCR Pcr;

* -LAN_C-P_PL+G_NOTI.93 P-LAN_C-P_PL+G_NOTI.9;

State

5)

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 102/114

>1 Referen*es

Returns the state of the plug1

,l6gN6m

$lug number1

,l6gTye

!&pe of plug1

,8r$CR settings1

CM,D"L"T",L%#

t>pee0 struct _C-P_%,L,T,_PL+G   IN 7AN%L, P'u?;* C-P_%,L,T,_PL+G3 PC-P_%,L,T,_PL+G;

h,l6g

$lug Handle

CM,DISC!NN"CT

t>pee0 struct _C-P_%ISCONN,CT   IN 7AN%L, Connect;* C-P_%ISCONN,CT3 PC-P_%ISCONN,CT;

hConne8t

Conne*tion handle to dis*onne*t

MLAN$C,#"TR"H%"ST

t>pee0 struct _-LAN_.CP_G,T_R,+,ST   O+T NO%,_A%%R,SS NoeAress;  IN O+T +LONG Len?t;  IN O+T .CP_.RA-, .ra#e;* -LAN_.CP_G,T_R,+,ST3 P-LAN_.CP_G,T_R,+,ST;

NodeAddress

!he node address of the de%i*e that sent the get FC$ request7 pro%ided it is a

%irtual de%i*e1

Length

!he ma+imum a%ailable length of the frame pa&load7 in*luding FC$ header1$rame

2efines a fun*tion *ontrol proto*ol /FC$0 request1

MLAN$C,#"TR"S,!NS"

t>pee0 struct _-LAN_.CP_G,T_R,SPONS,   O+T NO%,_A%%R,SS NoeAress;  IN O+T +LONG Len?t;  IN O+T .CP_.RA-, .ra#e;* -LAN_.CP_G,T_R,SPONS,3 P-LAN_.CP_G,T_R,SPONS,;

NodeAddress

5

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 103/114

>1 Referen*es

!he node address of the de%i*e that sent the get FC$ response7 pro%ided it is a

%irtual de%i*e1

Length

!he ma+imum a%ailable length of the frame pa&load7 in*luding FC$ header1

$rame

2efines a fun*tion *ontrol proto*ol /FC$0 request1

CM,#"T,L%#+ANDL"

t>pee0 struct _C-P_G,T_PL+G_7AN%L,   IN +LONG P'u?Nu#;

IN C-P_PL+G_T9P, T>pe;O+T 7AN%L, P'u?;

* C-P_G,T_PL+G_7AN%L,3 PC-P_G,T_PL+G_7AN%L,;

,l6gN6m

Requested plug number1Tye

Requested plug t&pe1

h,l6g

Returned plug handle1

CM,#"T,L%#STAT"

t>pee0 struct _C-P_G,T_PL+G_STAT,   IN 7AN%L, P'u?;

O+T +LONG State;

O+T +LONG %ataRate;O+T +LONG Pa>'oa;O+T +LONG 8C_Connections;O+T +LONG PP_Connections;

* C-P_G,T_PL+G_STAT,3 PC-P_G,T_PL+G_STAT,;

h,l6g 

!he handle of the plug to retrie%e state information1

State 

!he state of the plug1

DataRate 

!he data rate of the plug1

,ayload !he pa&load sie for the plug1

BCConne8tions 

!he number of broad*ast *onne*tions asso*iated -ith the plug1

,,Conne8tions 

!he number of point,to,point *onne*tions asso*iated -ith the plug1

MLAN$C,S"NDR"H%"ST

t>pee0 struct _-LAN_.CP_S,N%_R,+,ST   IN NO%,_A%%R,SS NoeAress;

  IN +LONG Len?t;  IN .CP_.RA-, .ra#e;

5D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 104/114

>1 Referen*es

* -LAN_.CP_S,N%_R,+,ST3 P-LAN_.CP_S,N%_R,+,ST;

NodeAddress

!he node address of the de%i*e that sent the send FC$ request7 pro%ided it is a

%irtual de%i*e1

Length!he ma+imum a%ailable length of the frame pa&load7 in*luding FC$ header1

$rame

2efines a fun*tion *ontrol proto*ol /FC$0 request1

MLAN$C,S"NDR"S,!NS"

t>pee0 struct _-LAN_.CP_S,N%_R,SPONS,   IN NO%,_A%%R,SS NoeAress;  IN +LONG Len?t;  IN .CP_.RA-, .ra#e;* -LAN_.CP_S,N%_R,SPONS,3 P-LAN_.CP_S,N%_R,SPONS,;

NodeAddress

!he node address of the de%i*e that sent the send FC$ response7 pro%ided it is

a %irtual de%i*e1

Length

!he ma+imum a%ailable length of the frame pa&load7 in*luding FC$ header1

$rame

2efines a fun*tion *ontrol proto*ol /FC$0 request1

S"T$C,N!TI$1

t>pee0 struct _S,T_.CP_NOTI.9   IN +LONG .'a?s; .'a?s  IN NO%,_A%%R,SS NoeAress; Noe Aress* S,T_.CP_NOTI.93 PS,T_.CP_NOTI.9;

$lags

Spe*ifies the notifi*ation requested b& the dri%er1

NodeAddress

Reser%ed for use b& the operating s&stem1

CM,S"T,L%#

t>pee0 struct _C-P_S,T_PL+G   IN 7AN%L, P'u?;

IN A1_PCR Pcr;* C-P_S,T_PL+G3 PC-P_S,T_PL+G;

h,l6g

$lug handle1

,8r

$CR settings1

MLANASI!INIT,ARAM

5>

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 105/114

>1 Referen*es

t>pee0 struct _-LAN_ASIO_INIT_PARA- O+T +LONG nu#OutCanne'sA&ai'aM'eE-LAN_-AH_S,N%_STR,A-SF;O+T +LONG Mit#apOutSeuencesA&ai'aM'eE-LAN_-AH_S,N%_STR,A-SFE-LAN_-AH_N+-_S,+,NC,S +LONG_8ITSIJ,F;O+T +LONG nu#InCanne'sA&ai'aM'eE-LAN_-AH_R,C,I1,_STR,A-SF;

O+T +LONG Mit#apInSeuencesA&ai'aM'eE-LAN_-AH_R,C,I1,_STR,A-SFE-LAN_-AH_N+-_S,+,NC,S +LONG_8ITSIJ,F;O+T +LONG sa#p'eRate8ein?+se;O+T +LONG #ini#u#8u00erSi@ePerCanne';O+T +LONG p'a>Mack8u00erSi@ePerCanne';O+T +LONG recor8u00erSi@ePerCanne';O+T 7AN%L, 8u00erSwitc,&ent;O+T 7AN%L, %ri&erReset,&ent;O+T +LONG sen8itSi@e;O+T +LONG rec&8itSi@e;O+T 8OOL,AN useI,,,Mit.'oat;O+T +LONG errorCoe;O+T +LONG pNu#,&entsReueste8>%ri&er;

O+T +LONG pO00set.orC'ient8u00er8>%ri&er;* -LAN_ASIO_INIT_PARA-3 P-LAN_ASIO_INIT_PARA-;

n6m!6tChannelsAvailale

!he number of ASIO output *hannels a%ailable1

itma!6tSe?6en8esAvailale

 Not sure1

n6mInChannelsAvailale

!he number of ASIO input *hannels a%ailable

itmaInSe?6en8esAvailalesamleRateBeing%sed

 Not sure1

minim6mB6fferSi<e,erChannelin samples , not b&tes7 '6bit data in 4'bit *ontainers7 this is the mininum

a%ailable buffersie1

laya8@B6fferSi<e,erChannel

in samples , used to report laten*&1

re8ordB6fferSi<e,erChannel

in samples , usde to report laten*&1

hB6fferSwit8h"vent

A handle to a buffer s-it*h e%ent /re*ei%ed in ASIOINI!01

hDriverReset"vent

A handle to the ASIO dri%er reset e%ent /re*ei%ed in ASIOINI!01

sendBitSi<e Not sure1

re8vBitSi<e

 Not sure1

6seI"""*(it$loat

!his -ill for*e the dri%er to report 4'bit float as the format1

errorCode

!he error *ode status reported b& the IOC!L after it returns1

N6m"ventsRe?6estedByDriver

/re*ei%ed in ASIOINI!01

!ffset$orClientB6fferByDriver

/re*ei%ed in ASIOINI!01

55

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 106/114

>1 Referen*es

MLANASI!ALL!C,ARAM

t>pee0 struct _-LAN_ASIO_ALLOC_PARA- IN +LONG asio8u00erSi@e;IN +LONG output8u00ersReuire-ap_Strea#Ine5

E-AH_ASIO_C7ANN,LSF;IN +LONG output8u00ersReuire-ap_SeuenceIne5E-AH_ASIO_C7ANN,LSF;O+T P+LONG pOut8u00ersE-AH_ASIO_C7ANN,LS F;IN +LONG input8u00ersReuire-ap_Strea#Ine5E-AH_ASIO_C7ANN,LSF;IN +LONG input8u00ersReuire-ap_SeuenceIne5E-AH_ASIO_C7ANN,LSF;O+T P+LONG pIn8u00ersE-AH_ASIO_C7ANN,LS F;O+T +LONG errorCoe;

* -LAN_ASIO_ALLOC_PARA-3 P-LAN_ASIO_ALLOC_PARA-;

asioB6fferSi<e

!his is the requested buffersie7 should not be smaller than the sie reported inINI!$ARA#

o6t6tB6ffersRe?6iredMaStreamIndeE

Spe*ifies the requested output buffers to be used for streams1

o6t6tB6ffersRe?6iredMa  Se?6en8eIndeE 

Spe*ifies the requested output buffers to be used for sequen*e1

!6tB6ffers

A pointer to the output buffer that has '6bit data in 4'bit *ontainers1

in6tB6ffersRe?6iredMaStreamIndeE

Spe*ifies the requested input buffers to be used for streams1

in6tB6ffersRe?6iredMaSe?6en8eIndeE

Spe*ifies the requested input buffers to be used for sequen*es1

InB6ffers

A pointer to the input buffer that has '6bit data in 4'bit *ontainers1

errorCode

!he error *ode spe*ified b& the *ompletion of the IOC!L *all1

 

MLANASI!C!MMAND,ARAM

t>pee0 struct _-LAN_ASIO_CO--AN%_PARA- +LONG errorCoe;

* -LAN_ASIO_CO--AN%_PARA-3 P-LAN_ASIO_CO--AN%_PARA-;

errorCode

!he error *ode returned b& the *ompletion of the IOC!L1

)undr& structs contained within main structs

ADDR"SS!$$S"T

t>pee0 struct _A%%R,SS_O..S,T   +S7ORT O00_7i?;

  +LONG O00_Low;* A%%R,SS_O..S,T3 PA%%R,SS_O..S,T;

3((

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 107/114

>1 Referen*es

!ff+igh 

Spe*ifies the high order offset for a IEEE 3456 address1

!ffLow 

Spe*ifies the lo- order offset for a IEEE 3456 address1K#S2N7 '(()

I!ADDR"SS

t>pee0 struct _IO_A%%R,SS   NO%,_A%%R,SS IA_%estination_I%;  A%%R,SS_O..S,T IA_%estination_O00set;* IO_A%%R,SS3 PIO_A%%R,SS;

IADestinationID 

Holds a stru*ture of t&pe N!D"ADDR"SS *ontaining the destination nodeaddress1

IADestination!ffset 

Holds a stru*ture of t&pe ADDR"SS!$$S"T that spe*ifies the inde+ of the

3456 address -ithin the address arra&1

K#S2N7 '(()

S,""DMA,

t>pee0 struct _SP,,%_-AP

  +S7ORT SP%_Len?t;+S7ORT SP%_CRC;+LONG SP%_Generation;+C7AR SP%_Spee_CoeED4F;

* SP,,%_-AP3 PSP,,%_-AP;

S,DLength 

Spe*ifies the number of quadlets in the speed map1

S,DCRC 

Spe*ifies the CRC %alue for the speed map1

S,D#eneration 

Spe*ifies the generation *ount for the bus reset that *orresponds to this speed

map1

S,DSeedCode 

Spe*ifies an arra& of speed *odes1

K#S2N7 '(()

T!,!L!#1MA,

t>pee0 struct _TOPOLOG9_-AP   +S7ORT TOP_Len?t;

+S7ORT TOP_CRC;

+LONG TOP_Generation;+S7ORT TOP_Noe_Count;+S7ORT TOP_Se'0_I%_Count;

3(3

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 108/114

>1 Referen*es

S,L._I% TOP_Se'0_I%_Arra>EF;S,L._I% TOP_Se'0_I%_Arra>ED4F;

* TOPOLOG9_-AP3 PTOPOLOG9_-AP;

T!,Length 

Spe*ifies the length in quadlets of the topolog& map1

T!,CRC 

Spe*ifies the CRC %alue for the topolog& map1

T!,#eneration 

Spe*ifies the bus reset generation for -hi*h the topolog& map -as *reated1

T!,NodeCo6nt 

Spe*ifies the number of nodes in the topolog& map1

T!,SelfIDCo6nt 

Spe*ifies the number of entries in T!,SelfIDArray 1 /Not used0

T!,SelfIDArray  

$ointer to an arra& of S"L$ID and S"L$IDM!R" stru*tures /the t-o

stru*tures are the same sie01K#S2N7 '(()

MLANSTR"AMC!N$I#

t>pee0 struct _-LAN_STR,A-_CON.IG +LONG Strea#T>pe;+LONG Spee;+LONG Canne';+LONG Nu#8u00erGroups;+LONG Nu#PacketsPer8u00erGroup;

* -LAN_STR,A-_CON.IG3 P-LAN_STR,A-_CON.IG;

StreamTye

Spe*ifies the t&pe of the stream1

Seed

Spe*ifies the speed of the bus1

Channel

Spe*ifies the *hannel the stream belongs to1

N6mB6ffer#ro6s

Spe*ifies the number of buffers1

N6m,a8@ets,erB6ffer#ro6

Spe*ifies the number of pa*.ets per group of buffers1

MLANSTR"AMSTAT%S

t>pee0 struct  _-LAN_STR,A-_STAT+S  8OOL,AN MRunnin?;  +LONG Recei&in?Sa#p'eRate;  8OOL,AN recei&in?-atc;  +LONG Nu#%8C,rrorPacket;  +LONG Nu#Seuences;  +LONG strea#Ine5;  -LAN_S,+,NC,_STAT+S SeuenceStatusE-LAN_-AH_N+-_S,+,NC,SF;

* -LAN_STR,A-_STAT+S3 P-LAN_STR,A-_STAT+S;

R6nning

3('

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 109/114

>1 Referen*es

Spe*ifies -hether the stream is running or not1

Re8eivingSamleRate

Spe*ifies the sample rate -hen re*ei%ing pa*.ets1

re8eivingMat8h

Spe*ifies -hether the stream t&pe required mat*hes the stream t&pe re*ei%ed

N6mDBC"rror,a8@etSpe*ifies the number of 2ata Blo*. Count error pa*.ets1

N6mSe?6en8es

Spe*ifies the number of sequen*es the stream has1

streamIndeE

Spe*ifies the stream inde+ in relation to the rest of the a*ti%e streams1

Se?6en8eStat6s9MLANMA5N%MS"H%"NC"S;

Spe*ifies the indi%idual status of ea*h sequen*e1

MLANDATA$I"LDC!N$I#

t>pee0 struct _-LAN_%ATA_.I,L%_CON.IG+LONG Sa#p'eRate;8OOL,AN useI,,,Mit.'oat;+LONG Mit%ept.or2%-Auio;-LAN_S9T_LOCAL_OR_,HT S>tPara#;+LONG Nu#Seuences;-LAN_S,+,NC,_%ATA_CON.IG Seuence%ataE-LAN_-AH_N+-_S,+,NC,SF;

* -LAN_%ATA_.I,L%_CON.IG3 P-LAN_%ATA_.I,L%_CON.IG;

SamleRate

Spe*ifies the sample rate of the iso*hronous stream1

6seI"""*(it$loat

Spe*ifies -hether the data is represented in IEEE 3456 4'bit float format or

not1

itDeth$orWDMA6dio

Spe*ifies the resolution of the 2# audio sample1

Syt,aram

Spe*ifies the stream that is bus master1

N6mSe?6en8es

Spe*ifies the number of sequen*es the stream has1

Se?6en8eData9MLANMA5N%MS"H%"NC"S;

Spe*ifies the sequen*e t&pe and *orresponding allo*ated de%i*e number1

MLANS"H%"NC"STAT%S

t>pee0 struct  _-LAN_S,+,NC,_STAT+S-LAN_S,+,NC,_%ATA_CON.IG Seuence%ata;

  +LONG AuioSa#p'eSi@e;  8OOL,AN MCop>Protect;  +LONG Nu#Parit>,rror;* -LAN_S,+,NC,_STAT+S3 P-LAN_S,+,NC,_STAT+S;

Se?6en8eData

Spe*ifies the sequen*e t&pe and *orresponding allo*ated de%i*e number1

A6dioSamleSi<e

Spe*ifies the sie of ea*h audio sample1

3(4

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 110/114

>1 Referen*es

Coy,rote8t

Spe*ifies -hether the sequen*e data *an be o%er-ritten or not1

N6m,arity"rror

Re*ords the number of parit& errors1

MLANS1TL!CAL!R"5T

t>pee0 struct _-LAN_S9T_LOCAL_OR_,HT 8OOL,AN M-aster;7AN%L, Strea#;

* -LAN_S9T_LOCAL_OR_,HT3 P-LAN_S9T_LOCAL_OR_,HT;

Master

Spe*ifies if the o-ner of the stream is the bus master or not1

hStream

Spe*ifies the handle to the stream resour*e that is the bus master1

MLANS"H%"NC"DATAC!N$I#

t>pee0 struct _-LAN_S,+,NC,_%ATA_CON.IG+LONG SeuenceT>pe;+LONG %e&iceNu#Mer;

* -LAN_S,+,NC,_%ATA_CON.IG3 P-LAN_S,+,NC,_%ATA_CON.IG;

Se?6en8eTye

!he number of the sequen*e1

Devi8eN6mer

!he de%i*e number asso*iated -ith the sequen*e1 !he %alue is %alid fromnumber 3 to the number of allo*ated de%i*es1

CM,C!NN"CTT1,"

t>pee0 enu#   C-P_8roacast = 43  C-P_PointToPoint* C-P_CONN,CT_T9P,;

An enumeration of the *onne*t t&pe used in *onne*ting 3>>4 plugs1

CI,DATA$!RMAT

t>pee0 struct _CIP_%ATA_.OR-AT   +C7AR .-T;

+C7AR .%._i;+C7AR .%._#i;

  +C7AR .%._'o;  8OOL,AN M7eaer;

+C7AR Pain?;+C7AR 8'ockSi@e;+C7AR .raction;+LONG 8'ockPerio;

* CIP_%ATA_.OR-AT3 PCIP_%ATA_.OR-AT;

3(6

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 111/114

>1 Referen*es

$MT

!his is the data t&pe used in the CI$1 F#! and F2F are either .no-n7 or

dis*o%ered1

$D$hi

As*ertained %ia A<:C *ommand1$D$mid

 Not sure1

$D$lo

 Not sure1

+eader

S$H /-hether a transport time dela& stamp has been added0 as defined b&

IEC,3>>41

,adding

  $C /quadlet padding *ount0 as defined b& IEC,3>>41

Blo8@Si<e

2BS /data blo*. sie0 as defined b& IEC,3>>41$ra8tion

FN /number of fra*tions the original pa*.et -as di%ided into0 as defined b&

IEC,3>>41

Blo8@,eriod

Blo*.$eriod , transmission onl&1

CM,,L%#T1,"

t>pee0 enu# 

  C-P_P'u?Out = 43C-P_P'u?In* C-P_PL+G_T9P,;

An enumeration of the plug t&pe1

A&,CR

t>pee0 struct _A1_PCR   union   OPCR oPCR;  IPCR iPCR;  +LONG u'on?%ata;  *;* A1_PCR3 PA1_PCR;

o,CR  

Contains an !,CR  stru*ture that *ontains initialiation %alues for an output

 plug1

i,CR  

Contains an I,CR  stru*ture that *ontains initialiation %alues for an input

 plug1

6longData 

Reser%ed for internal use1K#S2N7 '(()

3()

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 112/114

>1 Referen*es

I,CR

t>pee0 struct _IPCR   +LONG Reser&e4B;

  +LONG Canne';  +LONG Reser&eB;  +LONG PPCCounter;  +LONG 8CCCounterB;  +LONG OnLineB;* IPCR3 PIPCR;

,ayload 

Spe*ifies the *onne*tion speed1

!verheadID 

Spe*ifies7 for an un*onne*ted output plug7 the upper bounds for the band-idth

that the output plug needs for the transmission of an iso*hronous pa*.et1

DataRate Indi*ates the bit rate that the output plug uses to transmit an iso*hronous

 pa*.et1

Channel 

Indi*ates the *hannel number that the output plug shall use to transmit the

iso*hronous data flo-7 for a suspended output plug1 For an a*ti%e output plug

it indi*ates the a*tual *hannel number that the output plug uses to transmit the

iso*hronous data flo-1 For an un*onne*ted output plug it has no meaning1

Reserved 

Reser%ed1

,,CCo6nter 

Indi*ates the number of point,to,point *onne*tions to the output plug1

BCCCo6nter 

Indi*ates7 -hen one7 that there is a broad*ast,out *onne*tion to the output

 plug1 hen ero it indi*ates that there is no *onne*tion1

!nLine 

Indi*ates7 -hen one7 that the *orresponding output plug is on,line1 hen ero

it indi*ates that the output plug is off,line1

K#S2N7 '(()

!,CR

t>pee0 struct _OPCR   +LONG Pa>'oaB4;  +LONG O&ereaI%D;  +LONG %ataRate;  +LONG Canne';  +LONG Reser&e;  +LONG PPCCounter;  +LONG 8CCCounterB;  +LONG OnLineB;* OPCR3 POPCR;

Reserved= 

Reser%ed1Channel 

3(

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 113/114

>1 Referen*es

Indi*ates the *hannel number that the input plug shall use to transmit the

iso*hronous data flo-7 for a suspended input plug1 For an a*ti%e input plug it

indi*ates the a*tual *hannel number that the input plug uses to transmit the

iso*hronous data flo-1 For an un*onne*ted input plug it has no meaning1

Reserved' 

Reser%ed1,,CCo6nter 

Indi*ates the number of point,to,point *onne*tions to the input plug1

BCCCo6nter 

Indi*ates7 -hen one7 that there is a broad*ast,in *onne*tion to the input plug1

hen ero it indi*ates that there is no *onne*tion1

!nLine 

Indi*ates7 -hen one7 that the *orresponding input plug is on,line1 hen ero it

indi*ates that the input plug is off,line1

K#S2N7 '(()

$C,$RAM"

t>pee0 struct _.CP_.RA-,   +C7AR ct>peD;  +C7AR ctsD;  +C7AR pa>'oaEBBF;* .CP_.RA-,3 P.CP_.RA-,;

8tye 

!he *ommand or response t&pe as defined b& the Command:!ransa*tion Set

/C!S0 used for this request1

8ts !he C!S used for this FC$ request1 !he C!S spe*ifies the *ommand set7 the

stru*ture of the *ommand:response field7 and the rules of transa*tions used for

sending FC$ *ommands and responses1

ayload 

!he FC$ request for this frame1

"RRMLANSTR"AM

t>pee0 enu#

,RR_-LAN_S+CC,SS = 43,RR_-LAN_STR,A-_,HIST3,RR_-LAN_8AN%_O1,R3,RR_-LAN_C7_+S,%3,RR_-LAN_NO_R,S3,RR_-LAN_STR,A-_NOT_ALLOC3,RR_-LAN_STR,A-_R+NNING3,RR_-LAN_.S_-IS-ATC73,RR_-LAN_CANNOT_G,T_S9T

*,RR_-LAN_STR,A-_,;

!his is an enumeration of the error *odes used in some of the data stru*tures1 Should

an IOC!L *all fail7 depending on the IOC!L7 it -ill return an error *ode1

"RRASI!MLAN

3(D

8/19/2019 Shaun Miles Thesis

http://slidepdf.com/reader/full/shaun-miles-thesis 114/114

>1 Referen*es

t>pee0 enu#,RR_ASIO_-LAN_S+CC,SS = 43,RR_ASIO_-LAN_NO-,-3,RR_ASIO_-LAN_NOR,S3,RR_ASIO_-LAN_NOTS,T+P3

,RR_ASIO_-LAN_ALR,A%9_INITIALIJ,%3,RR_ASIO_-LAN_NOTR+NNING3,RR_ASIO_-LAN_NOTINITIALIJ,%3,RR_ASIO_-LAN_ALR,A%9R+NNING3,RR_ASIO_-LAN_ALR,A%9ALLOCAT,%3,RR_ASIO_-LAN_NOTALLOCAT,%3,RR_ASIO_-LAN_IN1ALI%_8+..,R_SIJ,3

*,RR_ASIO_-LAN_,;

An enumeration of the error *odes that are produ*ed b& ASIO related IOC!L *alls1

3(>