Lines Matching refs:ns_cmd

2807 			fctl_ns_req_t *ns_cmd;
2812 ns_cmd = (fctl_ns_req_t *)job->job_private;
2813 if (ns_cmd->ns_cmd_code < NS_GA_NXT ||
2814 ns_cmd->ns_cmd_code > NS_DA_ID) {
2820 if (FC_IS_CMD_A_REG(ns_cmd->ns_cmd_code)) {
2821 if (ns_cmd->ns_pd != NULL) {
2829 rval = fp_ns_reg(port, ns_cmd->ns_pd,
2830 ns_cmd->ns_cmd_code, job, 0, KM_SLEEP);
2841 rval = fp_ns_query(port, ns_cmd, job, 0, KM_SLEEP);
7129 fctl_ns_req_t *ns_cmd;
7138 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gid_pt_t),
7142 if (ns_cmd == NULL) {
7146 ns_cmd->ns_cmd_code = NS_GID_PT;
7147 ((ns_req_gid_pt_t *)(ns_cmd->ns_cmd_buf))->port_type.port_type
7149 ((ns_req_gid_pt_t *)(ns_cmd->ns_cmd_buf))->port_type.rsvd = 0;
7158 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gan_t),
7161 if (ns_cmd == NULL) {
7164 ns_cmd->ns_gan_index = 0;
7165 ns_cmd->ns_gan_sid = FCTL_GAN_START_ID;
7166 ns_cmd->ns_cmd_code = NS_GA_NXT;
7167 ns_cmd->ns_gan_max = 0xFFFF;
7169 ((ns_req_gan_t *)(ns_cmd->ns_cmd_buf))->pid.port_id = src_id;
7170 ((ns_req_gan_t *)(ns_cmd->ns_cmd_buf))->pid.priv_lilp_posit = 0;
7177 rval = fp_ns_query(port, ns_cmd, job, 1, sleep);
7188 ns_cmd->ns_resp_hdr.ct_cmdrsp != FS_ACC_IU) {
7193 fctl_free_ns_cmd(ns_cmd);
7199 max_resid = ns_cmd->ns_resp_hdr.ct_aiusize;
7212 port->fp_total_devices = *((int *)ns_cmd->ns_data_buf);
7214 fctl_free_ns_cmd(ns_cmd);
8369 fctl_ns_req_t *ns_cmd;
8376 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gan_t),
8380 ASSERT(ns_cmd != NULL);
8382 ns_cmd->ns_gan_index = 0;
8383 ns_cmd->ns_gan_sid = FCTL_GAN_START_ID;
8384 ns_cmd->ns_cmd_code = NS_GA_NXT;
8385 ns_cmd->ns_gan_max = map_size / sizeof (fc_port_dev_t);
8391 ret = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
8395 fctl_free_ns_cmd(ns_cmd);
8420 new_count = ns_cmd->ns_gan_index;
8425 fctl_free_ns_cmd(ns_cmd);
8430 if (fp_copyout((void *)ns_cmd->ns_data_buf,
8432 ns_cmd->ns_gan_index, mode)) {
8434 fctl_free_ns_cmd(ns_cmd);
8438 fctl_free_ns_cmd(ns_cmd);
8661 fctl_ns_req_t *ns_cmd;
8688 ns_cmd = fctl_alloc_ns_cmd(
8693 ASSERT(ns_cmd != NULL);
8695 ns_cmd->ns_cmd_code = NS_GID_PN;
8697 (ns_cmd->ns_cmd_buf))->pwwn = pwwn;
8699 ret = fp_ns_query(port, ns_cmd, job,
8714 fctl_free_ns_cmd(ns_cmd);
9555 fctl_ns_req_t *ns_cmd;
9575 ns_req->ns_cmd = ns_req32->ns_cmd;
9609 ns_cmd = fctl_alloc_ns_cmd(ns_req->ns_req_len,
9612 ASSERT(ns_cmd != NULL);
9613 ns_cmd->ns_cmd_code = ns_req->ns_cmd;
9615 if (ns_cmd->ns_cmd_code == NS_GA_NXT) {
9616 ns_cmd->ns_gan_max = 1;
9617 ns_cmd->ns_gan_index = 0;
9618 ns_cmd->ns_gan_sid = FCTL_GAN_START_ID;
9622 ns_cmd->ns_cmd_buf, ns_req->ns_req_len, mode)) {
9624 fctl_free_ns_cmd(ns_cmd);
9630 job->job_private = (void *)ns_cmd;
9637 if (ddi_copyout(ns_cmd->ns_data_buf,
9639 ns_cmd->ns_data_len, mode)) {
9641 fctl_free_ns_cmd(ns_cmd);
9650 ns_req->ns_resp_hdr = ns_cmd->ns_resp_hdr;
9651 fctl_free_ns_cmd(ns_cmd);
10129 fctl_ns_req_t *ns_cmd;
10139 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gid_pn_t),
10143 ASSERT(ns_cmd != NULL);
10145 ns_cmd->ns_cmd_code = NS_GID_PN;
10164 (ns_cmd->ns_cmd_buf))->pwwn = orp->orp_pwwn;
10166 ns_cmd->ns_data_buf)->pid.port_id = 0;
10168 ns_cmd->ns_data_buf)->pid.priv_lilp_posit = 0;
10170 rval = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
10173 BE_32(*((uint32_t *)ns_cmd->ns_data_buf));
10283 (ns_cmd->ns_cmd_buf))->pwwn = pd->pd_port_name;
10285 ns_cmd->ns_data_buf)->pid.port_id = 0;
10287 ((ns_resp_gid_pn_t *)ns_cmd->ns_data_buf)->
10296 rval = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
10319 d_id = BE_32(*((uint32_t *)ns_cmd->ns_data_buf));
10341 if (ns_cmd) {
10342 fctl_free_ns_cmd(ns_cmd);
11566 fctl_ns_req_t *ns_cmd;
11577 ns_cmd = fctl_alloc_ns_cmd(
11582 if (ns_cmd != NULL) {
11585 ns_cmd->ns_cmd_code = NS_GID_PN;
11587 (ns_cmd->ns_cmd_buf))->pwwn =
11590 port, ns_cmd, job, 1, KM_SLEEP);
11593 fctl_free_ns_cmd(ns_cmd);
11600 fctl_free_ns_cmd(ns_cmd);
12318 fctl_ns_req_t *ns_cmd;
12365 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gpn_id_t),
12368 if (ns_cmd == NULL) {
12380 ns_cmd->ns_cmd_code = NS_GPN_ID;
12421 fp_validate_rscn_page(port, page, job, ns_cmd,
12476 if (ns_cmd) {
12477 fctl_free_ns_cmd(ns_cmd);
12671 fctl_ns_req_t *ns_cmd;
12673 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gid_pn_t),
12677 if (ns_cmd == NULL) {
12681 ns_cmd->ns_cmd_code = NS_GID_PN;
12682 ((ns_req_gid_pn_t *)(ns_cmd->ns_cmd_buf))->pwwn = *pwwn;
12684 ret = fp_ns_query(port, ns_cmd, job, 1, sleep);
12686 fctl_free_ns_cmd(ns_cmd);
12689 bcopy(ns_cmd->ns_data_buf, (caddr_t)&d_id, sizeof (d_id));
12690 d_id = BE_32(*((uint32_t *)ns_cmd->ns_data_buf));
12692 fctl_free_ns_cmd(ns_cmd);
12699 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gpt_id_t),
12703 if (ns_cmd == NULL) {
12708 ns_cmd->ns_cmd_code = NS_GPT_ID;
12710 ((ns_req_gpt_id_t *)(ns_cmd->ns_cmd_buf))->pid.port_id = d_id;
12712 (ns_cmd->ns_cmd_buf))->pid.priv_lilp_posit = 0;
12714 ret = fp_ns_query(port, ns_cmd, job, 1, sleep);
12716 fctl_free_ns_cmd(ns_cmd);
12719 bcopy(ns_cmd->ns_data_buf, (caddr_t)&ptype, sizeof (ptype));
12721 fctl_free_ns_cmd(ns_cmd);
12894 fp_ns_query(fc_local_port_t *port, fctl_ns_req_t *ns_cmd, job_request_t *job,
12902 if (ns_cmd->ns_cmd_code == NS_GA_NXT) {
12904 port->fp_port_id.port_id, ns_cmd->ns_gan_sid);
12907 if (ns_cmd->ns_cmd_size == 0) {
12912 ns_cmd->ns_cmd_size, sizeof (fc_ct_header_t) +
12913 ns_cmd->ns_resp_size, sleep, NULL);
12918 fp_ct_init(port, cmd, ns_cmd, ns_cmd->ns_cmd_code, ns_cmd->ns_cmd_buf,
12919 ns_cmd->ns_cmd_size, ns_cmd->ns_resp_size, job);
12951 fp_ct_init(fc_local_port_t *port, fp_cmd_t *cmd, fctl_ns_req_t *ns_cmd,
12968 cmd->cmd_private = ns_cmd;
13031 fctl_ns_req_t *ns_cmd;
13042 ns_cmd = (fctl_ns_req_t *)
13057 if (ns_cmd) {
13061 bcopy(&resp_hdr, &ns_cmd->ns_resp_hdr,
13073 if (ns_cmd) {
13074 if (ns_cmd->ns_flags & FCTL_NS_VALIDATE_PD) {
13075 ASSERT(ns_cmd->ns_pd != NULL);
13078 mutex_enter(&ns_cmd->ns_pd->pd_mutex);
13079 ns_cmd->ns_pd->pd_type = PORT_DEVICE_OLD;
13080 mutex_exit(&ns_cmd->ns_pd->pd_mutex);
13083 if (ns_cmd->ns_flags & FCTL_NS_ASYNC_REQUEST) {
13084 fctl_free_ns_cmd(ns_cmd);
13115 fp_gan_handler(pkt, ns_cmd);
13121 if (ns_cmd) {
13122 if ((ns_cmd->ns_flags & FCTL_NS_NO_DATA_BUF) == 0) {
13123 fp_ns_query_handler(pkt, ns_cmd);
13137 fp_gan_handler(fc_packet_t *pkt, fctl_ns_req_t *ns_cmd)
13147 ASSERT(ns_cmd != NULL);
13166 if (ns_cmd->ns_gan_sid == d_id.port_id) {
13174 if (ns_cmd->ns_gan_sid == FCTL_GAN_START_ID) {
13175 ns_cmd->ns_gan_sid = d_id.port_id;
13220 if (ns_cmd->ns_flags & FCTL_NS_CREATE_DEVICE && pd == NULL) {
13231 if (ns_cmd->ns_flags & FCTL_NS_GET_DEV_COUNT) {
13232 *((int *)ns_cmd->ns_data_buf) += 1;
13235 if (ns_cmd->ns_flags & FCTL_NS_FILL_NS_MAP) {
13236 ASSERT((ns_cmd->ns_flags & FCTL_NS_NO_DATA_BUF) == 0);
13238 if (ns_cmd->ns_flags & FCTL_NS_BUF_IS_USERLAND) {
13242 ns_cmd->ns_data_buf) +
13243 ns_cmd->ns_gan_index++;
13266 } else if (ns_cmd->ns_flags &
13271 ns_cmd->ns_data_buf) +
13272 ns_cmd->ns_gan_index++;
13290 dst_ptr = ns_cmd->ns_data_buf +
13291 (NS_GAN_RESP_LEN) * ns_cmd->ns_gan_index++;
13298 ns_cmd->ns_gan_index++;
13300 if (ns_cmd->ns_gan_index >= ns_cmd->ns_gan_max) {
13327 fp_ns_query_handler(fc_packet_t *pkt, fctl_ns_req_t *ns_cmd)
13337 xfer_len = ns_cmd->ns_resp_size;
13340 ns_cmd->ns_cmd_code, xfer_len);
13342 if (ns_cmd->ns_cmd_code == NS_GPN_ID) {
13349 if (xfer_len <= ns_cmd->ns_data_len) {
13352 (uint8_t *)ns_cmd->ns_data_buf,
13356 if (ns_cmd->ns_flags & FCTL_NS_VALIDATE_PD) {
13357 ASSERT(ns_cmd->ns_pd != NULL);
13359 mutex_enter(&ns_cmd->ns_pd->pd_mutex);
13360 if (ns_cmd->ns_pd->pd_type == PORT_DEVICE_OLD) {
13361 ns_cmd->ns_pd->pd_type = PORT_DEVICE_NOCHANGE;
13363 mutex_exit(&ns_cmd->ns_pd->pd_mutex);
13366 if (ns_cmd->ns_flags & FCTL_NS_ASYNC_REQUEST) {
13367 fctl_free_ns_cmd(ns_cmd);
13635 fctl_ns_req_t *ns_cmd;
13641 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gan_t),
13645 ns_cmd->ns_data_len = sizeof (**map) * (*len);
13646 ns_cmd->ns_data_buf = (caddr_t)*map;
13648 ASSERT(ns_cmd != NULL);
13650 ns_cmd->ns_gan_index = 0;
13651 ns_cmd->ns_gan_sid = sid;
13652 ns_cmd->ns_cmd_code = NS_GA_NXT;
13653 ns_cmd->ns_gan_max = *len;
13655 ret = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
13657 if (ns_cmd->ns_gan_index != *len) {
13658 *len = ns_cmd->ns_gan_index;
13660 ns_cmd->ns_data_len = 0;
13661 ns_cmd->ns_data_buf = NULL;
13662 fctl_free_ns_cmd(ns_cmd);
13676 fctl_ns_req_t *ns_cmd;
13695 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gan_t),
13698 if (ns_cmd == NULL) {
13703 ns_cmd->ns_gan_max = 1;
13704 ns_cmd->ns_cmd_code = NS_GA_NXT;
13705 ns_cmd->ns_gan_sid = FCTL_GAN_START_ID;
13706 ((ns_req_gan_t *)(ns_cmd->ns_cmd_buf))->pid.port_id = d_id - 1;
13707 ((ns_req_gan_t *)(ns_cmd->ns_cmd_buf))->pid.priv_lilp_posit = 0;
13710 rval = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
13711 fctl_free_ns_cmd(ns_cmd);
14041 fctl_ns_req_t *ns_cmd;
14050 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gid_pn_t),
14053 if (ns_cmd == NULL) {
14062 ns_cmd->ns_cmd_code = NS_GID_PN;
14140 fctl_free_ns_cmd(ns_cmd);
14172 (ns_cmd->ns_cmd_buf))->pwwn =
14181 rval = fp_ns_query(port, ns_cmd, job, 1,
14311 ((ns_req_gid_pn_t *)ns_cmd->ns_cmd_buf)->pwwn = orp->orp_pwwn;
14313 ((ns_resp_gid_pn_t *)ns_cmd->ns_data_buf)->pid.port_id = 0;
14315 ns_cmd->ns_data_buf)->pid.priv_lilp_posit = 0;
14317 rval = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
14319 d_id = BE_32(*((uint32_t *)ns_cmd->ns_data_buf));
14431 if (ns_cmd) {
14432 fctl_free_ns_cmd(ns_cmd);
14454 job_request_t *job, fctl_ns_req_t *ns_cmd, fc_portmap_t *listptr,
14484 pwwn = &((ns_resp_gpn_id_t *)ns_cmd->ns_data_buf)->pwwn;
14486 ((ns_req_gpn_id_t *)ns_cmd->ns_cmd_buf)->pid.port_id = page->aff_d_id;
14487 ((ns_req_gpn_id_t *)ns_cmd->ns_cmd_buf)->pid.priv_lilp_posit = 0;
14489 bzero(ns_cmd->ns_data_buf, sizeof (la_wwn_t));
14490 rval = fp_ns_query(port, ns_cmd, job, 1, sleep);
14494 ns_cmd->ns_resp_hdr.ct_rev, ns_cmd->ns_resp_hdr.ct_inid,
14495 ns_cmd->ns_resp_hdr.ct_cmdrsp, ns_cmd->ns_resp_hdr.ct_reason,
14496 ns_cmd->ns_resp_hdr.ct_expln);
14881 fctl_ns_req_t *ns_cmd;
14884 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gid_pn_t),
14887 if (ns_cmd == NULL) {
14895 ns_cmd->ns_cmd_code = NS_GID_PN;
14896 ns_cmd->ns_pd = pd;
14897 ((ns_req_gid_pn_t *)ns_cmd->ns_cmd_buf)->pwwn = pwwn;
14898 ((ns_resp_gid_pn_t *)ns_cmd->ns_data_buf)->pid.port_id = 0;
14899 ((ns_resp_gid_pn_t *)ns_cmd->ns_data_buf)->pid.priv_lilp_posit = 0;
14901 return (fp_ns_query(port, ns_cmd, job, polled, sleep));
15044 fctl_ns_req_t *ns_cmd;
15056 ns_cmd = fctl_alloc_ns_cmd(sizeof (ns_req_gid_pn_t),
15060 ASSERT(ns_cmd != NULL);
15062 ns_cmd->ns_cmd_code = NS_GID_PN;
15063 ((ns_req_gid_pn_t *)(ns_cmd->ns_cmd_buf))->pwwn = pwwn;
15065 ret = fp_ns_query(port, ns_cmd, job, 1, KM_SLEEP);
15073 fctl_free_ns_cmd(ns_cmd);
15076 d_id = BE_32(*((uint32_t *)ns_cmd->ns_data_buf));
15077 fctl_free_ns_cmd(ns_cmd);