Removed unwanted tabulators.

This commit is contained in:
Florian Pose
2009-07-27 10:37:47 +00:00
parent f0904054f9
commit 735f1efbc1
14 changed files with 353 additions and 353 deletions
+139 -139
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -118,7 +118,7 @@ void ec_datagram_clear(ec_datagram_t *datagram /**< EtherCAT datagram. */)
{
if (datagram->data_origin == EC_ORIG_INTERNAL && datagram->data) {
kfree(datagram->data);
datagram->data = NULL;
datagram->data = NULL;
}
}
+5 -5
View File
@@ -319,15 +319,15 @@ void ec_device_send(
#else
if (device->dev->hard_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
#endif
device->tx_count++;
device->tx_count++;
#ifdef EC_DEBUG_IF
ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);
ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);
#endif
#ifdef EC_DEBUG_RING
ec_device_debug_ring_append(
device, TX, skb->data + ETH_HLEN, size);
ec_device_debug_ring_append(
device, TX, skb->data + ETH_HLEN, size);
#endif
}
}
}
/*****************************************************************************/
+32 -32
View File
@@ -1084,57 +1084,57 @@ void ec_fsm_coe_down_start(ec_fsm_coe_t *fsm /**< finite state machine */)
fsm->state = ec_fsm_coe_error;
return;
}
if (request->data_size <= 4) { // use expedited transfer type
data = ec_slave_mbox_prepare_send(slave, datagram, 0x03, 10);
if (request->data_size <= 4) { // use expedited transfer type
data = ec_slave_mbox_prepare_send(slave, datagram, 0x03, 10);
if (IS_ERR(data)) {
fsm->state = ec_fsm_coe_error;
return;
}
fsm->state = ec_fsm_coe_error;
return;
}
size = 4 - request->data_size;
size = 4 - request->data_size;
EC_WRITE_U16(data, 0x2 << 12); // SDO request
EC_WRITE_U8 (data + 2, (0x3 // size specified, expedited
| size << 2
| 0x1 << 5)); // Download request
EC_WRITE_U16(data + 3, request->index);
EC_WRITE_U8 (data + 5, request->subindex);
memcpy(data + 6, request->data, request->data_size);
EC_WRITE_U16(data, 0x2 << 12); // SDO request
EC_WRITE_U8 (data + 2, (0x3 // size specified, expedited
| size << 2
| 0x1 << 5)); // Download request
EC_WRITE_U16(data + 3, request->index);
EC_WRITE_U8 (data + 5, request->subindex);
memcpy(data + 6, request->data, request->data_size);
memset(data + 6 + request->data_size, 0x00, 4 - request->data_size);
if (slave->master->debug_level) {
EC_DBG("Expedited download request:\n");
ec_print_data(data, 10);
}
}
}
else { // request->data_size > 4, use normal transfer type
if (slave->configured_rx_mailbox_size < 6 + 10 + request->data_size) {
EC_ERR("SDO fragmenting not supported yet!\n");
fsm->state = ec_fsm_coe_error;
return;
}
if (slave->configured_rx_mailbox_size < 6 + 10 + request->data_size) {
EC_ERR("SDO fragmenting not supported yet!\n");
fsm->state = ec_fsm_coe_error;
return;
}
data = ec_slave_mbox_prepare_send(slave, datagram, 0x03,
data = ec_slave_mbox_prepare_send(slave, datagram, 0x03,
request->data_size + 10);
if (IS_ERR(data)) {
fsm->state = ec_fsm_coe_error;
return;
}
fsm->state = ec_fsm_coe_error;
return;
}
EC_WRITE_U16(data, 0x2 << 12); // SDO request
EC_WRITE_U8 (data + 2, (0x1 // size indicator, normal
| 0x1 << 5)); // Download request
EC_WRITE_U16(data + 3, request->index);
EC_WRITE_U8 (data + 5, request->subindex);
EC_WRITE_U32(data + 6, request->data_size);
memcpy(data + 10, request->data, request->data_size);
EC_WRITE_U16(data, 0x2 << 12); // SDO request
EC_WRITE_U8 (data + 2, (0x1 // size indicator, normal
| 0x1 << 5)); // Download request
EC_WRITE_U16(data + 3, request->index);
EC_WRITE_U8 (data + 5, request->subindex);
EC_WRITE_U32(data + 6, request->data_size);
memcpy(data + 10, request->data, request->data_size);
if (slave->master->debug_level) {
EC_DBG("Normal download request:\n");
ec_print_data(data, 10 + request->data_size);
}
}
}
fsm->request->jiffies_sent = jiffies;
fsm->retries = EC_FSM_RETRIES;
+2 -2
View File
@@ -867,7 +867,7 @@ void ec_fsm_master_state_scan_slave(
wake_up_interruptible(&master->scan_queue);
ec_master_calc_dc(master);
// Attach slave configurations
ec_master_attach_slave_configs(master);
@@ -967,7 +967,7 @@ void ec_fsm_master_state_write_sii(
/** Master state: WRITE FOE.
*/
void ec_fsm_master_state_foe_request(
ec_fsm_master_t *fsm /**< Master state machine. */
ec_fsm_master_t *fsm /**< Master state machine. */
)
{
ec_master_t *master = fsm->master;
+1 -1
View File
@@ -641,7 +641,7 @@ void ec_fsm_pdo_conf_state_zero_pdo_count(
// assign first PDO
fsm->pdo_pos = 1;
ec_fsm_pdo_conf_action_assign_pdo(fsm);
ec_fsm_pdo_conf_action_assign_pdo(fsm);
}
/*****************************************************************************/
+40 -40
View File
@@ -139,7 +139,7 @@ int ec_fsm_sii_exec(ec_fsm_sii_t *fsm /**< finite state machine */)
fsm->state(fsm);
return fsm->state != ec_fsm_sii_state_end
&& fsm->state != ec_fsm_sii_state_error;
&& fsm->state != ec_fsm_sii_state_error;
}
/*****************************************************************************/
@@ -164,8 +164,8 @@ int ec_fsm_sii_success(ec_fsm_sii_t *fsm /**< Finite state machine */)
*/
void ec_fsm_sii_state_start_reading(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
ec_datagram_t *datagram = fsm->datagram;
@@ -184,8 +184,8 @@ void ec_fsm_sii_state_start_reading(
EC_WRITE_U16(datagram->data + 2, fsm->word_offset);
#ifdef SII_DEBUG
EC_DBG("reading SII data:\n");
ec_print_data(datagram->data, 4);
EC_DBG("reading SII data:\n");
ec_print_data(datagram->data, 4);
#endif
fsm->retries = EC_FSM_RETRIES;
@@ -200,8 +200,8 @@ void ec_fsm_sii_state_start_reading(
*/
void ec_fsm_sii_state_read_check(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
ec_datagram_t *datagram = fsm->datagram;
@@ -250,8 +250,8 @@ void ec_fsm_sii_state_read_check(
*/
void ec_fsm_sii_state_read_fetch(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
ec_datagram_t *datagram = fsm->datagram;
@@ -275,8 +275,8 @@ void ec_fsm_sii_state_read_fetch(
}
#ifdef SII_DEBUG
EC_DBG("checking SII read state:\n");
ec_print_data(datagram->data, 10);
EC_DBG("checking SII read state:\n");
ec_print_data(datagram->data, 10);
#endif
if (EC_READ_U8(datagram->data + 1) & 0x20) {
@@ -286,15 +286,15 @@ void ec_fsm_sii_state_read_fetch(
}
// check "busy bit"
if (EC_READ_U8(datagram->data + 1) & 0x81) { // busy bit or
// read operation busy
if (EC_READ_U8(datagram->data + 1) & 0x81) { /* busy bit or
read operation busy */
// still busy... timeout?
unsigned long diff_ms =
(datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ;
if (diff_ms >= SII_TIMEOUT) {
if (fsm->check_once_more) {
fsm->check_once_more = 0;
} else {
fsm->check_once_more = 0;
} else {
EC_ERR("SII: Read timeout.\n");
fsm->state = ec_fsm_sii_state_error;
return;
@@ -319,23 +319,23 @@ void ec_fsm_sii_state_read_fetch(
*/
void ec_fsm_sii_state_start_writing(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
ec_datagram_t *datagram = fsm->datagram;
// initiate write operation
ec_datagram_fpwr(datagram, fsm->slave->station_address, 0x502, 8);
EC_WRITE_U8 (datagram->data, 0x81); // two address octets
// + enable write access
EC_WRITE_U8 (datagram->data, 0x81); /* two address octets
+ enable write access */
EC_WRITE_U8 (datagram->data + 1, 0x02); // request write operation
EC_WRITE_U16(datagram->data + 2, fsm->word_offset);
memset(datagram->data + 4, 0x00, 2);
memset(datagram->data + 4, 0x00, 2);
memcpy(datagram->data + 6, fsm->value, 2);
#ifdef SII_DEBUG
EC_DBG("writing SII data:\n");
ec_print_data(datagram->data, 8);
EC_DBG("writing SII data:\n");
ec_print_data(datagram->data, 8);
#endif
fsm->retries = EC_FSM_RETRIES;
@@ -349,8 +349,8 @@ void ec_fsm_sii_state_start_writing(
*/
void ec_fsm_sii_state_write_check(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
ec_datagram_t *datagram = fsm->datagram;
@@ -390,8 +390,8 @@ void ec_fsm_sii_state_write_check(
*/
void ec_fsm_sii_state_write_check2(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
ec_datagram_t *datagram = fsm->datagram;
unsigned long diff_ms;
@@ -416,8 +416,8 @@ void ec_fsm_sii_state_write_check2(
}
#ifdef SII_DEBUG
EC_DBG("checking SII write state:\n");
ec_print_data(datagram->data, 2);
EC_DBG("checking SII write state:\n");
ec_print_data(datagram->data, 2);
#endif
if (EC_READ_U8(datagram->data + 1) & 0x20) {
@@ -426,25 +426,25 @@ void ec_fsm_sii_state_write_check2(
return;
}
/* FIXME: some slaves never answer with the busy flag set...
* wait a few ms for the write operation to complete. */
/* FIXME: some slaves never answer with the busy flag set...
* wait a few ms for the write operation to complete. */
diff_ms = (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ;
if (diff_ms < SII_INHIBIT) {
#ifdef SII_DEBUG
EC_DBG("too early.\n");
EC_DBG("too early.\n");
#endif
// issue check datagram again
fsm->retries = EC_FSM_RETRIES;
return;
}
}
if (EC_READ_U8(datagram->data + 1) & 0x82) { // busy bit or
// write operation busy bit
if (EC_READ_U8(datagram->data + 1) & 0x82) { /* busy bit or
write operation busy bit */
// still busy... timeout?
if (diff_ms >= SII_TIMEOUT) {
if (fsm->check_once_more) {
fsm->check_once_more = 0;
} else {
fsm->check_once_more = 0;
} else {
EC_ERR("SII: Write timeout.\n");
fsm->state = ec_fsm_sii_state_error;
return;
@@ -473,8 +473,8 @@ void ec_fsm_sii_state_write_check2(
*/
void ec_fsm_sii_state_error(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
}
@@ -485,8 +485,8 @@ void ec_fsm_sii_state_error(
*/
void ec_fsm_sii_state_end(
ec_fsm_sii_t *fsm /**< finite state machine */
)
ec_fsm_sii_t *fsm /**< finite state machine */
)
{
}
+2 -2
View File
@@ -443,7 +443,7 @@ void ec_fsm_slave_config_state_dc_read_offset(
// set DC system time offset and transmission delay
ec_datagram_fpwr(datagram, slave->station_address, 0x0920, 12);
EC_WRITE_U64(datagram->data, new_offset);
EC_WRITE_U32(datagram->data + 8, slave->transmission_delay);
EC_WRITE_U32(datagram->data + 8, slave->transmission_delay);
fsm->retries = EC_FSM_RETRIES;
fsm->state = ec_fsm_slave_config_state_dc_write_offset;
}
@@ -829,7 +829,7 @@ void ec_fsm_slave_config_state_pdo_conf(
ec_fsm_slave_config_t *fsm /**< slave state machine */
)
{
// TODO check for config here
// TODO check for config here
if (ec_fsm_pdo_exec(fsm->fsm_pdo))
return;
+19 -19
View File
@@ -239,13 +239,13 @@ typedef struct {
typedef struct {
// inputs
uint32_t index;
uint32_t index;
// outputs
uint32_t data_size;
uint32_t logical_base_address;
uint16_t working_counter;
uint16_t expected_working_counter;
uint32_t data_size;
uint32_t logical_base_address;
uint16_t working_counter;
uint16_t expected_working_counter;
uint32_t fmmu_count;
} ec_ioctl_domain_t;
@@ -253,15 +253,15 @@ typedef struct {
typedef struct {
// inputs
uint32_t domain_index;
uint32_t fmmu_index;
uint32_t domain_index;
uint32_t fmmu_index;
// outputs
uint16_t slave_config_alias;
uint16_t slave_config_position;
uint8_t sync_index;
ec_direction_t dir;
uint32_t logical_address;
uint32_t logical_address;
uint32_t data_size;
} ec_ioctl_domain_fmmu_t;
@@ -269,7 +269,7 @@ typedef struct {
typedef struct {
// inputs
uint32_t domain_index;
uint32_t domain_index;
uint32_t data_size;
uint8_t *target;
} ec_ioctl_domain_data_t;
@@ -278,7 +278,7 @@ typedef struct {
typedef struct {
// inputs
uint16_t slave_position;
uint16_t slave_position;
uint8_t al_state;
} ec_ioctl_slave_state_t;
@@ -448,15 +448,15 @@ typedef struct {
uint16_t eoe_index;
// outputs
char name[EC_DATAGRAM_NAME_SIZE];
uint16_t slave_position;
uint8_t open;
uint32_t rx_bytes;
uint32_t rx_rate;
uint32_t tx_bytes;
uint32_t tx_rate;
uint32_t tx_queued_frames;
uint32_t tx_queue_size;
char name[EC_DATAGRAM_NAME_SIZE];
uint16_t slave_position;
uint8_t open;
uint32_t rx_bytes;
uint32_t rx_rate;
uint32_t tx_bytes;
uint32_t tx_rate;
uint32_t tx_queued_frames;
uint32_t tx_queue_size;
} ec_ioctl_eoe_handler_t;
/*****************************************************************************/
+71 -71
View File
@@ -129,9 +129,9 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */
INIT_LIST_HEAD(&master->configs);
master->app_time = 0ULL;
master->app_start_time = 0ULL;
master->has_start_time = 0;
master->app_time = 0ULL;
master->app_start_time = 0ULL;
master->has_start_time = 0;
master->scan_busy = 0;
master->allow_scan = 1;
@@ -224,7 +224,7 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */
EC_ERR("Failed to allocate synchronisation datagram.\n");
goto out_clear_ref_sync;
}
ec_master_find_dc_ref_clock(master);
ec_master_find_dc_ref_clock(master);
// init character device
ret = ec_cdev_init(&master->cdev, master, device_number);
@@ -1257,17 +1257,17 @@ const ec_slave_t *ec_master_find_slave_const(
* \return Number of configurations.
*/
unsigned int ec_master_config_count(
const ec_master_t *master /**< EtherCAT master. */
)
const ec_master_t *master /**< EtherCAT master. */
)
{
const ec_slave_config_t *sc;
unsigned int count = 0;
const ec_slave_config_t *sc;
unsigned int count = 0;
list_for_each_entry(sc, &master->configs, list) {
count++;
}
list_for_each_entry(sc, &master->configs, list) {
count++;
}
return count;
return count;
}
/*****************************************************************************/
@@ -1277,12 +1277,12 @@ unsigned int ec_master_config_count(
*/
#define EC_FIND_CONFIG \
do { \
list_for_each_entry(sc, &master->configs, list) { \
if (pos--) \
continue; \
return sc; \
} \
return NULL; \
list_for_each_entry(sc, &master->configs, list) { \
if (pos--) \
continue; \
return sc; \
} \
return NULL; \
} while (0)
/** Get a slave configuration via its position in the list.
@@ -1290,12 +1290,12 @@ unsigned int ec_master_config_count(
* \return Slave configuration or \a NULL.
*/
ec_slave_config_t *ec_master_get_config(
const ec_master_t *master, /**< EtherCAT master. */
unsigned int pos /**< List position. */
)
const ec_master_t *master, /**< EtherCAT master. */
unsigned int pos /**< List position. */
)
{
ec_slave_config_t *sc;
EC_FIND_CONFIG;
ec_slave_config_t *sc;
EC_FIND_CONFIG;
}
/** Get a slave configuration via its position in the list.
@@ -1305,12 +1305,12 @@ ec_slave_config_t *ec_master_get_config(
* \return Slave configuration or \a NULL.
*/
const ec_slave_config_t *ec_master_get_config_const(
const ec_master_t *master, /**< EtherCAT master. */
unsigned int pos /**< List position. */
)
const ec_master_t *master, /**< EtherCAT master. */
unsigned int pos /**< List position. */
)
{
const ec_slave_config_t *sc;
EC_FIND_CONFIG;
const ec_slave_config_t *sc;
EC_FIND_CONFIG;
}
/*****************************************************************************/
@@ -1320,17 +1320,17 @@ const ec_slave_config_t *ec_master_get_config_const(
* \return Number of domains.
*/
unsigned int ec_master_domain_count(
const ec_master_t *master /**< EtherCAT master. */
)
const ec_master_t *master /**< EtherCAT master. */
)
{
const ec_domain_t *domain;
unsigned int count = 0;
const ec_domain_t *domain;
unsigned int count = 0;
list_for_each_entry(domain, &master->domains, list) {
count++;
}
list_for_each_entry(domain, &master->domains, list) {
count++;
}
return count;
return count;
}
/*****************************************************************************/
@@ -1354,11 +1354,11 @@ unsigned int ec_master_domain_count(
* \return Domain pointer, or \a NULL if not found.
*/
ec_domain_t *ec_master_find_domain(
ec_master_t *master, /**< EtherCAT master. */
unsigned int index /**< Domain index. */
)
ec_master_t *master, /**< EtherCAT master. */
unsigned int index /**< Domain index. */
)
{
ec_domain_t *domain;
ec_domain_t *domain;
EC_FIND_DOMAIN;
}
@@ -1369,11 +1369,11 @@ ec_domain_t *ec_master_find_domain(
* \return Domain pointer, or \a NULL if not found.
*/
const ec_domain_t *ec_master_find_domain_const(
const ec_master_t *master, /**< EtherCAT master. */
unsigned int index /**< Domain index. */
)
const ec_master_t *master, /**< EtherCAT master. */
unsigned int index /**< Domain index. */
)
{
const ec_domain_t *domain;
const ec_domain_t *domain;
EC_FIND_DOMAIN;
}
@@ -1384,17 +1384,17 @@ const ec_domain_t *ec_master_find_domain_const(
* \return Number of EoE handlers.
*/
uint16_t ec_master_eoe_handler_count(
const ec_master_t *master /**< EtherCAT master. */
)
const ec_master_t *master /**< EtherCAT master. */
)
{
const ec_eoe_t *eoe;
unsigned int count = 0;
const ec_eoe_t *eoe;
unsigned int count = 0;
list_for_each_entry(eoe, &master->eoe_handlers, list) {
count++;
}
list_for_each_entry(eoe, &master->eoe_handlers, list) {
count++;
}
return count;
return count;
}
/*****************************************************************************/
@@ -1406,19 +1406,19 @@ uint16_t ec_master_eoe_handler_count(
* \return EoE handler pointer, or \a NULL if not found.
*/
const ec_eoe_t *ec_master_get_eoe_handler_const(
const ec_master_t *master, /**< EtherCAT master. */
uint16_t index /**< EoE handler index. */
)
const ec_master_t *master, /**< EtherCAT master. */
uint16_t index /**< EoE handler index. */
)
{
const ec_eoe_t *eoe;
const ec_eoe_t *eoe;
list_for_each_entry(eoe, &master->eoe_handlers, list) {
if (index--)
continue;
return eoe;
}
list_for_each_entry(eoe, &master->eoe_handlers, list) {
if (index--)
continue;
return eoe;
}
return NULL;
return NULL;
}
/*****************************************************************************/
@@ -1452,9 +1452,9 @@ int ec_master_debug_level(
*/
void ec_master_find_dc_ref_clock(
ec_master_t *master /**< EtherCAT master. */
)
)
{
ec_slave_t *slave, *ref = NULL;
ec_slave_t *slave, *ref = NULL;
for (slave = master->slaves;
slave < master->slaves + master->slave_count;
@@ -1480,7 +1480,7 @@ int ec_master_calc_topology_rec(
ec_master_t *master, /**< EtherCAT master. */
ec_slave_t *port0_slave, /**< Slave at port 0. */
unsigned int *slave_position /**< Slave position. */
)
)
{
ec_slave_t *slave = master->slaves + *slave_position;
unsigned int i;
@@ -1512,7 +1512,7 @@ int ec_master_calc_topology_rec(
*/
void ec_master_calc_topology(
ec_master_t *master /**< EtherCAT master. */
)
)
{
unsigned int slave_position = 0;
@@ -1529,9 +1529,9 @@ void ec_master_calc_topology(
*/
void ec_master_calc_transmission_delays(
ec_master_t *master /**< EtherCAT master. */
)
)
{
ec_slave_t *slave;
ec_slave_t *slave;
for (slave = master->slaves;
slave < master->slaves + master->slave_count;
@@ -1551,10 +1551,10 @@ void ec_master_calc_transmission_delays(
*/
void ec_master_calc_dc(
ec_master_t *master /**< EtherCAT master. */
)
)
{
// find DC reference clock
ec_master_find_dc_ref_clock(master);
// find DC reference clock
ec_master_find_dc_ref_clock(master);
// calculate bus topology
ec_master_calc_topology(master);
+4 -4
View File
@@ -747,7 +747,7 @@ void ec_slave_attach_pdo_names(
*/
uint32_t ec_slave_calc_rtt_sum(
ec_slave_t *slave /**< EtherCAT slave. */
)
)
{
uint32_t rtt_sum = 0, rtt;
unsigned int i;
@@ -768,7 +768,7 @@ uint32_t ec_slave_calc_rtt_sum(
*/
ec_slave_t *ec_slave_find_next_dc_slave(
ec_slave_t *slave /**< EtherCAT slave. */
)
)
{
ec_slave_t *dc_slave = NULL;
@@ -796,7 +796,7 @@ ec_slave_t *ec_slave_find_next_dc_slave(
*/
void ec_slave_calc_port_delays(
ec_slave_t *slave /**< EtherCAT slave. */
)
)
{
unsigned int i;
ec_slave_t *next, *next_dc;
@@ -834,7 +834,7 @@ void ec_slave_calc_port_delays(
void ec_slave_calc_transmission_delays_rec(
ec_slave_t *slave, /**< Current slave. */
uint32_t *delay /**< Sum of delays. */
)
)
{
unsigned int i;
ec_slave_t *next, *next_dc;
+25 -25
View File
@@ -74,11 +74,11 @@ void ec_slave_config_init(
sc->used_fmmus = 0;
sc->dc_assign_activate = 0x0000;
sc->dc_sync[0].cycle_time = 0x00000000;
sc->dc_sync[1].cycle_time = 0x00000000;
sc->dc_sync[0].shift_time = 0x00000000;
sc->dc_sync[1].shift_time = 0x00000000;
sc->dc_assign_activate = 0x0000;
sc->dc_sync[0].cycle_time = 0x00000000;
sc->dc_sync[1].cycle_time = 0x00000000;
sc->dc_sync[0].shift_time = 0x00000000;
sc->dc_sync[1].shift_time = 0x00000000;
INIT_LIST_HEAD(&sc->sdo_configs);
INIT_LIST_HEAD(&sc->sdo_requests);
@@ -184,10 +184,10 @@ int ec_slave_config_attach(
ec_slave_config_t *sc /**< Slave configuration. */
)
{
ec_slave_t *slave;
ec_slave_t *slave;
if (sc->slave)
return 0; // already attached
if (sc->slave)
return 0; // already attached
if (!(slave = ec_master_find_slave(
sc->master, sc->alias, sc->position))) {
@@ -197,7 +197,7 @@ int ec_slave_config_attach(
return -ENOENT;
}
if (slave->config) {
if (slave->config) {
if (sc->master->debug_level)
EC_DBG("Failed to attach slave configuration %u:%u. Slave %u"
" already has a configuration!\n", sc->alias,
@@ -214,11 +214,11 @@ int ec_slave_config_attach(
slave->sii.product_code, sc->alias, sc->position,
sc->vendor_id, sc->product_code);
return -EINVAL;
}
}
// attach slave
slave->config = sc;
sc->slave = slave;
// attach slave
slave->config = sc;
sc->slave = slave;
ec_slave_request_state(slave, EC_SLAVE_STATE_OP);
@@ -226,7 +226,7 @@ int ec_slave_config_attach(
EC_DBG("Attached slave %u to config %u:%u.\n",
slave->ring_position, sc->alias, sc->position);
return 0;
return 0;
}
/*****************************************************************************/
@@ -334,14 +334,14 @@ unsigned int ec_slave_config_sdo_count(
const ec_slave_config_t *sc /**< Slave configuration. */
)
{
const ec_sdo_request_t *req;
unsigned int count = 0;
const ec_sdo_request_t *req;
unsigned int count = 0;
list_for_each_entry(req, &sc->sdo_configs, list) {
count++;
}
list_for_each_entry(req, &sc->sdo_configs, list) {
count++;
}
return count;
return count;
}
/*****************************************************************************/
@@ -679,11 +679,11 @@ void ecrt_slave_config_dc(ec_slave_config_t *sc, uint16_t assign_activate,
uint32_t sync0_cycle_time, uint32_t sync0_shift_time,
uint32_t sync1_cycle_time, uint32_t sync1_shift_time)
{
sc->dc_assign_activate = assign_activate;
sc->dc_sync[0].cycle_time = sync0_cycle_time;
sc->dc_sync[0].shift_time = sync0_shift_time;
sc->dc_sync[1].cycle_time = sync1_cycle_time;
sc->dc_sync[1].shift_time = sync1_shift_time;
sc->dc_assign_activate = assign_activate;
sc->dc_sync[0].cycle_time = sync0_cycle_time;
sc->dc_sync[0].shift_time = sync0_shift_time;
sc->dc_sync[1].cycle_time = sync1_cycle_time;
sc->dc_sync[1].shift_time = sync1_shift_time;
}
/*****************************************************************************/
+1 -1
View File
@@ -91,7 +91,7 @@ const ec_sdo_request_t *ec_slave_config_get_sdo_by_pos_const(
ec_sdo_request_t *ec_slave_config_find_sdo_request(ec_slave_config_t *,
unsigned int);
ec_voe_handler_t *ec_slave_config_find_voe_handler(ec_slave_config_t *,
unsigned int);
unsigned int);
ec_sdo_request_t *ecrt_slave_config_create_sdo_request_err(
ec_slave_config_t *, uint16_t, uint8_t, size_t);
+11 -11
View File
@@ -108,14 +108,14 @@ void ec_voe_handler_clear(
/** Get usable memory size.
*/
size_t ec_voe_handler_mem_size(
const ec_voe_handler_t *voe /**< VoE handler. */
)
const ec_voe_handler_t *voe /**< VoE handler. */
)
{
if (voe->datagram.mem_size >= EC_MBOX_HEADER_SIZE + EC_VOE_HEADER_SIZE)
return voe->datagram.mem_size -
(EC_MBOX_HEADER_SIZE + EC_VOE_HEADER_SIZE);
else
return 0;
if (voe->datagram.mem_size >= EC_MBOX_HEADER_SIZE + EC_VOE_HEADER_SIZE)
return voe->datagram.mem_size -
(EC_MBOX_HEADER_SIZE + EC_VOE_HEADER_SIZE);
else
return 0;
}
/*****************************************************************************
@@ -223,7 +223,7 @@ void ec_voe_handler_state_write_start(ec_voe_handler_t *voe)
voe->request_state = EC_INT_REQUEST_FAILURE;
return;
}
data = ec_slave_mbox_prepare_send(slave, &voe->datagram,
EC_MBOX_TYPE_VOE, EC_VOE_HEADER_SIZE + voe->data_size);
if (IS_ERR(data)) {
@@ -308,7 +308,7 @@ void ec_voe_handler_state_read_start(ec_voe_handler_t *voe)
voe->request_state = EC_INT_REQUEST_FAILURE;
return;
}
ec_slave_mbox_prepare_check(slave, datagram); // can not fail.
voe->jiffies_start = jiffies;
@@ -451,7 +451,7 @@ void ec_voe_handler_state_read_nosync_start(ec_voe_handler_t *voe)
voe->request_state = EC_INT_REQUEST_FAILURE;
return;
}
ec_slave_mbox_prepare_fetch(slave, datagram); // can not fail.
voe->jiffies_start = jiffies;
@@ -502,7 +502,7 @@ void ec_voe_handler_state_read_nosync_response(ec_voe_handler_t *voe)
}
if (!(data = ec_slave_mbox_fetch(slave, datagram,
&mbox_prot, &rec_size))) {
&mbox_prot, &rec_size))) {
voe->state = ec_voe_handler_state_error;
voe->request_state = EC_INT_REQUEST_FAILURE;
return;