usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1007
fcsm_handle_port_detach(fc_ulp_port_info_t *pinfo, fcsm_t *fcsm,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1022
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1033
if (fcsm->sm_flags &
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1035
fcsm->sm_flags |= flag;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1036
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1042
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1046
fcsm->sm_flags |= flag;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1055
while ((count++ <= 30) && (fcsm->sm_ncmds || fcsm->sm_cb_count)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1056
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1058
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1060
if (fcsm->sm_ncmds || fcsm->sm_cb_count) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1061
fcsm->sm_flags &= ~flag;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1062
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1063
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1068
fcsm->sm_flags &= ~FCSM_DETACHING;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1069
fcsm->sm_flags |= FCSM_DETACHED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1072
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1074
FCSM_DEBUG(SMDL_INFO, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1079
fcsm_cleanup_port(fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1085
fcsm_suspend_port(fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1092
fcsm_suspend_port(fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1094
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1096
if (fcsm->sm_offline_tid != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1099
tid = fcsm->sm_offline_tid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1100
fcsm->sm_offline_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1101
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1103
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1104
fcsm->sm_flags |= FCSM_RESTORE_OFFLINE_TIMEOUT;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1107
if (fcsm->sm_retry_tid != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1110
tid = fcsm->sm_retry_tid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1111
fcsm->sm_retry_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1112
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1114
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1115
fcsm->sm_flags |= FCSM_RESTORE_RETRY_TIMEOUT;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1118
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1122
fcsm_resume_port(fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1124
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1126
if (fcsm->sm_flags & FCSM_RESTORE_OFFLINE_TIMEOUT) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1127
fcsm->sm_flags &= ~FCSM_RESTORE_OFFLINE_TIMEOUT;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1133
if (!(fcsm->sm_flags & FCSM_LINK_DOWN) &&
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1134
fcsm->sm_offline_tid == NULL &&
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1135
(fcsm->sm_flags & FCSM_PORT_OFFLINE)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1136
fcsm->sm_offline_tid = timeout(fcsm_offline_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1137
(caddr_t)fcsm, fcsm_offline_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1141
if (fcsm->sm_flags & FCSM_RESTORE_RETRY_TIMEOUT) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1142
fcsm->sm_flags &= ~FCSM_RESTORE_RETRY_TIMEOUT;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1148
if (fcsm->sm_retry_head && fcsm->sm_retry_tid == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1149
fcsm->sm_retry_tid = timeout(fcsm_retry_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1150
(caddr_t)fcsm, fcsm_retry_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1153
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1157
fcsm_cleanup_port(fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1163
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1171
fcsm_init_job(job, fcsm->sm_instance, FCSM_JOB_THREAD_SHUTDOWN,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1185
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1187
ASSERT(fcsm->sm_retry_tid == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1189
if (fcsm->sm_offline_tid != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1192
tid = fcsm->sm_offline_tid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1193
fcsm->sm_offline_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1194
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1197
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1204
while (curr != fcsm && curr != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1217
if (fcsm->sm_cmd_cache != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1218
kmem_cache_destroy(fcsm->sm_cmd_cache);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1220
cv_destroy(&fcsm->sm_job_cv);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1221
mutex_destroy(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1224
ddi_soft_state_free(fcsm_state, fcsm->sm_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1234
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1243
fcsm = ddi_get_soft_state(fcsm_state,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1245
if (fcsm == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1252
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1253
ASSERT(fcsm->sm_instance == fc_ulp_get_port_instance(port_handle));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1254
if ((fcsm->sm_flags & FCSM_ATTACHED) == 0) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1255
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1257
FCSM_DEBUG(SMDL_TRACE, (CE_NOTE, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1262
ASSERT(fcsm->sm_cb_count >= 0);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1264
fcsm->sm_cb_count++;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1265
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1268
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1273
fcsm_disp_devlist(fcsm, devlist, dev_cnt);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1275
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1280
fcsm->sm_flags &= ~FCSM_MGMT_SERVER_LOGGED_IN;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1282
fcsm->sm_sid = port_sid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1283
fcsm->sm_port_top = port_top;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1284
fcsm->sm_port_state = port_state;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1290
fcsm->sm_flags |= FCSM_PORT_OFFLINE;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1297
fcsm->sm_flags &= ~FCSM_PORT_OFFLINE;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1298
fcsm->sm_flags &= ~FCSM_LINK_DOWN;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1310
if (fcsm->sm_flags & FCSM_PORT_OFFLINE) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1315
if (fcsm->sm_offline_tid == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1316
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1318
fcsm->sm_flags |= FCSM_CMD_RETRY_Q_SUSPENDED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1320
retry_tid = fcsm->sm_retry_tid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1321
fcsm->sm_retry_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1323
fcsm->sm_offline_tid = timeout(fcsm_offline_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1324
(caddr_t)fcsm, fcsm_offline_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1332
if (fcsm->sm_offline_tid) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1333
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1335
offline_tid = fcsm->sm_offline_tid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1336
fcsm->sm_offline_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1339
fcsm->sm_flags &= ~FCSM_CMD_RETRY_Q_SUSPENDED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1341
if (fcsm->sm_retry_head && fcsm->sm_retry_tid == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1342
fcsm->sm_retry_tid = timeout(fcsm_retry_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1343
(caddr_t)fcsm, fcsm_retry_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1347
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1357
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1358
fcsm->sm_cb_count--;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1359
ASSERT(fcsm->sm_cb_count >= 0);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1360
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1367
fcsm_t *fcsm = (fcsm_t *)handle;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1369
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1372
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1373
if (fcsm->sm_flags & FCSM_PORT_OFFLINE) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1374
fcsm->sm_flags |= FCSM_LINK_DOWN;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1376
fcsm->sm_offline_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1377
fcsm->sm_flags &= ~FCSM_CMD_RETRY_Q_SUSPENDED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1380
if (fcsm->sm_retry_head && fcsm->sm_retry_tid == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1381
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1383
ASSERT(fcsm->sm_retry_tid == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1384
fcsm->sm_retry_tid = timeout(fcsm_retry_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1385
(caddr_t)fcsm, fcsm_retry_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1387
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1506
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1553
fcsm = ddi_get_soft_state(fcsm_state, instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1556
if (fcsm != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1557
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1558
if (fcsm->sm_flags & FCSM_ATTACHED) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1559
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1562
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1571
fcsm = ddi_get_soft_state(fcsm_state, instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1598
status = fcsm_ct_passthru(fcsm->sm_instance, fcio, KM_SLEEP,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1604
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1794
fcsm_disp_devlist(fcsm_t *fcsm, fc_portmap_t *devlist, uint32_t dev_cnt)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1806
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1824
fcsm_display(int level, int flags, fcsm_t *fcsm, fc_packet_t *pkt,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1835
if (fcsm) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1837
ddi_get_instance(fcsm->sm_port_info.port_dip));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1961
fcsm_t *fcsm = (fcsm_t *)cdarg;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1966
ASSERT(fcsm != NULL && buf != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1971
cmd->cmd_fcsm = fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1980
if (!(fcsm->sm_flags & FCSM_USING_NODMA_FCA)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
1981
pinfo = &fcsm->sm_port_info;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2016
fcsm_t *fcsm = (fcsm_t *)cdarg;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2019
ASSERT(fcsm == cmd->cmd_fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2034
fcsm_alloc_cmd(fcsm_t *fcsm, uint32_t cmd_len, uint32_t resp_len, int sleep)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2046
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2047
pinfo = &fcsm->sm_port_info;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2051
cmd = (fcsm_cmd_t *)kmem_cache_alloc(fcsm->sm_cmd_cache, sleep);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2053
FCSM_DEBUG(SMDL_ERR, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2082
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2086
if ((cmd_len) && !(fcsm->sm_flags & FCSM_USING_NODMA_FCA)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2090
fcsm->sm_port_info.port_acc_attr, DDI_DMA_CONSISTENT,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2097
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2107
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2119
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2130
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2144
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2159
if ((resp_len) && !(fcsm->sm_flags & FCSM_USING_NODMA_FCA)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2163
fcsm->sm_port_info.port_acc_attr, DDI_DMA_CONSISTENT,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2170
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2180
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2192
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2203
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2217
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2235
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2243
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2245
fcsm = cmd->cmd_fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2246
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2248
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2253
(void) fc_ulp_uninit_packet((opaque_t)fcsm->sm_port_info.port_handle,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2255
kmem_cache_free(fcsm->sm_cmd_cache, (void *)cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2390
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2396
fcsm = ddi_get_soft_state(fcsm_state, job->job_port_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2398
if (fcsm == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2418
fcsm_enque_job(fcsm, job, priority_flag);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2426
FCSM_DEBUG(SMDL_ERR, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2436
fcsm_enque_job(fcsm_t *fcsm, fcsm_job_t *job, int priority_flag)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2438
ASSERT(!MUTEX_HELD(&fcsm->sm_mutex));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2440
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2443
FCSM_DEBUG(SMDL_INFO, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2446
if (fcsm->sm_job_tail == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2447
ASSERT(fcsm->sm_job_head == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2448
fcsm->sm_job_head = fcsm->sm_job_tail = job;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2450
ASSERT(fcsm->sm_job_head != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2451
job->job_next = fcsm->sm_job_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2452
fcsm->sm_job_head = job;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2455
FCSM_DEBUG(SMDL_INFO, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2458
if (fcsm->sm_job_tail == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2459
ASSERT(fcsm->sm_job_head == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2460
fcsm->sm_job_head = fcsm->sm_job_tail = job;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2462
ASSERT(fcsm->sm_job_head != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2463
fcsm->sm_job_tail->job_next = job;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2464
fcsm->sm_job_tail = job;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2470
cv_signal(&fcsm->sm_job_cv);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2471
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2475
fcsm_retry_job(fcsm_t *fcsm, fcsm_job_t *job)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2504
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2505
fcsm->sm_flags &= ~FCSM_MGMT_SERVER_LOGGED_IN;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2506
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2510
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2525
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2534
fcsm_enque_job(fcsm, job, 1);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2536
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2537
ASSERT(fcsm->sm_flags & FCSM_SERIALIZE_JOBTHREAD);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2538
fcsm->sm_flags &= ~FCSM_SERIALIZE_JOBTHREAD;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2541
cv_signal(&fcsm->sm_job_cv);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2542
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2558
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2560
fcsm = ddi_get_soft_state(fcsm_state, job->job_port_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2561
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2564
if (fcsm_retry_job(fcsm, job) == 0) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2577
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2578
ASSERT(fcsm->sm_flags & FCSM_SERIALIZE_JOBTHREAD);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2579
fcsm->sm_flags &= ~FCSM_SERIALIZE_JOBTHREAD;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2582
cv_signal(&fcsm->sm_job_cv);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2583
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2598
fcsm_deque_job(fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2602
ASSERT(MUTEX_HELD(&fcsm->sm_mutex));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2604
if (fcsm->sm_job_head == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2605
ASSERT(fcsm->sm_job_tail == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2608
ASSERT(fcsm->sm_job_tail != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2609
job = fcsm->sm_job_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2611
ASSERT(fcsm->sm_job_tail == job);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2612
fcsm->sm_job_tail = NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2614
fcsm->sm_job_head = job->job_next;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2624
fcsm_job_thread(fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2628
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2630
CALLB_CPR_INIT(&fcsm->sm_cpr_info, &fcsm->sm_mutex,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2635
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2637
while (fcsm->sm_job_head == NULL ||
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2638
fcsm->sm_flags & FCSM_SERIALIZE_JOBTHREAD) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2639
CALLB_CPR_SAFE_BEGIN(&fcsm->sm_cpr_info);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2640
cv_wait(&fcsm->sm_job_cv, &fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2641
CALLB_CPR_SAFE_END(&fcsm->sm_cpr_info, &fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2644
job = fcsm_deque_job(fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2646
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2652
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2653
ASSERT(!(fcsm->sm_flags & FCSM_SERIALIZE_JOBTHREAD));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2654
fcsm->sm_flags |= FCSM_SERIALIZE_JOBTHREAD;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2655
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2660
ASSERT(fcsm->sm_instance == job->job_port_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2664
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2671
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2678
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2679
ASSERT(fcsm->sm_job_head == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2680
ASSERT(fcsm->sm_job_tail == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2681
ASSERT(fcsm->sm_retry_head == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2682
ASSERT(fcsm->sm_retry_tail == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2685
CALLB_CPR_EXIT(&fcsm->sm_cpr_info);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2695
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2702
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2708
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2714
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2727
fcsm_ct_init(fcsm_t *fcsm, fcsm_cmd_t *cmd, fc_ct_aiu_t *req_iu, size_t req_len,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2749
pkt->pkt_cmd_fhdr.s_id = fcsm->sm_sid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2774
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2790
fcsm = cmd->cmd_fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2807
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2817
fcsm = ddi_get_soft_state(fcsm_state, job->job_port_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2818
if (fcsm == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2827
if (!FC_TOP_EXTERNAL(fcsm->sm_port_top)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2828
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2864
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2867
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2870
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2879
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2893
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2895
!(fcsm->sm_flags & FCSM_MGMT_SERVER_LOGGED_IN)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2896
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2897
if (fcsm_login_and_process_job(fcsm, job) != FC_SUCCESS) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2898
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2905
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2911
cmd = fcsm_alloc_cmd(fcsm, fcio->fcio_ilen, fcio->fcio_olen, KM_SLEEP);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2921
fcsm_ct_init(fcsm, cmd, (fc_ct_aiu_t *)fcio->fcio_ibuf, fcio->fcio_ilen,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2936
fcsm_login_and_process_job(fcsm_t *fcsm, fcsm_job_t *orig_job)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2947
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2950
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2951
if (fcsm->sm_flags & FCSM_MGMT_SERVER_LOGGED_IN) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2957
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2958
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2961
fcsm_enque_job(fcsm, orig_job, 0);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2965
if (fcsm->sm_flags & FCSM_MGMT_SERVER_LOGIN_IN_PROG) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2971
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2972
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2975
fcsm_enque_job(fcsm, orig_job, 0);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2979
fcsm->sm_flags |= FCSM_MGMT_SERVER_LOGIN_IN_PROG;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2980
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
2992
fcsm_init_job(login_job, fcsm->sm_instance, FCSM_JOB_LOGIN_MGMT_SERVER,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3011
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3027
fcsm = ddi_get_soft_state(fcsm_state, login_job->job_port_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3028
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3030
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3031
ASSERT((fcsm->sm_flags & FCSM_MGMT_SERVER_LOGGED_IN) == 0);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3032
ASSERT(fcsm->sm_flags & FCSM_MGMT_SERVER_LOGIN_IN_PROG);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3033
fcsm->sm_flags &= ~FCSM_MGMT_SERVER_LOGIN_IN_PROG;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3042
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3047
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3051
fcsm->sm_flags |= FCSM_MGMT_SERVER_LOGGED_IN;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3052
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3057
fcsm_enque_job(fcsm, orig_job, 1);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3065
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3067
fcsm = cmd->cmd_fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3069
ASSERT(fcsm != NULL && pkt != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3074
pkt->pkt_cmd_fhdr.s_id = fcsm->sm_sid;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3089
fcsm_xlogi_init(fcsm_t *fcsm, fcsm_cmd_t *cmd, uint32_t d_id,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3103
status = fc_ulp_get_port_login_params(fcsm->sm_port_info.port_handle,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3135
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3141
fcsm = cmd->cmd_fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3142
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3145
fcsm_display(CE_WARN, SM_LOG, fcsm, pkt,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3150
FCSM_REP_RD(pkt->pkt_resp_acc, &fcsm->sm_ms_service_params,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3165
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3172
fcsm = ddi_get_soft_state(fcsm_state, job->job_port_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3173
if (fcsm == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3182
cmd = fcsm_alloc_cmd(fcsm, sizeof (la_els_logi_t),
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3193
status = fcsm_xlogi_init(fcsm, cmd, FS_MANAGEMENT_SERVER,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3197
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3264
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3278
fcsm = cmd->cmd_fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3279
ASSERT(fcsm != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3285
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3286
if (fcsm->sm_flags & FCSM_LINK_DOWN) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3291
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3297
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3350
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3354
fcsm = cmd->cmd_fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3359
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3362
ASSERT(!MUTEX_HELD(&fcsm->sm_mutex));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3363
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3364
if (fcsm->sm_flags & FCSM_LINK_DOWN) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3370
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3375
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3378
status = cmd->cmd_transport(fcsm->sm_port_info.port_handle, pkt);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3414
(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3431
(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3440
FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3468
fcsm_enque_cmd(fcsm_t *fcsm, fcsm_cmd_t *cmd)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3470
ASSERT(!MUTEX_HELD(&fcsm->sm_mutex));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3472
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL, "enque_cmd"));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3475
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3476
if (fcsm->sm_retry_tail) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3477
ASSERT(fcsm->sm_retry_head != NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3478
fcsm->sm_retry_tail->cmd_next = cmd;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3479
fcsm->sm_retry_tail = cmd;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3481
ASSERT(fcsm->sm_retry_tail == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3482
fcsm->sm_retry_head = fcsm->sm_retry_tail = cmd;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3485
if (fcsm->sm_retry_tid == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3486
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3488
fcsm->sm_retry_tid = timeout(fcsm_retry_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3489
(caddr_t)fcsm, fcsm_retry_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3492
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3497
fcsm_deque_cmd(fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3501
ASSERT(!MUTEX_HELD(&fcsm->sm_mutex));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3503
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL, "deque_cmd"));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3505
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3506
if (fcsm->sm_retry_head == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3507
ASSERT(fcsm->sm_retry_tail == NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3510
cmd = fcsm->sm_retry_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3511
fcsm->sm_retry_head = cmd->cmd_next;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3512
if (fcsm->sm_retry_head == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3513
fcsm->sm_retry_tail = NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3517
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3525
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3531
fcsm = (fcsm_t *)handle;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3533
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL, "retry_timeout"));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3539
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3540
if (fcsm->sm_flags & FCSM_CMD_RETRY_Q_SUSPENDED) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3545
fcsm->sm_retry_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3546
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3547
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3553
linkdown = (fcsm->sm_flags & FCSM_LINK_DOWN) ? 1 : 0;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3559
curr_tail = fcsm->sm_retry_tail;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3560
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3567
while ((!done) && ((cmd = fcsm_deque_cmd(fcsm)) != NULL)) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3591
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3601
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3603
fcsm_enque_cmd(fcsm, cmd);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3607
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3608
if (fcsm->sm_retry_head) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3610
fcsm->sm_retry_tid = timeout(fcsm_retry_timeout,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3611
(caddr_t)fcsm, fcsm_retry_ticks);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3612
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3619
fcsm->sm_retry_tid = (timeout_id_t)NULL;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
3621
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
529
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
536
if ((fcsm = ddi_get_soft_state(fcsm_state, instance)) == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
543
ASSERT(fcsm->sm_instance == instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
546
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
547
if ((fcsm->sm_flags & FCSM_ATTACHED) == 0) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
548
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
549
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
553
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
555
if (fcsm_handle_port_resume(ulph, pinfo, cmd, s_id, fcsm) !=
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
560
(void) ddi_pathname(fcsm->sm_port_info.port_dip, fcsm_pathname);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
561
fcsm_display(CE_NOTE, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
584
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
597
if ((fcsm = ddi_get_soft_state(fcsm_state, instance)) == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
607
mutex_init(&fcsm->sm_mutex, NULL, MUTEX_DRIVER, NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
608
cv_init(&fcsm->sm_job_cv, NULL, CV_DRIVER, NULL);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
610
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
611
fcsm->sm_flags |= FCSM_ATTACHING;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
612
fcsm->sm_sid = s_id;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
613
fcsm->sm_instance = instance;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
614
fcsm->sm_port_state = pinfo->port_state;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
620
fcsm->sm_port_info = *pinfo; /* Structure copy !!! */
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
621
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
624
(void) sprintf(name, "fcsm%d_cmd_cache", fcsm->sm_instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
625
fcsm->sm_cmd_cache = kmem_cache_create(name,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
628
NULL, (void *)fcsm, NULL, 0);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
629
if (fcsm->sm_cmd_cache == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
630
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
632
cv_destroy(&fcsm->sm_job_cv);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
633
mutex_destroy(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
639
(caddr_t)fcsm, 0, &p0, TS_RUN, v.v_maxsyspri-2);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
641
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
643
kmem_cache_destroy(fcsm->sm_cmd_cache);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
644
cv_destroy(&fcsm->sm_job_cv);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
645
mutex_destroy(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
650
fcsm->sm_thread = thread;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
655
fcsm_port_head = fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
657
fcsm->sm_next = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
658
fcsm_port_head = fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
662
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
663
fcsm->sm_flags &= ~FCSM_ATTACHING;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
664
fcsm->sm_flags |= FCSM_ATTACHED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
665
fcsm->sm_port_top = pinfo->port_flags;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
666
fcsm->sm_port_state = pinfo->port_state;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
671
fcsm->sm_flags |= FCSM_USING_NODMA_FCA;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
673
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
675
(void) ddi_pathname(fcsm->sm_port_info.port_dip, fcsm_pathname);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
676
fcsm_display(CE_NOTE, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
679
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
690
fc_attach_cmd_t cmd, uint32_t s_id, fcsm_t *fcsm)
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
692
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
695
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
699
ASSERT(!(fcsm->sm_flags & FCSM_POWER_DOWN));
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
700
fcsm->sm_flags &= ~FCSM_SUSPENDED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
705
fcsm->sm_flags &= ~FCSM_POWER_DOWN;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
706
if (fcsm->sm_flags & FCSM_SUSPENDED) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
707
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
712
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
716
fcsm->sm_sid = s_id;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
721
fcsm->sm_port_info = *pinfo; /* Structure copy !!! */
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
722
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
724
fcsm_resume_port(fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
748
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
798
fcsm = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
799
while (fcsm != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
801
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
802
if (!(fcsm->sm_flags & FCSM_ATTACHED) ||
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
803
fcsm->sm_ncmds || fcsm->sm_cb_count) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
805
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
809
fcsm->sm_flags |= FCSM_DETACHING;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
810
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
812
fcsm = fcsm->sm_next;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
821
if (fcsm != NULL || fcsm_num_attaching || fcsm_num_detaching) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
826
fcsm = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
827
while (fcsm != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
828
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
829
if (fcsm->sm_flags & FCSM_DETACHING) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
830
fcsm->sm_flags &= ~FCSM_DETACHING;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
832
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
834
fcsm = fcsm->sm_next;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
844
fcsm = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
845
while (fcsm != NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
846
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
847
fcsm->sm_flags &= ~FCSM_DETACHING;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
848
fcsm->sm_flags |= FCSM_DETACHED;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
849
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
851
fcsm = fcsm->sm_next;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
862
fcsm = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
869
fcsm_cleanup_port(fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
907
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
909
fcsm = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
911
while (fcsm) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
912
fcsm_cleanup_port(fcsm);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
918
fcsm = fcsm_port_head;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
929
fcsm_t *fcsm;
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
946
if ((fcsm = ddi_get_soft_state(fcsm_state, instance)) == NULL) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
956
ASSERT(fcsm->sm_instance == instance);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
959
mutex_enter(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
960
if ((fcsm->sm_flags & FCSM_ATTACHED) == 0) {
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
961
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
962
fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
969
mutex_exit(&fcsm->sm_mutex);
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
983
FCSM_DEBUG(SMDL_TRACE, (CE_CONT, SM_LOG, fcsm, NULL,
usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
991
if (fcsm_handle_port_detach(pinfo, fcsm, cmd) == DDI_SUCCESS) {
usr/src/uts/common/sys/fibre-channel/ulp/fcsm.h
105
struct fcsm *sm_next; /* for global linked list */
usr/src/uts/common/sys/fibre-channel/ulp/fcsm.h
203
if (!((fcsm)->sm_flags & FCSM_USING_NODMA_FCA)) { \
usr/src/uts/common/sys/fibre-channel/ulp/fcsm.h
214
if (!((fcsm)->sm_flags & FCSM_USING_NODMA_FCA)) { \
usr/src/uts/common/sys/fibre-channel/ulp/fcsm.h
330
static int fcsm_retry_job(fcsm_t *fcsm, fcsm_job_t *job);