equal
deleted
inserted
replaced
54 /** PDO copy constructor. |
54 /** PDO copy constructor. |
55 * |
55 * |
56 * \retval 0 Success. |
56 * \retval 0 Success. |
57 * \retval <0 Error code. |
57 * \retval <0 Error code. |
58 */ |
58 */ |
59 int ec_pdo_init_copy(ec_pdo_t *pdo, const ec_pdo_t *other_pdo) |
59 int ec_pdo_init_copy( |
|
60 ec_pdo_t *pdo, /**< PDO to create. */ |
|
61 const ec_pdo_t *other_pdo /**< PDO to copy from. */ |
|
62 ) |
60 { |
63 { |
61 int ret = 0; |
64 int ret = 0; |
62 |
65 |
63 pdo->index = other_pdo->index; |
66 pdo->index = other_pdo->index; |
64 pdo->sync_index = other_pdo->sync_index; |
67 pdo->sync_index = other_pdo->sync_index; |
147 /** Add a new PDO entry to the configuration. |
150 /** Add a new PDO entry to the configuration. |
148 * |
151 * |
149 * \retval Pointer to the added entry, otherwise a ERR_PTR() code. |
152 * \retval Pointer to the added entry, otherwise a ERR_PTR() code. |
150 */ |
153 */ |
151 ec_pdo_entry_t *ec_pdo_add_entry( |
154 ec_pdo_entry_t *ec_pdo_add_entry( |
152 ec_pdo_t *pdo, |
155 ec_pdo_t *pdo, /**< PDO. */ |
153 uint16_t index, |
156 uint16_t index, /**< New entry's index. */ |
154 uint8_t subindex, |
157 uint8_t subindex, /**< New entry's subindex. */ |
155 uint8_t bit_length |
158 uint8_t bit_length /**< New entry's bit length. */ |
156 ) |
159 ) |
157 { |
160 { |
158 ec_pdo_entry_t *entry; |
161 ec_pdo_entry_t *entry; |
159 |
162 |
160 if (!(entry = kmalloc(sizeof(ec_pdo_entry_t), GFP_KERNEL))) { |
163 if (!(entry = kmalloc(sizeof(ec_pdo_entry_t), GFP_KERNEL))) { |
175 /** Copy PDO entries from another PDO. |
178 /** Copy PDO entries from another PDO. |
176 * |
179 * |
177 * \retval 0 Success. |
180 * \retval 0 Success. |
178 * \retval <0 Error code. |
181 * \retval <0 Error code. |
179 */ |
182 */ |
180 int ec_pdo_copy_entries(ec_pdo_t *pdo, const ec_pdo_t *other) |
183 int ec_pdo_copy_entries( |
|
184 ec_pdo_t *pdo, /**< PDO whos entries shall be replaced. */ |
|
185 const ec_pdo_t *other /**< Pdo with entries to copy. */ |
|
186 ) |
181 { |
187 { |
182 ec_pdo_entry_t *entry, *other_entry; |
188 ec_pdo_entry_t *entry, *other_entry; |
183 int ret; |
189 int ret; |
184 |
190 |
185 ec_pdo_clear_entries(pdo); |
191 ec_pdo_clear_entries(pdo); |