Lines Matching refs:tp

31 enc_parse_td(ses2_td_hdr_impl_t *tip, const char *tp, nvlist_t *nvl)
35 if (tp != NULL)
37 tp, tip->sthi_text_len);
43 enc_eid(const ses2_ed_impl_t *tp, nvlist_t *nvl, const char *name)
47 SES_NV_ADD(uint64, nverr, nvl, name, tp->st_hdr.sehi_subenclosure_id);
53 enc_espid(const ses2_ed_impl_t *tp, nvlist_t *nvl, const char *name)
57 SES_NV_ADD(uint64, nverr, nvl, name, tp->st_hdr.sehi_rel_esp_id);
63 enc_nesp(const ses2_ed_impl_t *tp, nvlist_t *nvl, const char *name)
67 SES_NV_ADD(uint64, nverr, nvl, name, tp->st_hdr.sehi_n_esps);
73 enc_lid(const ses2_ed_impl_t *tp, nvlist_t *nvl, const char *name)
82 SCSI_READ64(&tp->st_logical_id));
84 switch (tp->st_logical_id.sni8i_naa) {
89 NAA_IEEE_EXT_COMPANY_ID(&tp->st_logical_id.sni8i_ext_id));
91 NAA_IEEE_EXT_VENDOR_A(&tp->st_logical_id.sni8i_ext_id));
93 NAA_IEEE_EXT_VENDOR_B(&tp->st_logical_id.sni8i_ext_id));
99 NAA_IEEE_REG_COMPANY_ID(&tp->st_logical_id.sni8i_reg_id));
101 NAA_IEEE_REG_VENDOR_ID(&tp->st_logical_id.sni8i_reg_id));
118 enc_vid(const ses2_ed_impl_t *tp, nvlist_t *nvl,
123 SES_NV_ADD_FS_TRUNC(nverr, nvl, name, tp->st_vendor_id);
129 enc_pid(const ses2_ed_impl_t *tp, nvlist_t *nvl,
134 SES_NV_ADD_FS_TRUNC(nverr, nvl, name, tp->st_product_id);
140 enc_rev(const ses2_ed_impl_t *tp, nvlist_t *nvl,
145 SES_NV_ADD_FS_TRUNC(nverr, nvl, name, tp->st_product_revision);
151 enc_vs(const ses2_ed_impl_t *tp, nvlist_t *nvl, const char *name)
155 SES_NV_ADD(byte_array, nverr, nvl, name, (uchar_t *)tp->st_priv,
156 tp->st_hdr.sehi_ed_len - offsetof(ses2_ed_impl_t, st_priv[0]) +
186 enc_parse_ed(ses2_ed_impl_t *tp, nvlist_t *nvl)
191 if (tp == NULL)
195 if (mp->func != NULL && tp->st_hdr.sehi_ed_len >= mp->minsz) {
196 err = mp->func(tp, nvl, mp->name);
208 ses_target_t *tp;
216 if ((tp = ses_zalloc(sizeof (ses_target_t))) == NULL)
219 tp->st_target = stp;
220 tp->st_scsi_hdl = libscsi_get_handle(stp);
221 tp->st_truncate = (getenv("LIBSES_TRUNCATE") != NULL);
222 if (tp->st_truncate)
225 (void) pthread_mutex_init(&tp->st_lock, NULL);
227 if (ses_plugin_load(tp) != 0) {
228 ses_close(tp);
232 if ((sp = ses_snap_new(tp)) == NULL) {
233 ses_close(tp);
239 return (tp);
245 ses_target_t *tp;
262 if ((tp = ses_open_scsi(version, stp)) == NULL) {
268 tp->st_closescsi = B_TRUE;
270 return (tp);
274 ses_scsi_target(ses_target_t *tp)
276 return (tp->st_target);
280 ses_close(ses_target_t *tp)
282 if (tp->st_snapshots != NULL)
283 ses_snap_rele(tp->st_snapshots);
284 if (tp->st_snapshots != NULL)
286 ses_plugin_unload(tp);
287 if (tp->st_closescsi) {
288 libscsi_close(tp->st_scsi_hdl, tp->st_target);
289 libscsi_fini(tp->st_scsi_hdl);
291 ses_free(tp);