Lines Matching refs:tgt

382 	srpt_target_port_t	*tgt;
392 tgt = ioc->ioc_tgt_port;
394 if (tgt != NULL) {
395 stmf_status = srpt_stp_destroy_port(tgt);
398 (void) srpt_stp_free_port(tgt);
732 srpt_target_port_t *tgt = NULL;
753 tgt = ioc->ioc_tgt_port;
754 if (tgt == NULL) {
766 mutex_enter(&tgt->tp_lock);
768 if (tgt->tp_ibt_svc_hdl != NULL) {
769 status = srpt_ioc_svc_bind(tgt, event->ev_port);
777 if ((tgt->tp_num_active_ports == 0) &&
778 (tgt->tp_requested_state != tgt->tp_state) &&
779 (tgt->tp_requested_state == SRPT_TGT_STATE_ONLINE)) {
786 mutex_exit(&tgt->tp_lock);
791 ret = stmf_ctl(STMF_CMD_LPORT_ONLINE, tgt->tp_lport, &cstatus);
813 srpt_target_port_t *tgt;
839 tgt = ioc->ioc_tgt_port;
840 if (tgt == NULL) {
845 mutex_enter(&tgt->tp_lock);
851 mutex_enter(&tgt->tp_ch_list_lock);
852 ch = list_head(&tgt->tp_ch_list);
854 next_ch = list_next(&tgt->tp_ch_list, ch);
861 mutex_exit(&tgt->tp_ch_list_lock);
863 tgt->tp_num_active_ports--;
866 if ((tgt->tp_num_active_ports == 0) &&
867 (tgt->tp_state == SRPT_TGT_STATE_ONLINE)) {
873 mutex_exit(&tgt->tp_lock);
878 ret = stmf_ctl(STMF_CMD_LPORT_OFFLINE, tgt->tp_lport, &cstatus);
954 srpt_ioc_svc_bind(srpt_target_port_t *tgt, uint_t portnum)
965 ASSERT(tgt != NULL);
966 ASSERT(tgt->tp_ioc != NULL);
967 ioc = tgt->tp_ioc;
969 if (tgt->tp_ibt_svc_hdl == NULL) {
975 if (portnum == 0 || portnum > tgt->tp_nports) {
1000 port = &tgt->tp_hw_port[portnum-1];
1013 (void) ibt_unbind_service(tgt->tp_ibt_svc_hdl,
1032 status = ibt_bind_service(tgt->tp_ibt_svc_hdl, new_gid, NULL,
1033 tgt, &port->hwp_bind_hdl);
1044 tgt->tp_num_active_ports++;
1049 EUI_STR(sess.ss_t_name, tgt->tp_ibt_svc_id);
1060 srpt_ioc_svc_unbind(srpt_target_port_t *tgt, uint_t portnum)
1066 if (tgt == NULL) {
1071 if (portnum == 0 || portnum > tgt->tp_nports) {
1075 port = &tgt->tp_hw_port[portnum-1];
1081 EUI_STR(sess.ss_t_name, tgt->tp_ibt_svc_id);
1085 if (tgt->tp_ibt_svc_hdl != NULL && port->hwp_bind_hdl != NULL) {
1087 ret = ibt_unbind_service(tgt->tp_ibt_svc_hdl,
1105 srpt_ioc_svc_unbind_all(srpt_target_port_t *tgt)
1109 if (tgt == NULL) {
1114 for (portnum = 1; portnum <= tgt->tp_nports; portnum++) {
1115 srpt_ioc_svc_unbind(tgt, portnum);