Lines Matching refs:pkt
1824 fcsm_display(int level, int flags, fcsm_t *fcsm, fc_packet_t *pkt, in fcsm_display() argument
1846 if (pkt) { in fcsm_display()
1849 (void) fc_ulp_pkt_error(pkt, &state, &reason, &action, &expln); in fcsm_display()
1853 state, pkt->pkt_state, reason, pkt->pkt_reason); in fcsm_display()
1963 fc_packet_t *pkt; in fcsm_cmd_cache_constructor() local
1974 pkt = &cmd->cmd_fc_packet; in fcsm_cmd_cache_constructor()
1976 pkt->pkt_ulp_rscn_infop = NULL; in fcsm_cmd_cache_constructor()
1977 pkt->pkt_fca_private = (opaque_t)((caddr_t)cmd + sizeof (fcsm_cmd_t)); in fcsm_cmd_cache_constructor()
1978 pkt->pkt_ulp_private = (opaque_t)cmd; in fcsm_cmd_cache_constructor()
1984 callback, NULL, &pkt->pkt_cmd_dma) != DDI_SUCCESS) { in fcsm_cmd_cache_constructor()
1990 callback, NULL, &pkt->pkt_resp_dma) != DDI_SUCCESS) { in fcsm_cmd_cache_constructor()
1991 ddi_dma_free_handle(&pkt->pkt_cmd_dma); in fcsm_cmd_cache_constructor()
1995 pkt->pkt_cmd_dma = NULL; in fcsm_cmd_cache_constructor()
1996 pkt->pkt_cmd = NULL; in fcsm_cmd_cache_constructor()
1997 pkt->pkt_resp_dma = NULL; in fcsm_cmd_cache_constructor()
1998 pkt->pkt_resp = NULL; in fcsm_cmd_cache_constructor()
2001 pkt->pkt_cmd_acc = pkt->pkt_resp_acc = NULL; in fcsm_cmd_cache_constructor()
2002 pkt->pkt_cmd_cookie_cnt = pkt->pkt_resp_cookie_cnt = in fcsm_cmd_cache_constructor()
2003 pkt->pkt_data_cookie_cnt = 0; in fcsm_cmd_cache_constructor()
2004 pkt->pkt_cmd_cookie = pkt->pkt_resp_cookie = in fcsm_cmd_cache_constructor()
2005 pkt->pkt_data_cookie = NULL; in fcsm_cmd_cache_constructor()
2017 fc_packet_t *pkt; in fcsm_cmd_cache_destructor() local
2021 pkt = cmd->cmd_fp_pkt; in fcsm_cmd_cache_destructor()
2023 if (pkt->pkt_cmd_dma != NULL) { in fcsm_cmd_cache_destructor()
2024 ddi_dma_free_handle(&pkt->pkt_cmd_dma); in fcsm_cmd_cache_destructor()
2027 if (pkt->pkt_resp_dma != NULL) { in fcsm_cmd_cache_destructor()
2028 ddi_dma_free_handle(&pkt->pkt_resp_dma); in fcsm_cmd_cache_destructor()
2037 fc_packet_t *pkt; in fcsm_alloc_cmd() local
2065 pkt = cmd->cmd_fp_pkt; in fcsm_alloc_cmd()
2068 pkt->pkt_pd = NULL; in fcsm_alloc_cmd()
2069 pkt->pkt_datalen = 0; in fcsm_alloc_cmd()
2070 pkt->pkt_data = NULL; in fcsm_alloc_cmd()
2071 pkt->pkt_state = 0; in fcsm_alloc_cmd()
2072 pkt->pkt_action = 0; in fcsm_alloc_cmd()
2073 pkt->pkt_reason = 0; in fcsm_alloc_cmd()
2074 pkt->pkt_expln = 0; in fcsm_alloc_cmd()
2080 if (fc_ulp_init_packet((opaque_t)pinfo->port_handle, pkt, sleep) in fcsm_alloc_cmd()
2087 ASSERT(pkt->pkt_cmd_dma != NULL); in fcsm_alloc_cmd()
2089 rval = ddi_dma_mem_alloc(pkt->pkt_cmd_dma, cmd_len, in fcsm_alloc_cmd()
2091 callback, NULL, (caddr_t *)&pkt->pkt_cmd, &real_len, in fcsm_alloc_cmd()
2092 &pkt->pkt_cmd_acc); in fcsm_alloc_cmd()
2096 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2106 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2112 rval = ddi_dma_addr_bind_handle(pkt->pkt_cmd_dma, NULL, in fcsm_alloc_cmd()
2113 pkt->pkt_cmd, real_len, DDI_DMA_WRITE | DDI_DMA_CONSISTENT, in fcsm_alloc_cmd()
2114 callback, NULL, &pkt_cookie, &pkt->pkt_cmd_cookie_cnt); in fcsm_alloc_cmd()
2118 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2126 if (pkt->pkt_cmd_cookie_cnt > in fcsm_alloc_cmd()
2129 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2135 ASSERT(pkt->pkt_cmd_cookie_cnt != 0); in fcsm_alloc_cmd()
2137 cp = pkt->pkt_cmd_cookie = (ddi_dma_cookie_t *)kmem_alloc( in fcsm_alloc_cmd()
2138 pkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie), in fcsm_alloc_cmd()
2143 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2151 for (cnt = 1; cnt < pkt->pkt_cmd_cookie_cnt; cnt++, cp++) { in fcsm_alloc_cmd()
2152 ddi_dma_nextcookie(pkt->pkt_cmd_dma, &pkt_cookie); in fcsm_alloc_cmd()
2156 pkt->pkt_cmd = kmem_zalloc(cmd_len, KM_SLEEP); in fcsm_alloc_cmd()
2160 ASSERT(pkt->pkt_resp_dma != NULL); in fcsm_alloc_cmd()
2162 rval = ddi_dma_mem_alloc(pkt->pkt_resp_dma, resp_len, in fcsm_alloc_cmd()
2164 callback, NULL, (caddr_t *)&pkt->pkt_resp, &real_len, in fcsm_alloc_cmd()
2165 &pkt->pkt_resp_acc); in fcsm_alloc_cmd()
2169 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2179 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2185 rval = ddi_dma_addr_bind_handle(pkt->pkt_resp_dma, NULL, in fcsm_alloc_cmd()
2186 pkt->pkt_resp, real_len, DDI_DMA_READ | DDI_DMA_CONSISTENT, in fcsm_alloc_cmd()
2187 callback, NULL, &pkt_cookie, &pkt->pkt_resp_cookie_cnt); in fcsm_alloc_cmd()
2191 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2199 if (pkt->pkt_resp_cookie_cnt > in fcsm_alloc_cmd()
2202 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2208 ASSERT(pkt->pkt_resp_cookie_cnt != 0); in fcsm_alloc_cmd()
2210 cp = pkt->pkt_resp_cookie = (ddi_dma_cookie_t *)kmem_alloc( in fcsm_alloc_cmd()
2211 pkt->pkt_resp_cookie_cnt * sizeof (pkt_cookie), in fcsm_alloc_cmd()
2216 (opaque_t)pinfo->port_handle, pkt); in fcsm_alloc_cmd()
2224 for (cnt = 1; cnt < pkt->pkt_resp_cookie_cnt; cnt++, cp++) { in fcsm_alloc_cmd()
2225 ddi_dma_nextcookie(pkt->pkt_resp_dma, &pkt_cookie); in fcsm_alloc_cmd()
2229 pkt->pkt_resp = kmem_zalloc(resp_len, KM_SLEEP); in fcsm_alloc_cmd()
2232 pkt->pkt_cmdlen = cmd_len; in fcsm_alloc_cmd()
2233 pkt->pkt_rsplen = resp_len; in fcsm_alloc_cmd()
2261 fc_packet_t *pkt; in fcsm_free_cmd_dma() local
2263 pkt = cmd->cmd_fp_pkt; in fcsm_free_cmd_dma()
2264 ASSERT(pkt != NULL); in fcsm_free_cmd_dma()
2267 if (pkt->pkt_cmd) { in fcsm_free_cmd_dma()
2268 kmem_free(pkt->pkt_cmd, pkt->pkt_cmdlen); in fcsm_free_cmd_dma()
2269 pkt->pkt_cmd = NULL; in fcsm_free_cmd_dma()
2272 if (pkt->pkt_resp) { in fcsm_free_cmd_dma()
2273 kmem_free(pkt->pkt_resp, pkt->pkt_rsplen); in fcsm_free_cmd_dma()
2274 pkt->pkt_resp = NULL; in fcsm_free_cmd_dma()
2278 pkt->pkt_cmdlen = 0; in fcsm_free_cmd_dma()
2279 pkt->pkt_rsplen = 0; in fcsm_free_cmd_dma()
2280 pkt->pkt_tran_type = 0; in fcsm_free_cmd_dma()
2281 pkt->pkt_tran_flags = 0; in fcsm_free_cmd_dma()
2283 if (pkt->pkt_cmd_cookie != NULL) { in fcsm_free_cmd_dma()
2284 kmem_free(pkt->pkt_cmd_cookie, pkt->pkt_cmd_cookie_cnt * in fcsm_free_cmd_dma()
2286 pkt->pkt_cmd_cookie = NULL; in fcsm_free_cmd_dma()
2289 if (pkt->pkt_resp_cookie != NULL) { in fcsm_free_cmd_dma()
2290 kmem_free(pkt->pkt_resp_cookie, pkt->pkt_resp_cookie_cnt * in fcsm_free_cmd_dma()
2292 pkt->pkt_resp_cookie = NULL; in fcsm_free_cmd_dma()
2296 (void) ddi_dma_unbind_handle(pkt->pkt_cmd_dma); in fcsm_free_cmd_dma()
2300 if (pkt->pkt_cmd_acc) { in fcsm_free_cmd_dma()
2301 ddi_dma_mem_free(&pkt->pkt_cmd_acc); in fcsm_free_cmd_dma()
2306 (void) ddi_dma_unbind_handle(pkt->pkt_resp_dma); in fcsm_free_cmd_dma()
2310 if (pkt->pkt_resp_acc) { in fcsm_free_cmd_dma()
2311 ddi_dma_mem_free(&pkt->pkt_resp_acc); in fcsm_free_cmd_dma()
2730 fc_packet_t *pkt; in fcsm_ct_init() local
2732 pkt = cmd->cmd_fp_pkt; in fcsm_ct_init()
2733 ASSERT(pkt != NULL); in fcsm_ct_init()
2742 pkt->pkt_cmd_fhdr.d_id = FS_MANAGEMENT_SERVER; in fcsm_ct_init()
2744 pkt->pkt_cmd_fhdr.d_id = FS_NAME_SERVER; in fcsm_ct_init()
2747 pkt->pkt_cmd_fhdr.r_ctl = R_CTL_UNSOL_CONTROL; in fcsm_ct_init()
2748 pkt->pkt_cmd_fhdr.rsvd = 0; in fcsm_ct_init()
2749 pkt->pkt_cmd_fhdr.s_id = fcsm->sm_sid; in fcsm_ct_init()
2750 pkt->pkt_cmd_fhdr.type = FC_TYPE_FC_SERVICES; in fcsm_ct_init()
2751 pkt->pkt_cmd_fhdr.f_ctl = F_CTL_SEQ_INITIATIVE | in fcsm_ct_init()
2753 pkt->pkt_cmd_fhdr.seq_id = 0; in fcsm_ct_init()
2754 pkt->pkt_cmd_fhdr.df_ctl = 0; in fcsm_ct_init()
2755 pkt->pkt_cmd_fhdr.seq_cnt = 0; in fcsm_ct_init()
2756 pkt->pkt_cmd_fhdr.ox_id = 0xffff; in fcsm_ct_init()
2757 pkt->pkt_cmd_fhdr.rx_id = 0xffff; in fcsm_ct_init()
2758 pkt->pkt_cmd_fhdr.ro = 0; in fcsm_ct_init()
2760 pkt->pkt_timeout = FCSM_MS_TIMEOUT; in fcsm_ct_init()
2761 pkt->pkt_comp = comp_func; in fcsm_ct_init()
2763 FCSM_REP_WR(pkt->pkt_cmd_acc, req_iu, pkt->pkt_cmd, req_len); in fcsm_ct_init()
2771 fc_packet_t *pkt; in fcsm_ct_intr() local
2776 pkt = cmd->cmd_fp_pkt; in fcsm_ct_intr()
2783 if (pkt->pkt_state != FC_PKT_SUCCESS) { in fcsm_ct_intr()
2784 FCSM_DEBUG(SMDL_ERR, (CE_NOTE, SM_LOG, cmd->cmd_fcsm, pkt, in fcsm_ct_intr()
2787 pkt->pkt_cmd_fhdr.d_id)); in fcsm_ct_intr()
2791 FCSM_REP_RD(pkt->pkt_resp_acc, fcio->fcio_obuf, in fcsm_ct_intr()
2792 pkt->pkt_resp, fcio->fcio_olen); in fcsm_ct_intr()
2796 fcsm_pkt_state_to_rval(pkt->pkt_state, pkt->pkt_reason); in fcsm_ct_intr()
3064 fc_packet_t *pkt; in fcsm_els_init() local
3068 pkt = cmd->cmd_fp_pkt; in fcsm_els_init()
3069 ASSERT(fcsm != NULL && pkt != NULL); in fcsm_els_init()
3071 pkt->pkt_cmd_fhdr.r_ctl = R_CTL_ELS_REQ; in fcsm_els_init()
3072 pkt->pkt_cmd_fhdr.d_id = d_id; in fcsm_els_init()
3073 pkt->pkt_cmd_fhdr.rsvd = 0; in fcsm_els_init()
3074 pkt->pkt_cmd_fhdr.s_id = fcsm->sm_sid; in fcsm_els_init()
3075 pkt->pkt_cmd_fhdr.type = FC_TYPE_EXTENDED_LS; in fcsm_els_init()
3076 pkt->pkt_cmd_fhdr.f_ctl = F_CTL_SEQ_INITIATIVE | F_CTL_FIRST_SEQ; in fcsm_els_init()
3077 pkt->pkt_cmd_fhdr.seq_id = 0; in fcsm_els_init()
3078 pkt->pkt_cmd_fhdr.df_ctl = 0; in fcsm_els_init()
3079 pkt->pkt_cmd_fhdr.seq_cnt = 0; in fcsm_els_init()
3080 pkt->pkt_cmd_fhdr.ox_id = 0xffff; in fcsm_els_init()
3081 pkt->pkt_cmd_fhdr.rx_id = 0xffff; in fcsm_els_init()
3082 pkt->pkt_cmd_fhdr.ro = 0; in fcsm_els_init()
3084 pkt->pkt_timeout = FCSM_ELS_TIMEOUT; in fcsm_els_init()
3093 fc_packet_t *pkt; in fcsm_xlogi_init() local
3110 pkt = cmd->cmd_fp_pkt; in fcsm_xlogi_init()
3113 pkt->pkt_comp = comp_func; in fcsm_xlogi_init()
3118 FCSM_REP_WR(pkt->pkt_cmd_acc, login_params, in fcsm_xlogi_init()
3119 pkt->pkt_cmd, sizeof (la_els_logi_t)); in fcsm_xlogi_init()
3120 FCSM_REP_WR(pkt->pkt_cmd_acc, &payload, in fcsm_xlogi_init()
3121 pkt->pkt_cmd, sizeof (payload)); in fcsm_xlogi_init()
3133 fc_packet_t *pkt; in fcsm_xlogi_intr() local
3137 pkt = cmd->cmd_fp_pkt; in fcsm_xlogi_intr()
3144 if (pkt->pkt_state != FC_PKT_SUCCESS) { in fcsm_xlogi_intr()
3145 fcsm_display(CE_WARN, SM_LOG, fcsm, pkt, in fcsm_xlogi_intr()
3147 pkt->pkt_cmd_fhdr.d_id); in fcsm_xlogi_intr()
3150 FCSM_REP_RD(pkt->pkt_resp_acc, &fcsm->sm_ms_service_params, in fcsm_xlogi_intr()
3151 pkt->pkt_resp, sizeof (la_els_logi_t)); in fcsm_xlogi_intr()
3155 fcsm_pkt_state_to_rval(pkt->pkt_state, pkt->pkt_reason); in fcsm_xlogi_intr()
3260 fcsm_pkt_common_intr(fc_packet_t *pkt) in fcsm_pkt_common_intr() argument
3269 cmd = (fcsm_cmd_t *)pkt->pkt_ulp_private; in fcsm_pkt_common_intr()
3272 if (pkt->pkt_state == FC_PKT_SUCCESS) { in fcsm_pkt_common_intr()
3281 FCSM_DEBUG(SMDL_ERR, (CE_NOTE, SM_LOG, cmd->cmd_fcsm, pkt, in fcsm_pkt_common_intr()
3283 pkt->pkt_cmd_fhdr.d_id, pkt)); in fcsm_pkt_common_intr()
3299 jobstatus = fcsm_pkt_state_to_rval(pkt->pkt_state, pkt->pkt_reason); in fcsm_pkt_common_intr()
3311 switch (pkt->pkt_state) { in fcsm_pkt_common_intr()
3317 pkt_state = pkt->pkt_state; in fcsm_pkt_common_intr()
3329 pkt->pkt_state = pkt_state; in fcsm_pkt_common_intr()
3330 pkt->pkt_reason = 0; in fcsm_pkt_common_intr()
3349 fc_packet_t *pkt; in fcsm_issue_cmd() local
3353 pkt = cmd->cmd_fp_pkt; in fcsm_issue_cmd()
3357 pkt->pkt_ulp_rscn_infop = NULL; in fcsm_issue_cmd()
3371 pkt->pkt_state = FC_PKT_PORT_OFFLINE; in fcsm_issue_cmd()
3372 pkt->pkt_reason = FC_REASON_OFFLINE; in fcsm_issue_cmd()
3378 status = cmd->cmd_transport(fcsm->sm_port_info.port_handle, pkt); in fcsm_issue_cmd()
3389 pkt->pkt_state = FC_PKT_LOCAL_RJT; in fcsm_issue_cmd()
3390 pkt->pkt_reason = FC_REASON_LOGIN_REQUIRED; in fcsm_issue_cmd()
3427 pkt->pkt_state = FC_PKT_TRAN_BSY; in fcsm_issue_cmd()
3428 pkt->pkt_reason = 0; in fcsm_issue_cmd()
3443 pkt->pkt_state = FC_PKT_TRAN_ERROR; in fcsm_issue_cmd()
3444 pkt->pkt_reason = 0; in fcsm_issue_cmd()
3576 fc_packet_t *pkt; in fcsm_retry_timeout() local
3582 pkt = cmd->cmd_fp_pkt; in fcsm_retry_timeout()
3583 pkt->pkt_state = FC_PKT_PORT_OFFLINE; in fcsm_retry_timeout()
3584 pkt->pkt_reason = FC_REASON_OFFLINE; in fcsm_retry_timeout()
3585 pkt->pkt_comp(pkt); in fcsm_retry_timeout()