Device files realted to DLPI interface - SUN

This is a discussion on Device files realted to DLPI interface - SUN ; SunOS 5.10 ------ From man 7p dlpi for HP-UX ------ Device File Format To access LAN drivers via DLPI interface, DLS users must use the following device files: Name Type Major # Minor # Access Type -------- ---- ------- ------- ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Device files realted to DLPI interface

  1. Device files realted to DLPI interface

    SunOS 5.10

    ------ From man 7p dlpi for HP-UX ------
    Device File Format
    To access LAN drivers via DLPI interface, DLS users must use the
    following device files:

    Name Type Major # Minor # Access Type
    -------- ---- ------- ------- -----------
    /dev/dlpi c 72 0x77 Clone access
    /dev/dlpiX c 119 0xX Non-Clone access
    -------------------------------------------------------

    So, man 7p for HP-UX contain informations of names of device files
    related to DLPI interface.

    man 7p for Sun doesn't contain information of names of device files
    related to DLPI interface.

    How to know names of these files for Sun?

    Thanks,
    Alex Vinokur

  2. Re: Device files realted to DLPI interface

    Alex Vinokur writes:
    > Name Type Major # Minor # Access Type
    > -------- ---- ------- ------- -----------
    > /dev/dlpi c 72 0x77 Clone access
    > /dev/dlpiX c 119 0xX Non-Clone access
    > -------------------------------------------------------


    That doesn't look quite right.

    > man 7p for Sun doesn't contain information of names of device files
    > related to DLPI interface.
    >
    > How to know names of these files for Sun?


    There are several ways:

    - Read the man pages for the drivers you're interested in. There's
    no standard that specifies how the drivers are named or where they
    appear, though there are conventions.

    - Use libdevinfo to iterate through the networking devices installed
    on the system, and generate the device paths from there.

    - Use some interface library, such as libdlpi or even libpcap on
    Solaris, that knows where the device nodes are located and doesn't
    force you to hunt them down.

    - Just assume what everyone else does on every platform that
    supports DLPI (including Solaris): if it's DLPI Style 1, then
    it'll be /dev/nameX (where "name" is the driver name, and "X" is
    the PPA), and if it's DLPI Style 2, then it'll be /dev/name (and
    you'll supply the PPA with DL_ATTACH_REQ).

    Besides the libraries (which I highly recommend, especially libdlpi),
    the most common way to do this is to try "/dev/%s" first. If that
    works, then use DL_INFO_REQ and check that it's Style 1. It'd better
    be.

    If that doesn't work, then trim off all trailing decimal digits, and
    try again. If that works, then use DL_INFO_REQ and verify that it's
    Style 2. If not, fail.

    If you end up with Style 2, then you have to do DL_ATTACH_REQ to
    select the PPA (convert the trailing decimal digits on the original
    interface name to a number with atoi(3C)), and then issue DL_INFO_REQ
    again. Not all Style 2 drivers return coherent data (other than style
    number) when unattached.

    --
    James Carlson, Solaris Networking
    Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

+ Reply to Thread