Hi, The 'real' way to do this is via the netlink socket.
I have attached a simple test program that works happily on a Dell running FC5. The program only checks for the link being up/down but is notified of address changes as well - just there isn't any code to handle this. If your program has a 'select' somewhere waiting for input, then you just need to add the netlink file descriptor into the list of descriptors. It only receives something when it detects a change so there is no polling overhead in your app. If the ethernet driver does not support netlink then it is broken & it needs adding - this is the future ;-) Regards Phil Q Phil Quiney, Senior Software Engineer Trinity Convergence Cambridge Business Park Cowley Road Cambridge CB4 0WZ, UK T: +44(0)1223-435536 F: +44(0)1223-435560 www.trinityconvergence.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ronald Taneza Sent: 19 April 2008 16:54 To: António Silva Cc: [email protected] Subject: Re: Ethernet Link Status Try ifplugd. It's a linux daemon that can detect link status and call a user script (example: /etc/ifplugd/ifplugd.action) whenever the link status changes. -Ronald 2008/4/18 António Silva <[EMAIL PROTECTED]>: > Hi all, > > How can I check the ETH link status on the EVMDM355?? > > If we unplug the cable we see a message specifying "link down", and > another message "link up" when the cable is plugged again, but i can't > find where this is made in the kernel. I pretend to use this > automatically on my application generating an alarm and maintaining an alarm > log. > > I know that using mii-tool we can check the status of the link, i > re-compile the kernel, checking all option of mii (under Device > Driver->Networking > Support->PHY device support), I performed make modules and make > modules_install and the re-compile the kernel. > > Nonetheless i still can't use mii-tool because I get the foolowing > error > messages: > > modprobe: FATAL: Could not load > /lib/modules/2.6.10_mvl401/modules.dep: No such file or directory > > Does anybody knows how we can solve this, or another way to check the > link status. > > Best Regards, > > A.Silva > > _______________________________________________ > Davinci-linux-open-source mailing list > [email protected] > > http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source > > _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
netlink_test.c
Description: netlink_test.c
_______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
