Lines Matching defs:si_portp

287 					si_port_state_t *si_portp, int);
1127 si_port_state_t *si_portp;
1143 si_portp = si_ctlp->sictl_ports[cport];
1145 if (si_portp == NULL) {
1151 mutex_enter(&si_portp->siport_mutex);
1154 if (pmport >= si_portp->siport_portmult_state.sipm_num_ports) {
1157 mutex_exit(&si_portp->siport_mutex);
1160 si_portmultp = &si_portp->siport_portmult_state;
1164 port_type = si_portp->siport_port_type;
1180 si_portp->siport_portmult_state.sipm_num_ports;
1195 (void) si_read_portmult_reg(si_ctlp, si_portp, cport,
1197 (void) si_read_portmult_reg(si_ctlp, si_portp, cport,
1199 (void) si_read_portmult_reg(si_ctlp, si_portp, cport,
1201 (void) si_read_portmult_reg(si_ctlp, si_portp, cport,
1205 if (!(si_portp->siport_active)) {
1219 mutex_exit(&si_portp->siport_mutex);
1234 si_port_state_t *si_portp;
1240 si_portp = si_ctlp->sictl_ports[cport];
1243 SIDBG_P(SIDBG_ENTRY, si_portp,
1246 mutex_enter(&si_portp->siport_mutex);
1248 if ((si_portp->siport_port_type == PORT_TYPE_NODEV) ||
1249 !si_portp->siport_active) {
1257 mutex_exit(&si_portp->siport_mutex);
1262 si_portp->siport_reset_in_progress = 0;
1263 SIDBG_P(SIDBG_RESET, si_portp,
1268 if (si_portp->siport_reset_in_progress &&
1273 SIDBG_P(SIDBG_RESET, si_portp,
1276 mutex_exit(&si_portp->siport_mutex);
1280 if (si_portp->mopping_in_progress > 0) {
1282 SIDBG_P(SIDBG_RESET, si_portp,
1285 mutex_exit(&si_portp->siport_mutex);
1289 if ((slot = si_deliver_satapkt(si_ctlp, si_portp, cport, spkt))
1292 SIDBG_P(SIDBG_ERRS, si_portp,
1295 mutex_exit(&si_portp->siport_mutex);
1301 si_poll_cmd(si_ctlp, si_portp, cport, slot, spkt);
1306 si_portp->siport_slot_pkts[slot] = NULL;
1309 mutex_exit(&si_portp->siport_mutex);
1313 #define SENDUP_PACKET(si_portp, satapkt, reason) \
1319 si_portp->siport_pending_ncq_count--; \
1328 mutex_exit(&si_portp->siport_mutex); \
1330 mutex_enter(&si_portp->siport_mutex); \
1353 si_port_state_t *si_portp,
1367 SIDBG_P(SIDBG_ERRS, si_portp,
1371 SIDBG_P(SIDBG_ERRS, si_portp,
1385 finished_tags = si_portp->siport_pending_tags &
1401 satapkt = si_portp->siport_slot_pkts[tmpslot];
1409 SIDBG_P(SIDBG_ERRS, si_portp,
1413 CLEAR_BIT(si_portp->siport_pending_tags, tmpslot);
1415 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_COMPLETED);
1426 SIDBG_P(SIDBG_ERRS, si_portp, "si3124: si_mop_commands: "
1429 satapkt = si_portp->siport_slot_pkts[tmpslot];
1460 if (si_portp->siport_err_tags_SDBERROR &
1463 si_read_log_ext(si_ctlp, si_portp, port);
1468 CLEAR_BIT(si_portp->siport_pending_tags, tmpslot);
1469 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_DEV_ERROR);
1481 satapkt = si_portp->siport_slot_pkts[tmpslot];
1482 SIDBG_P(SIDBG_ERRS, si_portp,
1487 CLEAR_BIT(si_portp->siport_pending_tags, tmpslot);
1489 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_TIMEOUT);
1501 satapkt = si_portp->siport_slot_pkts[tmpslot];
1502 SIDBG_P(SIDBG_ERRS, si_portp,
1510 CLEAR_BIT(si_portp->siport_pending_tags, tmpslot);
1512 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_ABORTED);
1524 satapkt = si_portp->siport_slot_pkts[tmpslot];
1525 SIDBG_P(SIDBG_ERRS, si_portp,
1531 CLEAR_BIT(si_portp->siport_pending_tags, tmpslot);
1532 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_RESET);
1543 satapkt = si_portp->siport_slot_pkts[tmpslot];
1544 SIDBG_P(SIDBG_ERRS, si_portp,
1550 CLEAR_BIT(si_portp->siport_pending_tags, tmpslot);
1551 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_RESET);
1556 si_portp->mopping_in_progress--;
1557 ASSERT(si_portp->mopping_in_progress >= 0);
1573 si_port_state_t *si_portp;
1579 si_portp = si_ctlp->sictl_ports[port];
1582 SIDBG_P(SIDBG_ERRS, si_portp, "si_tran_abort on port: %x", port);
1584 mutex_enter(&si_portp->siport_mutex);
1589 if (si_portp->mopping_in_progress > 0) {
1590 SIDBG_P(SIDBG_ERRS, si_portp,
1593 mutex_exit(&si_portp->siport_mutex);
1597 if ((si_portp->siport_port_type == PORT_TYPE_NODEV) ||
1598 !si_portp->siport_active) {
1606 mutex_exit(&si_portp->siport_mutex);
1611 aborting_tags = si_portp->siport_pending_tags;
1619 if (si_portp->siport_slot_pkts[tmpslot] == spkt) {
1629 mutex_exit(&si_portp->siport_mutex);
1634 si_portp->mopping_in_progress++;
1638 (void) si_reset_dport_wait_till_ready(si_ctlp, si_portp,
1648 finished_tags = si_portp->siport_pending_tags &
1653 si_portp,
1662 mutex_exit(&si_portp->siport_mutex);
1677 si_port_state_t *si_portp,
1683 _NOTE(ASSUMING_PROTECTED(si_portp))
1685 SIDBG_P(SIDBG_RESET, si_portp,
1695 si_portp->mopping_in_progress++;
1698 si_portp,
1718 si_port_state_t *si_portp;
1729 si_portp = si_ctlp->sictl_ports[port];
1732 mutex_enter(&si_portp->siport_mutex);
1737 if (si_portp->mopping_in_progress > 0) {
1738 SIDBG_P(SIDBG_RESET, si_portp,
1741 mutex_exit(&si_portp->siport_mutex);
1746 retval = si_reset_dport_wait_till_ready(si_ctlp, si_portp, port,
1748 si_reject_all_reset_pkts(si_ctlp, si_portp, port);
1749 mutex_exit(&si_portp->siport_mutex);
1755 si_portp = si_ctlp->sictl_ports[port];
1758 mutex_enter(&si_portp->siport_mutex);
1760 if ((si_portp->siport_port_type == PORT_TYPE_NODEV) ||
1761 !si_portp->siport_active) {
1762 mutex_exit(&si_portp->siport_mutex);
1770 if (si_portp->mopping_in_progress > 0) {
1771 SIDBG_P(SIDBG_RESET, si_portp,
1774 mutex_exit(&si_portp->siport_mutex);
1779 retval = si_reset_dport_wait_till_ready(si_ctlp, si_portp, port,
1781 si_reject_all_reset_pkts(si_ctlp, si_portp, port);
1782 mutex_exit(&si_portp->siport_mutex);
1789 si_portp = si_ctlp->sictl_ports[i];
1792 mutex_enter(&si_portp->siport_mutex);
1798 if (si_portp->mopping_in_progress > 0) {
1799 SIDBG_P(SIDBG_RESET, si_portp,
1802 mutex_exit(&si_portp->siport_mutex);
1808 si_portp, i, SI_PORT_RESET);
1810 mutex_exit(&si_portp->siport_mutex);
1813 si_reject_all_reset_pkts(si_ctlp, si_portp, i);
1814 mutex_exit(&si_portp->siport_mutex);
1820 SIDBG_P(SIDBG_RESET, si_portp,
1842 si_port_state_t *si_portp;
1848 si_portp = si_ctlp->sictl_ports[port];
1851 SIDBG_P(SIDBG_EVENT, si_portp, "si_tran_hotplug_port_activate entry",
1854 mutex_enter(&si_portp->siport_mutex);
1862 (void) si_reset_dport_wait_till_ready(si_ctlp, si_portp, port,
1867 si_portp->siport_active = PORT_ACTIVE;
1871 mutex_exit(&si_portp->siport_mutex);
1884 si_port_state_t *si_portp;
1890 si_portp = si_ctlp->sictl_ports[port];
1895 mutex_enter(&si_portp->siport_mutex);
1896 if (si_portp->siport_pending_tags & SI_SLOT_MASK) {
1902 mutex_exit(&si_portp->siport_mutex);
1907 si_portp->siport_active = PORT_INACTIVE;
1922 mutex_exit(&si_portp->siport_mutex);
1933 si_port_state_t *si_portp;
1938 si_portp = si_ctlp->sictl_ports[port];
1939 mutex_init(&si_portp->siport_mutex, NULL, MUTEX_DRIVER,
1941 mutex_enter(&si_portp->siport_mutex);
1945 mutex_exit(&si_portp->siport_mutex);
1951 mutex_exit(&si_portp->siport_mutex);
1957 si_portp->siport_event_args =
1960 si_portp->siport_active = PORT_ACTIVE;
1961 mutex_exit(&si_portp->siport_mutex);
1973 si_port_state_t *si_portp;
1974 si_portp = si_ctlp->sictl_ports[port];
1976 mutex_enter(&si_portp->siport_mutex);
1977 kmem_free(si_portp->siport_event_args, sizeof (si_event_arg_t));
1980 mutex_exit(&si_portp->siport_mutex);
1982 mutex_destroy(&si_portp->siport_mutex);
1994 si_port_state_t *si_portp;
2001 si_portp = si_ctlp->sictl_ports[port];
2008 &si_portp->siport_sgbpool_dma_handle) !=
2015 if (ddi_dma_mem_alloc(si_portp->siport_sgbpool_dma_handle,
2021 (caddr_t *)&si_portp->siport_sgbpool,
2023 &si_portp->siport_sgbpool_acc_handle) != NULL) {
2026 ddi_dma_free_handle(&si_portp->siport_sgbpool_dma_handle);
2031 if (ddi_dma_addr_bind_handle(si_portp->siport_sgbpool_dma_handle,
2033 (caddr_t)si_portp->siport_sgbpool,
2041 ddi_dma_mem_free(&si_portp->siport_sgbpool_acc_handle);
2042 ddi_dma_free_handle(&si_portp->siport_sgbpool_dma_handle);
2046 si_portp->siport_sgbpool_physaddr = sgbpool_dma_cookie.dmac_laddress;
2056 si_port_state_t *si_portp = si_ctlp->sictl_ports[port];
2059 (void) ddi_dma_unbind_handle(si_portp->siport_sgbpool_dma_handle);
2062 ddi_dma_mem_free(&si_portp->siport_sgbpool_acc_handle);
2065 ddi_dma_free_handle(&si_portp->siport_sgbpool_dma_handle);
2075 si_port_state_t *si_portp;
2081 si_portp = si_ctlp->sictl_ports[port];
2088 &si_portp->siport_prbpool_dma_handle) !=
2094 if (ddi_dma_mem_alloc(si_portp->siport_prbpool_dma_handle,
2100 (caddr_t *)&si_portp->siport_prbpool,
2102 &si_portp->siport_prbpool_acc_handle) != NULL) {
2105 ddi_dma_free_handle(&si_portp->siport_prbpool_dma_handle);
2109 if (ddi_dma_addr_bind_handle(si_portp->siport_prbpool_dma_handle,
2111 (caddr_t)si_portp->siport_prbpool,
2119 ddi_dma_mem_free(&si_portp->siport_prbpool_acc_handle);
2120 ddi_dma_free_handle(&si_portp->siport_prbpool_dma_handle);
2124 si_portp->siport_prbpool_physaddr =
2135 si_port_state_t *si_portp = si_ctlp->sictl_ports[port];
2138 (void) ddi_dma_unbind_handle(si_portp->siport_prbpool_dma_handle);
2141 ddi_dma_mem_free(&si_portp->siport_prbpool_acc_handle);
2144 ddi_dma_free_handle(&si_portp->siport_prbpool_dma_handle);
2157 si_port_state_t *si_portp,
2165 SIDBG_P(SIDBG_INIT, si_portp,
2170 mutex_enter(&si_portp->siport_mutex);
2172 slot = si_claim_free_slot(si_ctlp, si_portp, port);
2177 si_portp->siport_portmult_state.sipm_port_type[pmp] =
2180 si_portp->siport_port_type = PORT_TYPE_NODEV;
2183 mutex_exit(&si_portp->siport_mutex);
2186 prb = &si_portp->siport_prbpool[slot];
2210 POST_PRB_ADDR(si_ctlp, si_portp, port, slot);
2230 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
2234 CLEAR_BIT(si_portp->siport_pending_tags, slot);
2244 SIDBG_P(SIDBG_INIT, si_portp, "Device signature: 0x%x", signature);
2248 SIDBG_P(SIDBG_INIT, si_portp,
2257 si_portp->siport_portmult_state.sipm_port_type[pmp] =
2260 si_portp->siport_port_type = PORT_TYPE_MULTIPLIER;
2261 mutex_exit(&si_portp->siport_mutex);
2263 si_portp, port);
2264 mutex_enter(&si_portp->siport_mutex);
2271 si_portp->siport_portmult_state.sipm_port_type[pmp] =
2274 si_portp->siport_port_type = PORT_TYPE_ATAPI;
2277 SIDBG_P(SIDBG_INIT, si_portp,
2285 si_portp->siport_portmult_state.sipm_port_type[pmp] =
2288 si_portp->siport_port_type = PORT_TYPE_DISK;
2291 SIDBG_P(SIDBG_INIT, si_portp,
2298 si_portp->siport_portmult_state.sipm_port_type[pmp] =
2301 si_portp->siport_port_type = PORT_TYPE_UNKNOWN;
2303 SIDBG_P(SIDBG_INIT, si_portp,
2308 mutex_exit(&si_portp->siport_mutex);
2319 si_port_state_t *si_portp,
2329 SIDBG_P(SIDBG_ENTRY, si_portp, "si_poll_cmd entered: port: 0x%x", port);
2348 mutex_exit(&si_portp->siport_mutex);
2350 mutex_enter(&si_portp->siport_mutex);
2352 mutex_exit(&si_portp->siport_mutex);
2356 mutex_enter(&si_portp->siport_mutex);
2382 SIDBG_P(SIDBG_VERBOSE, si_portp,
2387 mutex_exit(&si_portp->siport_mutex);
2388 (void) si_intr_command_error(si_ctlp, si_portp, port);
2389 mutex_enter(&si_portp->siport_mutex);
2437 si_portp->siport_pending_ncq_count--;
2440 CLEAR_BIT(si_portp->siport_pending_tags, slot);
2466 si_claim_free_slot(si_ctl_state_t *si_ctlp, si_port_state_t *si_portp, int port)
2471 _NOTE(ASSUMING_PROTECTED(si_portp))
2473 SIDBG_P(SIDBG_ENTRY, si_portp,
2475 si_portp->siport_pending_tags);
2477 free_slots = (~si_portp->siport_pending_tags) & SI_SLOT_MASK;
2480 SIDBG_P(SIDBG_VERBOSE, si_portp,
2485 si_portp->siport_pending_tags |= (0x1 << slot);
2486 SIDBG_P(SIDBG_VERBOSE, si_portp, "si_claim_free_slot: found slot: 0x%x",
2504 si_port_state_t *si_portp,
2519 _NOTE(ASSUMING_PROTECTED(si_portp))
2521 slot = si_claim_free_slot(si_ctlp, si_portp, port);
2530 if ((si_portp->siport_port_type == PORT_TYPE_NODEV) ||
2531 !si_portp->siport_active) {
2539 CLEAR_BIT(si_portp->siport_pending_tags, slot);
2545 prb = &(si_portp->siport_prbpool[slot]);
2550 SIDBG_P(SIDBG_ENTRY, si_portp,
2656 si_portp->siport_pending_ncq_count++;
2668 si_portp->siport_sgbpool_physaddr +
2678 si_portp->siport_sgbpool_physaddr +
2689 bzero(&si_portp->siport_sgbpool[slot * si_dma_sg_number],
2695 SIDBG_P(SIDBG_COOKIES, si_portp, "total ncookies: %d", ncookies);
2697 sgbp = &si_portp->siport_sgbpool[slot * si_dma_sg_number];
2702 SIDBG_P(SIDBG_COOKIES, si_portp, "empty cookies: terminating.",
2714 sgbp = &si_portp->siport_sgbpool[slot * si_dma_sg_number];
2724 SIDBG_P(SIDBG_COOKIES, si_portp,
2743 SIDBG_P(SIDBG_COOKIES, si_portp,
2760 SIDBG_P(SIDBG_COOKIES, si_portp,
2764 sgep->sge_addr = si_portp->siport_sgbpool_physaddr +
2777 si_portp->siport_slot_pkts[slot] = spkt;
2797 SIDBG_P(SIDBG_VERBOSE, si_portp, "deliver: acdb_len: %d",
2840 &si_portp->siport_sgbpool[slot * si_dma_sg_number];
2861 POST_PRB_ADDR(si_ctlp, si_portp, port, slot);
2884 si_port_state_t *si_portp;
2910 si_portp = si_ctlp->sictl_ports[port];
2911 mutex_enter(&si_portp->siport_mutex);
2912 si_portp->siport_ctlp = si_ctlp;
2913 si_portp->siport_port_num = port;
3017 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3033 mutex_exit(&si_portp->siport_mutex);
3057 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3067 mutex_exit(&si_portp->siport_mutex);
3068 si_find_dev_signature(si_ctlp, si_portp, port,
3070 mutex_enter(&si_portp->siport_mutex);
3078 si_check_port_handles(si_portp) != DDI_SUCCESS) {
3081 mutex_exit(&si_portp->siport_mutex);
3086 mutex_exit(&si_portp->siport_mutex);
3170 si_port_state_t *si_portp,
3180 SIDBG_P(SIDBG_INIT, si_portp,
3184 mutex_enter(&si_portp->siport_mutex);
3195 if (si_read_portmult_reg(si_ctlp, si_portp, port, PORTMULT_CONTROL_PORT,
3197 mutex_exit(&si_portp->siport_mutex);
3200 si_portp->siport_portmult_state.sipm_num_ports = num_dev_ports;
3202 SIDBG_P(SIDBG_INIT, si_portp,
3211 if (si_read_portmult_reg(si_ctlp, si_portp, port, pmport,
3218 if (si_write_portmult_reg(si_ctlp, si_portp, port, pmport,
3228 if (si_write_portmult_reg(si_ctlp, si_portp, port, pmport,
3236 if (si_read_portmult_reg(si_ctlp, si_portp, port,
3240 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3270 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3281 SIDBG_P(SIDBG_INIT, si_portp,
3288 if (si_read_portmult_reg(si_ctlp, si_portp, port,
3292 SIDBG_P(SIDBG_INIT, si_portp,
3294 if (si_write_portmult_reg(si_ctlp, si_portp, port,
3300 mutex_exit(&si_portp->siport_mutex);
3301 si_find_dev_signature(si_ctlp, si_portp, port, pmport);
3302 mutex_enter(&si_portp->siport_mutex);
3306 mutex_exit(&si_portp->siport_mutex);
3321 si_port_state_t *si_portp,
3334 _NOTE(ASSUMING_PROTECTED(si_portp))
3336 SIDBG_P(SIDBG_ENTRY, si_portp, "si_read_portmult_reg: port: %x,"
3340 slot = si_claim_free_slot(si_ctlp, si_portp, port);
3345 prb = &(si_portp->siport_prbpool[slot]);
3375 POST_PRB_ADDR(si_ctlp, si_portp, port, slot);
3382 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3398 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3402 CLEAR_BIT(si_portp->siport_pending_tags, slot);
3412 si_check_port_handles(si_portp) != DDI_SUCCESS) {
3442 si_port_state_t *si_portp,
3455 _NOTE(ASSUMING_PROTECTED(si_portp))
3457 SIDBG_P(SIDBG_ENTRY, si_portp,
3462 slot = si_claim_free_slot(si_ctlp, si_portp, port);
3467 prb = &(si_portp->siport_prbpool[slot]);
3502 POST_PRB_ADDR(si_ctlp, si_portp, port, slot);
3509 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3525 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
3529 CLEAR_BIT(si_portp->siport_pending_tags, slot);
3539 si_check_port_handles(si_portp) != DDI_SUCCESS) {
3603 si_port_state_t *si_portp;
3636 si_portp = si_ctlp->sictl_ports[port];
3642 SIDBG_P(SIDBG_VERBOSE, si_portp,
3648 (void) si_intr_command_complete(si_ctlp, si_portp,
3651 mutex_enter(&si_portp->siport_mutex);
3653 si_check_port_handles(si_portp) != DDI_SUCCESS) {
3656 si_schedule_port_initialize(si_ctlp, si_portp,
3659 mutex_exit(&si_portp->siport_mutex);
3674 si_schedule_intr_command_error(si_ctlp, si_portp, port);
3678 (void) si_intr_port_ready(si_ctlp, si_portp, port);
3682 (void) si_intr_pwr_change(si_ctlp, si_portp, port);
3686 (void) si_intr_phy_ready_change(si_ctlp, si_portp,
3691 (void) si_intr_comwake_rcvd(si_ctlp, si_portp,
3696 (void) si_intr_unrecognised_fis(si_ctlp, si_portp,
3701 (void) si_intr_dev_xchanged(si_ctlp, si_portp, port);
3705 (void) si_intr_decode_err_threshold(si_ctlp, si_portp,
3710 (void) si_intr_crc_err_threshold(si_ctlp, si_portp,
3716 si_portp, port);
3720 (void) si_intr_set_devbits_notify(si_ctlp, si_portp,
3739 si_port_state_t *si_portp,
3748 SIDBG_P(SIDBG_INTR, si_portp,
3751 mutex_enter(&si_portp->siport_mutex);
3756 if (!si_portp->siport_pending_tags) {
3761 mutex_exit(&si_portp->siport_mutex);
3765 SIDBG_P(SIDBG_VERBOSE, si_portp, "si3124: si_intr_command_complete: "
3767 si_portp->siport_pending_tags,
3770 finished_tags = si_portp->siport_pending_tags &
3779 satapkt = si_portp->siport_slot_pkts[finished_slot];
3786 CLEAR_BIT(si_portp->siport_pending_tags, finished_slot);
3788 SENDUP_PACKET(si_portp, satapkt, SATA_PKT_COMPLETED);
3791 SIDBG_P(SIDBG_PKTCOMP, si_portp,
3793 si_portp->siport_pending_tags,
3802 mutex_exit(&si_portp->siport_mutex);
3814 si_port_state_t *si_portp,
3819 mutex_enter(&si_portp->siport_mutex);
3821 args = si_portp->siport_event_args;
3825 mutex_exit(&si_portp->siport_mutex);
3832 (void) timeout(si_do_intr_command_error, si_portp, 1);
3834 mutex_exit(&si_portp->siport_mutex);
3846 si_port_state_t *si_portp;
3849 si_portp = arg;
3850 mutex_enter(&si_portp->siport_mutex);
3852 args = si_portp->siport_event_args;
3857 mutex_exit(&si_portp->siport_mutex);
3858 (void) si_intr_command_error(si_ctlp, si_portp, port);
3874 si_port_state_t *si_portp,
3883 SIDBG_P(SIDBG_ERRS, si_portp,
3887 mutex_enter(&si_portp->siport_mutex);
3901 si_error_recovery_DEVICEERROR(si_ctlp, si_portp, port);
3906 si_error_recovery_SDBERROR(si_ctlp, si_portp, port);
3914 si_error_recovery_DATAFISERROR(si_ctlp, si_portp, port);
3922 si_error_recovery_SENDFISERROR(si_ctlp, si_portp, port);
3930 si_error_recovery_default(si_ctlp, si_portp, port);
3943 failed_tags = si_portp->siport_pending_tags &
3944 (si_portp->siport_err_tags_SDBERROR |
3945 si_portp->siport_err_tags_nonSDBERROR);
3947 SIDBG_P(SIDBG_ERRS, si_portp, "si_intr_command_error: "
3951 si_portp->siport_err_tags_SDBERROR,
3952 si_portp->siport_err_tags_nonSDBERROR,
3955 SIDBG_P(SIDBG_ERRS, si_portp,
3959 si_portp->siport_pending_tags);
3961 si_portp->mopping_in_progress++;
3964 si_portp,
3972 ASSERT(si_portp->siport_pending_tags == 0);
3974 si_portp->siport_err_tags_SDBERROR = 0;
3975 si_portp->siport_err_tags_nonSDBERROR = 0;
3977 mutex_exit(&si_portp->siport_mutex);
3997 si_port_state_t *si_portp,
4004 _NOTE(ASSUMING_PROTECTED(si_portp))
4006 SIDBG_P(SIDBG_ERRS, si_portp,
4023 si_portp->siport_err_tags_SDBERROR |= (0x1 << failed_slot);
4025 si_portp->siport_err_tags_nonSDBERROR |= (0x1 << failed_slot);
4057 si_portp->siport_err_tags_SDBERROR |=
4060 si_portp->siport_err_tags_nonSDBERROR |=
4102 si_port_state_t *si_portp,
4108 _NOTE(ASSUMING_PROTECTED(si_portp))
4110 SIDBG_P(SIDBG_ERRS, si_portp,
4114 if (si_portp->siport_port_type == PORT_TYPE_MULTIPLIER) {
4115 si_recover_portmult_errors(si_ctlp, si_portp, port);
4120 si_portp->siport_err_tags_nonSDBERROR |= (0x1 << failed_slot);
4138 si_port_state_t *si_portp,
4144 _NOTE(ASSUMING_PROTECTED(si_portp))
4146 SIDBG_P(SIDBG_ERRS, si_portp,
4150 if (si_portp->siport_port_type == PORT_TYPE_MULTIPLIER) {
4151 si_recover_portmult_errors(si_ctlp, si_portp, port);
4156 si_portp->siport_err_tags_SDBERROR |= (0x1 << failed_slot);
4173 si_port_state_t *si_portp,
4179 _NOTE(ASSUMING_PROTECTED(si_portp))
4181 SIDBG_P(SIDBG_ERRS, si_portp,
4186 if (si_portp->siport_pending_ncq_count) {
4190 si_portp->siport_err_tags_nonSDBERROR |= (0x1 << failed_slot);
4191 (void) si_reset_dport_wait_till_ready(si_ctlp, si_portp, port,
4200 si_error_recovery_DEVICEERROR(si_ctlp, si_portp, port);
4213 si_port_state_t *si_portp,
4219 _NOTE(ASSUMING_PROTECTED(si_portp))
4221 SIDBG_P(SIDBG_ERRS, si_portp,
4225 if (si_portp->siport_port_type == PORT_TYPE_MULTIPLIER) {
4226 si_recover_portmult_errors(si_ctlp, si_portp, port);
4231 si_portp->siport_err_tags_nonSDBERROR |= (0x1 << failed_slot);
4232 (void) si_reset_dport_wait_till_ready(si_ctlp, si_portp, port,
4246 si_port_state_t *si_portp,
4252 _NOTE(ASSUMING_PROTECTED(si_portp))
4254 SIDBG_P(SIDBG_ERRS, si_portp,
4261 si_portp->siport_err_tags_nonSDBERROR |= (0x1 << failed_slot);
4263 (void) si_reset_dport_wait_till_ready(si_ctlp, si_portp, port,
4274 si_read_log_ext(si_ctl_state_t *si_ctlp, si_port_state_t *si_portp, int port)
4284 _NOTE(ASSUMING_PROTECTED(si_portp))
4286 SIDBG_P(SIDBG_ERRS, si_portp,
4289 slot = si_claim_free_slot(si_ctlp, si_portp, port);
4294 prb = &(si_portp->siport_prbpool[slot]);
4322 POST_PRB_ADDR(si_ctlp, si_portp, port, slot);
4329 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
4356 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
4371 si_check_port_handles(si_portp) != DDI_SUCCESS) {
4378 CLEAR_BIT(si_portp->siport_pending_tags, slot);
4397 si_port_state_t *si_portp = si_ctlp->sictl_ports[port];
4497 SIDBG_P(SIDBG_ERRS, si_portp,
4521 si_port_state_t *si_portp,
4524 SIDBG_P(SIDBG_INTR, si_portp, "si_intr_ready", NULL);
4538 si_port_state_t *si_portp,
4541 SIDBG_P(SIDBG_INTR, si_portp, "si_intr_pwr_change", NULL);
4552 si_port_state_t *si_portp,
4560 SIDBG_P(SIDBG_INTR, si_portp,
4564 if ((si_ctlp->sictl_sata_hba_tran == NULL) || (si_portp == NULL)) {
4572 mutex_enter(&si_portp->siport_mutex);
4580 if (si_portp->siport_port_type != PORT_TYPE_NODEV) {
4590 if (si_portp->siport_port_type == PORT_TYPE_MULTIPLIER) {
4602 SIDBG_P(SIDBG_INTR, si_portp,
4604 if (si_portp->siport_active) {
4605 SIDBG_P(SIDBG_EVENT, si_portp,
4620 mutex_exit(&si_portp->siport_mutex);
4621 si_find_dev_signature(si_ctlp, si_portp, port,
4623 mutex_enter(&si_portp->siport_mutex);
4624 SIDBG_P(SIDBG_INTR, si_portp,
4626 if (si_portp->siport_active) {
4627 SIDBG_P(SIDBG_EVENT, si_portp,
4643 if (si_portp->siport_active) {
4644 SIDBG_P(SIDBG_EVENT, si_portp,
4653 si_portp->siport_port_type = PORT_TYPE_NODEV;
4658 SIDBG_P(SIDBG_INTR, si_portp,
4663 mutex_exit(&si_portp->siport_mutex);
4678 si_port_state_t *si_portp,
4681 SIDBG_P(SIDBG_INTR, si_portp,
4696 si_port_state_t *si_portp,
4699 SIDBG_P(SIDBG_INTR, si_portp,
4714 si_port_state_t *si_portp,
4718 SIDBG_P(SIDBG_INTR, si_portp,
4733 si_port_state_t *si_portp,
4736 SIDBG_P(SIDBG_INTR, si_portp,
4751 si_port_state_t *si_portp,
4754 SIDBG_P(SIDBG_INTR, si_portp,
4769 si_port_state_t *si_portp,
4772 SIDBG_P(SIDBG_INTR, si_portp,
4787 si_port_state_t *si_portp,
4790 SIDBG_P(SIDBG_INTR, si_portp,
4806 si_port_state_t *si_portp = si_ctlp->sictl_ports[port];
4812 SIDBG_P(SIDBG_INIT, si_portp,
5172 si_port_state_t *si_portp,
5183 _NOTE(ASSUMING_PROTECTED(si_portp))
5208 si_portp->siport_reset_in_progress = 1;
5273 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
5297 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
5312 if (si_portp->siport_port_type == PORT_TYPE_MULTIPLIER) {
5326 SIDBG_P(SIDBG_EVENT, si_portp,
5336 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
5348 SIDBG_P(SIDBG_INIT, si_portp,
5379 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
5395 si_port_state_t *si_portp,
5400 ASSERT(mutex_owned(&si_portp->siport_mutex));
5402 args = si_portp->siport_event_args;
5412 (void) timeout(si_do_initialize_port, si_portp, 1);
5424 si_port_state_t *si_portp;
5427 si_portp = arg;
5428 mutex_enter(&si_portp->siport_mutex);
5430 args = si_portp->siport_event_args;
5436 mutex_exit(&si_portp->siport_mutex);
5458 si_port_state_t *si_portp = si_ctlp->sictl_ports[port];
5472 SIDBG_P(SIDBG_INTR, si_portp,
5487 SIDBG_P(SIDBG_POLL_LOOP, si_portp,
5516 si_port_state_t *si_portp,
5523 SIDBG_P(SIDBG_TIMEOUT, si_portp,
5526 mutex_enter(&si_portp->siport_mutex);
5530 si_portp->mopping_in_progress++;
5543 finished_tags = si_portp->siport_pending_tags &
5547 SIDBG_P(SIDBG_TIMEOUT, si_portp,
5553 si_portp,
5561 mutex_exit(&si_portp->siport_mutex);
5575 si_port_state_t *si_portp;
5592 si_portp = si_ctlp->sictl_ports[port];
5593 if (si_portp == NULL) {
5597 mutex_enter(&si_portp->siport_mutex);
5599 if (si_portp->siport_port_type == PORT_TYPE_NODEV) {
5600 mutex_exit(&si_portp->siport_mutex);
5605 if (si_portp->mopping_in_progress > 0) {
5606 SIDBG_P(SIDBG_INFO, si_portp,
5609 mutex_exit(&si_portp->siport_mutex);
5613 pending_tags = si_portp->siport_pending_tags;
5620 satapkt = si_portp->siport_slot_pkts[tmpslot];
5641 si_portp,
5653 mutex_exit(&si_portp->siport_mutex);
5655 si_timeout_pkts(si_ctlp, si_portp, port, timedout_tags);
5657 mutex_enter(&si_portp->siport_mutex);
5660 mutex_exit(&si_portp->siport_mutex);
5814 si_check_port_handles(si_port_state_t *si_portp)
5816 if ((si_check_dma_handle(si_portp->siport_prbpool_dma_handle)
5818 (si_check_acc_handle(si_portp->siport_prbpool_acc_handle)
5820 (si_check_dma_handle(si_portp->siport_sgbpool_dma_handle)
5822 (si_check_acc_handle(si_portp->siport_sgbpool_acc_handle)
5852 si_log(si_ctl_state_t *si_ctlp, si_port_state_t *si_portp, char *fmt, ...)
5860 if (si_portp == NULL && si_ctlp == NULL) {
5867 if (si_portp == NULL && si_ctlp != NULL) {
5875 * si_portp is not NULL, but si_ctlp might be.
5876 * Reference si_portp for both port and dip.
5879 si_portp->siport_port_num, fmt);
5881 if (si_portp->siport_ctlp == NULL) {
5888 sata_vtrace_debug(si_portp->siport_ctlp->sictl_devinfop,
5904 si_port_state_t *si_portp = si_ctlp->sictl_ports[port];
5932 SIDBG_P(SIDBG_VERBOSE, si_portp,
5939 SIDBG_P(SIDBG_VERBOSE, si_portp,
5946 SIDBG_P(SIDBG_VERBOSE, si_portp,
5953 SIDBG_P(SIDBG_VERBOSE, si_portp,
5961 SIDBG_P(SIDBG_VERBOSE, si_portp,
5968 SIDBG_P(SIDBG_VERBOSE, si_portp,
5975 SIDBG_P(SIDBG_VERBOSE, si_portp,
5982 SIDBG_P(SIDBG_VERBOSE, si_portp,
5989 SIDBG_P(SIDBG_VERBOSE, si_portp,
5996 SIDBG_P(SIDBG_VERBOSE, si_portp,