if (fw->size != size) { /* Due to race conditions in firmware loading (esp. with udev <0.95) the wrong file was sometimes loaded. So we check filesizes to see if at least the right-sized file was loaded. If not, then we
retry. */
IVTV_INFO("Retry: file loaded was not %s (expected size %ld, got %zu)\n", fn, size, fw->size);
release_firmware(fw);
retries--; goto retry;
} for (i = 0; i < fw->size; i += 4) { /* no need for endianness conversion on the ppc */
__raw_writel(*src, dst);
dst++;
src++;
}
IVTV_INFO("Loaded %s firmware (%zu bytes)\n", fn, fw->size);
release_firmware(fw); return size;
}
IVTV_ERR("Unable to open firmware %s (must be %ld bytes)\n", fn, size);
IVTV_ERR("Did you put the firmware in the hotplug firmware directory?\n"); return -ENOMEM;
}
void ivtv_halt_firmware(struct ivtv *itv)
{
IVTV_DEBUG_INFO("Preparing for firmware halt.\n"); if (itv->has_cx23415 && itv->dec_mbox.mbox)
ivtv_vapi(itv, CX2341X_DEC_HALT_FW, 0); if (itv->enc_mbox.mbox)
ivtv_vapi(itv, CX2341X_ENC_HALT_FW, 0);
/* Check firmware running state. The checks fall through
allowing multiple failures to be logged. */ int ivtv_firmware_check(struct ivtv *itv, char *where)
{ int res = 0;
/* Check encoder is still running */ if (ivtv_vapi(itv, CX2341X_ENC_PING_FW, 0) < 0) {
IVTV_WARN("Encoder has died : %s\n", where);
res = -1;
}
/* Also check audio. Only check if not in use & encoder is okay */ if (!res && !atomic_read(&itv->capturing) &&
(!atomic_read(&itv->decoding) ||
(atomic_read(&itv->decoding) < 2 && test_bit(IVTV_F_I_DEC_YUV,
&itv->i_flags)))) {
if (ivtv_vapi(itv, CX2341X_ENC_MISC, 1, 12) < 0) {
IVTV_WARN("Audio has died (Encoder OK) : %s\n", where);
res = -2;
}
}
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) { /* Second audio check. Skip if audio already failed */ if (res != -2 && read_dec(0x100) != read_dec(0x104)) { /* Wait & try again to be certain. */
ivtv_msleep_timeout(14, 0); if (read_dec(0x100) != read_dec(0x104)) {
IVTV_WARN("Audio has died (Decoder) : %s\n",
where);
res = -1;
}
}
/* Check decoder is still running */ if (ivtv_vapi(itv, CX2341X_DEC_PING_FW, 0) < 0) {
IVTV_WARN("Decoder has died : %s\n", where);
res = -1;
}
}
/* If something failed & currently idle, try to reload */ if (res && !atomic_read(&itv->capturing) &&
!atomic_read(&itv->decoding)) {
IVTV_INFO("Detected in %s that firmware had failed - Reloading\n",
where);
res = ivtv_firmware_restart(itv); /* * Even if restarted ok, still signal a problem had occurred. * The caller can come through this function again to check * if things are really ok after the restart.
*/ if (!res) {
IVTV_INFO("Firmware restart okay\n");
res = -EAGAIN;
} else {
IVTV_INFO("Firmware restart failed\n");
}
} elseif (res) {
res = -EIO;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.