MERGE branches/async -r243:244 -> trunk (intypes).
authorFlorian Pose <fp@igh-essen.com>
Wed, 08 Mar 2006 13:23:56 +0000
changeset 101 b0c19892145a
parent 100 d3d4654e499d
child 102 ddb355dd3e21
MERGE branches/async -r243:244 -> trunk (intypes).
master/canopen.c
master/device.c
master/domain.c
master/domain.h
master/master.c
master/module.c
master/slave.c
master/slave.h
master/types.h
--- a/master/canopen.c	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/canopen.c	Wed Mar 08 13:23:56 2006 +0000
@@ -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_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 */
-                                 )
-{
-    unsigned char data[0xF6];
+                        uint16_t sdo_index, /**< SDO-Index */
+                        uint8_t sdo_subindex, /**< SDO-Subindex */
+                        uint32_t *value /**< Speicher für gel. Wert */
+                        )
+{
+    uint8_t data[0xF6];
     ec_command_t command;
     ec_master_t *master;
     cycles_t start, end, timeout;
--- a/master/device.c	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/device.c	Wed Mar 08 13:23:56 2006 +0000
@@ -255,7 +255,7 @@
    \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 */
                        )
 {
--- a/master/domain.c	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/domain.c	Wed Mar 08 13:23:56 2006 +0000
@@ -127,7 +127,8 @@
     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 @@
 
 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_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;
 
--- a/master/domain.h	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/domain.h	Wed Mar 08 13:23:56 2006 +0000
@@ -52,7 +52,7 @@
     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 */
 };
--- a/master/master.c	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/master.c	Wed Mar 08 13:23:56 2006 +0000
@@ -413,7 +413,7 @@
     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");
--- a/master/module.c	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/module.c	Wed Mar 08 13:23:56 2006 +0000
@@ -43,7 +43,7 @@
 
 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 @@
     }
 
     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;
--- a/master/slave.c	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/slave.c	Wed Mar 08 13:23:56 2006 +0000
@@ -122,15 +122,15 @@
 
 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 @@
                         )
 {
     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 @@
                           )
 {
     ec_command_t command;
-    unsigned char data[2];
+    uint8_t data[2];
     cycles_t start, end, timeout;
 
     EC_WRITE_U16(data, state);
--- a/master/slave.h	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/slave.h	Wed Mar 08 13:23:56 2006 +0000
@@ -93,7 +93,7 @@
 
 // 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 *);
 
--- a/master/types.h	Mon Mar 06 16:25:12 2006 +0000
+++ b/master/types.h	Wed Mar 08 13:23:56 2006 +0000
@@ -82,8 +82,8 @@
 
 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;