Lines Matching refs:error

258 	int		error = 0;
281 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_SET_OS_MBOX_VER,
283 if (error != 0) {
291 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_GET_SMS_MBOX_VER,
293 if (error != 0) {
306 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_REG_CALLBACK,
308 if (error != 0) {
312 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_init ret: 0x%08x\n", error);
322 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_init ret: 0x%08x\n", error);
323 return (error);
336 int error = 0;
345 error = mod_remove(&modlinkage);
346 if (error == 0) {
362 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_fini ret: 0x%08x\n", error);
363 return (error);
374 int error = 0;
378 error = mod_info(&modlinkage, modinfop);
380 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_info ret: 0x%08x\n", error);
382 return (error);
393 int error = 0;
429 error = mboxsc_add_mailbox(mailboxp);
432 if (error != 0) {
438 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_init ret: 0x%08x\n", error);
439 return (error);
450 int error = 0;
462 error = EBADF;
471 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_fini ret: 0x%08x\n", error);
472 return (error);
487 int error = 0;
556 error = EBADF;
562 error = EINVAL;
565 if (error != 0) {
568 "mboxsc_putmsg ret: 0x%08x\n", error);
569 return (error);
604 * did not, decrement its reference count and return an error to the
608 error = ENOSPC;
610 error = EINTR;
613 if (error != 0) {
617 "mboxsc_putmsg ret: 0x%08x\n", error);
618 return (error);
647 error = mboxsc_timed_write(deadline, key, MBOXSC_MSGHDR_OFFSET,
650 if (error == 0) {
651 error = mboxsc_timed_write(deadline, key, MBOXSC_DATA_OFFSET,
655 if (error == 0) {
656 error = mboxsc_timed_write(deadline, key, header.msg_length,
666 if (error == 0) {
667 error = mboxsc_lock_flags(FALSE, deadline);
668 if (error == 0) {
670 } else if (error == EBUSY) {
671 error = EAGAIN;
675 if (error == 0) {
676 error = mboxsc_timed_set_flag(deadline, key, IOSRAM_DATA_VALID,
681 * Unlock the flags. If an error is encountered, only return it if
682 * another error hasn't been encountered previously.
686 if ((unlock_err != 0) && ((error == 0) || (error == EAGAIN))) {
687 error = unlock_err;
694 * an error.
696 if (error != 0) {
697 ASSERT((error != EINVAL) && (error != EMSGSIZE));
704 "mboxsc_putmsg ret: 0x%08x\n", error);
705 return (error);
712 error = mboxsc_timed_send_intr(deadline);
721 if (error == DDI_SUCCESS) {
724 error = iosram_get_flag(key, &data_valid, NULL);
726 ((error == EAGAIN) || (error == 0)) &&
738 } else if ((error == 0) || (error == DDI_FAILURE)) {
741 ASSERT(error != EINVAL);
742 result = error;
748 * picks it up at the last moment. If expiration fails due to an error,
749 * return an error to the user even if the message appears to have
753 error = mboxsc_expire_message(key, &result);
754 if ((error != 0) && ((result == 0) || (result == ETIMEDOUT))) {
755 result = error;
791 * detected, but can't be successfully read, an error will be returned even
798 int error = 0;
862 error = EBADF;
864 error = EINVAL;
867 if (error != 0) {
870 "mboxsc_getmsg ret: 0x%08x\n", error);
871 return (error);
882 * message (e.g. checksum error, cancellation by the sender) are
884 * arrive rather than returning an error. To facilitate restarting
899 error = 0;
908 error = ETIMEDOUT;
910 error = EINTR;
913 if (error != 0) {
917 "mboxsc_getmsg ret: 0x%08x\n", error);
918 return (error);
947 error = iosram_get_flag(key, &data_valid, NULL);
949 ASSERT(error != EINVAL);
950 if (error == 0) {
955 } else if ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0)) {
964 * with the length of the message and return an error.
967 if ((error == 0) && (datalen > *lengthp)) {
969 error = EMSGSIZE;
976 if (error != 0) {
981 "mboxsc_getmsg ret: 0x%08x\n", error);
982 return (error);
995 error = mboxsc_timed_read(deadline, key, MBOXSC_DATA_OFFSET,
999 if (error == 0) {
1000 error = mboxsc_timed_read(deadline, key, header.msg_length,
1007 if (error != 0) {
1008 ASSERT((error != EINVAL) && (error != EMSGSIZE));
1017 "mboxsc_getmsg ret: 0x%08x\n", error);
1018 return (error);
1038 error = -1;
1042 error = -1;
1050 if (error == -1) {
1063 if ((error = mboxsc_lock_flags(FALSE, deadline)) != 0) {
1068 if (error == EBUSY) {
1069 error = EAGAIN;
1075 if (error == 0) {
1076 error = mboxsc_timed_get_flag(deadline, key, &data_valid, NULL);
1079 if ((error == 0) && (data_valid == IOSRAM_DATA_VALID)) {
1080 error = mboxsc_timed_read(deadline, key,
1087 * If something failed along the way, either the error is unrecoverable
1092 if (error != 0) {
1093 ASSERT((error != EINVAL) && (error != EMSGSIZE));
1105 "mboxsc_getmsg ret: 0x%08x\n", error);
1106 return (error);
1139 error = mboxsc_unlock_flags(TRUE);
1153 error = mboxsc_timed_set_flag(deadline, key, IOSRAM_DATA_INVALID,
1159 if (error != 0) {
1160 ASSERT(error != EINVAL);
1168 "mboxsc_getmsg ret: 0x%08x\n", error);
1169 return (error);
1209 int error = 0;
1234 error = EINVAL;
1246 error = EINVAL;
1259 error = EINVAL;
1276 error = EINVAL;
1295 error = EINVAL;
1306 error = ENOTSUP;
1311 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_ctrl ret: 0x%08x\n", error);
1312 return (error);
1336 int error = 0;
1360 error = iosram_rd(key, MBOXSC_MSGHDR_OFFSET, MBOXSC_MSGHDR_SIZE,
1369 error = -1;
1384 if (error == 0) {
1385 error = iosram_get_flag(key, &data_valid, NULL);
1386 if ((error == 0) && (data_valid != IOSRAM_DATA_VALID)) {
1387 error = -1;
1394 if (error != 0) {
1397 "mboxsc_iosram_callback ret (0x%08x)\n", error);
1432 int error;
1438 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_GET_SMS_MBOX_VER,
1440 if (error == 0) {
1463 int error = 0;
1486 * chunk is too small to be used as a mailbox, return an error to the
1489 error = iosram_ctrl(key, IOSRAM_CMD_CHUNKLEN, &(mailboxp->mbox_length));
1491 if ((error == 0) && (mailboxp->mbox_length < MBOXSC_PROTOCOL_SIZE)) {
1492 error = EFAULT;
1495 if ((error == 0) && (mailboxp->mbox_direction == MBOXSC_MBOX_IN)) {
1496 error = iosram_register(key, mboxsc_iosram_callback,
1498 if (error == EBUSY) {
1499 error = EFAULT;
1503 if (error != 0) {
1505 "mboxsc_add_mailbox ret: 0x%08x\n", error);
1506 return (error);
1533 int error = 0;
1548 error = iosram_unregister(key);
1549 if (error == EINVAL) {
1552 error = 0;
1718 * before retrying. If a hardware error is encountered return it to the caller.
1726 int error;
1740 * appropriate amount of time before retrying. Any other error is
1754 ((error = iosram_sema_acquire(&sema)) == 0)) {
1773 if (error == EBUSY) {
1784 } else if (error == EAGAIN) {
1798 if ((error == EAGAIN) || (error == EBUSY)) {
1808 error);
1822 } while (((error == EAGAIN) || (error == EBUSY)) &&
1828 if ((error != EAGAIN) && (error != EBUSY)) {
1829 cmn_err(CE_WARN, "Flag locking failed! (%d)", error);
1833 error);
1834 return (error);
1841 * If a hardware error is encountered, return it to the caller. If the
1847 int error;
1864 ((error = iosram_sema_release()) == 0)) {
1883 if ((error == EAGAIN) && mandatory) {
1899 } while ((error == EAGAIN) && mandatory);
1902 error);
1903 return (error);
1917 int error;
1927 error = iosram_rd(key, off, len, dptr);
1928 if (error == EAGAIN) {
1931 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0));
1934 "mboxsc_timed_read ret: 0x%08x\n", error);
1935 return (error);
1949 int error;
1959 error = iosram_wr(key, off, len, dptr);
1960 if (error == EAGAIN) {
1963 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0));
1966 "mboxsc_timed_write ret: 0x%08x\n", error);
1967 return (error);
1981 int error;
1992 error = iosram_get_flag(key, data_validp, int_pendingp);
1993 if (error == EAGAIN) {
1996 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0));
1999 "mboxsc_timed_get_flag ret: 0x%08x\n", error);
2000 return (error);
2014 int error;
2023 error = iosram_set_flag(key, data_valid, int_pending);
2024 if (error == EAGAIN) {
2027 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0));
2030 "mboxsc_timed_set_flag ret: 0x%08x\n", error);
2031 return (error);
2044 int error;
2050 error = iosram_send_intr();
2051 if (error == DDI_FAILURE) {
2054 } while ((error == DDI_FAILURE) && (deadline - ddi_get_lbolt() >= 0));
2057 "mboxsc_timed_send_intr ret: 0x%08x\n", error);
2058 return (error);
2067 * successfully expired, or a serious error has been encountered. If the
2076 int error = 0;
2087 error = 0;
2093 error = mboxsc_lock_flags(TRUE, 0);
2094 if (error == 0) {
2103 if (error == 0) {
2104 error = iosram_get_flag(key, &data_valid, NULL);
2112 if (error == 0) {
2126 error = iosram_set_flag(key,
2134 * of "error" unless no errors other than EAGAIN have been
2142 if (error == EAGAIN) {
2150 } else if ((error == 0) || (error == EAGAIN)) {
2151 error = unlock_err;
2160 if (error == EAGAIN) {
2181 } while (error == EAGAIN);
2189 if (error != 0) {
2190 cmn_err(CE_WARN, "Message expiration failure! (%d)", error);
2196 "mboxsc_expire_message ret: 0x%08x\n", error);
2197 return (error);
2297 int error = 0;
2303 error = print_mailbox_by_key((uint32_t)(uintptr_t)arg);
2317 error = ENOTTY;
2321 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_debug ret: 0x%08x\n", error);
2323 return (error);
2401 int error = 0;
2412 error = 0;
2416 error = EBADF;
2421 "print_mailbox_by_key ret: 0x%08x\n", error);
2423 return (error);