# HG changeset patch # User Florian Pose # Date 1239972955 0 # Node ID 96baef8a3162c68d0b2e6542153d52d9051e48f9 # Parent 3c4923051e43b0f2967c5cb2adb77028b10b7663 Output link state in 'ethercat master'. diff -r 3c4923051e43 -r 96baef8a3162 NEWS --- a/NEWS Fri Apr 17 12:41:57 2009 +0000 +++ b/NEWS Fri Apr 17 12:55:55 2009 +0000 @@ -33,6 +33,7 @@ * Added debug level for all masters as a module parameter. Thanks to Erwin Burgstaller. * Clear slave list on link down. +* Output device link state in 'ethercat master'. Changes in 1.4.0: diff -r 3c4923051e43 -r 96baef8a3162 TODO --- a/TODO Fri Apr 17 12:41:57 2009 +0000 +++ b/TODO Fri Apr 17 12:55:55 2009 +0000 @@ -14,7 +14,6 @@ - Delay calculation. - Synchronize the reference clock to the master clock. * Read alias from register 0x0012 instead of SII. -* Output link state in 'ethercat master'. * Finish library implementation. * Re-work EoE code. * Replace locking callbacks. diff -r 3c4923051e43 -r 96baef8a3162 master/cdev.c --- a/master/cdev.c Fri Apr 17 12:41:57 2009 +0000 +++ b/master/cdev.c Fri Apr 17 12:55:55 2009 +0000 @@ -180,6 +180,7 @@ memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); } data.devices[0].attached = master->main_device.dev ? 1 : 0; + data.devices[0].link_state = master->main_device.link_state ? 1 : 0; data.devices[0].tx_count = master->main_device.tx_count; data.devices[0].rx_count = master->main_device.rx_count; @@ -190,6 +191,7 @@ memcpy(data.devices[1].address, master->backup_mac, ETH_ALEN); } data.devices[1].attached = master->backup_device.dev ? 1 : 0; + data.devices[1].link_state = master->backup_device.link_state ? 1 : 0; data.devices[1].tx_count = master->backup_device.tx_count; data.devices[1].rx_count = master->backup_device.rx_count; up(&master->device_sem); diff -r 3c4923051e43 -r 96baef8a3162 master/ioctl.h --- a/master/ioctl.h Fri Apr 17 12:41:57 2009 +0000 +++ b/master/ioctl.h Fri Apr 17 12:55:55 2009 +0000 @@ -127,6 +127,7 @@ struct { uint8_t address[6]; uint8_t attached; + uint8_t link_state; uint32_t tx_count; uint32_t rx_count; } devices[2]; diff -r 3c4923051e43 -r 96baef8a3162 tool/CommandMaster.cpp --- a/tool/CommandMaster.cpp Fri Apr 17 12:41:57 2009 +0000 +++ b/tool/CommandMaster.cpp Fri Apr 17 12:55:55 2009 +0000 @@ -107,6 +107,7 @@ << setw(2) << (unsigned int) data.devices[i].address[5] << " (" << (data.devices[i].attached ? "attached" : "waiting...") << ")" << endl << dec + << " Link: " << (data.devices[i].link_state ? "UP" : "DOWN") << endl << " Tx count: " << data.devices[i].tx_count << endl << " Rx count: " << data.devices[i].rx_count; }