Re: [PARPORT] Questions and first pass at ieee1284 MODULE_DEVICE_TABLE support

From: Joerg Schilling (schilling@fokus.gmd.de)
Date: Thu Dec 14 2000 - 07:58:33 EST

  • Next message: Adam J. Richter: "Re: [PARPORT] Questions and first pass at ieee1284 MODULE_DEVICE_TABLE support"

    >From: Tim Waugh <tim@cyberelk.demon.co.uk>

    >On Wed, Dec 13, 2000 at 04:26:21PM -0800, Adam J. Richter wrote:

    >> The user space matching scheme that I described will only
    >> determine what modules to load. Once the modules are loaded, it is
    >> up to them to figure out which devices to bind to. Imagine that
    >> I have a system with three parallel ports, one of which has a
    >> zip drive attached to it. Once the module is loaded, how does
    >> it figure out which port to bind to, if it cannot check the
    >> ieee1284 device string?

    >I see what you mean. I think most drivers look for their device on
    >all ports once they're loaded anyway. I think that's probably
    >enough isn't it?

    >But if the kernel matching is easy to do and doesn't complicate things
    >too much..

    It should be simple..... here are the man pages:

    /*--------------------------------------------------------------------------*/
    . \" @(#)patcompile.3 1.1 88/07/21 Copyright 1985,1995 J. Schilling
    . \" Manual Seite fuer patcompile
    . \"
    .if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a
    .if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o
    .if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u
    .if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A
    .if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O
    .if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U
    .if t .ds s \\(*b
    .if t .ds S SS
    .if n .ds a ae
    .if n .ds o oe
    .if n .ds u ue
    .if n .ds s sz
    .TH PATCOMPILE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS"
    .SH NAME
    patcompile() \- compiles a matching pattern
    .SH SYNOPSIS
    .nf
    .B
    int patcompile(pattern, length, aux)
    .B char *pattern;
    .B int length;
    .B int aux[];
    .fi
    .SH DESCRIPTION
    .B patcompile()
    compiles a pattern into an internal form which
    .BR patmatch(3)
    can use.
    .PP
    The string at
    .I pattern
    with size
    .I length
    is scanned. The array
    .B aux
    is filled in with state information for
    .BR patchmatch (3).
    .B aux
    should have at least
    .I length
    elements.
    .SH RETURNS
    Returns 0 if the pattern contains an error.
    .PP
    Other values should be passed to
    .BR patmatch (3)
    as the
    .B alt
    argument.
    .SH "SEE ALSO
    .BR match (1)
    .PP
    For a description ot the regular expressions.
    .SH NOTES
    The pattern matching functions are based on ones presented by
    Martin Richards in "A Compact Function for Regular Expression
    Pattern Matching", Software-Practice and Experience vol 9,
    527-534 (1979).
    /*--------------------------------------------------------------------------*/
    . \" @(#)patmatch.3 1.2 00/11/12 Copyright 1985,1995 J. Schilling
    . \" Manual Seite fuer patmatch
    . \"
    .if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a
    .if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o
    .if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u
    .if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A
    .if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O
    .if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U
    .if t .ds s \\(*b
    .if t .ds S SS
    .if n .ds a ae
    .if n .ds o oe
    .if n .ds u ue
    .if n .ds s sz
    .TH PATMATCH 3 "12. Nov 2000" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS"
    .SH NAME
    patmatch() \- checks string for matches
    .SH SYNOPSIS
    .nf
    .B
    char *patmatch(pattern, aux, string, soff, slen, alt, state)
    .B char *pattern;
    .B int *aux;
    .B char *string;
    .B int soff;
    .B int slen;
    .B int alt;
    .B int state[];
    .fi
    .SH DESCRIPTION
    .B patmatch()
    uses the pattern matching information
    .IR pattern
    and in addition
    .IR aux " and " alt
    (previously set up by a call to
    .BR patcompile (3))
    to check string for a match. The length of the string is
    .I slen
    and the starting index used for matching is
    .IR soff .
    The string can also be terminated by a null byte.
    .PP
    The
    .I state
    array is set up and used internally by
    .B patmatch
    and should have at least
    .BI "strlen(" pattern ") + 1"
    elements.
    .SH RETURNS
    Returns a NULL pointer if the
    .I string
    starting at the specified offset did not match the
    .IR pattern .
    .PP
    Any non-NULL return is a pointer to the first character of
    .I string
    after the part that matches.
    .SH "SEE ALSO
    .BR patcompile (3)
    for information on
    .I aux
    and
    .IR alt .
    .PP
    And
    .BR match (1)
    for a description ot the regular expressions.
    .SH NOTES
    The pattern matching functions are based on ones presented by
    Martin Richards in "A Compact Function for Regular Expression
    Pattern Matching", Software-Practice and Experience vol 9,
    527-534 (1979).
    /*--------------------------------------------------------------------------*/
    Jörg

     EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
           js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
           schilling@fokus.gmd.de (work) chars I am J"org Schilling
     URL: http://www.fokus.gmd.de/usr/schilling ftp://ftp.fokus.gmd.de/pub/unix

    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Thu Dec 14 2000 - 08:02:47 EST