Lines Matching +full:idma +full:- +full:addr
51 * version The version of the target driver -
94 ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); in t1394_attach()
97 "hp-node"); in t1394_attach()
102 mutex_enter(&hal->topology_tree_mutex); in t1394_attach()
104 target->target_version = version; in t1394_attach()
107 target->target_dip = dip; in t1394_attach()
108 target->on_hal = hal; in t1394_attach()
111 target->on_node = NULL; in t1394_attach()
113 rw_enter(&target->on_hal->target_list_rwlock, RW_WRITER); in t1394_attach()
120 if (target->on_node == NULL) { in t1394_attach()
122 rw_exit(&target->on_hal->target_list_rwlock); in t1394_attach()
123 mutex_exit(&hal->topology_tree_mutex); in t1394_attach()
128 target->target_state = S1394_TARG_HP_NODE; in t1394_attach()
129 if (S1394_NODE_BUS_PWR_CONSUMER(target->on_node) == B_TRUE) in t1394_attach()
130 target->target_state |= S1394_TARG_BUS_PWR_CONSUMER; in t1394_attach()
134 attachinfo->localinfo.bus_generation = target->on_hal->generation_count; in t1394_attach()
137 attachinfo->localinfo.local_nodeID = target->on_hal->node_id; in t1394_attach()
140 attachinfo->iblock_cookie = target->on_hal->halinfo.hw_interrupt; in t1394_attach()
143 attachinfo->acc_attr = target->on_hal->halinfo.acc_attr; in t1394_attach()
144 attachinfo->dma_attr = target->on_hal->halinfo.dma_attr; in t1394_attach()
147 DDI_PROP_DONTPASS, "unit-dir-offset", 0); in t1394_attach()
148 target->unit_dir = unit_dir; in t1394_attach()
151 target->physical_arreq_enabled = 0; in t1394_attach()
156 target->dev_max_payload = dev; in t1394_attach()
157 target->current_max_payload = curr; in t1394_attach()
160 if ((target->on_hal->target_head == NULL) && in t1394_attach()
161 (target->on_hal->target_tail == NULL)) { in t1394_attach()
162 target->on_hal->target_head = target; in t1394_attach()
163 target->on_hal->target_tail = target; in t1394_attach()
165 target->on_hal->target_tail->target_next = target; in t1394_attach()
166 target->target_prev = target->on_hal->target_tail; in t1394_attach()
167 target->on_hal->target_tail = target; in t1394_attach()
169 rw_exit(&target->on_hal->target_list_rwlock); in t1394_attach()
174 mutex_exit(&hal->topology_tree_mutex); in t1394_attach()
203 ASSERT(target->on_hal); in t1394_detach()
205 mutex_enter(&target->on_hal->topology_tree_mutex); in t1394_detach()
206 rw_enter(&target->on_hal->target_list_rwlock, RW_WRITER); in t1394_detach()
209 num_cmds = target->target_num_cmds; in t1394_detach()
212 rw_exit(&target->on_hal->target_list_rwlock); in t1394_detach()
213 mutex_exit(&target->on_hal->topology_tree_mutex); in t1394_detach()
221 if ((target->on_hal->target_head == target) && in t1394_detach()
222 (target->on_hal->target_tail == target)) { in t1394_detach()
223 target->on_hal->target_head = NULL; in t1394_detach()
224 target->on_hal->target_tail = NULL; in t1394_detach()
226 if (target->target_prev) in t1394_detach()
227 target->target_prev->target_next = target->target_next; in t1394_detach()
228 if (target->target_next) in t1394_detach()
229 target->target_next->target_prev = target->target_prev; in t1394_detach()
230 if (target->on_hal->target_head == target) in t1394_detach()
231 target->on_hal->target_head = target->target_next; in t1394_detach()
232 if (target->on_hal->target_tail == target) in t1394_detach()
233 target->on_hal->target_tail = target->target_prev; in t1394_detach()
237 rw_exit(&target->on_hal->target_list_rwlock); in t1394_detach()
239 mutex_exit(&target->on_hal->topology_tree_mutex); in t1394_detach()
279 hal = target->on_hal; in t1394_alloc_cmd()
281 rw_enter(&hal->target_list_rwlock, RW_WRITER); in t1394_alloc_cmd()
284 num_cmds = target->target_num_cmds; in t1394_alloc_cmd()
287 rw_exit(&hal->target_list_rwlock); in t1394_alloc_cmd()
288 /* kstats - cmd alloc failures */ in t1394_alloc_cmd()
289 hal->hal_kstats->cmd_alloc_fail++; in t1394_alloc_cmd()
294 target->target_num_cmds = num_cmds + 1; in t1394_alloc_cmd()
297 target->target_num_cmds = num_cmds; /* Undo increment */ in t1394_alloc_cmd()
298 rw_exit(&hal->target_list_rwlock); in t1394_alloc_cmd()
299 /* kstats - cmd alloc failures */ in t1394_alloc_cmd()
300 hal->hal_kstats->cmd_alloc_fail++; in t1394_alloc_cmd()
304 rw_exit(&hal->target_list_rwlock); in t1394_alloc_cmd()
310 mutex_init(&s_priv->blocking_mutex, NULL, MUTEX_DRIVER, in t1394_alloc_cmd()
311 hal->halinfo.hw_interrupt); in t1394_alloc_cmd()
314 cv_init(&s_priv->blocking_cv, NULL, CV_DRIVER, NULL); in t1394_alloc_cmd()
332 * in-use by the 1394 Software Framework.
348 hal = target->on_hal; in t1394_free_cmd()
350 rw_enter(&hal->target_list_rwlock, RW_WRITER); in t1394_free_cmd()
353 num_cmds = target->target_num_cmds; in t1394_free_cmd()
356 rw_exit(&hal->target_list_rwlock); in t1394_free_cmd()
365 if (s_priv->cmd_in_use == B_TRUE) { in t1394_free_cmd()
366 rw_exit(&hal->target_list_rwlock); in t1394_free_cmd()
367 ASSERT(s_priv->cmd_in_use == B_FALSE); in t1394_free_cmd()
372 target->target_num_cmds--; in t1394_free_cmd()
374 rw_exit(&hal->target_list_rwlock); in t1394_free_cmd()
377 cv_destroy(&s_priv->blocking_cv); in t1394_free_cmd()
380 mutex_destroy(&s_priv->blocking_mutex); in t1394_free_cmd()
382 kmem_cache_free(hal->hal_kmem_cachep, *cmdp); in t1394_free_cmd()
387 /* kstats - number of cmd frees */ in t1394_free_cmd()
388 hal->hal_kstats->cmd_free++; in t1394_free_cmd()
422 if (s_priv->cmd_in_use == B_TRUE) { in t1394_read()
423 ASSERT(s_priv->cmd_in_use == B_FALSE); in t1394_read()
429 /* Set-up the destination of the command */ in t1394_read()
430 to_hal = target->on_hal; in t1394_read()
433 cmd->cmd_result = CMD1394_NOSTATUS; in t1394_read()
436 if ((cmd->cmd_type != CMD1394_ASYNCH_RD_QUAD) && in t1394_read()
437 (cmd->cmd_type != CMD1394_ASYNCH_RD_BLOCK)) { in t1394_read()
438 cmd->cmd_result = CMD1394_EINVALID_COMMAND; in t1394_read()
443 if ((cmd->cmd_options & CMD1394_BLOCKING) && in t1394_read()
445 cmd->cmd_result = CMD1394_EINVALID_CONTEXT; in t1394_read()
449 mutex_enter(&to_hal->topology_tree_mutex); in t1394_read()
450 state = to_hal->hal_state; in t1394_read()
454 cmd->cmd_result = ret; in t1394_read()
455 mutex_exit(&to_hal->topology_tree_mutex); in t1394_read()
466 cmd->cmd_result = err; in t1394_read()
467 mutex_exit(&to_hal->topology_tree_mutex); in t1394_read()
481 if (cmd->cmd_options & CMD1394_BLOCKING) { in t1394_read()
482 mutex_exit(&to_hal->topology_tree_mutex); in t1394_read()
483 s_priv->cmd_in_use = B_FALSE; in t1394_read()
484 cmd->cmd_result = CMD1394_EINVALID_CONTEXT; in t1394_read()
490 mutex_exit(&to_hal->topology_tree_mutex); in t1394_read()
495 mutex_exit(&to_hal->topology_tree_mutex); in t1394_read()
514 s_priv->cmd_in_use = B_FALSE; in t1394_read()
517 cmd->cmd_result = err; in t1394_read()
561 if (s_priv->cmd_in_use == B_TRUE) { in t1394_write()
562 ASSERT(s_priv->cmd_in_use == B_FALSE); in t1394_write()
568 /* Set-up the destination of the command */ in t1394_write()
569 to_hal = target->on_hal; in t1394_write()
572 if (s_priv->cmd_ext_type == S1394_CMD_EXT_FA) { in t1394_write()
581 cmd->cmd_result = CMD1394_NOSTATUS; in t1394_write()
584 if ((cmd->cmd_type != CMD1394_ASYNCH_WR_QUAD) && in t1394_write()
585 (cmd->cmd_type != CMD1394_ASYNCH_WR_BLOCK)) { in t1394_write()
586 cmd->cmd_result = CMD1394_EINVALID_COMMAND; in t1394_write()
592 if ((cmd->cmd_options & CMD1394_BLOCKING) && in t1394_write()
594 cmd->cmd_result = CMD1394_EINVALID_CONTEXT; in t1394_write()
599 mutex_enter(&to_hal->topology_tree_mutex); in t1394_write()
600 state = to_hal->hal_state; in t1394_write()
604 cmd->cmd_result = ret; in t1394_write()
605 mutex_exit(&to_hal->topology_tree_mutex); in t1394_write()
617 cmd->cmd_result = err; in t1394_write()
618 mutex_exit(&to_hal->topology_tree_mutex); in t1394_write()
633 if (cmd->cmd_options & CMD1394_BLOCKING) { in t1394_write()
634 mutex_exit(&to_hal->topology_tree_mutex); in t1394_write()
635 s_priv->cmd_in_use = B_FALSE; in t1394_write()
636 cmd->cmd_result = CMD1394_EINVALID_CONTEXT; in t1394_write()
643 mutex_exit(&to_hal->topology_tree_mutex); in t1394_write()
650 mutex_exit(&to_hal->topology_tree_mutex); in t1394_write()
670 s_priv->cmd_in_use = B_FALSE; in t1394_write()
673 cmd->cmd_result = err; in t1394_write()
716 if (s_priv->cmd_in_use == B_TRUE) { in t1394_lock()
717 ASSERT(s_priv->cmd_in_use == B_FALSE); in t1394_lock()
723 /* Set-up the destination of the command */ in t1394_lock()
724 to_hal = target->on_hal; in t1394_lock()
726 mutex_enter(&to_hal->topology_tree_mutex); in t1394_lock()
727 state = to_hal->hal_state; in t1394_lock()
731 cmd->cmd_result = ret; in t1394_lock()
732 mutex_exit(&to_hal->topology_tree_mutex); in t1394_lock()
736 mutex_exit(&to_hal->topology_tree_mutex); in t1394_lock()
739 if ((cmd->cmd_type != CMD1394_ASYNCH_LOCK_32) && in t1394_lock()
740 (cmd->cmd_type != CMD1394_ASYNCH_LOCK_64)) { in t1394_lock()
741 cmd->cmd_result = CMD1394_EINVALID_COMMAND; in t1394_lock()
746 cmd->cmd_result = CMD1394_NOSTATUS; in t1394_lock()
749 if ((cmd->cmd_options & CMD1394_BLOCKING) && in t1394_lock()
751 cmd->cmd_result = CMD1394_EINVALID_CONTEXT; in t1394_lock()
755 if (cmd->cmd_type == CMD1394_ASYNCH_LOCK_32) { in t1394_lock()
756 lock_type = cmd->cmd_u.l32.lock_type; in t1394_lock()
757 num_retries = cmd->cmd_u.l32.num_retries; in t1394_lock()
758 } else { /* (cmd->cmd_type == CMD1394_ASYNCH_LOCK_64) */ in t1394_lock()
759 lock_type = cmd->cmd_u.l64.lock_type; in t1394_lock()
760 num_retries = cmd->cmd_u.l64.num_retries; in t1394_lock()
791 cmd->cmd_result = CMD1394_EINVALID_COMMAND; in t1394_lock()
839 hal = target->on_hal; in t1394_alloc_addr()
842 addr_lo = addr_allocp->aa_address; in t1394_alloc_addr()
843 addr_hi = addr_lo + addr_allocp->aa_length; in t1394_alloc_addr()
846 if ((addr_allocp->aa_enable & T1394_ADDR_RDENBL) && in t1394_alloc_addr()
847 (addr_allocp->aa_evts.recv_read_request == NULL) && in t1394_alloc_addr()
848 (addr_allocp->aa_kmem_bufp == NULL)) { in t1394_alloc_addr()
849 if ((addr_allocp->aa_type != T1394_ADDR_FIXED) || in t1394_alloc_addr()
850 (addr_lo < hal->physical_addr_lo) || in t1394_alloc_addr()
851 (addr_hi > hal->physical_addr_hi)) { in t1394_alloc_addr()
859 /* kstats - addr alloc failures */ in t1394_alloc_addr()
860 hal->hal_kstats->addr_alloc_fail++; in t1394_alloc_addr()
863 addr_allocp->aa_enable &= ~T1394_ADDR_RDENBL; in t1394_alloc_addr()
867 if ((addr_allocp->aa_enable & T1394_ADDR_WRENBL) && in t1394_alloc_addr()
868 (addr_allocp->aa_evts.recv_write_request == NULL) && in t1394_alloc_addr()
869 (addr_allocp->aa_kmem_bufp == NULL)) { in t1394_alloc_addr()
870 if ((addr_allocp->aa_type != T1394_ADDR_FIXED) || in t1394_alloc_addr()
871 (addr_lo < hal->physical_addr_lo) || in t1394_alloc_addr()
872 (addr_hi > hal->physical_addr_hi)) { in t1394_alloc_addr()
880 /* kstats - addr alloc failures */ in t1394_alloc_addr()
881 hal->hal_kstats->addr_alloc_fail++; in t1394_alloc_addr()
884 addr_allocp->aa_enable &= ~T1394_ADDR_WRENBL; in t1394_alloc_addr()
888 if ((addr_allocp->aa_enable & T1394_ADDR_LKENBL) && in t1394_alloc_addr()
889 (addr_allocp->aa_evts.recv_lock_request == NULL) && in t1394_alloc_addr()
890 (addr_allocp->aa_kmem_bufp == NULL)) { in t1394_alloc_addr()
891 if ((addr_allocp->aa_type != T1394_ADDR_FIXED) || in t1394_alloc_addr()
892 (addr_lo < hal->physical_addr_lo) || in t1394_alloc_addr()
893 (addr_hi > hal->physical_addr_hi)) { in t1394_alloc_addr()
901 /* kstats - addr alloc failures */ in t1394_alloc_addr()
902 hal->hal_kstats->addr_alloc_fail++; in t1394_alloc_addr()
905 addr_allocp->aa_enable &= ~T1394_ADDR_LKENBL; in t1394_alloc_addr()
910 if (addr_allocp->aa_type != T1394_ADDR_FIXED) { in t1394_alloc_addr()
911 err = s1394_request_addr_blk((s1394_hal_t *)target->on_hal, in t1394_alloc_addr()
915 /* kstats - addr alloc failures */ in t1394_alloc_addr()
916 hal->hal_kstats->addr_alloc_fail++; in t1394_alloc_addr()
922 err = s1394_claim_addr_blk((s1394_hal_t *)target->on_hal, in t1394_alloc_addr()
926 /* kstats - addr alloc failures */ in t1394_alloc_addr()
927 hal->hal_kstats->addr_alloc_fail++; in t1394_alloc_addr()
931 if ((addr_lo >= hal->physical_addr_lo) && in t1394_alloc_addr()
932 (addr_hi <= hal->physical_addr_hi)) { in t1394_alloc_addr()
933 rw_enter(&hal->target_list_rwlock, RW_WRITER); in t1394_alloc_addr()
934 target->physical_arreq_enabled++; in t1394_alloc_addr()
935 rw_exit(&hal->target_list_rwlock); in t1394_alloc_addr()
973 hal = target->on_hal; in t1394_free_addr()
982 if (curr_blk->addr_type == T1394_ADDR_FIXED) { in t1394_free_addr()
983 target->physical_arreq_enabled--; in t1394_free_addr()
989 /* kstats - number of addr frees */ in t1394_free_addr()
990 hal->hal_kstats->addr_space_free++; in t1394_free_addr()
1037 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_recv_request_done()
1043 h_priv = (h1394_cmd_priv_t *)&s_priv->hal_cmd_private; in t1394_recv_request_done()
1046 if (s_priv->cmd_ext_type == S1394_CMD_EXT_FA) { in t1394_recv_request_done()
1051 if ((resp->cmd_type == CMD1394_ASYNCH_WR_QUAD) || in t1394_recv_request_done()
1052 (resp->cmd_type == CMD1394_ASYNCH_WR_BLOCK)) { in t1394_recv_request_done()
1055 posted_write = s_priv->posted_write; in t1394_recv_request_done()
1059 if ((resp->broadcast == 1) || in t1394_recv_request_done()
1065 /* kstats - Posted Write error */ in t1394_recv_request_done()
1066 hal->hal_kstats->arreq_posted_write_error++; in t1394_recv_request_done()
1069 /* Free the command - Pass it back to the HAL */ in t1394_recv_request_done()
1070 HAL_CALL(hal).response_complete(hal->halinfo.hal_private, resp, in t1394_recv_request_done()
1078 switch (resp->cmd_result) { in t1394_recv_request_done()
1081 if (resp->cmd_type == CMD1394_ASYNCH_RD_BLOCK) { in t1394_recv_request_done()
1082 curr_blk = resp->cmd_u.b.data_block; in t1394_recv_request_done()
1083 size = resp->cmd_u.b.blk_length; in t1394_recv_request_done()
1089 * Free the command - Pass it back in t1394_recv_request_done()
1093 hal->halinfo.hal_private, resp, h_priv); in t1394_recv_request_done()
1100 (curr_blk->b_wptr - curr_blk->b_rptr); in t1394_recv_request_done()
1106 curr_blk = curr_blk->b_cont; in t1394_recv_request_done()
1111 * Free the command - Pass it back in t1394_recv_request_done()
1115 hal->halinfo.hal_private, resp, h_priv); in t1394_recv_request_done()
1334 * Description: Used to compare-swap a CMP register value.
1390 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_alloc_isoch_single()
1393 if (sii->si_channel_mask == 0) { in t1394_alloc_isoch_single()
1398 if ((sii->si_bandwidth <= IEEE1394_BANDWIDTH_MIN) || in t1394_alloc_isoch_single()
1399 (sii->si_bandwidth > IEEE1394_BANDWIDTH_MAX)) { in t1394_alloc_isoch_single()
1403 /* Verify that rsrc_fail_target() callback is non-NULL */ in t1394_alloc_isoch_single()
1404 if (sii->rsrc_fail_target == NULL) { in t1394_alloc_isoch_single()
1416 cec_new->cec_type = S1394_SINGLE; in t1394_alloc_isoch_single()
1419 mutex_init(&cec_new->isoch_cec_mutex, NULL, MUTEX_DRIVER, in t1394_alloc_isoch_single()
1420 hal->halinfo.hw_interrupt); in t1394_alloc_isoch_single()
1421 cv_init(&cec_new->in_callbacks_cv, NULL, CV_DRIVER, in t1394_alloc_isoch_single()
1422 hal->halinfo.hw_interrupt); in t1394_alloc_isoch_single()
1425 cec_new->cec_member_list_head = NULL; in t1394_alloc_isoch_single()
1426 cec_new->cec_member_list_tail = NULL; in t1394_alloc_isoch_single()
1429 cec_new->filter_min_speed = sii->si_speed; in t1394_alloc_isoch_single()
1430 cec_new->filter_max_speed = sii->si_speed; in t1394_alloc_isoch_single()
1431 cec_new->filter_current_speed = cec_new->filter_max_speed; in t1394_alloc_isoch_single()
1432 cec_new->filter_channel_mask = sii->si_channel_mask; in t1394_alloc_isoch_single()
1433 cec_new->bandwidth = sii->si_bandwidth; in t1394_alloc_isoch_single()
1434 cec_new->state_transitions = ISOCH_CEC_FREE | ISOCH_CEC_JOIN | in t1394_alloc_isoch_single()
1437 mutex_enter(&hal->isoch_cec_list_mutex); in t1394_alloc_isoch_single()
1442 mutex_exit(&hal->isoch_cec_list_mutex); in t1394_alloc_isoch_single()
1447 jii.req_channel_mask = sii->si_channel_mask; in t1394_alloc_isoch_single()
1448 jii.req_max_speed = sii->si_speed; in t1394_alloc_isoch_single()
1450 jii.isoch_cec_evts_arg = sii->single_evt_arg; in t1394_alloc_isoch_single()
1458 jii.isoch_cec_evts.rsrc_fail_target = sii->rsrc_fail_target; in t1394_alloc_isoch_single()
1508 /* Return the setup_args - channel num and speed */ in t1394_alloc_isoch_single()
1509 mutex_enter(&cec_new->isoch_cec_mutex); in t1394_alloc_isoch_single()
1510 output_args->channel_num = cec_new->realloc_chnl_num; in t1394_alloc_isoch_single()
1511 mutex_exit(&cec_new->isoch_cec_mutex); in t1394_alloc_isoch_single()
1610 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_alloc_isoch_cec()
1613 if (props->cec_channel_mask == 0) { in t1394_alloc_isoch_cec()
1618 temp = props->cec_channel_mask; in t1394_alloc_isoch_cec()
1619 if (props->cec_options & T1394_NO_IRM_ALLOC) { in t1394_alloc_isoch_cec()
1626 if (props->cec_min_speed != props->cec_max_speed) { in t1394_alloc_isoch_cec()
1632 if ((props->cec_bandwidth <= IEEE1394_BANDWIDTH_MIN) || in t1394_alloc_isoch_cec()
1633 (props->cec_bandwidth > IEEE1394_BANDWIDTH_MAX)) { in t1394_alloc_isoch_cec()
1641 cec_new->cec_type = S1394_PEER_TO_PEER; in t1394_alloc_isoch_cec()
1644 mutex_init(&cec_new->isoch_cec_mutex, NULL, MUTEX_DRIVER, in t1394_alloc_isoch_cec()
1645 hal->halinfo.hw_interrupt); in t1394_alloc_isoch_cec()
1646 cv_init(&cec_new->in_callbacks_cv, NULL, CV_DRIVER, in t1394_alloc_isoch_cec()
1647 hal->halinfo.hw_interrupt); in t1394_alloc_isoch_cec()
1650 cec_new->cec_member_list_head = NULL; in t1394_alloc_isoch_cec()
1651 cec_new->cec_member_list_tail = NULL; in t1394_alloc_isoch_cec()
1654 cec_new->filter_min_speed = props->cec_min_speed; in t1394_alloc_isoch_cec()
1655 cec_new->filter_max_speed = props->cec_max_speed; in t1394_alloc_isoch_cec()
1656 cec_new->filter_current_speed = cec_new->filter_max_speed; in t1394_alloc_isoch_cec()
1657 cec_new->filter_channel_mask = props->cec_channel_mask; in t1394_alloc_isoch_cec()
1658 cec_new->bandwidth = props->cec_bandwidth; in t1394_alloc_isoch_cec()
1659 cec_new->cec_options = props->cec_options; in t1394_alloc_isoch_cec()
1660 cec_new->state_transitions = ISOCH_CEC_FREE | ISOCH_CEC_JOIN | in t1394_alloc_isoch_cec()
1663 mutex_enter(&hal->isoch_cec_list_mutex); in t1394_alloc_isoch_cec()
1668 mutex_exit(&hal->isoch_cec_list_mutex); in t1394_alloc_isoch_cec()
1702 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_free_isoch_cec()
1708 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_free_isoch_cec()
1713 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_free_isoch_cec()
1720 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_free_isoch_cec()
1723 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_free_isoch_cec()
1725 mutex_enter(&hal->isoch_cec_list_mutex); in t1394_free_isoch_cec()
1730 mutex_exit(&hal->isoch_cec_list_mutex); in t1394_free_isoch_cec()
1733 cv_destroy(&cec_curr->in_callbacks_cv); in t1394_free_isoch_cec()
1734 mutex_destroy(&cec_curr->isoch_cec_mutex); in t1394_free_isoch_cec()
1782 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_join_isoch_cec()
1791 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1795 cec_curr->cec_want_wakeup = B_TRUE; in t1394_join_isoch_cec()
1796 cv_wait(&cec_curr->in_callbacks_cv, in t1394_join_isoch_cec()
1797 &cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1804 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1809 check_mask = join_isoch_info->req_channel_mask & in t1394_join_isoch_cec()
1810 cec_curr->filter_channel_mask; in t1394_join_isoch_cec()
1814 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1819 if (join_isoch_info->req_max_speed < cec_curr->filter_min_speed) { in t1394_join_isoch_cec()
1822 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1824 } else if (join_isoch_info->req_max_speed < in t1394_join_isoch_cec()
1825 cec_curr->filter_current_speed) { in t1394_join_isoch_cec()
1826 curr_max_speed = join_isoch_info->req_max_speed; in t1394_join_isoch_cec()
1828 curr_max_speed = cec_curr->filter_current_speed; in t1394_join_isoch_cec()
1832 if ((join_isoch_info->jii_options & T1394_TALKER) && in t1394_join_isoch_cec()
1833 (cec_curr->cec_member_talker != NULL)) { in t1394_join_isoch_cec()
1836 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1840 /* Verify that all callbacks are non-NULL (for PEER_TO_PEER) */ in t1394_join_isoch_cec()
1841 if ((cec_curr->cec_type == S1394_PEER_TO_PEER) && in t1394_join_isoch_cec()
1842 ((join_isoch_info->isoch_cec_evts.setup_target == NULL) || in t1394_join_isoch_cec()
1843 (join_isoch_info->isoch_cec_evts.start_target == NULL) || in t1394_join_isoch_cec()
1844 (join_isoch_info->isoch_cec_evts.stop_target == NULL) || in t1394_join_isoch_cec()
1845 (join_isoch_info->isoch_cec_evts.rsrc_fail_target == NULL) || in t1394_join_isoch_cec()
1846 (join_isoch_info->isoch_cec_evts.teardown_target == NULL))) { in t1394_join_isoch_cec()
1849 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1854 member_new->isoch_cec_evts = join_isoch_info->isoch_cec_evts; in t1394_join_isoch_cec()
1855 member_new->isoch_cec_evts_arg = join_isoch_info->isoch_cec_evts_arg; in t1394_join_isoch_cec()
1856 member_new->cec_mem_options = join_isoch_info->jii_options; in t1394_join_isoch_cec()
1857 member_new->cec_mem_target = (s1394_target_t *)t1394_hdl; in t1394_join_isoch_cec()
1863 cec_curr->filter_channel_mask = check_mask; in t1394_join_isoch_cec()
1866 cec_curr->filter_current_speed = curr_max_speed; in t1394_join_isoch_cec()
1869 if (join_isoch_info->jii_options & T1394_TALKER) in t1394_join_isoch_cec()
1870 cec_curr->cec_member_talker = cec_curr->cec_member_list_head; in t1394_join_isoch_cec()
1880 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_join_isoch_cec()
1919 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_leave_isoch_cec()
1925 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_leave_isoch_cec()
1929 cec_curr->cec_want_wakeup = B_TRUE; in t1394_leave_isoch_cec()
1930 cv_wait(&cec_curr->in_callbacks_cv, in t1394_leave_isoch_cec()
1931 &cec_curr->isoch_cec_mutex); in t1394_leave_isoch_cec()
1937 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_leave_isoch_cec()
1943 temp_channel_mask = cec_curr->cec_alloc_props.cec_channel_mask; in t1394_leave_isoch_cec()
1944 temp_max_speed = cec_curr->cec_alloc_props.cec_max_speed; in t1394_leave_isoch_cec()
1945 member_curr = cec_curr->cec_member_list_head; in t1394_leave_isoch_cec()
1947 if (member_curr->cec_mem_target == in t1394_leave_isoch_cec()
1953 temp_channel_mask &= member_curr->req_channel_mask; in t1394_leave_isoch_cec()
1954 if (member_curr->req_max_speed < temp_max_speed) in t1394_leave_isoch_cec()
1955 temp_max_speed = member_curr->req_max_speed; in t1394_leave_isoch_cec()
1957 member_curr = member_curr->cec_mem_next; in t1394_leave_isoch_cec()
1963 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_leave_isoch_cec()
1967 cec_curr->filter_current_speed = temp_max_speed; in t1394_leave_isoch_cec()
1968 cec_curr->filter_channel_mask = temp_channel_mask; in t1394_leave_isoch_cec()
1975 if (cec_curr->cec_member_talker == member_temp) in t1394_leave_isoch_cec()
1976 cec_curr->cec_member_talker = NULL; in t1394_leave_isoch_cec()
1979 if ((cec_curr->cec_member_list_head == NULL) && in t1394_leave_isoch_cec()
1980 (cec_curr->cec_member_list_tail == NULL)) { in t1394_leave_isoch_cec()
1992 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_leave_isoch_cec()
2043 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_setup_isoch_cec()
2049 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2054 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2061 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2066 if (cec_curr->cec_options & T1394_NO_IRM_ALLOC) { in t1394_setup_isoch_cec()
2073 * Get the current generation number - don't in t1394_setup_isoch_cec()
2076 generation = hal->generation_count; in t1394_setup_isoch_cec()
2080 cec_curr->bandwidth, cec_curr->filter_current_speed); in t1394_setup_isoch_cec()
2082 /* Check that the generation has not changed - */ in t1394_setup_isoch_cec()
2084 if (generation != hal->generation_count) in t1394_setup_isoch_cec()
2088 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2095 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2104 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2109 /* Check that the generation has not changed - */ in t1394_setup_isoch_cec()
2111 if (generation != hal->generation_count) in t1394_setup_isoch_cec()
2116 * From IEEE 1394-1995, Section 8.3.2.3.8: "Bits in t1394_setup_isoch_cec()
2129 temp_chnl_mask = cec_curr->filter_channel_mask; in t1394_setup_isoch_cec()
2130 for (chnl_num = 63; chnl_num >= 0; chnl_num--) { in t1394_setup_isoch_cec()
2132 try_chnl = (1 << ((63 - chnl_num) % 32)); in t1394_setup_isoch_cec()
2135 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2148 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2169 if (generation != hal->generation_count) in t1394_setup_isoch_cec()
2173 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2180 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2189 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2204 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2208 cec_curr->realloc_valid = B_TRUE; in t1394_setup_isoch_cec()
2209 cec_curr->realloc_chnl_num = chnl_num; in t1394_setup_isoch_cec()
2210 cec_curr->realloc_bandwidth = cec_curr->bandwidth; in t1394_setup_isoch_cec()
2211 cec_curr->realloc_speed = cec_curr->filter_current_speed; in t1394_setup_isoch_cec()
2216 target_args.channel_speed = cec_curr->filter_current_speed; in t1394_setup_isoch_cec()
2219 cec_curr->in_callbacks = B_TRUE; in t1394_setup_isoch_cec()
2222 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2224 member_curr = cec_curr->cec_member_list_head; in t1394_setup_isoch_cec()
2227 if (member_curr->isoch_cec_evts.setup_target != NULL) { in t1394_setup_isoch_cec()
2229 member_curr->isoch_cec_evts.setup_target; in t1394_setup_isoch_cec()
2231 member_curr->isoch_cec_evts_arg, &target_args); in t1394_setup_isoch_cec()
2235 member_curr = member_curr->cec_mem_next; in t1394_setup_isoch_cec()
2239 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2242 cec_curr->in_callbacks = B_FALSE; in t1394_setup_isoch_cec()
2243 if (cec_curr->cec_want_wakeup == B_TRUE) { in t1394_setup_isoch_cec()
2244 cec_curr->cec_want_wakeup = B_FALSE; in t1394_setup_isoch_cec()
2245 cv_broadcast(&cec_curr->in_callbacks_cv); in t1394_setup_isoch_cec()
2257 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_setup_isoch_cec()
2302 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_start_isoch_cec()
2307 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_start_isoch_cec()
2314 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_start_isoch_cec()
2319 cec_curr->in_callbacks = B_TRUE; in t1394_start_isoch_cec()
2322 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_start_isoch_cec()
2329 member_curr = cec_curr->cec_member_list_tail; in t1394_start_isoch_cec()
2332 if (member_curr->isoch_cec_evts.start_target != NULL) { in t1394_start_isoch_cec()
2334 member_curr->isoch_cec_evts.start_target; in t1394_start_isoch_cec()
2336 member_curr->isoch_cec_evts_arg); in t1394_start_isoch_cec()
2340 member_curr = member_curr->cec_mem_prev; in t1394_start_isoch_cec()
2344 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_start_isoch_cec()
2347 cec_curr->in_callbacks = B_FALSE; in t1394_start_isoch_cec()
2348 if (cec_curr->cec_want_wakeup == B_TRUE) { in t1394_start_isoch_cec()
2349 cec_curr->cec_want_wakeup = B_FALSE; in t1394_start_isoch_cec()
2350 cv_broadcast(&cec_curr->in_callbacks_cv); in t1394_start_isoch_cec()
2361 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_start_isoch_cec()
2406 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_stop_isoch_cec()
2411 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_stop_isoch_cec()
2418 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_stop_isoch_cec()
2423 cec_curr->in_callbacks = B_TRUE; in t1394_stop_isoch_cec()
2426 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_stop_isoch_cec()
2433 member_curr = cec_curr->cec_member_list_head; in t1394_stop_isoch_cec()
2435 if (member_curr->isoch_cec_evts.stop_target != NULL) { in t1394_stop_isoch_cec()
2437 member_curr->isoch_cec_evts.stop_target; in t1394_stop_isoch_cec()
2439 member_curr->isoch_cec_evts_arg); in t1394_stop_isoch_cec()
2441 member_curr = member_curr->cec_mem_next; in t1394_stop_isoch_cec()
2445 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_stop_isoch_cec()
2448 cec_curr->in_callbacks = B_FALSE; in t1394_stop_isoch_cec()
2449 if (cec_curr->cec_want_wakeup == B_TRUE) { in t1394_stop_isoch_cec()
2450 cec_curr->cec_want_wakeup = B_FALSE; in t1394_stop_isoch_cec()
2451 cv_broadcast(&cec_curr->in_callbacks_cv); in t1394_stop_isoch_cec()
2462 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_stop_isoch_cec()
2506 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_teardown_isoch_cec()
2512 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2517 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2524 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2529 if (cec_curr->cec_options & T1394_NO_IRM_ALLOC) { in t1394_teardown_isoch_cec()
2535 if ((cec_curr->realloc_valid == B_FALSE) || in t1394_teardown_isoch_cec()
2536 (cec_curr->realloc_failed == B_TRUE)) { in t1394_teardown_isoch_cec()
2541 * Get the current generation number - don't need the in t1394_teardown_isoch_cec()
2542 * topology tree mutex here because it is read-only, and in t1394_teardown_isoch_cec()
2545 generation = hal->generation_count; in t1394_teardown_isoch_cec()
2549 cec_curr->bandwidth, cec_curr->realloc_speed); in t1394_teardown_isoch_cec()
2551 /* Check that the generation has not changed - */ in t1394_teardown_isoch_cec()
2553 if (generation != hal->generation_count) in t1394_teardown_isoch_cec()
2557 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2563 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2572 chnl_mask = (1 << ((63 - cec_curr->realloc_chnl_num) % 32)); in t1394_teardown_isoch_cec()
2575 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2576 if (cec_curr->realloc_chnl_num < 32) { in t1394_teardown_isoch_cec()
2584 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2588 cec_curr->realloc_valid = B_FALSE; in t1394_teardown_isoch_cec()
2589 cec_curr->realloc_chnl_num = 0; in t1394_teardown_isoch_cec()
2590 cec_curr->realloc_bandwidth = 0; in t1394_teardown_isoch_cec()
2593 cec_curr->in_callbacks = B_TRUE; in t1394_teardown_isoch_cec()
2596 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2599 member_curr = cec_curr->cec_member_list_head; in t1394_teardown_isoch_cec()
2601 if (member_curr->isoch_cec_evts.teardown_target != NULL) { in t1394_teardown_isoch_cec()
2603 member_curr->isoch_cec_evts.teardown_target; in t1394_teardown_isoch_cec()
2605 member_curr->isoch_cec_evts_arg); in t1394_teardown_isoch_cec()
2607 member_curr = member_curr->cec_mem_next; in t1394_teardown_isoch_cec()
2611 mutex_enter(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2614 cec_curr->in_callbacks = B_FALSE; in t1394_teardown_isoch_cec()
2615 if (cec_curr->cec_want_wakeup == B_TRUE) { in t1394_teardown_isoch_cec()
2616 cec_curr->cec_want_wakeup = B_FALSE; in t1394_teardown_isoch_cec()
2617 cv_broadcast(&cec_curr->in_callbacks_cv); in t1394_teardown_isoch_cec()
2628 if ((cec_curr->cec_member_list_head == NULL) && in t1394_teardown_isoch_cec()
2629 (cec_curr->cec_member_list_tail == NULL)) { in t1394_teardown_isoch_cec()
2634 mutex_exit(&cec_curr->isoch_cec_mutex); in t1394_teardown_isoch_cec()
2647 * Output(s): t1394_idma_hdl The IDMA "handle" used in all
2672 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_alloc_isoch_dma()
2675 if ((idi->idma_options & ID1394_TALK) && in t1394_alloc_isoch_dma()
2676 (idi->idma_options != ID1394_TALK)) { in t1394_alloc_isoch_dma()
2682 if ((idi->idma_options & ID1394_LISTEN_PKT_MODE) && in t1394_alloc_isoch_dma()
2683 (idi->idma_options & ID1394_LISTEN_BUF_MODE)) { in t1394_alloc_isoch_dma()
2689 ret = HAL_CALL(hal).alloc_isoch_dma(hal->halinfo.hal_private, idi, in t1394_alloc_isoch_dma()
2706 * t1394_idma_hdl The IDMA "handle" returned by
2725 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_free_isoch_dma()
2728 HAL_CALL(hal).free_isoch_dma(hal->halinfo.hal_private, *t1394_idma_hdl); in t1394_free_isoch_dma()
2738 * t1394_idma_hdl The IDMA "handle" returned by
2743 * flags One flag defined - ID1394_START_ON_CYCLE
2766 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_start_isoch_dma()
2768 ret = HAL_CALL(hal).start_isoch_dma(hal->halinfo.hal_private, in t1394_start_isoch_dma()
2778 * t1394_idma_hdl The IDMA "handle" returned by
2799 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_stop_isoch_dma()
2801 HAL_CALL(hal).stop_isoch_dma(hal->halinfo.hal_private, in t1394_stop_isoch_dma()
2809 * t1394_idma_hdl The IDMA "handle" returned by
2838 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_update_isoch_dma()
2840 ret = HAL_CALL(hal).update_isoch_dma(hal->halinfo.hal_private, in t1394_update_isoch_dma()
2867 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_initiate_bus_reset()
2870 if (hal->halinfo.phy == H1394_PHY_1394A) { in t1394_initiate_bus_reset()
2871 (void) HAL_CALL(hal).short_bus_reset(hal->halinfo.hal_private); in t1394_initiate_bus_reset()
2873 (void) HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); in t1394_initiate_bus_reset()
2890 * IEEE 1394-1995 Section 8.2.3.4.1 for format information. This
2906 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_get_topology_map()
2909 mutex_enter(&hal->topology_tree_mutex); in t1394_get_topology_map()
2912 if (bus_generation != hal->generation_count) { in t1394_get_topology_map()
2914 mutex_exit(&hal->topology_tree_mutex); in t1394_get_topology_map()
2918 tm_ptr = (uint32_t *)hal->CSR_topology_map; in t1394_get_topology_map()
2926 mutex_exit(&hal->topology_tree_mutex); in t1394_get_topology_map()
2934 mutex_exit(&hal->topology_tree_mutex); in t1394_get_topology_map()
2940 * Input(s): d The data to compute the CRC-16 for
2944 * Output(s): CRC The CRC-16 computed for the length
2948 * 1212, 1994 - 8.1.5.
2955 /* ANSI/IEEE Std 1212, 1994 - 8.1.5 */ in t1394_CRC16()
2999 key = cfgrom_entryinfo->ce_key; in t1394_add_cfgrom_entry()
3000 buffer = cfgrom_entryinfo->ce_buffer; in t1394_add_cfgrom_entry()
3001 size = (uint_t)cfgrom_entryinfo->ce_size; in t1394_add_cfgrom_entry()
3016 hal = target->on_hal; in t1394_add_cfgrom_entry()
3025 mutex_enter(&hal->local_config_rom_mutex); in t1394_add_cfgrom_entry()
3032 mutex_exit(&hal->local_config_rom_mutex); in t1394_add_cfgrom_entry()
3038 if (hal->config_rom_timer_set == B_FALSE) { in t1394_add_cfgrom_entry()
3039 hal->config_rom_timer_set = B_TRUE; in t1394_add_cfgrom_entry()
3040 mutex_exit(&hal->local_config_rom_mutex); in t1394_add_cfgrom_entry()
3041 hal->config_rom_timer = in t1394_add_cfgrom_entry()
3045 mutex_exit(&hal->local_config_rom_mutex); in t1394_add_cfgrom_entry()
3079 hal = target->on_hal; in t1394_rem_cfgrom_entry()
3088 mutex_enter(&hal->local_config_rom_mutex); in t1394_rem_cfgrom_entry()
3093 mutex_exit(&hal->local_config_rom_mutex); in t1394_rem_cfgrom_entry()
3098 if (hal->config_rom_timer_set == B_FALSE) { in t1394_rem_cfgrom_entry()
3099 hal->config_rom_timer_set = B_TRUE; in t1394_rem_cfgrom_entry()
3100 mutex_exit(&hal->local_config_rom_mutex); in t1394_rem_cfgrom_entry()
3101 hal->config_rom_timer = in t1394_rem_cfgrom_entry()
3105 mutex_exit(&hal->local_config_rom_mutex); in t1394_rem_cfgrom_entry()
3140 hal = ((s1394_target_t *)t1394_hdl)->on_hal; in t1394_get_targetinfo()
3145 mutex_enter(&hal->topology_tree_mutex); in t1394_get_targetinfo()
3148 if (bus_generation != hal->generation_count) { in t1394_get_targetinfo()
3150 mutex_exit(&hal->topology_tree_mutex); in t1394_get_targetinfo()
3154 rw_enter(&hal->target_list_rwlock, RW_READER); in t1394_get_targetinfo()
3160 if (((target->target_state & S1394_TARG_GONE) != 0) || in t1394_get_targetinfo()
3161 (target->on_node == NULL)) { in t1394_get_targetinfo()
3162 targetinfo->target_nodeID = T1394_INVALID_NODEID; in t1394_get_targetinfo()
3164 targetinfo->target_nodeID = in t1394_get_targetinfo()
3165 (target->on_hal->node_id & IEEE1394_BUS_NUM_MASK) | in t1394_get_targetinfo()
3166 target->on_node->node_num; in t1394_get_targetinfo()
3168 from_node = (target->on_hal->node_id) & IEEE1394_NODE_NUM_MASK; in t1394_get_targetinfo()
3169 to_node = target->on_node->node_num; in t1394_get_targetinfo()
3171 targetinfo->current_max_speed = (uint_t)s1394_speed_map_get( in t1394_get_targetinfo()
3176 targetinfo->current_max_payload = curr; in t1394_get_targetinfo()
3179 rw_exit(&hal->target_list_rwlock); in t1394_get_targetinfo()
3181 mutex_exit(&hal->topology_tree_mutex); in t1394_get_targetinfo()