Operating System - HP-UX
1827283 Members
3831 Online
109717 Solutions
New Discussion

Accessing to /dev/lan0 with a Gb card

 
Alessio_3
Occasional Advisor

Accessing to /dev/lan0 with a Gb card

Hello,

we run an application that needs to access the device file of a Gigabit Ethernet card; the program has to perform an "open" and a "ioctl"; it returns an error (errno=6 no such device).
Do you know any kind of tips to simulate the device file of such a card? Ioscan, also, does not show any device files associated to it.

Thanks,
Alessio
8 REPLIES 8
David Burgess
Esteemed Contributor

Re: Accessing to /dev/lan0 with a Gb card

You could create a link to it (ln -s). We've done that for tape devices. Take a look at then man page for ln.

Regards,

Dave.
Steven E. Protter
Exalted Contributor

Re: Accessing to /dev/lan0 with a Gb card

David's approach may work.

The security implications of doing so concerns me though.

I suupose if anything bad happened insf -e would fix it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff Schussele
Honored Contributor

Re: Accessing to /dev/lan0 with a Gb card

Hi Alessio,

There are device files for GigE devices - they aren't displayed in an ioscan output because GigE cards are now all lumped under the btlan umbrella even though the ioscan shows the driver as igelan.
You can confirm this with a
lsdev -C lan
and you'll see *no* igelan driver, but you will see btlan.

But there *should* be device files for the GigE cards. What's under the I column for the device - that should be the PPA or lanX number.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Ajit Natarajan
Valued Contributor

Re: Accessing to /dev/lan0 with a Gb card

Which OS release is this?

Starting HP-UX 11.0 (10.30 actually), there are no device specific files for Ethernet cards. Access to Ethernet cards are through /dev/lan which is the same as /dev/dlpi. The interface through /dev/dlpi conforms to the DLPI specification. The application will have to open /dev/dlpi, attach to the interface, and then issue the ioctl.

What ioctl does your application issue? There aren't that many ioctls available to applications to use.

Thanks.

Ajit Natarajan
HP-UX Gigabit Ethernet
Alessio_3
Occasional Advisor

Re: Accessing to /dev/lan0 with a Gb card

Thanks everyone for your answers. Indeed I tried to do all things you suggested before asking help to the forum.

Ajit,
this is the code:

main ()
{
int fd, i;
struct fis arg;

fd = open("/dev/dlpi", O_RDONLY);
printf("%d errno=%d", fd,errno);
arg.reqtype = LOCAL_ADDRESS;
i = ioctl(fd, NETSTAT, &arg);
printf("%d errno=%d", i,errno);
}

If I open /dev/dlpi, I got an error in the ioctl; opening /dev/lan0, I got an error just in the open.

Thanks,
Alessio
Alessio_3
Occasional Advisor

Re: Accessing to /dev/lan0 with a Gb card

Sorry,

OS is HPUX 11.11

Alessio
rick jones
Honored Contributor

Re: Accessing to /dev/lan0 with a Gb card

Alessio -

Your code snippet is using what was called "LLA" for Link-Level Access.

Back when HP-UX 10.20 was shipped - IIRC back in 1995 or the better part of ten years ago - HP announced that LLA was "going away" and being replaced with the DLPI mentioned by Ajit.

Starting from 1995, support for LLA was fading, and "new" cards were not including LLA support. There were a _very_ few exceptions to deal with lethargic licensing software on workstations. I think even that is gone now.

So, the time has come (8 years ago :) to migrate your LLA application to DLPI. There are I believe some migration documents on docs.hp.com that should help you.

And if you or anyone else knows anyone or any vendor that is _still_ using LLA, please apply an HP P/N 19511-80014 to their craniums (gently please :) and get them migrating _yeasterday_
there is no rest for the wicked yet the virtuous have no pillows
Ajit Natarajan
Valued Contributor

Re: Accessing to /dev/lan0 with a Gb card

As Rick stated, HP does not support the LLA programming interface anymore. Opening /dev/dlpi tells the OS that you want to use the DLPI interface.

You can find the DLPI programmer's guide at the following location:

http://docs.hp.com/hpux/11i/index.html

(search for DLPI)

You may also find the LLA to DLPI migration guide useful. You can find it at the following location:

http://docs.hp.com/hpux/10.x/index.html

(search for LLA).

Hope this helps.

Thanks.

Ajit
HP-UX Gigabit Ethernet