packet->payload_length,
DMA_TO_DEVICE);
if (packet->payload_bus == 0) {
- complete_transmission(packet, -ENOMEM, list);
+ complete_transmission(packet, RCODE_SEND_ERROR, list);
return;
}
/* We dont return error codes from this function; all
* transmission errors are reported through the
* callback. */
- complete_transmission(packet, -ESTALE, list);
+ complete_transmission(packet, RCODE_GENERATION, list);
}
}
switch (evt) {
case OHCI1394_evt_timeout:
/* Async response transmit timed out. */
- complete_transmission(packet, -ETIMEDOUT, &list);
+ complete_transmission(packet, RCODE_CANCELLED, &list);
break;
case OHCI1394_evt_flushed:
/* The packet was flushed should give same
* error as when we try to use a stale
* generation count. */
- complete_transmission(packet, -ESTALE, &list);
+ complete_transmission(packet,
+ RCODE_GENERATION, &list);
break;
case OHCI1394_evt_missing_ack:
- /* This would be a higher level software
- * error, it is using a valid (current)
- * generation count, but the node is not on
- * the bus. */
- complete_transmission(packet, -ENODEV, &list);
+ /* Using a valid (current) generation count,
+ * but the node is not on the bus or not
+ * sending acks. */
+ complete_transmission(packet, RCODE_NO_ACK, &list);
break;
default:
- complete_transmission(packet, -EIO, &list);
+ complete_transmission(packet, RCODE_SEND_ERROR, &list);
break;
}
} else
close_transaction(t, card, RCODE_BUSY, NULL, 0);
break;
case ACK_DATA_ERROR:
+ close_transaction(t, card, RCODE_DATA_ERROR, NULL, 0);
+ break;
case ACK_TYPE_ERROR:
- close_transaction(t, card, RCODE_SEND_ERROR, NULL, 0);
+ close_transaction(t, card, RCODE_TYPE_ERROR, NULL, 0);
break;
default:
- /* FIXME: In this case, status is a negative errno,
- * corresponding to an OHCI specific transmit error
- * code. We should map that to an RCODE instead of
- * just the generic RCODE_SEND_ERROR. */
- close_transaction(t, card, RCODE_SEND_ERROR, NULL, 0);
+ /* In this case the ack is really a juju specific
+ * rcode, so just forward that to the callback. */
+ close_transaction(t, card, status, NULL, 0);
break;
}
}