Lines Matching defs:target

30  *    by target drivers
51 * Input(s): dip The dip given to the target driver
53 * version The version of the target driver -
57 * Output(s): attachinfo Used to pass info back to target,
60 * t1394_hdl The target "handle" to be used for
64 * Description: t1394_attach() registers the target (based on its dip) with
67 * the target, as well as a handle (t1394_hdl) that will be used
76 s1394_target_t *target;
100 tnf_string, msg, "No parent dip found for target");
112 target = kmem_zalloc(sizeof (s1394_target_t), KM_SLEEP);
116 target->target_version = version;
119 target->target_dip = dip;
120 target->on_hal = hal;
122 /* Place the target on the appropriate node */
123 target->on_node = NULL;
125 rw_enter(&target->on_hal->target_list_rwlock, RW_WRITER);
127 s1394_add_target_to_node(target);
130 * while the target driver is in its attach routine.
132 if (target->on_node == NULL) {
133 s1394_remove_target_from_node(target);
134 rw_exit(&target->on_hal->target_list_rwlock);
136 kmem_free(target, sizeof (s1394_target_t));
145 target->target_state = S1394_TARG_HP_NODE;
146 if (S1394_NODE_BUS_PWR_CONSUMER(target->on_node) == B_TRUE)
147 target->target_state |= S1394_TARG_BUS_PWR_CONSUMER;
151 attachinfo->localinfo.bus_generation = target->on_hal->generation_count;
154 attachinfo->localinfo.local_nodeID = target->on_hal->node_id;
156 /* Give the target driver the iblock_cookie */
157 attachinfo->iblock_cookie = target->on_hal->halinfo.hw_interrupt;
159 /* Give the target driver the attributes */
160 attachinfo->acc_attr = target->on_hal->halinfo.acc_attr;
161 attachinfo->dma_attr = target->on_hal->halinfo.dma_attr;
165 target->unit_dir = unit_dir;
168 target->physical_arreq_enabled = 0;
172 s1394_get_maxpayload(target, &dev, &curr);
173 target->dev_max_payload = dev;
174 target->current_max_payload = curr;
177 if ((target->on_hal->target_head == NULL) &&
178 (target->on_hal->target_tail == NULL)) {
179 target->on_hal->target_head = target;
180 target->on_hal->target_tail = target;
182 target->on_hal->target_tail->target_next = target;
183 target->target_prev = target->on_hal->target_tail;
184 target->on_hal->target_tail = target;
186 rw_exit(&target->on_hal->target_list_rwlock);
189 *t1394_hdl = (t1394_handle_t)target;
199 * Input(s): t1394_hdl The target "handle" returned by
206 * Description: t1394_detach() unregisters the target from the 1394 Software
207 * Framework. t1394_detach() can fail if the target has any
214 s1394_target_t *target;
221 target = (s1394_target_t *)(*t1394_hdl);
223 ASSERT(target->on_hal);
225 mutex_enter(&target->on_hal->topology_tree_mutex);
226 rw_enter(&target->on_hal->target_list_rwlock, RW_WRITER);
228 /* How many cmds has this target allocated? */
229 num_cmds = target->target_num_cmds;
232 rw_exit(&target->on_hal->target_list_rwlock);
233 mutex_exit(&target->on_hal->topology_tree_mutex);
245 if ((target->on_hal->target_head == target) &&
246 (target->on_hal->target_tail == target)) {
247 target->on_hal->target_head = NULL;
248 target->on_hal->target_tail = NULL;
250 if (target->target_prev)
251 target->target_prev->target_next = target->target_next;
252 if (target->target_next)
253 target->target_next->target_prev = target->target_prev;
254 if (target->on_hal->target_head == target)
255 target->on_hal->target_head = target->target_next;
256 if (target->on_hal->target_tail == target)
257 target->on_hal->target_tail = target->target_prev;
260 s1394_remove_target_from_node(target);
261 rw_exit(&target->on_hal->target_list_rwlock);
263 mutex_exit(&target->on_hal->topology_tree_mutex);
266 kmem_free(target, sizeof (s1394_target_t));
276 * Input(s): t1394_hdl The target "handle" returned by
286 * If this is undesirable, the target may set the
288 * this call may fail because a target driver has already
295 s1394_target_t *target;
303 target = (s1394_target_t *)t1394_hdl;
305 /* Find the HAL this target resides on */
306 hal = target->on_hal;
310 /* How many cmds has this target allocated? */
311 num_cmds = target->target_num_cmds;
325 /* Increment the number of cmds this target has allocated? */
326 target->target_num_cmds = num_cmds + 1;
329 target->target_num_cmds = num_cmds; /* Undo increment */
358 * Input(s): t1394_hdl The target "handle" returned by
367 * been allocated by the target driver. It is possible for
376 s1394_target_t *target;
384 target = (s1394_target_t *)t1394_hdl;
386 /* Find the HAL this target resides on */
387 hal = target->on_hal;
391 /* How many cmds has this target allocated? */
392 num_cmds = target->target_num_cmds;
419 /* Decrement the number of cmds this target has allocated */
420 target->target_num_cmds--;
444 * Input(s): t1394_hdl The target "handle" returned by
458 s1394_target_t *target;
482 target = (s1394_target_t *)t1394_hdl;
485 to_hal = target->on_hal;
524 ret = s1394_setup_asynch_command(to_hal, target, cmd,
615 * Input(s): t1394_hdl The target "handle" returned by
629 s1394_target_t *target;
653 target = (s1394_target_t *)t1394_hdl;
656 to_hal = target->on_hal;
709 ret = s1394_setup_asynch_command(to_hal, target, cmd,
806 * Input(s): t1394_hdl The target "handle" returned by
820 s1394_target_t *target;
845 target = (s1394_target_t *)t1394_hdl;
848 to_hal = target->on_hal;
907 ret = s1394_compare_swap(to_hal, target, cmd);
921 ret = s1394_split_lock_req(to_hal, target, cmd);
938 * Input(s): t1394_hdl The target "handle" returned by
947 * to target
950 * on the local node be set aside for this target driver, and
965 s1394_target_t *target;
976 target = (s1394_target_t *)t1394_hdl;
978 /* Find the HAL this target resides on */
979 hal = target->on_hal;
994 * Reads are enabled, but target doesn't want to
1022 * Writes are enabled, but target doesn't want to
1050 * Locks are enabled, but target doesn't want to
1072 err = s1394_request_addr_blk((s1394_hal_t *)target->on_hal,
1085 err = s1394_claim_addr_blk((s1394_hal_t *)target->on_hal,
1097 target->physical_arreq_enabled++;
1100 s1394_physical_arreq_set_one(target);
1111 * Input(s): t1394_hdl The target "handle" returned by
1121 * allocated by the target using t1394_alloc_addr().
1130 s1394_target_t *target;
1137 target = (s1394_target_t *)t1394_hdl;
1139 /* Find the HAL this target resides on */
1140 hal = target->on_hal;
1152 target->physical_arreq_enabled--;
1153 s1394_physical_arreq_clear_one(target);
1167 * Input(s): t1394_hdl The target "handle" returned by
1170 * target received in it's callback
1209 /* Find the HAL this target resides on */
1328 * Input(s): t1394_hdl The target "handle" returned by
1330 * evts The structure in which the target
1339 * Description: Used to register the target within the Framework as an FCP
1363 * Input(s): t1394_hdl The target "handle" returned by
1370 * Description: Used to unregister the target within the Framework as an FCP
1392 * Input(s): t1394_hdl The target "handle" returned by
1394 * evts The structure in which the target
1403 * Description: Used to register the target within the Framework as an FCP
1404 * target.
1427 * Input(s): t1394_hdl The target "handle" returned by
1434 * Description: Used to unregister the target within the Framework as an FCP
1435 * target.
1456 * Input(s): t1394_hdl The target "handle" returned by
1458 * evts The structure in which the target
1465 * Description: Used to register the target within the Framework as a CMP
1487 * Input(s): t1394_hdl The target "handle" returned by
1489 * evts The structure in which the target
1496 * Description: Used to unregister the target within the Framework as a CMP
1518 * Input(s): t1394_hdl The target "handle" returned by
1546 * Input(s): t1394_hdl The target "handle" returned by
1578 * Input(s): t1394_hdl The target "handle" returned by
1590 * to target
1788 * Input(s): t1394_hdl The target "handle" returned by
1865 * Input(s): t1394_hdl The target "handle" returned by
1985 * Input(s): t1394_hdl The target "handle" returned by
2069 * Input(s): t1394_hdl The target "handle" returned by
2075 * about a target that wishes to join
2084 * given in the join_isoch_info structure, if the target may
2085 * join the Isoch CEC. If it is determined that the target may
2238 * Input(s): t1394_hdl The target "handle" returned by
2248 * Description: t1394_leave_isoch_cec() is used by a target driver to remove
2250 * for this call to fail because the target is not found in
2252 * time for a target to leave.
2368 * Input(s): t1394_hdl The target "handle" returned by
2375 * to target
2675 * Input(s): t1394_hdl The target "handle" returned by
2799 * Input(s): t1394_hdl The target "handle" returned by
2910 * Input(s): t1394_hdl The target "handle" returned by
3110 * Input(s): t1394_hdl The target "handle" returned by
3120 * to target
3144 /* Find the HAL this target resides on */
3193 * Input(s): t1394_hdl The target "handle" returned by
3217 /* Find the HAL this target resides on */
3232 * Input(s): t1394_hdl The target "handle" returned by
3242 * to target
3264 /* Find the HAL this target resides on */
3277 * Input(s): t1394_hdl The target "handle" returned by
3302 /* Find the HAL this target resides on */
3314 * Input(s): t1394_hdl The target "handle" returned by
3325 * to target
3347 /* Find the HAL this target resides on */
3360 * Input(s): t1394_hdl The target "handle" returned by
3382 /* Find the HAL this target resides on */
3408 * Input(s): t1394_hdl The target "handle" returned by
3437 /* Find the HAL this target resides on */
3512 * Input(s): t1394_hdl The target "handle" returned by
3521 * to target
3536 s1394_target_t *target;
3547 target = (s1394_target_t *)t1394_hdl;
3575 /* Find the HAL this target resides on */
3576 hal = target->on_hal;
3622 * Input(s): t1394_hdl The target "handle" returned by
3629 * to target
3640 s1394_target_t *target;
3648 target = (s1394_target_t *)t1394_hdl;
3650 /* Find the HAL this target resides on */
3651 hal = target->on_hal;
3694 * Input(s): t1394_hdl The target "handle" returned by
3700 * max_speed, and target node ID.
3703 * to a target device. It will fail if the generation given
3712 s1394_target_t *target;
3722 /* Find the HAL this target resides on */
3725 target = (s1394_target_t *)t1394_hdl;
3747 if (((target->target_state & S1394_TARG_GONE) != 0) ||
3748 (target->on_node == NULL)) {
3754 (target->on_hal->node_id & IEEE1394_BUS_NUM_MASK) |
3755 target->on_node->node_num;
3757 from_node = (target->on_hal->node_id) & IEEE1394_NODE_NUM_MASK;
3758 to_node = target->on_node->node_num;
3764 s1394_get_maxpayload(target, &dev, &curr);