Lines Matching refs:cfg_p

116 	if (task_p == task_p->cfg_p->curtask_p)
117 task_p->cfg_p->curtask_p = NULL;
150 rv = isns_socket_create(&(task_p->cfg_p->sd), ai_p->ai_family,
155 rv = isns_socket_connect(task_p->cfg_p->sd, ai_p->ai_addr,
159 rv = isns_change_kevent_list(task_p->cfg_p,
167 task_p->cfg_p->sd_connected = 1;
169 /* Add cfg_p->sd to kqueue */
170 rv = isns_change_kevent_list(task_p->cfg_p,
171 (uintptr_t)(task_p->cfg_p->sd), EVFILT_READ,
197 struct isns_config_s *cfg_p;
209 cfg_p = task_p->cfg_p;
248 bytes_written = isns_socket_writev(cfg_p->sd, iovp,
253 isns_socket_close(cfg_p->sd);
254 cfg_p->sd_connected = 0;
256 isns_process_connection_loss(cfg_p);
258 if (cfg_p->pdu_in_p != NULL) {
259 isns_free_pdu(cfg_p->pdu_in_p);
260 cfg_p->pdu_in_p = NULL;
320 struct isns_config_s *cfg_p;
326 cfg_p = task_p->cfg_p;
328 if (cfg_p->sd_connected) {
329 isns_socket_close(cfg_p->sd);
330 cfg_p->sd_connected = 0;
333 if (cfg_p->pdu_in_p != NULL) {
334 isns_free_pdu(cfg_p->pdu_in_p);
335 cfg_p->pdu_in_p = NULL;
340 if (cfg_p->ai_p != NULL) {
341 isns_free(cfg_p->ai_p);
342 cfg_p->ai_p = NULL;
345 cfg_p->sd = task_p->var.init_socket_io.sd;
346 cfg_p->ai_p = task_p->var.init_socket_io.ai_p;
348 cfg_p->sd_connected = 1;
350 /* Add cfg_p->sd to kqueue */
351 rv = isns_change_kevent_list(cfg_p, (uintptr_t)cfg_p->sd,
368 struct isns_config_s *cfg_p;
374 cfg_p = task_p->cfg_p;
375 if (cfg_p->refresh_p != NULL) {
376 if (cfg_p->refresh_p->trans_p != NULL)
377 isns_free_trans(cfg_p->refresh_p->trans_p);
378 isns_free(cfg_p->refresh_p);
382 cfg_p->refresh_p = task_p->var.init_refresh.ref_p;
383 cfg_p->refresh_p->trans_p = NULL;
386 rval = isns_change_kevent_list(cfg_p,
388 EV_ADD | EV_ENABLE, (int64_t)cfg_p->refresh_p->interval * 1000,
400 isns_new_task(struct isns_config_s *cfg_p, uint8_t task_type, int waitable)
411 task_p->cfg_p = cfg_p;
459 isns_taskq_insert_head(struct isns_config_s *cfg_p,
462 pthread_mutex_lock(&cfg_p->taskq_mutex);
463 SIMPLEQ_INSERT_HEAD(&cfg_p->taskq_head, task_p, taskq_entry);
464 pthread_mutex_unlock(&cfg_p->taskq_mutex);
471 isns_taskq_insert_tail(struct isns_config_s *cfg_p,
474 pthread_mutex_lock(&cfg_p->taskq_mutex);
475 SIMPLEQ_INSERT_TAIL(&cfg_p->taskq_head, task_p, taskq_entry);
476 pthread_mutex_unlock(&cfg_p->taskq_mutex);
483 isns_taskq_remove(struct isns_config_s *cfg_p)
487 pthread_mutex_lock(&cfg_p->taskq_mutex);
488 if ((task_p = SIMPLEQ_FIRST(&cfg_p->taskq_head)) != NULL)
489 SIMPLEQ_REMOVE_HEAD(&cfg_p->taskq_head, taskq_entry);
490 pthread_mutex_unlock(&cfg_p->taskq_mutex);
499 isns_taskq_remove_trans(struct isns_config_s *cfg_p, uint16_t trans_id)
505 pthread_mutex_lock(&cfg_p->taskq_mutex);
506 SIMPLEQ_FOREACH(task_p, &cfg_p->taskq_head, taskq_entry) {
514 SIMPLEQ_REMOVE(&cfg_p->taskq_head, task_p, isns_task_s,
517 pthread_mutex_unlock(&cfg_p->taskq_mutex);