Lines Matching defs:login
76 * BASE 0xffff f001 0020 command port for login id 0
77 * BASE 0xffff f001 0040 command port for login id 1
208 struct sbp_targ_login *login;
265 sbp_targ_dealloc_login(struct sbp_targ_login *login)
269 if (login == NULL) {
270 printf("%s: login = NULL\n", __func__);
273 for (orbi = STAILQ_FIRST(&login->orbs); orbi != NULL; orbi = next) {
280 callout_stop(&login->hold_callout);
282 STAILQ_REMOVE(&login->lstate->logins, login, sbp_targ_login, link);
283 login->lstate->sc->logins[login->id] = NULL;
285 printf("%s: free login %p\n", __func__, login);
286 free((void *)login, M_SBP_TARG);
287 login = NULL;
293 struct sbp_targ_login *login;
295 login = (struct sbp_targ_login *)arg;
297 if (login->flags & F_HOLD) {
298 printf("%s: login_id=%d expired\n", __func__, login->id);
299 sbp_targ_dealloc_login(login);
301 printf("%s: login_id=%d not hold\n", __func__, login->id);
313 struct sbp_targ_login *login;
354 login = sc->logins[i];
355 if (login == NULL)
357 sbp_targ_abort(sc, STAILQ_FIRST(&login->orbs));
358 if (login->flags & F_LOGIN) {
359 login->flags |= F_HOLD;
360 callout_reset(&login->hold_callout,
361 hz * login->hold_sec,
362 sbp_targ_hold_expire, (void *)login);
482 struct sbp_targ_login *login, *next;
510 for (login = STAILQ_FIRST(&lstate->logins); login != NULL;
511 login = next) {
512 next = STAILQ_NEXT(login, link);
513 sbp_targ_dealloc_login(login);
544 sbp_targ_remove_orb_info_locked(struct sbp_targ_login *login, struct orb_info *orbi)
546 STAILQ_REMOVE(&login->orbs, orbi, orb_info, link);
550 sbp_targ_remove_orb_info(struct sbp_targ_login *login, struct orb_info *orbi)
553 STAILQ_REMOVE(&login->orbs, orbi, orb_info, link);
574 struct sbp_targ_login *login;
577 login = lstate->sc->logins[init_id];
578 if (login == NULL) {
579 printf("%s: no such login\n", __func__);
582 STAILQ_FOREACH(orbi, &login->orbs, link)
608 sbp_targ_remove_orb_info_locked(orbi->login, orbi);
650 sbp_targ_remove_orb_info(orbi->login, orbi);
727 sbp_targ_remove_orb_info_locked(orbi->login, norbi);
814 orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/1);
854 sbp_targ_remove_orb_info(orbi->login, orbi);
881 orbi->login->fifo_hi, orbi->login->fifo_lo,
1006 sbp_targ_remove_orb_info(orbi->login, orbi);
1029 orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/1);
1218 sbp_targ_remove_orb_info_locked(orbi->login, orbi);
1289 struct sbp_targ_login *login;
1294 STAILQ_FOREACH(login, &lstate->logins, link)
1295 if ((login->flags & F_ATIO_STARVED) != 0) {
1296 login->flags &= ~F_ATIO_STARVED;
1298 login->fwdev,
1299 login->last_hi, login->last_lo,
1300 login, FETCH_CMD);
1448 orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/1);
1458 sbp_targ_remove_orb_info(orbi->login, orbi);
1480 atio->ccb_h.target_lun = orbi->login->lstate->lun;
1484 atio->init_id = orbi->login->id;
1525 orb[0], orb[1], orbi->login, FETCH_CMD);
1528 orbi->login->flags &= ~F_LINK_ACTIVE;
1547 struct sbp_targ_login *login;
1552 STAILQ_FOREACH(login, &lstate->logins, link)
1553 if (login->fwdev == fwdev)
1554 return (login);
1564 login = (struct sbp_targ_login *)malloc(
1567 if (login == NULL) {
1572 login->id = i;
1573 login->fwdev = fwdev;
1574 login->lstate = lstate;
1575 login->last_hi = 0xffff;
1576 login->last_lo = 0xffffffff;
1577 login->hold_sec = 1;
1578 STAILQ_INIT(&login->orbs);
1579 CALLOUT_INIT(&login->hold_callout);
1580 sc->logins[i] = login;
1581 return (login);
1588 struct sbp_targ_login *login;
1605 orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/0);
1645 /* allocate login */
1646 login = sbp_targ_get_login(orbi->sc, orbi->fwdev, lun);
1647 if (login == NULL) {
1655 printf("%s: login id=%d\n", __func__, login->id);
1657 login->fifo_hi = orb[6];
1658 login->fifo_lo = orb[7];
1659 login->loginres.len = htons(sizeof(uint32_t) * 4);
1660 login->loginres.id = htons(login->id);
1661 login->loginres.cmd_hi = htons(SBP_TARG_BIND_HI);
1662 login->loginres.cmd_lo = htonl(SBP_TARG_BIND_LO(login->id));
1663 login->loginres.recon_hold = htons(login->hold_sec);
1665 STAILQ_INSERT_TAIL(&lstate->logins, login, link);
1667 sizeof(struct sbp_login_res), (void *)&login->loginres,
1673 login = orbi->sc->logins[orb4->id];
1674 if (login != NULL && login->fwdev == orbi->fwdev) {
1675 login->flags &= ~F_HOLD;
1676 callout_stop(&login->hold_callout);
1678 __func__, login->id);
1687 login = orbi->sc->logins[orb4->id];
1688 if (login->fwdev != orbi->fwdev) {
1692 sbp_targ_dealloc_login(login);
1723 sbp_targ_fetch_orb(orbi->login->lstate->sc, orbi->fwdev,
1724 (uint16_t)orb0, orb1, orbi->login, FETCH_CMD);
1733 uint16_t orb_hi, uint32_t orb_lo, struct sbp_targ_login *login,
1747 orbi->login = login;
1762 login->last_hi = orb_hi;
1763 login->last_lo = orb_lo;
1764 login->flags |= F_LINK_ACTIVE;
1768 SLIST_FIRST(&login->lstate->accept_tios);
1772 login->lstate->flags |= F_ATIO_STARVED;
1773 login->flags |= F_ATIO_STARVED;
1776 login->fwdev = fwdev;
1780 SLIST_REMOVE_HEAD(&login->lstate->accept_tios, sim_links.sle);
1781 STAILQ_INSERT_TAIL(&login->orbs, orbi, link);
1789 login->flags |= F_LINK_ACTIVE;
1820 struct sbp_targ_login *login;
1828 login = sc->logins[login_id];
1829 if (login == NULL)
1832 if (login->fwdev != fwdev) {
1841 if ((login->flags & F_LINK_ACTIVE) != 0) {
1849 login, FETCH_CMD);
1854 login->last_hi = 0xffff;
1855 login->last_lo = 0xffffffff;
1856 sbp_targ_abort(sc, STAILQ_FIRST(&login->orbs));
1861 if (login->last_hi == 0xffff &&
1862 login->last_lo == 0xffffffff) {
1867 if ((login->flags & F_LINK_ACTIVE) != 0) {
1873 login->last_hi, login->last_lo,
1874 login, FETCH_POINTER);