<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML ><HEAD ><TITLE >Port drivers</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="The Linux 2.4 Parallel Port Subsystem" HREF="book1.html"><LINK REL="PREVIOUS" TITLE="Device driver's view" HREF="c192.html"><LINK REL="NEXT" TITLE="The printer driver" HREF="c452.html"></HEAD ><BODY CLASS="CHAPTER" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >The Linux 2.4 Parallel Port Subsystem</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="c192.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="c452.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="CHAPTER" ><H1 ><A NAME="PORTDRIVERS" ></A >Port drivers</H1 ><P > To recap, then:</P ><P ></P ><UL COMPACT="COMPACT" ><LI ><P > The device driver registers itself with <TT CLASS="LITERAL" >parport</TT >. </P ></LI ><LI ><P > A low-level driver finds a parallel port and registers it with <TT CLASS="LITERAL" >parport</TT > (these first two things can happen in either order). This registration creates a <SPAN CLASS="STRUCTNAME" >struct parport</SPAN > which is linked onto a list of known ports. </P ></LI ><LI ><P > <TT CLASS="LITERAL" >parport</TT > calls the <TT CLASS="FUNCTION" >attach</TT > function of each registered device driver, passing it the pointer to the new <SPAN CLASS="STRUCTNAME" >struct parport</SPAN >. </P ></LI ><LI ><P > The device driver gets a handle from <TT CLASS="LITERAL" >parport</TT >, for use with <TT CLASS="FUNCTION" >parport_claim</TT >/<TT CLASS="FUNCTION" >release</TT >. This handle takes the form of a pointer to a <SPAN CLASS="STRUCTNAME" >struct pardevice</SPAN >, representing a particular device on the parallel port, and is acquired using <TT CLASS="FUNCTION" >parport_register_device</TT >. </P ></LI ><LI ><P > The device driver claims the port using <TT CLASS="FUNCTION" >parport_claim</TT > (or <TT CLASS="FUNCTION" >function_claim_or_block</TT >). </P ></LI ><LI ><P > Then it goes ahead and uses the port. When finished it releases the port. </P ></LI ></UL ><P > The purpose of the low-level drivers, then, is to detect parallel ports and provide methods of accessing them (i.e. implementing the operations in <SPAN CLASS="STRUCTNAME" >struct parport_operations</SPAN >). </P ><P > A more complete description of which operation is supposed to do what is available in <TT CLASS="FILENAME" >Documentation/parport-lowlevel.txt</TT >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="c192.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="c452.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Device driver's view</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >The printer driver</TD ></TR ></TABLE ></DIV ></BODY ></HTML >