Output link state in 'ethercat master'.

This commit is contained in:
Florian Pose
2009-04-17 12:55:55 +00:00
parent 515a66aa8e
commit b7e06d12f4
5 changed files with 5 additions and 1 deletions

1
NEWS
View File

@@ -33,6 +33,7 @@ Changes since 1.4.0:
* 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:

1
TODO
View File

@@ -14,7 +14,6 @@ Version 1.5.0:
- 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.

View File

@@ -180,6 +180,7 @@ int ec_cdev_ioctl_master(
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 @@ int ec_cdev_ioctl_master(
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);

View File

@@ -127,6 +127,7 @@ typedef struct {
struct {
uint8_t address[6];
uint8_t attached;
uint8_t link_state;
uint32_t tx_count;
uint32_t rx_count;
} devices[2];

View File

@@ -107,6 +107,7 @@ void CommandMaster::execute(MasterDevice &m, const StringVector &args)
<< 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;
}