Minor changes.
This commit is contained in:
parent
40745b789e
commit
aaea721316
6
TODO
6
TODO
|
|
@ -8,6 +8,12 @@ $Id$
|
|||
|
||||
Important things to do:
|
||||
|
||||
* Add Kobjects in constructors.
|
||||
|
||||
* Read AL Status Code with AL Control Response.
|
||||
|
||||
* Coupling of EoE handlers before configuring slaves.
|
||||
|
||||
* SysFS interface
|
||||
- Add secondary slave address
|
||||
- Add SDO dictionary
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ void ec_domain_clear(struct kobject *kobj /**< kobject of the domain */)
|
|||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
Registeres a data field in a domain.
|
||||
Registeres a PDO entry.
|
||||
\return 0 in case of success, else < 0
|
||||
*/
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ int ec_domain_reg_pdo_entry(ec_domain_t *domain, /**< EtherCAT domain */
|
|||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
Clears the list of the registered data fields.
|
||||
Clears the list of the data registrations.
|
||||
*/
|
||||
|
||||
void ec_domain_clear_data_regs(ec_domain_t *domain /**< EtherCAT domain */)
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ void ec_eoe_run(ec_eoe_t *eoe /**< EoE handler */)
|
|||
\return 1 if the device is "up", 0 if it is "down"
|
||||
*/
|
||||
|
||||
unsigned int ec_eoe_active(const ec_eoe_t *eoe /**< EoE handler */)
|
||||
int ec_eoe_active(const ec_eoe_t *eoe /**< EoE handler */)
|
||||
{
|
||||
return eoe->slave && eoe->opened;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,10 +78,13 @@ struct ec_eoe
|
|||
struct net_device *dev; /**< net_device for virtual ethernet device */
|
||||
struct net_device_stats stats; /**< device statistics */
|
||||
unsigned int opened; /**< net_device is opened */
|
||||
cycles_t t_last; /**< time of last rate output */
|
||||
struct sk_buff *rx_skb; /**< current rx socket buffer */
|
||||
off_t rx_skb_offset; /**< current write pointer in the socket buffer */
|
||||
size_t rx_skb_size; /**< size of the allocated socket buffer memory */
|
||||
uint8_t rx_expected_fragment; /**< next expected fragment number */
|
||||
uint32_t rx_counter; /**< octets received during last second */
|
||||
uint32_t rx_rate; /**< receive rate (bps) */
|
||||
struct list_head tx_queue; /**< queue for frames to send */
|
||||
unsigned int tx_queue_active; /**< kernel netif queue started */
|
||||
unsigned int tx_queued_frames; /**< number of frames in the queue */
|
||||
|
|
@ -90,11 +93,8 @@ struct ec_eoe
|
|||
uint8_t tx_frame_number; /**< number of the transmitted frame */
|
||||
uint8_t tx_fragment_number; /**< number of the fragment */
|
||||
size_t tx_offset; /**< number of octets sent */
|
||||
uint32_t rx_counter; /**< octets received during last second */
|
||||
uint32_t tx_counter; /**< octets transmitted during last second */
|
||||
uint32_t rx_rate; /**< receive rate (bps) */
|
||||
uint32_t tx_rate; /**< transmit rate (bps) */
|
||||
cycles_t t_last; /**< time of last output */
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
@ -102,6 +102,6 @@ struct ec_eoe
|
|||
int ec_eoe_init(ec_eoe_t *);
|
||||
void ec_eoe_clear(ec_eoe_t *);
|
||||
void ec_eoe_run(ec_eoe_t *);
|
||||
unsigned int ec_eoe_active(const ec_eoe_t *);
|
||||
int ec_eoe_active(const ec_eoe_t *);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void ec_fsm_change_check_ack(ec_fsm_t *);
|
|||
void ec_fsm_coe_down_start(ec_fsm_t *);
|
||||
void ec_fsm_coe_down_request(ec_fsm_t *);
|
||||
void ec_fsm_coe_down_check(ec_fsm_t *);
|
||||
void ec_fsm_coe_down_fetch(ec_fsm_t *);
|
||||
void ec_fsm_coe_down_response(ec_fsm_t *);
|
||||
|
||||
void ec_fsm_end(ec_fsm_t *);
|
||||
void ec_fsm_error(ec_fsm_t *);
|
||||
|
|
@ -2097,16 +2097,16 @@ void ec_fsm_coe_down_check(ec_fsm_t *fsm /**< finite state machine */)
|
|||
// Fetch response
|
||||
ec_slave_mbox_prepare_fetch(slave, datagram); // can not fail.
|
||||
ec_master_queue_datagram(fsm->master, datagram);
|
||||
fsm->coe_state = ec_fsm_coe_down_fetch;
|
||||
fsm->coe_state = ec_fsm_coe_down_response;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
CoE state: DOWN_FETCH.
|
||||
CoE state: DOWN_RESPONSE.
|
||||
*/
|
||||
|
||||
void ec_fsm_coe_down_fetch(ec_fsm_t *fsm /**< finite state machine */)
|
||||
void ec_fsm_coe_down_response(ec_fsm_t *fsm /**< finite state machine */)
|
||||
{
|
||||
ec_datagram_t *datagram = &fsm->datagram;
|
||||
ec_slave_t *slave = fsm->slave;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ struct ec_fsm
|
|||
cycles_t sii_start; /**< sii start */
|
||||
|
||||
void (*change_state)(ec_fsm_t *); /**< slave state change state function */
|
||||
uint8_t change_new; /**< input: new state */
|
||||
ec_slave_state_t change_new; /**< input: new state */
|
||||
cycles_t change_start; /**< change start */
|
||||
|
||||
void (*coe_state)(ec_fsm_t *); /**< CoE state function */
|
||||
|
|
|
|||
|
|
@ -723,7 +723,7 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */
|
|||
break;
|
||||
}
|
||||
|
||||
off += sprintf(buffer + off, "\n\nNumber of slaves: %i\n",
|
||||
off += sprintf(buffer + off, "\nSlaves: %i\n",
|
||||
master->slave_count);
|
||||
|
||||
off += sprintf(buffer + off, "\nTiming (min/avg/max) [us]:\n");
|
||||
|
|
@ -755,7 +755,7 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */
|
|||
min, sum / HZ, (sum * 100 / HZ) % 100, max);
|
||||
|
||||
if (!list_empty(&master->eoe_handlers))
|
||||
off += sprintf(buffer + off, "\nEoE Statistics (RX/TX) [bps]:\n");
|
||||
off += sprintf(buffer + off, "\nEoE statistics (RX/TX) [bps]:\n");
|
||||
list_for_each_entry(eoe, &master->eoe_handlers, list) {
|
||||
off += sprintf(buffer + off, " %s: %u / %u\n",
|
||||
eoe->dev->name, eoe->rx_rate, eoe->tx_rate);
|
||||
|
|
|
|||
|
|
@ -521,18 +521,17 @@ size_t ec_slave_info(const ec_slave_t *slave, /**< EtherCAT slave */
|
|||
if (slave->sii_name)
|
||||
off += sprintf(buffer + off, "%s", slave->sii_name);
|
||||
|
||||
off += sprintf(buffer + off, "\n\nVendor ID: 0x%08X\n",
|
||||
off += sprintf(buffer + off, "\nVendor ID: 0x%08X\n",
|
||||
slave->sii_vendor_id);
|
||||
off += sprintf(buffer + off, "Product code: 0x%08X\n\n",
|
||||
slave->sii_product_code);
|
||||
|
||||
off += sprintf(buffer + off, "Ring position: %i\n", slave->ring_position);
|
||||
off += sprintf(buffer + off, "Advanced position: %i:%i\n\n",
|
||||
slave->coupler_index, slave->coupler_subindex);
|
||||
|
||||
off += sprintf(buffer + off, "State: ");
|
||||
off += ec_state_string(slave->current_state, buffer + off);
|
||||
off += sprintf(buffer + off, "\n\n");
|
||||
off += sprintf(buffer + off, "\nRing position: %i\n",
|
||||
slave->ring_position);
|
||||
off += sprintf(buffer + off, "Advanced position: %i:%i\n\n",
|
||||
slave->coupler_index, slave->coupler_subindex);
|
||||
|
||||
off += sprintf(buffer + off, "Data link status:\n");
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
|
@ -611,7 +610,7 @@ size_t ec_slave_info(const ec_slave_t *slave, /**< EtherCAT slave */
|
|||
if (slave->sii_image)
|
||||
off += sprintf(buffer + off, " Image: %s\n", slave->sii_image);
|
||||
if (slave->sii_order)
|
||||
off += sprintf(buffer + off, " Order#: %s\n", slave->sii_order);
|
||||
off += sprintf(buffer + off, " Order number: %s\n", slave->sii_order);
|
||||
|
||||
if (!list_empty(&slave->sii_syncs))
|
||||
off += sprintf(buffer + off, "\nSync-Managers:\n");
|
||||
|
|
@ -629,13 +628,13 @@ size_t ec_slave_info(const ec_slave_t *slave, /**< EtherCAT slave */
|
|||
|
||||
list_for_each_entry(pdo, &slave->sii_pdos, list) {
|
||||
off += sprintf(buffer + off,
|
||||
" %s \"%s\" (0x%04X), -> Sync-Manager %i\n",
|
||||
" %s \"%s\" (0x%04X), Sync-Manager %i\n",
|
||||
pdo->type == EC_RX_PDO ? "RXPDO" : "TXPDO",
|
||||
pdo->name ? pdo->name : "???",
|
||||
pdo->index, pdo->sync_index);
|
||||
|
||||
list_for_each_entry(pdo_entry, &pdo->entries, list) {
|
||||
off += sprintf(buffer + off, " \"%s\" 0x%04X:%X, %i Bit\n",
|
||||
off += sprintf(buffer + off, " \"%s\" 0x%04X:%X, %i bit\n",
|
||||
pdo_entry->name ? pdo_entry->name : "???",
|
||||
pdo_entry->index, pdo_entry->subindex,
|
||||
pdo_entry->bit_length);
|
||||
|
|
|
|||
Loading…
Reference in New Issue