Lines Matching refs:error
258 int error = 0; in _init() local
281 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_SET_OS_MBOX_VER, in _init()
283 if (error != 0) { in _init()
291 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_GET_SMS_MBOX_VER, in _init()
293 if (error != 0) { in _init()
306 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_REG_CALLBACK, in _init()
308 if (error != 0) { in _init()
312 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_init ret: 0x%08x\n", error); in _init()
322 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_init ret: 0x%08x\n", error); in _init()
323 return (error); in _init()
336 int error = 0; in _fini() local
345 error = mod_remove(&modlinkage); in _fini()
346 if (error == 0) { in _fini()
362 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_fini ret: 0x%08x\n", error); in _fini()
363 return (error); in _fini()
374 int error = 0; in _info() local
378 error = mod_info(&modlinkage, modinfop); in _info()
380 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "_info ret: 0x%08x\n", error); in _info()
382 return (error); in _info()
393 int error = 0; in mboxsc_init() local
429 error = mboxsc_add_mailbox(mailboxp); in mboxsc_init()
432 if (error != 0) { in mboxsc_init()
438 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_init ret: 0x%08x\n", error); in mboxsc_init()
439 return (error); in mboxsc_init()
450 int error = 0; in mboxsc_fini() local
462 error = EBADF; in mboxsc_fini()
471 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_fini ret: 0x%08x\n", error); in mboxsc_fini()
472 return (error); in mboxsc_fini()
487 int error = 0; in mboxsc_putmsg() local
556 error = EBADF; in mboxsc_putmsg()
562 error = EINVAL; in mboxsc_putmsg()
565 if (error != 0) { in mboxsc_putmsg()
568 "mboxsc_putmsg ret: 0x%08x\n", error); in mboxsc_putmsg()
569 return (error); in mboxsc_putmsg()
608 error = ENOSPC; in mboxsc_putmsg()
610 error = EINTR; in mboxsc_putmsg()
613 if (error != 0) { in mboxsc_putmsg()
617 "mboxsc_putmsg ret: 0x%08x\n", error); in mboxsc_putmsg()
618 return (error); in mboxsc_putmsg()
647 error = mboxsc_timed_write(deadline, key, MBOXSC_MSGHDR_OFFSET, in mboxsc_putmsg()
650 if (error == 0) { in mboxsc_putmsg()
651 error = mboxsc_timed_write(deadline, key, MBOXSC_DATA_OFFSET, in mboxsc_putmsg()
655 if (error == 0) { in mboxsc_putmsg()
656 error = mboxsc_timed_write(deadline, key, header.msg_length, in mboxsc_putmsg()
666 if (error == 0) { in mboxsc_putmsg()
667 error = mboxsc_lock_flags(FALSE, deadline); in mboxsc_putmsg()
668 if (error == 0) { in mboxsc_putmsg()
670 } else if (error == EBUSY) { in mboxsc_putmsg()
671 error = EAGAIN; in mboxsc_putmsg()
675 if (error == 0) { in mboxsc_putmsg()
676 error = mboxsc_timed_set_flag(deadline, key, IOSRAM_DATA_VALID, in mboxsc_putmsg()
686 if ((unlock_err != 0) && ((error == 0) || (error == EAGAIN))) { in mboxsc_putmsg()
687 error = unlock_err; in mboxsc_putmsg()
696 if (error != 0) { in mboxsc_putmsg()
697 ASSERT((error != EINVAL) && (error != EMSGSIZE)); in mboxsc_putmsg()
704 "mboxsc_putmsg ret: 0x%08x\n", error); in mboxsc_putmsg()
705 return (error); in mboxsc_putmsg()
712 error = mboxsc_timed_send_intr(deadline); in mboxsc_putmsg()
721 if (error == DDI_SUCCESS) { in mboxsc_putmsg()
724 error = iosram_get_flag(key, &data_valid, NULL); in mboxsc_putmsg()
726 ((error == EAGAIN) || (error == 0)) && in mboxsc_putmsg()
738 } else if ((error == 0) || (error == DDI_FAILURE)) { in mboxsc_putmsg()
741 ASSERT(error != EINVAL); in mboxsc_putmsg()
742 result = error; in mboxsc_putmsg()
753 error = mboxsc_expire_message(key, &result); in mboxsc_putmsg()
754 if ((error != 0) && ((result == 0) || (result == ETIMEDOUT))) { in mboxsc_putmsg()
755 result = error; in mboxsc_putmsg()
798 int error = 0; in mboxsc_getmsg() local
862 error = EBADF; in mboxsc_getmsg()
864 error = EINVAL; in mboxsc_getmsg()
867 if (error != 0) { in mboxsc_getmsg()
870 "mboxsc_getmsg ret: 0x%08x\n", error); in mboxsc_getmsg()
871 return (error); in mboxsc_getmsg()
899 error = 0; in mboxsc_getmsg()
908 error = ETIMEDOUT; in mboxsc_getmsg()
910 error = EINTR; in mboxsc_getmsg()
913 if (error != 0) { in mboxsc_getmsg()
917 "mboxsc_getmsg ret: 0x%08x\n", error); in mboxsc_getmsg()
918 return (error); in mboxsc_getmsg()
947 error = iosram_get_flag(key, &data_valid, NULL); in mboxsc_getmsg()
949 ASSERT(error != EINVAL); in mboxsc_getmsg()
950 if (error == 0) { in mboxsc_getmsg()
955 } else if ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0)) { in mboxsc_getmsg()
967 if ((error == 0) && (datalen > *lengthp)) { in mboxsc_getmsg()
969 error = EMSGSIZE; in mboxsc_getmsg()
976 if (error != 0) { in mboxsc_getmsg()
981 "mboxsc_getmsg ret: 0x%08x\n", error); in mboxsc_getmsg()
982 return (error); in mboxsc_getmsg()
995 error = mboxsc_timed_read(deadline, key, MBOXSC_DATA_OFFSET, in mboxsc_getmsg()
999 if (error == 0) { in mboxsc_getmsg()
1000 error = mboxsc_timed_read(deadline, key, header.msg_length, in mboxsc_getmsg()
1007 if (error != 0) { in mboxsc_getmsg()
1008 ASSERT((error != EINVAL) && (error != EMSGSIZE)); in mboxsc_getmsg()
1017 "mboxsc_getmsg ret: 0x%08x\n", error); in mboxsc_getmsg()
1018 return (error); in mboxsc_getmsg()
1038 error = -1; in mboxsc_getmsg()
1042 error = -1; in mboxsc_getmsg()
1050 if (error == -1) { in mboxsc_getmsg()
1063 if ((error = mboxsc_lock_flags(FALSE, deadline)) != 0) { in mboxsc_getmsg()
1068 if (error == EBUSY) { in mboxsc_getmsg()
1069 error = EAGAIN; in mboxsc_getmsg()
1075 if (error == 0) { in mboxsc_getmsg()
1076 error = mboxsc_timed_get_flag(deadline, key, &data_valid, NULL); in mboxsc_getmsg()
1079 if ((error == 0) && (data_valid == IOSRAM_DATA_VALID)) { in mboxsc_getmsg()
1080 error = mboxsc_timed_read(deadline, key, in mboxsc_getmsg()
1092 if (error != 0) { in mboxsc_getmsg()
1093 ASSERT((error != EINVAL) && (error != EMSGSIZE)); in mboxsc_getmsg()
1105 "mboxsc_getmsg ret: 0x%08x\n", error); in mboxsc_getmsg()
1106 return (error); in mboxsc_getmsg()
1139 error = mboxsc_unlock_flags(TRUE); in mboxsc_getmsg()
1153 error = mboxsc_timed_set_flag(deadline, key, IOSRAM_DATA_INVALID, in mboxsc_getmsg()
1159 if (error != 0) { in mboxsc_getmsg()
1160 ASSERT(error != EINVAL); in mboxsc_getmsg()
1168 "mboxsc_getmsg ret: 0x%08x\n", error); in mboxsc_getmsg()
1169 return (error); in mboxsc_getmsg()
1209 int error = 0; in mboxsc_ctrl() local
1234 error = EINVAL; in mboxsc_ctrl()
1246 error = EINVAL; in mboxsc_ctrl()
1259 error = EINVAL; in mboxsc_ctrl()
1276 error = EINVAL; in mboxsc_ctrl()
1295 error = EINVAL; in mboxsc_ctrl()
1306 error = ENOTSUP; in mboxsc_ctrl()
1311 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_ctrl ret: 0x%08x\n", error); in mboxsc_ctrl()
1312 return (error); in mboxsc_ctrl()
1336 int error = 0; in mboxsc_iosram_callback() local
1360 error = iosram_rd(key, MBOXSC_MSGHDR_OFFSET, MBOXSC_MSGHDR_SIZE, in mboxsc_iosram_callback()
1369 error = -1; in mboxsc_iosram_callback()
1384 if (error == 0) { in mboxsc_iosram_callback()
1385 error = iosram_get_flag(key, &data_valid, NULL); in mboxsc_iosram_callback()
1386 if ((error == 0) && (data_valid != IOSRAM_DATA_VALID)) { in mboxsc_iosram_callback()
1387 error = -1; in mboxsc_iosram_callback()
1394 if (error != 0) { in mboxsc_iosram_callback()
1397 "mboxsc_iosram_callback ret (0x%08x)\n", error); in mboxsc_iosram_callback()
1432 int error; in mboxsc_hdrchange_callback() local
1438 error = iosram_hdr_ctrl(IOSRAM_HDRCMD_GET_SMS_MBOX_VER, in mboxsc_hdrchange_callback()
1440 if (error == 0) { in mboxsc_hdrchange_callback()
1463 int error = 0; in mboxsc_add_mailbox() local
1489 error = iosram_ctrl(key, IOSRAM_CMD_CHUNKLEN, &(mailboxp->mbox_length)); in mboxsc_add_mailbox()
1491 if ((error == 0) && (mailboxp->mbox_length < MBOXSC_PROTOCOL_SIZE)) { in mboxsc_add_mailbox()
1492 error = EFAULT; in mboxsc_add_mailbox()
1495 if ((error == 0) && (mailboxp->mbox_direction == MBOXSC_MBOX_IN)) { in mboxsc_add_mailbox()
1496 error = iosram_register(key, mboxsc_iosram_callback, in mboxsc_add_mailbox()
1498 if (error == EBUSY) { in mboxsc_add_mailbox()
1499 error = EFAULT; in mboxsc_add_mailbox()
1503 if (error != 0) { in mboxsc_add_mailbox()
1505 "mboxsc_add_mailbox ret: 0x%08x\n", error); in mboxsc_add_mailbox()
1506 return (error); in mboxsc_add_mailbox()
1533 int error = 0; in mboxsc_close_mailbox() local
1548 error = iosram_unregister(key); in mboxsc_close_mailbox()
1549 if (error == EINVAL) { in mboxsc_close_mailbox()
1552 error = 0; in mboxsc_close_mailbox()
1726 int error; in mboxsc_lock_flags() local
1754 ((error = iosram_sema_acquire(&sema)) == 0)) { in mboxsc_lock_flags()
1773 if (error == EBUSY) { in mboxsc_lock_flags()
1784 } else if (error == EAGAIN) { in mboxsc_lock_flags()
1798 if ((error == EAGAIN) || (error == EBUSY)) { in mboxsc_lock_flags()
1808 error); in mboxsc_lock_flags()
1822 } while (((error == EAGAIN) || (error == EBUSY)) && in mboxsc_lock_flags()
1828 if ((error != EAGAIN) && (error != EBUSY)) { in mboxsc_lock_flags()
1829 cmn_err(CE_WARN, "Flag locking failed! (%d)", error); in mboxsc_lock_flags()
1833 error); in mboxsc_lock_flags()
1834 return (error); in mboxsc_lock_flags()
1847 int error; in mboxsc_unlock_flags() local
1864 ((error = iosram_sema_release()) == 0)) { in mboxsc_unlock_flags()
1883 if ((error == EAGAIN) && mandatory) { in mboxsc_unlock_flags()
1899 } while ((error == EAGAIN) && mandatory); in mboxsc_unlock_flags()
1902 error); in mboxsc_unlock_flags()
1903 return (error); in mboxsc_unlock_flags()
1917 int error; in mboxsc_timed_read() local
1927 error = iosram_rd(key, off, len, dptr); in mboxsc_timed_read()
1928 if (error == EAGAIN) { in mboxsc_timed_read()
1931 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0)); in mboxsc_timed_read()
1934 "mboxsc_timed_read ret: 0x%08x\n", error); in mboxsc_timed_read()
1935 return (error); in mboxsc_timed_read()
1949 int error; in mboxsc_timed_write() local
1959 error = iosram_wr(key, off, len, dptr); in mboxsc_timed_write()
1960 if (error == EAGAIN) { in mboxsc_timed_write()
1963 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0)); in mboxsc_timed_write()
1966 "mboxsc_timed_write ret: 0x%08x\n", error); in mboxsc_timed_write()
1967 return (error); in mboxsc_timed_write()
1981 int error; in mboxsc_timed_get_flag() local
1992 error = iosram_get_flag(key, data_validp, int_pendingp); in mboxsc_timed_get_flag()
1993 if (error == EAGAIN) { in mboxsc_timed_get_flag()
1996 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0)); in mboxsc_timed_get_flag()
1999 "mboxsc_timed_get_flag ret: 0x%08x\n", error); in mboxsc_timed_get_flag()
2000 return (error); in mboxsc_timed_get_flag()
2014 int error; in mboxsc_timed_set_flag() local
2023 error = iosram_set_flag(key, data_valid, int_pending); in mboxsc_timed_set_flag()
2024 if (error == EAGAIN) { in mboxsc_timed_set_flag()
2027 } while ((error == EAGAIN) && (deadline - ddi_get_lbolt() >= 0)); in mboxsc_timed_set_flag()
2030 "mboxsc_timed_set_flag ret: 0x%08x\n", error); in mboxsc_timed_set_flag()
2031 return (error); in mboxsc_timed_set_flag()
2044 int error; in mboxsc_timed_send_intr() local
2050 error = iosram_send_intr(); in mboxsc_timed_send_intr()
2051 if (error == DDI_FAILURE) { in mboxsc_timed_send_intr()
2054 } while ((error == DDI_FAILURE) && (deadline - ddi_get_lbolt() >= 0)); in mboxsc_timed_send_intr()
2057 "mboxsc_timed_send_intr ret: 0x%08x\n", error); in mboxsc_timed_send_intr()
2058 return (error); in mboxsc_timed_send_intr()
2076 int error = 0; in mboxsc_expire_message() local
2087 error = 0; in mboxsc_expire_message()
2093 error = mboxsc_lock_flags(TRUE, 0); in mboxsc_expire_message()
2094 if (error == 0) { in mboxsc_expire_message()
2103 if (error == 0) { in mboxsc_expire_message()
2104 error = iosram_get_flag(key, &data_valid, NULL); in mboxsc_expire_message()
2112 if (error == 0) { in mboxsc_expire_message()
2126 error = iosram_set_flag(key, in mboxsc_expire_message()
2142 if (error == EAGAIN) { in mboxsc_expire_message()
2150 } else if ((error == 0) || (error == EAGAIN)) { in mboxsc_expire_message()
2151 error = unlock_err; in mboxsc_expire_message()
2160 if (error == EAGAIN) { in mboxsc_expire_message()
2181 } while (error == EAGAIN); in mboxsc_expire_message()
2189 if (error != 0) { in mboxsc_expire_message()
2190 cmn_err(CE_WARN, "Message expiration failure! (%d)", error); in mboxsc_expire_message()
2196 "mboxsc_expire_message ret: 0x%08x\n", error); in mboxsc_expire_message()
2197 return (error); in mboxsc_expire_message()
2297 int error = 0; in mboxsc_debug() local
2303 error = print_mailbox_by_key((uint32_t)(uintptr_t)arg); in mboxsc_debug()
2317 error = ENOTTY; in mboxsc_debug()
2321 DPRINTF1(DBG_RETS, DBGACT_DEFAULT, "mboxsc_debug ret: 0x%08x\n", error); in mboxsc_debug()
2323 return (error); in mboxsc_debug()
2401 int error = 0; in print_mailbox_by_key() local
2412 error = 0; in print_mailbox_by_key()
2416 error = EBADF; in print_mailbox_by_key()
2421 "print_mailbox_by_key ret: 0x%08x\n", error); in print_mailbox_by_key()
2423 return (error); in print_mailbox_by_key()