[...]
if (tx_desc_get_last(desc)) {
+ unsigned desc_first[2];
+
/* Modify the 1st descriptor of this packet to be owned by
* the processor.
*/
cpu_physical_memory_read(s->tx_desc_addr,
- (uint8_t *)&desc[0], sizeof(desc));
- tx_desc_set_used(desc);
+ (uint8_t *)&desc_first[0], sizeof(desc));
+ tx_desc_set_used(desc_first);
cpu_physical_memory_write(s->tx_desc_addr,
- (uint8_t *)&desc[0], sizeof(desc));
+ (uint8_t *)&desc_first[0], sizeof(desc));
/* Advance the hardare current descriptor past this packet */
This is quite fun.
Can we, please,
a) s/unsigned/uint8_t/ in the variable declaration,
and remove the useless casts and "readdressing" everywhere?
and, more interesting,
b) s/sizeof(desc)/sizeof(desc_first)/g
? :)
Thanks,
/mjt