From 783253cb733f6ad8e9ac0db430b7b087ee68abd1 Mon Sep 17 00:00:00 2001 From: Florian Pose <fp@igh-essen.com> Date: Wed, 8 Mar 2006 13:23:56 +0000 Subject: [PATCH] MERGE branches/async -r243:244 -> trunk (intypes). --- master/canopen.c | 20 ++++++++++---------- master/device.c | 2 +- master/domain.c | 9 ++++++--- master/domain.h | 2 +- master/master.c | 2 +- master/module.c | 5 +++-- master/slave.c | 10 +++++----- master/slave.h | 2 +- master/types.h | 4 ++-- 9 files changed, 30 insertions(+), 26 deletions(-) diff --git a/master/canopen.c b/master/canopen.c index 1598f612..f093ada8 100644 --- a/master/canopen.c +++ b/master/canopen.c @@ -22,11 +22,11 @@ */ int EtherCAT_rt_canopen_sdo_write(ec_slave_t *slave, /**< EtherCAT-Slave */ - uint16_t sdo_index, /**< SDO-Index */ - uint8_t sdo_subindex, /**< SDO-Subindex */ - uint32_t value, /**< Neuer Wert */ - size_t size /**< Größe des Datenfeldes */ - ) + uint16_t sdo_index, /**< SDO-Index */ + uint8_t sdo_subindex, /**< SDO-Subindex */ + uint32_t value, /**< Neuer Wert */ + size_t size /**< Größe des Datenfeldes */ + ) { uint8_t data[0xF6]; ec_command_t command; @@ -115,12 +115,12 @@ int EtherCAT_rt_canopen_sdo_write(ec_slave_t *slave, /**< EtherCAT-Slave */ */ int EtherCAT_rt_canopen_sdo_read(ec_slave_t *slave, /**< EtherCAT-Slave */ - uint16_t sdo_index, /**< SDO-Index */ - uint8_t sdo_subindex, /**< SDO-Subindex */ - uint32_t *value /**< Speicher für gel. Wert */ - ) + uint16_t sdo_index, /**< SDO-Index */ + uint8_t sdo_subindex, /**< SDO-Subindex */ + uint32_t *value /**< Speicher für gel. Wert */ + ) { - unsigned char data[0xF6]; + uint8_t data[0xF6]; ec_command_t command; ec_master_t *master; cycles_t start, end, timeout; diff --git a/master/device.c b/master/device.c index 6dbd29ce..6e998eec 100644 --- a/master/device.c +++ b/master/device.c @@ -255,7 +255,7 @@ void ec_data_print_diff(const uint8_t *d1, /**< Daten 1 */ \return 0 wenn nein, nicht-null wenn ja. */ -int EtherCAT_dev_is_ec(const ec_device_t *device, /**< EtherCAT-Gerät */ +inline int EtherCAT_dev_is_ec(const ec_device_t *device, /**< EtherCAT-Gerät */ const struct net_device *dev /**< Net-Device */ ) { diff --git a/master/domain.c b/master/domain.c index 258b08e0..aad5f5c7 100644 --- a/master/domain.c +++ b/master/domain.c @@ -127,7 +127,8 @@ int ec_domain_alloc(ec_domain_t *domain, /**< Dom ec_field_reg_t *field_reg; ec_slave_t *slave; ec_fmmu_t *fmmu; - unsigned int i, j, found, data_offset; + unsigned int i, j, found; + uint32_t data_offset; if (domain->data) { EC_ERR("Domain already allocated!\n"); @@ -349,8 +350,9 @@ int EtherCAT_rt_register_domain_fields(ec_domain_t *domain, void EtherCAT_rt_domain_queue(ec_domain_t *domain /**< Domäne */) { - unsigned int offset, i; + unsigned int i; size_t size; + off_t offset; offset = 0; for (i = 0; i < domain->command_count; i++) { @@ -372,9 +374,10 @@ void EtherCAT_rt_domain_queue(ec_domain_t *domain /**< Dom void EtherCAT_rt_domain_process(ec_domain_t *domain /**< Domäne */) { - unsigned int offset, working_counter_sum, i; + unsigned int working_counter_sum, i; ec_command_t *command; size_t size; + off_t offset; working_counter_sum = 0; diff --git a/master/domain.h b/master/domain.h index 22ecc354..bbd318f5 100644 --- a/master/domain.h +++ b/master/domain.h @@ -52,7 +52,7 @@ struct ec_domain unsigned int command_count; /**< Anzahl allozierter Kommandos */ ec_domain_mode_t mode; unsigned int timeout_us; /**< Timeout in Mikrosekunden. */ - unsigned int base_address; /**< Logische Basisaddresse der Domain */ + uint32_t base_address; /**< Logische Basisaddresse der Domain */ unsigned int response_count; /**< Anzahl antwortender Slaves */ struct list_head field_regs; /**< Liste der Datenfeldregistrierungen */ }; diff --git a/master/master.c b/master/master.c index 39d66b04..c79a5f9f 100644 --- a/master/master.c +++ b/master/master.c @@ -413,7 +413,7 @@ int ec_master_bus_scan(ec_master_t *master /**< EtherCAT-Master */) ec_slave_t *slave; ec_slave_ident_t *ident; unsigned int i; - unsigned char data[2]; + uint8_t data[2]; if (master->slaves || master->slave_count) { EC_ERR("Slave scan already done!\n"); diff --git a/master/module.c b/master/module.c index dbb0adb7..d1883e0e 100644 --- a/master/module.c +++ b/master/module.c @@ -43,7 +43,7 @@ void __exit ec_cleanup_module(void); int ec_master_count = 1; ec_master_t *ec_masters = NULL; -int *ec_masters_reserved = NULL; +unsigned int *ec_masters_reserved = NULL; /*****************************************************************************/ @@ -88,7 +88,8 @@ int __init ec_init_module(void) } if ((ec_masters_reserved = - (int *) kmalloc(sizeof(int) * ec_master_count, GFP_KERNEL)) == NULL) { + (unsigned int *) kmalloc(sizeof(int) * ec_master_count, + GFP_KERNEL)) == NULL) { EC_ERR("Could not allocate memory for reservation flags!\n"); kfree(ec_masters); return -1; diff --git a/master/slave.c b/master/slave.c index 3fe6afab..326d349d 100644 --- a/master/slave.c +++ b/master/slave.c @@ -122,15 +122,15 @@ int ec_slave_fetch(ec_slave_t *slave /**< EtherCAT-Slave */) int ec_slave_sii_read(ec_slave_t *slave, /**< EtherCAT-Slave */ - unsigned short int offset, + uint16_t offset, /**< Adresse des zu lesenden SII-Registers */ - unsigned int *target + uint32_t *target /**< Zeiger auf einen 4 Byte großen Speicher zum Ablegen der Daten */ ) { ec_command_t command; - unsigned char data[10]; + uint8_t data[10]; cycles_t start, end, timeout; // Initiate read operation @@ -194,7 +194,7 @@ void ec_slave_state_ack(ec_slave_t *slave, ) { ec_command_t command; - unsigned char data[2]; + uint8_t data[2]; cycles_t start, end, timeout; EC_WRITE_U16(data, state | EC_ACK); @@ -257,7 +257,7 @@ int ec_slave_state_change(ec_slave_t *slave, ) { ec_command_t command; - unsigned char data[2]; + uint8_t data[2]; cycles_t start, end, timeout; EC_WRITE_U16(data, state); diff --git a/master/slave.h b/master/slave.h index 14415d1c..0dfb1783 100644 --- a/master/slave.h +++ b/master/slave.h @@ -93,7 +93,7 @@ void ec_slave_clear(ec_slave_t *); // Slave control int ec_slave_fetch(ec_slave_t *); -int ec_slave_sii_read(ec_slave_t *, unsigned short, unsigned int *); +int ec_slave_sii_read(ec_slave_t *, uint16_t, uint32_t *); int ec_slave_state_change(ec_slave_t *, uint8_t); int ec_slave_set_fmmu(ec_slave_t *, const ec_domain_t *, const ec_sync_t *); diff --git a/master/types.h b/master/types.h index f266fdd4..f6d9f9bf 100644 --- a/master/types.h +++ b/master/types.h @@ -82,8 +82,8 @@ ec_slave_type_t; typedef struct slave_ident { - unsigned int vendor_id; /**< Hersteller-Code */ - unsigned int product_code; /**< Herstellerspezifischer Produktcode */ + uint32_t vendor_id; /**< Hersteller-Code */ + uint32_t product_code; /**< Herstellerspezifischer Produktcode */ const ec_slave_type_t *type; /**< Zeiger auf den entsprechenden Typ */ } ec_slave_ident_t; -- GitLab