Lines Matching +full:multi +full:- +full:chip

28  * packet-based protocol over a serial link connected to one of the serial
29 * ports of the SuperIO (SIO) chip.
32 * registers signify - only the clients need this information.
69 #define HANDLE_ADDR(hdlp) (hdlp->ah_addr)
70 #define HANDLE_FAULT(hdlp) (hdlp->ah_fault)
71 #define HANDLE_MAPLEN(hdlp) (hdlp->ah_len)
72 #define HANDLE_PRIVATE(hdlp) (hdlp->ah_bus_private)
80 #define HANDLE_ADDR(hdlp) (hdlp->ahi_common.ah_addr)
81 #define HANDLE_FAULT(hdlp) (hdlp->ahi_fault)
82 #define HANDLE_MAPLEN(hdlp) (hdlp->ahi_common.ah_len)
83 #define HANDLE_PRIVATE(hdlp) (hdlp->ahi_common.ah_bus_private)
101 #define ADDR_TO_OFFSET(a, hdlp) ((caddr_t)(a) - HANDLE_ADDR(hdlp))
102 #define ADDR_TO_VREG(a) ((caddr_t)(a) - LOMBUS_DUMMY_ADDRESS)
108 * for the National Semiconductor PC87317 (SuperIO) chip.
110 * This chip implements UART functionality as logical device 6.
112 * have chosen to use only the 16550-compatible features
113 * ("non-extended mode").
115 * Hardware: serial chip register numbers
133 * Hardware: serial chip register bits
203 #define LOMBUS_MASK 0xc0 /* Byte-type bits */
211 #define LOMBUS_CMD_XADDR 0x04 /* Extended (2-byte) addressing */
221 #define LOMBUS_VREG_LO(x) ((x) & ((1 << 7) - 1))
251 * This driver's soft-state structure
278 * it's still fetching data out of the chip FIFO.
284 * Data protected by the hardware mutex: the watchdog-patting
285 * protocol data (since the dog can be patted from a high-level
286 * cyclic), and the interrupt-enabled flag.
319 * (the child's parent-private-data points to this).
355 if (ssp->debug & (1 << (code-'@'))) { in lombus_trace()
357 (void) snprintf(p, sizeof (buf) - (p - buf), in lombus_trace()
362 (void) vsnprintf(p, sizeof (buf) - (p - buf), fmt, va); in lombus_trace()
365 buf[sizeof (buf) - 1] = '\0'; in lombus_trace()
366 (void) strlog(ssp->majornum, ssp->instance, code, SL_TRACE, in lombus_trace()
392 instance = -1; in lombus_getstate()
399 sdip = ssp->dip; in lombus_getstate()
415 * Lowest-level serial I/O chip register read/write
421 lombus_trace(ssp, 'P', "sio_put_reg", "REG[%d] <- $%02x", reg, val); in sio_put_reg()
423 if (ssp->sio_handle != NULL && !ssp->sio_fault) { in sio_put_reg()
425 * The chip is mapped as "I/O" (e.g. with the side-effect in sio_put_reg()
427 * in-order, with no value cacheing. However, there can in sio_put_reg()
428 * still be write-behind buffering, so it is not guaranteed in sio_put_reg()
429 * that a write actually reaches the chip in a given time. in sio_put_reg()
431 * To force the access right through to the chip, we follow in sio_put_reg()
439 * value wouldn't reach the chip (and have the *intended* in sio_put_reg()
440 * side-effects, such as disabling interrupts), for such a in sio_put_reg()
442 * instructions - including exiting the interrupt service in sio_put_reg()
443 * routine and re-enabling interrupts. This effect was in sio_put_reg()
450 ddi_put8(ssp->sio_handle, ssp->sio_regs + reg, val); in sio_put_reg()
451 ddi_put8(ssp->sio_handle, ssp->sio_regs + SIO_SCR, val); in sio_put_reg()
453 (void) ddi_get8(ssp->sio_handle, ssp->sio_regs + SIO_SCR); in sio_put_reg()
462 if (ssp->sio_handle && !ssp->sio_fault) in sio_get_reg()
463 val = ddi_get8(ssp->sio_handle, ssp->sio_regs + reg); in sio_get_reg()
467 lombus_trace(ssp, 'G', "sio_get_reg", "$%02x <- REG[%d]", val, reg); in sio_get_reg()
475 ssp->sio_fault = ddi_check_acc_handle(ssp->sio_handle) != DDI_SUCCESS; in sio_check_fault_status()
481 if (!ssp->sio_fault) in sio_faulty()
483 return (ssp->sio_fault); in sio_faulty()
514 * that the /CTS signal is being asserted (driven LOW) - in sio_lom_ready()
523 status, rslt, ssp->fake_cts); in sio_lom_ready()
525 return (rslt || ssp->fake_cts); in sio_lom_ready()
555 * chip-level interrupts are supposed to be enabled at this time.
560 ASSERT(ssp->hw_int_enabled);
576 ssp->hw_int_enabled = newstate; in lombus_set_irq()
596 * High-level interrupt handler:
598 * with mutex_init()), and whether chip interrupts are enabled.
603 * NOTE: the chip interrupt capability is only re-enabled once the
606 * guaranteed that there really is a chip interrupt pending here,
612 * event, we would notice that chip interrupts haven't yet been
613 * re-enabled and return UNCLAIMED, allowing the system's jabber
623 if (ssp->cycid != NULL) { in lombus_hi_intr()
624 mutex_enter(ssp->hw_mutex); in lombus_hi_intr()
625 if (ssp->hw_int_enabled) { in lombus_hi_intr()
627 ddi_trigger_softintr(ssp->softid); in lombus_hi_intr()
630 mutex_exit(ssp->hw_mutex); in lombus_hi_intr()
639 * This routine should be called from the low-level softint, or the
641 * low-level mutex already held.
653 ssp->cmdstate, ssp->error); in lombus_receive()
666 mutex_enter(ssp->hw_mutex); in lombus_receive()
669 ssp->reply[rcvd = ssp->index] = data; in lombus_receive()
672 ssp->index = rcvd; in lombus_receive()
677 mutex_exit(ssp->hw_mutex); in lombus_receive()
683 ssp->reply[0], ssp->reply[1], in lombus_receive()
684 ssp->reply[2], ssp->reply[3], in lombus_receive()
685 ssp->reply[4], ssp->reply[5], in lombus_receive()
686 ssp->reply[6], ssp->reply[7]); in lombus_receive()
688 if (ssp->cmdstate != LOMBUS_CMDSTATE_WAITING) { in lombus_receive()
694 ssp->index = 0; in lombus_receive()
702 if (ddi_get_lbolt() > ssp->deadline) { in lombus_receive()
703 ssp->cmdstate = LOMBUS_CMDSTATE_ERROR; in lombus_receive()
704 ssp->error = LOMBUS_ERR_TIMEOUT; in lombus_receive()
713 ssp->index = 0; in lombus_receive()
714 ssp->cmdstate = LOMBUS_CMDSTATE_ERROR; in lombus_receive()
715 ssp->error = LOMBUS_ERR_OFLOW; in lombus_receive()
726 * Invalid "status" byte - maybe an echo of the command? in lombus_receive()
737 if (ssp->allow_echo) { in lombus_receive()
741 ssp->reply[0], ssp->reply[1], in lombus_receive()
742 ssp->reply[2], ssp->reply[3], in lombus_receive()
743 ssp->reply[4], ssp->reply[5], in lombus_receive()
744 ssp->reply[6], ssp->reply[7]); in lombus_receive()
745 ssp->index = 0; in lombus_receive()
747 ssp->cmdstate = LOMBUS_CMDSTATE_ERROR; in lombus_receive()
748 ssp->error = LOMBUS_ERR_BADSTATUS; in lombus_receive()
751 } else if ((data & LOMBUS_SEQ) != ssp->sequence) { in lombus_receive()
755 ssp->cmdstate = LOMBUS_CMDSTATE_ERROR; in lombus_receive()
756 ssp->error = LOMBUS_ERR_SEQUENCE; in lombus_receive()
769 ssp->async = (data & LOMBUS_STATUS_ASYNC) ? 1 : 0; in lombus_receive()
770 tmp = ((data & LOMBUS_STATUS_MSB) ? 0x80 : 0) | ssp->reply[0]; in lombus_receive()
772 ssp->cmdstate = LOMBUS_CMDSTATE_ERROR; in lombus_receive()
773 ssp->error = tmp; in lombus_receive()
775 ssp->cmdstate = LOMBUS_CMDSTATE_READY; in lombus_receive()
776 ssp->result = tmp; in lombus_receive()
783 rcvd, data, ssp->cmdstate, ssp->error, ready); in lombus_receive()
786 cv_broadcast(ssp->lo_cv); in lombus_receive()
790 * Low-level softint handler
799 mutex_enter(ssp->lo_mutex); in lombus_softint()
801 mutex_exit(ssp->lo_mutex); in lombus_softint()
815 mutex_enter(ssp->lo_mutex); in lombus_cyclic()
817 mutex_exit(ssp->lo_mutex); in lombus_cyclic()
840 mutex_enter(ssp->lo_mutex); in lombus_cmd()
841 while (ssp->cmdstate != LOMBUS_CMDSTATE_IDLE && !panicstr) in lombus_cmd()
842 cv_wait(ssp->lo_cv, ssp->lo_mutex); in lombus_cmd()
844 ssp->cmdstate = LOMBUS_CMDSTATE_BUSY; in lombus_cmd()
845 ssp->sequence = (ssp->sequence + LOMBUS_SEQ_LSB) & LOMBUS_SEQ; in lombus_cmd()
855 p = &ssp->cmdbuf[0]; in lombus_cmd()
856 *p++ = LOMBUS_CMD | ssp->sequence | cmd; in lombus_cmd()
861 ssp->cmdbuf[0] |= LOMBUS_CMD_WMSB; in lombus_cmd()
866 ssp->cmdbuf[0] |= LOMBUS_CMD_XADDR; in lombus_cmd()
876 * the chip registers. If there's a (new or previous) fault, in lombus_cmd()
888 * open- or short-circuited (or the LOM firmware forgot to set it, in lombus_cmd()
892 ssp->deadline = start + drv_usectohz(LOMBUS_CTS_TIMEOUT/1000); in lombus_cmd()
894 if (ddi_get_lbolt() > ssp->deadline) in lombus_cmd()
897 (void) cv_reltimedwait(ssp->lo_cv, ssp->lo_mutex, in lombus_cmd()
907 * timed out (or was pre-empted by a PANIC!). This also makes in lombus_cmd()
913 mutex_enter(ssp->hw_mutex); in lombus_cmd()
914 while (p > ssp->cmdbuf) in lombus_cmd()
915 sio_put_reg(ssp, SIO_TXD, *--p); in lombus_cmd()
916 mutex_exit(ssp->hw_mutex); in lombus_cmd()
924 ssp->deadline = start + drv_usectohz(LOMBUS_CMD_TIMEOUT/1000); in lombus_cmd()
925 ssp->error = 0; in lombus_cmd()
926 ssp->index = 0; in lombus_cmd()
927 ssp->result = DUMMY_VALUE; in lombus_cmd()
928 ssp->cmdstate = LOMBUS_CMDSTATE_WAITING; in lombus_cmd()
929 while (ssp->cmdstate == LOMBUS_CMDSTATE_WAITING) { in lombus_cmd()
930 if (cv_reltimedwait(ssp->lo_cv, ssp->lo_mutex, in lombus_cmd()
931 drv_usectohz(LOMBUS_CMD_POLL/1000), TR_CLOCK_TICK) == -1) in lombus_cmd()
938 val = ssp->result; in lombus_cmd()
942 } else if (ssp->cmdstate != LOMBUS_CMDSTATE_READY) { in lombus_cmd()
945 * the per-instance state to the per-handle fault flag. in lombus_cmd()
948 if (ssp->error != 0) in lombus_cmd()
949 HANDLE_FAULT(hdlp) = ssp->error; in lombus_cmd()
957 ssp->index = 0; in lombus_cmd()
958 ssp->cmdstate = LOMBUS_CMDSTATE_IDLE; in lombus_cmd()
959 cv_broadcast(ssp->lo_cv); in lombus_cmd()
960 mutex_exit(ssp->lo_mutex); in lombus_cmd()
967 * Space 0 - LOM virtual register access
968 * Only 8-bit accesses are supported.
982 * Invalid access - flag a fault and return a dummy value in lombus_vreg_get8()
1006 * Invalid access - flag a fault and return in lombus_vreg_put8()
1025 for (; repcount--; dev_addr += inc) in lombus_vreg_rep_get8()
1036 for (; repcount--; dev_addr += inc) in lombus_vreg_rep_put8()
1042 * Space 1 - LOM watchdog pat register access
1043 * Only 8-bit accesses are supported.
1050 * Multi-byte reads (using ddi_rep_get8(9F)) are a fairly inefficient
1051 * way of zeroing the destination area ;-) and still won't pat the dog.
1053 * Multi-byte writes (using ddi_rep_put8(9F)) will almost certainly
1055 * says to write, as the inter-pat time is VERY long compared with
1071 * Invalid access - flag a fault and return a dummy value in lombus_pat_get8()
1096 * Invalid access - flag a fault and return in lombus_pat_put8()
1103 mutex_enter(ssp->hw_mutex); in lombus_pat_put8()
1105 if ((now - ssp->hw_last_pat) >= LOMBUS_MIN_PAT) { in lombus_pat_put8()
1107 ssp->hw_last_pat = now; in lombus_pat_put8()
1109 mutex_exit(ssp->hw_mutex); in lombus_pat_put8()
1119 for (; repcount--; dev_addr += inc) in lombus_pat_rep_get8()
1130 for (; repcount--; dev_addr += inc) in lombus_pat_rep_put8()
1136 * Space 2 - LOM async event flag register access
1137 * Only 16-bit accesses are supported.
1152 * Invalid access - flag a fault and return a dummy value in lombus_event_get16()
1159 * Return the value of the asynchronous-event-pending flag in lombus_event_get16()
1163 return (ssp->async); in lombus_event_get16()
1180 * Invalid access - flag a fault and return in lombus_event_put16()
1187 * The user can't overwrite the asynchronous-event-pending flag! in lombus_event_put16()
1199 for (; repcount--; dev_addr += inc) in lombus_event_rep_get16()
1210 for (; repcount--; dev_addr += inc) in lombus_event_rep_put16()
1216 * All spaces - access handle fault information
1217 * Only 32-bit accesses are supported.
1228 * which meta-register is to be accessed ... in lombus_meta_get32()
1234 * This meta-register provides a code for the most in lombus_meta_get32()
1241 * Reading this meta-register clears any existing fault in lombus_meta_get32()
1251 * Obsolescent - but still supported for backwards in lombus_meta_get32()
1256 * It returns the value of the asynchronous-event-pending in lombus_meta_get32()
1261 return (ssp->async); in lombus_meta_get32()
1265 * Invalid access - flag a fault and return a dummy value in lombus_meta_get32()
1280 * which meta-register is to be accessed ... in lombus_meta_put32()
1286 * This meta-register contains a code for the most in lombus_meta_put32()
1295 * Writing this meta-register clears any existing fault in lombus_meta_put32()
1306 * Invalid access - flag a fault in lombus_meta_put32()
1320 for (; repcount--; dev_addr += inc) in lombus_meta_rep_get32()
1331 for (; repcount--; dev_addr += inc) in lombus_meta_rep_put32()
1346 * Invalid access - flag a fault and return a dummy value in lombus_no_get8()
1358 * Invalid access - flag a fault in lombus_no_put8()
1370 * Invalid access - flag a fault in lombus_no_rep_get8()
1382 * Invalid access - flag a fault in lombus_no_rep_put8()
1393 * Invalid access - flag a fault and return a dummy value in lombus_no_get16()
1405 * Invalid access - flag a fault in lombus_no_put16()
1417 * Invalid access - flag a fault in lombus_no_rep_get16()
1429 * Invalid access - flag a fault in lombus_no_rep_put16()
1440 * Invalid access - flag a fault and return a dummy value in lombus_no_get64()
1452 * Invalid access - flag a fault in lombus_no_put64()
1464 * Invalid access - flag a fault in lombus_no_rep_get64()
1476 * Invalid access - flag a fault in lombus_no_rep_put64()
1489 * Hardware setup - put the SIO chip in the required operational
1513 if (ssp->baud < SIO_BAUD_MIN || ssp->baud > SIO_BAUD_MAX) in lombus_hw_reset()
1516 divisor = SIO_BAUD_TO_DIVISOR(ssp->baud); in lombus_hw_reset()
1525 * So, we explicitly set the low byte to a non-zero value first; in lombus_hw_reset()
1544 * Higher-level setup & teardown
1550 if (ssp->sio_handle != NULL) in lombus_offline()
1551 ddi_regs_map_free(&ssp->sio_handle); in lombus_offline()
1552 ssp->sio_handle = NULL; in lombus_offline()
1553 ssp->sio_regs = NULL; in lombus_offline()
1564 if (ddi_dev_nregs(ssp->dip, &nregs) != DDI_SUCCESS) in lombus_online()
1573 err = ddi_regs_map_setup(ssp->dip, 0, &p, 0, 0, in lombus_online()
1580 ssp->sio_handle = h; in lombus_online()
1581 ssp->sio_regs = (void *)p; in lombus_online()
1713 hdlp->ah_addr = *addrp = vaddr; in lombus_map_handle()
1714 hdlp->ah_len = len; in lombus_map_handle()
1715 hdlp->ah_bus_private = ssp; in lombus_map_handle()
1720 hdlp->ah_bus_private = NULL; in lombus_map_handle()
1732 ddi_acc_impl_t *aip = hdlp->ah_platform_private; in lombus_map_handle()
1744 aip->ahi_get8 = lombus_vreg_get8; in lombus_map_handle()
1745 aip->ahi_put8 = lombus_vreg_put8; in lombus_map_handle()
1746 aip->ahi_rep_get8 = lombus_vreg_rep_get8; in lombus_map_handle()
1747 aip->ahi_rep_put8 = lombus_vreg_rep_put8; in lombus_map_handle()
1749 aip->ahi_get16 = lombus_no_get16; in lombus_map_handle()
1750 aip->ahi_put16 = lombus_no_put16; in lombus_map_handle()
1751 aip->ahi_rep_get16 = lombus_no_rep_get16; in lombus_map_handle()
1752 aip->ahi_rep_put16 = lombus_no_rep_put16; in lombus_map_handle()
1754 aip->ahi_get32 = lombus_meta_get32; in lombus_map_handle()
1755 aip->ahi_put32 = lombus_meta_put32; in lombus_map_handle()
1756 aip->ahi_rep_get32 = lombus_meta_rep_get32; in lombus_map_handle()
1757 aip->ahi_rep_put32 = lombus_meta_rep_put32; in lombus_map_handle()
1759 aip->ahi_get64 = lombus_no_get64; in lombus_map_handle()
1760 aip->ahi_put64 = lombus_no_put64; in lombus_map_handle()
1761 aip->ahi_rep_get64 = lombus_no_rep_get64; in lombus_map_handle()
1762 aip->ahi_rep_put64 = lombus_no_rep_put64; in lombus_map_handle()
1764 aip->ahi_fault_check = lombus_acc_fault_check; in lombus_map_handle()
1768 aip->ahi_get8 = lombus_pat_get8; in lombus_map_handle()
1769 aip->ahi_put8 = lombus_pat_put8; in lombus_map_handle()
1770 aip->ahi_rep_get8 = lombus_pat_rep_get8; in lombus_map_handle()
1771 aip->ahi_rep_put8 = lombus_pat_rep_put8; in lombus_map_handle()
1773 aip->ahi_get16 = lombus_no_get16; in lombus_map_handle()
1774 aip->ahi_put16 = lombus_no_put16; in lombus_map_handle()
1775 aip->ahi_rep_get16 = lombus_no_rep_get16; in lombus_map_handle()
1776 aip->ahi_rep_put16 = lombus_no_rep_put16; in lombus_map_handle()
1778 aip->ahi_get32 = lombus_meta_get32; in lombus_map_handle()
1779 aip->ahi_put32 = lombus_meta_put32; in lombus_map_handle()
1780 aip->ahi_rep_get32 = lombus_meta_rep_get32; in lombus_map_handle()
1781 aip->ahi_rep_put32 = lombus_meta_rep_put32; in lombus_map_handle()
1783 aip->ahi_get64 = lombus_no_get64; in lombus_map_handle()
1784 aip->ahi_put64 = lombus_no_put64; in lombus_map_handle()
1785 aip->ahi_rep_get64 = lombus_no_rep_get64; in lombus_map_handle()
1786 aip->ahi_rep_put64 = lombus_no_rep_put64; in lombus_map_handle()
1788 aip->ahi_fault_check = lombus_acc_fault_check; in lombus_map_handle()
1792 aip->ahi_get8 = lombus_no_get8; in lombus_map_handle()
1793 aip->ahi_put8 = lombus_no_put8; in lombus_map_handle()
1794 aip->ahi_rep_get8 = lombus_no_rep_get8; in lombus_map_handle()
1795 aip->ahi_rep_put8 = lombus_no_rep_put8; in lombus_map_handle()
1797 aip->ahi_get16 = lombus_event_get16; in lombus_map_handle()
1798 aip->ahi_put16 = lombus_event_put16; in lombus_map_handle()
1799 aip->ahi_rep_get16 = lombus_event_rep_get16; in lombus_map_handle()
1800 aip->ahi_rep_put16 = lombus_event_rep_put16; in lombus_map_handle()
1802 aip->ahi_get32 = lombus_meta_get32; in lombus_map_handle()
1803 aip->ahi_put32 = lombus_meta_put32; in lombus_map_handle()
1804 aip->ahi_rep_get32 = lombus_meta_rep_get32; in lombus_map_handle()
1805 aip->ahi_rep_put32 = lombus_meta_rep_put32; in lombus_map_handle()
1807 aip->ahi_get64 = lombus_no_get64; in lombus_map_handle()
1808 aip->ahi_put64 = lombus_no_put64; in lombus_map_handle()
1809 aip->ahi_rep_get64 = lombus_no_rep_get64; in lombus_map_handle()
1810 aip->ahi_rep_put64 = lombus_no_rep_put64; in lombus_map_handle()
1812 aip->ahi_fault_check = lombus_acc_fault_check; in lombus_map_handle()
1815 hdlp->ah_addr = *addrp = vaddr; in lombus_map_handle()
1816 hdlp->ah_len = len; in lombus_map_handle()
1817 hdlp->ah_bus_private = ssp; in lombus_map_handle()
1822 hdlp->ah_bus_private = NULL; in lombus_map_handle()
1837 if ((ssp = lombus_getstate(dip, -1, "lombus_map")) == NULL) in lombus_map()
1844 if (mp->map_flags != DDI_MF_KERNEL_MAPPING) in lombus_map()
1846 if (mp->map_handlep == NULL) in lombus_map()
1848 if (mp->map_type != DDI_MT_RNUMBER) in lombus_map()
1852 if ((rsp = lcip->rsp) == NULL) in lombus_map()
1854 if (mp->map_obj.rnumber >= lcip->nregs) in lombus_map()
1856 rsp += mp->map_obj.rnumber; in lombus_map()
1857 if (off < 0 || off >= rsp->lombus_size) in lombus_map()
1860 len = rsp->lombus_size-off; in lombus_map()
1863 if (off+len < 0 || off+len > rsp->lombus_size) in lombus_map()
1866 return (lombus_map_handle(ssp, mp->map_op, in lombus_map()
1867 rsp->lombus_space, VREG_TO_ADDR(rsp->lombus_base+off), len, in lombus_map()
1868 mp->map_handlep, addrp)); in lombus_map()
1887 if ((ssp = lombus_getstate(dip, -1, "lombus_ctlops")) == NULL) in lombus_ctlops()
1898 * It must be a non-empty integer array containing a set in lombus_ctlops()
1906 * reference in the child's parent-private-data field. in lombus_ctlops()
1943 rsp[i].lombus_size = limit-rsp[i].lombus_base; in lombus_ctlops()
1956 lcip->nregs = nregs; in lombus_ctlops()
1957 lcip->rsp = rsp; in lombus_ctlops()
1971 ddi_prop_free(lcip->rsp); in lombus_ctlops()
1988 if ((rnum = *(uint_t *)arg) >= lcip->nregs) in lombus_ctlops()
1990 *(off_t *)result = lcip->rsp[rnum].lombus_size; in lombus_ctlops()
1996 *(int *)result = lcip->nregs; in lombus_ctlops()
2012 if (ssp->cycid != NULL) { in lombus_unattach()
2013 ddi_periodic_delete(ssp->cycid); in lombus_unattach()
2014 ssp->cycid = NULL; in lombus_unattach()
2015 if (ssp->sio_handle != NULL) in lombus_unattach()
2016 ddi_remove_intr(ssp->dip, 0, ssp->hw_iblk); in lombus_unattach()
2017 ddi_remove_softintr(ssp->softid); in lombus_unattach()
2018 cv_destroy(ssp->lo_cv); in lombus_unattach()
2019 mutex_destroy(ssp->lo_mutex); in lombus_unattach()
2020 mutex_destroy(ssp->hw_mutex); in lombus_unattach()
2023 ddi_set_driver_private(ssp->dip, NULL); in lombus_unattach()
2050 * Allocate the soft-state structure in lombus_attach()
2060 * Initialise devinfo-related fields in lombus_attach()
2062 ssp->dip = dip; in lombus_attach()
2063 ssp->majornum = ddi_driver_major(dip); in lombus_attach()
2064 ssp->instance = instance; in lombus_attach()
2069 ssp->allow_echo = ddi_prop_get_int(DDI_DEV_T_ANY, dip, in lombus_attach()
2070 DDI_PROP_DONTPASS, "allow-lom-echo", 0) != 0; in lombus_attach()
2071 ssp->baud = ddi_prop_get_int(DDI_DEV_T_ANY, dip, in lombus_attach()
2072 DDI_PROP_DONTPASS, "baud-rate", 0); in lombus_attach()
2073 ssp->debug = ddi_prop_get_int(DDI_DEV_T_ANY, dip, in lombus_attach()
2075 ssp->fake_cts = ddi_prop_get_int(DDI_DEV_T_ANY, dip, in lombus_attach()
2076 DDI_PROP_DONTPASS, "fake-cts", 0) != 0; in lombus_attach()
2081 ssp->cmdstate = LOMBUS_CMDSTATE_IDLE; in lombus_attach()
2082 ssp->hw_last_pat = gethrtime(); in lombus_attach()
2083 ssp->cycid = NULL; in lombus_attach()
2098 err = ddi_add_softintr(dip, DDI_SOFTINT_LOW, &ssp->softid, in lombus_attach()
2099 &ssp->lo_iblk, NULL, lombus_softint, (caddr_t)ssp); in lombus_attach()
2103 if (ssp->sio_handle != NULL) in lombus_attach()
2104 err = ddi_add_intr(dip, 0, &ssp->hw_iblk, NULL, in lombus_attach()
2107 mutex_init(ssp->hw_mutex, NULL, MUTEX_DRIVER, ssp->hw_iblk); in lombus_attach()
2108 mutex_init(ssp->lo_mutex, NULL, MUTEX_DRIVER, ssp->lo_iblk); in lombus_attach()
2109 cv_init(ssp->lo_cv, NULL, CV_DRIVER, NULL); in lombus_attach()
2114 ssp->cycid = ddi_periodic_add(lombus_cyclic, ssp, LOMBUS_ONE_SEC, in lombus_attach()
2118 * Final check before enabling h/w interrupts - did in lombus_attach()
2163 if ((ssp = lombus_getstate(dip, -1, "lombus_reset")) == NULL) in lombus_reset()