Lines Matching refs:lstate
223 struct ahc_tmode_lstate *lstate,
3937 struct ahc_tmode_lstate* lstate; in ahc_parse_msg() local
3939 lstate = tstate->enabled_luns[devinfo->lun]; in ahc_parse_msg()
3940 if (lstate != NULL) { in ahc_parse_msg()
3941 ahc_queue_lstate_event(ahc, lstate, in ahc_parse_msg()
3945 ahc_send_lstate_events(ahc, lstate); in ahc_parse_msg()
4318 struct ahc_tmode_lstate* lstate; in ahc_handle_devreset() local
4320 lstate = tstate->enabled_luns[lun]; in ahc_handle_devreset()
4321 if (lstate == NULL) in ahc_handle_devreset()
4324 ahc_queue_lstate_event(ahc, lstate, devinfo->our_scsiid, in ahc_handle_devreset()
4326 ahc_send_lstate_events(ahc, lstate); in ahc_handle_devreset()
4497 struct ahc_tmode_lstate *lstate; in ahc_free() local
4499 lstate = tstate->enabled_luns[j]; in ahc_free()
4500 if (lstate != NULL) { in ahc_free()
4501 xpt_free_path(lstate->path); in ahc_free()
4502 kfree(lstate); in ahc_free()
6537 struct ahc_tmode_lstate* lstate; in ahc_reset_channel() local
6539 lstate = tstate->enabled_luns[lun]; in ahc_reset_channel()
6540 if (lstate == NULL) in ahc_reset_channel()
6543 ahc_queue_lstate_event(ahc, lstate, CAM_TARGET_WILDCARD, in ahc_reset_channel()
6545 ahc_send_lstate_events(ahc, lstate); in ahc_reset_channel()
6676 ahc_queue_lstate_event(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate, in ahc_queue_lstate_event() argument
6682 xpt_freeze_devq(lstate->path, /*count*/1); in ahc_queue_lstate_event()
6683 if (lstate->event_w_idx >= lstate->event_r_idx) in ahc_queue_lstate_event()
6684 pending = lstate->event_w_idx - lstate->event_r_idx; in ahc_queue_lstate_event()
6687 - (lstate->event_r_idx - lstate->event_w_idx); in ahc_queue_lstate_event()
6697 lstate->event_r_idx = 0; in ahc_queue_lstate_event()
6698 lstate->event_w_idx = 0; in ahc_queue_lstate_event()
6699 xpt_release_devq(lstate->path, pending, /*runqueue*/FALSE); in ahc_queue_lstate_event()
6703 xpt_print_path(lstate->path); in ahc_queue_lstate_event()
6705 lstate->event_buffer[lstate->event_r_idx].event_type, in ahc_queue_lstate_event()
6706 lstate->event_buffer[lstate->event_r_idx].event_arg); in ahc_queue_lstate_event()
6707 lstate->event_r_idx++; in ahc_queue_lstate_event()
6708 if (lstate->event_r_idx == AHC_TMODE_EVENT_BUFFER_SIZE) in ahc_queue_lstate_event()
6709 lstate->event_r_idx = 0; in ahc_queue_lstate_event()
6710 xpt_release_devq(lstate->path, /*count*/1, /*runqueue*/FALSE); in ahc_queue_lstate_event()
6713 event = &lstate->event_buffer[lstate->event_w_idx]; in ahc_queue_lstate_event()
6717 lstate->event_w_idx++; in ahc_queue_lstate_event()
6718 if (lstate->event_w_idx == AHC_TMODE_EVENT_BUFFER_SIZE) in ahc_queue_lstate_event()
6719 lstate->event_w_idx = 0; in ahc_queue_lstate_event()
6727 ahc_send_lstate_events(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate) in ahc_send_lstate_events() argument
6732 while (lstate->event_r_idx != lstate->event_w_idx in ahc_send_lstate_events()
6733 && (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) { in ahc_send_lstate_events()
6736 event = &lstate->event_buffer[lstate->event_r_idx]; in ahc_send_lstate_events()
6737 SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); in ahc_send_lstate_events()
6752 lstate->event_r_idx++; in ahc_send_lstate_events()
6753 if (lstate->event_r_idx == AHC_TMODE_EVENT_BUFFER_SIZE) in ahc_send_lstate_events()
6754 lstate->event_r_idx = 0; in ahc_send_lstate_events()
7286 struct ahc_tmode_lstate **lstate, in ahc_find_tmode_devs() argument
7300 *lstate = ahc->black_hole; in ahc_find_tmode_devs()
7312 *lstate = NULL; in ahc_find_tmode_devs()
7314 *lstate = in ahc_find_tmode_devs()
7318 if (notfound_failure != 0 && *lstate == NULL) in ahc_find_tmode_devs()
7328 struct ahc_tmode_lstate *lstate; in ahc_handle_en_lun() local
7339 status = ahc_find_tmode_devs(ahc, sim, ccb, &tstate, &lstate, in ahc_handle_en_lun()
7460 if (lstate != NULL) { in ahc_handle_en_lun()
7491 lstate = kzalloc(sizeof(*lstate), GFP_ATOMIC); in ahc_handle_en_lun()
7492 if (lstate == NULL) { in ahc_handle_en_lun()
7498 status = xpt_create_path(&lstate->path, /*periph*/NULL, in ahc_handle_en_lun()
7503 kfree(lstate); in ahc_handle_en_lun()
7509 SLIST_INIT(&lstate->accept_tios); in ahc_handle_en_lun()
7510 SLIST_INIT(&lstate->immed_notifies); in ahc_handle_en_lun()
7514 tstate->enabled_luns[lun] = lstate; in ahc_handle_en_lun()
7565 ahc->black_hole = lstate; in ahc_handle_en_lun()
7584 if (lstate == NULL) { in ahc_handle_en_lun()
7605 if (SLIST_FIRST(&lstate->accept_tios) != NULL) { in ahc_handle_en_lun()
7610 if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { in ahc_handle_en_lun()
7622 xpt_free_path(lstate->path); in ahc_handle_en_lun()
7623 kfree(lstate); in ahc_handle_en_lun()
7792 struct ahc_tmode_lstate *lstate; in ahc_handle_target_cmd() local
7805 lstate = NULL; in ahc_handle_target_cmd()
7807 lstate = tstate->enabled_luns[lun]; in ahc_handle_target_cmd()
7812 if (lstate == NULL) in ahc_handle_target_cmd()
7813 lstate = ahc->black_hole; in ahc_handle_target_cmd()
7815 atio = (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios); in ahc_handle_target_cmd()
7829 lstate == ahc->black_hole ? "(Black Holed)" : ""); in ahc_handle_target_cmd()
7831 SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle); in ahc_handle_target_cmd()
7833 if (lstate == ahc->black_hole) { in ahc_handle_target_cmd()
7893 ahc->pending_device = lstate; in ahc_handle_target_cmd()