56 slave->eeprom_group = NULL; |
56 slave->eeprom_group = NULL; |
57 slave->eeprom_desc = NULL; |
57 slave->eeprom_desc = NULL; |
58 INIT_LIST_HEAD(&slave->eeprom_strings); |
58 INIT_LIST_HEAD(&slave->eeprom_strings); |
59 INIT_LIST_HEAD(&slave->eeprom_syncs); |
59 INIT_LIST_HEAD(&slave->eeprom_syncs); |
60 INIT_LIST_HEAD(&slave->eeprom_pdos); |
60 INIT_LIST_HEAD(&slave->eeprom_pdos); |
|
61 INIT_LIST_HEAD(&slave->sdo_dictionary); |
61 } |
62 } |
62 |
63 |
63 /*****************************************************************************/ |
64 /*****************************************************************************/ |
64 |
65 |
65 /** |
66 /** |
70 { |
71 { |
71 ec_eeprom_string_t *string, *next_str; |
72 ec_eeprom_string_t *string, *next_str; |
72 ec_eeprom_sync_t *sync, *next_sync; |
73 ec_eeprom_sync_t *sync, *next_sync; |
73 ec_eeprom_pdo_t *pdo, *next_pdo; |
74 ec_eeprom_pdo_t *pdo, *next_pdo; |
74 ec_eeprom_pdo_entry_t *entry, *next_ent; |
75 ec_eeprom_pdo_entry_t *entry, *next_ent; |
|
76 ec_sdo_t *sdo, *next_sdo; |
75 |
77 |
76 // Alle Strings freigeben |
78 // Alle Strings freigeben |
77 list_for_each_entry_safe(string, next_str, &slave->eeprom_strings, list) { |
79 list_for_each_entry_safe(string, next_str, &slave->eeprom_strings, list) { |
78 list_del(&string->list); |
80 list_del(&string->list); |
79 kfree(string); |
81 kfree(string); |
101 } |
103 } |
102 |
104 |
103 if (slave->eeprom_name) kfree(slave->eeprom_name); |
105 if (slave->eeprom_name) kfree(slave->eeprom_name); |
104 if (slave->eeprom_group) kfree(slave->eeprom_group); |
106 if (slave->eeprom_group) kfree(slave->eeprom_group); |
105 if (slave->eeprom_desc) kfree(slave->eeprom_desc); |
107 if (slave->eeprom_desc) kfree(slave->eeprom_desc); |
|
108 |
|
109 // Alle SDOs freigeben |
|
110 list_for_each_entry_safe(sdo, next_sdo, &slave->sdo_dictionary, list) { |
|
111 list_del(&sdo->list); |
|
112 if (sdo->name) kfree(sdo->name); |
|
113 kfree(sdo); |
|
114 } |
106 } |
115 } |
107 |
116 |
108 /*****************************************************************************/ |
117 /*****************************************************************************/ |
109 |
118 |
110 /** |
119 /** |
790 void ec_slave_print(const ec_slave_t *slave /**< EtherCAT-Slave */) |
799 void ec_slave_print(const ec_slave_t *slave /**< EtherCAT-Slave */) |
791 { |
800 { |
792 ec_eeprom_sync_t *sync; |
801 ec_eeprom_sync_t *sync; |
793 ec_eeprom_pdo_t *pdo; |
802 ec_eeprom_pdo_t *pdo; |
794 ec_eeprom_pdo_entry_t *entry; |
803 ec_eeprom_pdo_entry_t *entry; |
|
804 ec_sdo_t *sdo; |
795 int first; |
805 int first; |
796 |
806 |
797 EC_INFO("x-- EtherCAT slave information ---------------\n"); |
807 EC_INFO("x-- EtherCAT slave information ---------------\n"); |
798 |
808 |
799 if (slave->type) { |
809 if (slave->type) { |
887 |
897 |
888 list_for_each_entry(entry, &pdo->entries, list) { |
898 list_for_each_entry(entry, &pdo->entries, list) { |
889 EC_INFO("| \"%s\" 0x%04X:%X, %i Bit\n", |
899 EC_INFO("| \"%s\" 0x%04X:%X, %i Bit\n", |
890 entry->name ? entry->name : "???", |
900 entry->name ? entry->name : "???", |
891 entry->index, entry->subindex, entry->bit_length); |
901 entry->index, entry->subindex, entry->bit_length); |
|
902 } |
|
903 } |
|
904 |
|
905 if (!list_empty(&slave->sdo_dictionary)) { |
|
906 EC_INFO("| SDO-Dictionary:\n"); |
|
907 list_for_each_entry(sdo, &slave->sdo_dictionary, list) { |
|
908 EC_INFO("| 0x%04X: \"%s\"\n", sdo->index, |
|
909 sdo->name ? sdo->name : ""); |
|
910 EC_INFO("| Type 0x%04X, subindices: %i, features: 0x%02X\n", |
|
911 sdo->type, sdo->max_subindex, sdo->features); |
892 } |
912 } |
893 } |
913 } |
894 |
914 |
895 EC_INFO("x---------------------------------------------\n"); |
915 EC_INFO("x---------------------------------------------\n"); |
896 } |
916 } |