Lines Matching defs:session
103 ndmpd_session_t *session = ndmp_get_client_data(connection);
105 if (session->ns_scsi.sd_is_open == -1) {
112 (void) ndmp_open_list_del(session->ns_scsi.sd_adapter_name,
113 session->ns_scsi.sd_sid,
114 session->ns_scsi.sd_lun);
115 (void) close(session->ns_scsi.sd_devid);
117 session->ns_scsi.sd_is_open = -1;
118 session->ns_scsi.sd_devid = -1;
119 session->ns_scsi.sd_sid = 0;
120 session->ns_scsi.sd_lun = 0;
121 session->ns_scsi.sd_valid_target_set = FALSE;
122 (void) memset(session->ns_scsi.sd_adapter_name, 0,
123 sizeof (session->ns_scsi.sd_adapter_name));
153 ndmpd_session_t *session = ndmp_get_client_data(connection);
155 if (session->ns_scsi.sd_is_open == -1)
157 else if (!session->ns_scsi.sd_valid_target_set) {
165 reply.target_id = session->ns_scsi.sd_sid;
166 reply.target_lun = session->ns_scsi.sd_lun;
225 ndmpd_session_t *session = ndmp_get_client_data(connection);
228 if (session->ns_scsi.sd_devid == -1) {
235 if (ioctl(session->ns_scsi.sd_devid, USCSICMD, &cmd) < 0) {
293 ndmpd_session_t *session = ndmp_get_client_data(connection);
295 if (session->ns_scsi.sd_is_open == -1 ||
296 !session->ns_scsi.sd_valid_target_set) {
304 ndmp_execute_cdb(session, session->ns_scsi.sd_adapter_name,
305 session->ns_scsi.sd_sid, session->ns_scsi.sd_lun, request);
414 ndmpd_session_t *session = ndmp_get_client_data(connection);
423 if (session->ns_tape.td_fd != -1 || session->ns_scsi.sd_is_open != -1) {
468 (void) strlcpy(session->ns_scsi.sd_adapter_name, adptnm, SCSI_MAX_NAME);
469 session->ns_scsi.sd_is_open = 1;
470 session->ns_scsi.sd_devid = devid;
472 session->ns_scsi.sd_sid = sid;
473 session->ns_scsi.sd_lun = lun;
474 session->ns_scsi.sd_valid_target_set = TRUE;
476 session->ns_scsi.sd_sid = session->ns_scsi.sd_lun = -1;
477 session->ns_scsi.sd_valid_target_set = FALSE;
506 ndmpd_session_t *session = ndmp_get_client_data(connection);
511 if (session->ns_scsi.sd_is_open == -1) {
513 } else if (!scsi_dev_exists(session->ns_scsi.sd_adapter_name, sid,
519 type = scsi_get_devtype(session->ns_scsi.sd_adapter_name, sid,
540 if (sid != session->ns_scsi.sd_sid || lun != session->ns_scsi.sd_lun) {
542 session->ns_scsi.sd_adapter_name, sid, lun, 0)) {
544 (void) ndmp_open_list_del(session->
545 ns_scsi.sd_adapter_name, session->ns_scsi.sd_sid,
546 session->ns_scsi.sd_lun);
561 session->ns_scsi.sd_sid = sid;
562 session->ns_scsi.sd_lun = lun;
563 session->ns_scsi.sd_valid_target_set = TRUE;