• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/pppd/solaris/

Lines Matching refs:us

139  * us by the streams framework.
145 * now use ppp_lower_lock to give us an existence guarantee on the
214 #define US_LASTMOD 8 /* no PPP modules below us */
597 upperstr_t *us, *ppa, *nps;
615 us = (upperstr_t *) q->q_ptr;
616 if (us == 0) {
621 DPRINT1("pppuwput/%d: mp = 0!\n", us->mn);
625 DPRINT1("pppuwput/%d: mp->b_datap = 0!\n", us->mn);
632 dlpi_request(q, mp, us);
637 if (us->flags & US_DBGLOG)
639 us->mn, msgdsize(mp), us->flags);
640 if (us->ppa == 0 || msgdsize(mp) > us->ppa->mtu + PPP_HDRLEN
642 || (us->flags & US_CONTROL) == 0
651 if ((us->flags & US_CONTROL) == 0 && !pass_packet(us, mp, 1))
654 if (!send_data(mp, us) && !putq(q, mp))
661 if (us->flags & US_DBGLOG)
663 us->mn, iop->ioc_cmd, iop->ioc_count);
667 us->flags |= US_RAWDATA;
672 if ((us->flags & US_CONTROL) == 0 || us->lowerq != 0)
675 DPRINT1("pppuwput/%d: ioctl I_LINK b_cont = 0!\n", us->mn);
681 DPRINT1("pppuwput/%d: ioctl I_LINK l_qbot = 0!\n", us->mn);
685 us->lowerq = lq;
687 RD(lq)->q_ptr = (caddr_t) us->q;
691 us->flags &= ~US_LASTMOD;
695 are now linked below us. */
696 putctl2(lq, M_CTL, PPPCTL_UNIT, us->ppa_id);
697 putctl4(lq, M_CTL, PPPCTL_MRU, us->mru);
698 putctl4(lq, M_CTL, PPPCTL_MTU, us->mtu);
715 DPRINT1("pppuwput/%d: ioctl I_UNLINK b_cont = 0!\n", us->mn);
720 if (us->lowerq != lb->l_qbot) {
722 us->lowerq, lb->l_qbot);
733 if (us->flags & US_CONTROL)
735 if ((us->flags & US_PRIV) == 0) {
762 if (iop->ioc_count != sizeof(int) || us->ppa != 0)
765 DPRINT1("pppuwput/%d: ioctl PPPIO_ATTACH b_cont = 0!\n", us->mn);
774 us->ppa = ppa;
784 if (iop->ioc_count != sizeof(int) || us->ppa == 0)
787 DPRINT1("pppuwput/%d: ioctl PPPIO_BIND b_cont = 0!\n", us->mn);
795 for (os = us->ppa; os != 0; os = os->next)
800 us->sap = n;
807 if (iop->ioc_count != sizeof(int) || (us->flags & US_CONTROL) == 0)
810 DPRINT1("pppuwput/%d: ioctl PPPIO_MRU b_cont = 0!\n", us->mn);
818 us->mru = n;
819 if (us->lowerq)
820 putctl4(us->lowerq, M_CTL, PPPCTL_MRU, n);
826 if (iop->ioc_count != sizeof(int) || (us->flags & US_CONTROL) == 0)
829 DPRINT1("pppuwput/%d: ioctl PPPIO_MTU b_cont = 0!\n", us->mn);
835 us->mtu = n;
838 us->ifstats.ifs_mtu = n;
840 if (us->lowerq)
841 putctl4(us->lowerq, M_CTL, PPPCTL_MTU, n);
847 us->flags |= US_LASTMOD;
855 DPRINT1("pppuwput/%d: ioctl PPPIO_DEBUG b_cont = 0!\n", us->mn);
864 DPRINT1("ppp/%d: debug log enabled\n", us->mn);
865 us->flags |= US_DBGLOG;
869 if (us->ppa == 0 || us->ppa->lowerq == 0)
871 putnext(us->ppa->lowerq, mp);
880 if ((us->flags & US_CONTROL) == 0)
883 DPRINT1("pppuwput/%d: ioctl PPPIO_NPMODE b_cont = 0!\n", us->mn);
887 for (nps = us->next; nps != 0; nps = nps->next) {
888 if (us->flags & US_DBGLOG)
889 DPRINT2("us = 0x%x, us->next->sap = 0x%x\n", nps, nps->sap);
894 if (us->flags & US_DBGLOG)
895 DPRINT2("ppp/%d: no stream for sap %x\n", us->mn, sap);
907 if ((ppa = us->ppa) == 0)
928 /* Sent from IP down to us. Attach the ifstats structure. */
929 if (iop->ioc_count != sizeof(struct ifreq) || us->ppa == 0)
939 us->ifname[i] = ifr->ifr_name[i];
941 us->ifname[i] = 0;
954 if (us->ppa->ppa_id != n)
956 ppa = us->ppa;
959 strncpy (ppa->ifname, us->ifname, IFNAMSIZ);
963 ppa->ifstats.ifs_active = us->state != DL_UNBOUND;
975 if (!(us->flags & US_CONTROL)) {
976 if (us->ppa)
977 us = us->ppa;
981 ((struct iocblk_in *)iop)->ioc_ifflags = us->ifflags;
986 if (!(us->flags & US_CONTROL)) {
987 if (us->ppa)
988 us = us->ppa;
992 us->ifflags = ((struct iocblk_in *)iop)->ioc_ifflags;
997 if (!(us->flags & US_CONTROL)) {
998 if (us->ppa)
999 us = us->ppa;
1003 us->ifflags |= IFF_RUNNING;
1019 dlpi_request(q, mq, us);
1035 if (us->ppa == 0 || us->ppa->lowerq == 0)
1037 us->ioc_id = iop->ioc_id;
1042 if (us->flags & US_LASTMOD) {
1046 putnext(us->ppa->lowerq, mp);
1049 if (us->flags & US_PRIV)
1050 putnext(us->ppa->lowerq, mp);
1071 if (us->flags & US_DBGLOG)
1072 DPRINT2("ppp/%d: flush %x\n", us->mn, *mp->b_rptr);
1091 dlpi_request(q, mp, us)
1094 upperstr_t *us;
1108 if (us->flags & US_DBGLOG)
1109 DPRINT3("ppp/%d: dlpi prim %x len=%d\n", us->mn,
1122 info->dl_max_sdu = us->ppa? us->ppa->mtu: PPP_MAXMTU;
1126 info->dl_current_state = us->state;
1139 if (us->state != DL_UNATTACHED || us->ppa != 0) {
1140 dlpi_error(q, us, DL_ATTACH_REQ, DL_OUTSTATE, 0);
1147 dlpi_error(q, us, DL_ATTACH_REQ, DL_BADPPA, 0);
1150 us->ppa = ppa;
1157 if (us->state != DL_UNBOUND || us->ppa == 0) {
1158 dlpi_error(q, us, DL_DETACH_REQ, DL_OUTSTATE, 0);
1167 if (us->state != DL_UNBOUND || us->ppa == 0) {
1168 dlpi_error(q, us, DL_BIND_REQ, DL_OUTSTATE, 0);
1174 dlpi_error(q, us, DL_BIND_REQ, DL_UNSUPPORTED, 0);
1182 us->req_sap = sap;
1185 if (us->flags & US_DBGLOG)
1186 DPRINT2("DL_BIND_REQ: ip gives sap = 0x%x, us = 0x%x", sap, us);
1195 DPRINT2("DL_BIND_REQ: unrecognized sap = 0x%x, us = 0x%x", sap, us);
1196 dlpi_error(q, us, DL_BIND_REQ, DL_BADADDR, 0);
1203 dlpi_error(q, us, DL_BIND_REQ, DL_BADADDR, 0);
1209 for (os = us->ppa; os != 0; os = os->next)
1213 dlpi_error(q, us, DL_BIND_REQ, DL_NOADDR, 0);
1217 us->sap = sap;
1218 us->state = DL_IDLE;
1238 if (us->state != DL_IDLE) {
1239 dlpi_error(q, us, DL_UNBIND_REQ, DL_OUTSTATE, 0);
1242 us->sap = -1;
1243 us->state = DL_UNBOUND;
1245 us->ppa->ifstats.ifs_active = 0;
1253 if (us->state != DL_IDLE) {
1254 dlpi_error(q, us, DL_UNITDATA_REQ, DL_OUTSTATE, 0);
1257 if ((ppa = us->ppa) == 0) {
1273 promisc_sendup(ppa, mp->b_cont, us->sap, 0);
1280 if (mp->b_datap->db_type == M_PROTO && us->sap == PPP_IP
1354 mp->b_rptr[2] = us->sap >> 8;
1355 mp->b_rptr[3] = us->sap;
1357 if (pass_packet(us, mp, 1)) {
1358 if (!send_data(mp, us) && !putq(q, mp))
1391 us->flags |= US_PROMISC;
1398 us->flags &= ~US_PROMISC;
1421 dlpi_error(q, us, d->dl_primitive, DL_NOTSUPPORTED, 0);
1428 dlpi_error(q, us, d->dl_primitive, DL_OUTSTATE, 0);
1432 dlpi_error(q, us, d->dl_primitive, DL_BADQOSTYPE, 0);
1442 if (us->flags & US_DBGLOG)
1446 dlpi_error(q, us, d->dl_primitive, DL_BADPRIM, 0);
1453 dlpi_error(q, us, prim, err, uerr)
1455 upperstr_t *us;
1461 if (us->flags & US_DBGLOG)
1462 DPRINT3("ppp/%d: dlpi error, prim=%x, err=%x\n", us->mn, prim, err);
1500 pass_packet(us, mp, outbound)
1501 upperstr_t *us;
1508 if ((ppa = us->ppa) == 0) {
1514 pass = ip_hard_filter(us, mp, outbound);
1547 send_data(mp, us)
1549 upperstr_t *us;
1553 if ((us->flags & US_BLOCKED) || us->npmode == NPMODE_QUEUE)
1555 ppa = us->ppa;
1556 if (ppa == 0 || us->npmode == NPMODE_DROP || us->npmode == NPMODE_ERROR) {
1557 if (us->flags & US_DBGLOG)
1558 DPRINT2("ppp/%d: dropping pkt (npmode=%d)\n", us->mn, us->npmode);
1593 us->flags |= US_BLOCKED;
1607 upperstr_t *us, *up, **usp;
1610 us = (upperstr_t *) q->q_ptr;
1611 if (us == 0) {
1622 us->ppa_id = ppa_id;
1623 us->ppa = us;
1624 us->next = 0;
1625 us->nextppa = *usp;
1626 *usp = us;
1627 us->flags |= US_CONTROL;
1628 us->npmode = NPMODE_PASS;
1630 us->mtu = PPP_MTU;
1631 us->mru = PPP_MRU;
1637 if (us->kstats == 0) {
1640 sprintf(unit, "ppp%d", us->ppa->ppa_id);
1641 us->kstats = kstat_create("ppp", us->ppa->ppa_id, unit,
1643 if (us->kstats != 0) {
1644 kstat_named_t *kn = KSTAT_NAMED_PTR(us->kstats);
1654 kstat_install(us->kstats);
1669 upperstr_t *us, *t;
1671 us = (upperstr_t *) q->q_ptr;
1672 if (us == 0) {
1678 us->state = DL_UNBOUND;
1680 for (t = us->ppa; t->next != 0; t = t->next)
1682 t->next = us;
1683 us->next = 0;
1701 upperstr_t *us, *t;
1703 us = (upperstr_t *) q->q_ptr;
1704 if (us == 0) {
1709 for (t = us->ppa; t->next != 0; t = t->next)
1710 if (t->next == us) {
1711 t->next = us->next;
1714 us->next = 0;
1715 us->ppa = 0;
1716 us->state = DL_UNATTACHED;
1732 upperstr_t *us;
1734 us = (upperstr_t *) q->q_ptr;
1735 if (us == 0) {
1741 us->lowerq->q_ptr = 0;
1742 RD(us->lowerq)->q_ptr = 0;
1743 us->lowerq = 0;
1747 qenable(us->q);
1757 upperstr_t *us, *as;
1760 us = (upperstr_t *) q->q_ptr;
1761 if (us == 0) {
1773 if (us->flags & US_CONTROL) {
1774 for (as = us->next; as != 0; as = as->next)
1779 us->flags &= ~US_BLOCKED;
1781 if (!send_data(mp, us)) {
1827 upperstr_t *ppa, *us;
1865 for (us = ppa; us != 0; us = us->next)
1866 if (us->ioc_id == iop->ioc_id)
1868 if (us == 0)
1871 putnext(us->q, mp);
1878 * us from using the control stream any more. Instead we
1917 if (proto < 0x8000 && (us = find_dest(ppa, proto)) != 0) {
1926 if (!pass_packet(us, mp, 0))
1928 if (!us->rblocked && !canput(us->q))
1929 us->rblocked = 1;
1930 if (!putq(us->rblocked ? q : us->q, mp))
1957 upperstr_t *us, *as;
1964 us = (upperstr_t *) q->q_ptr;
1965 if (us == 0) {
1970 if (us->flags & US_CONTROL) {
1976 if (us->lowerq == 0) {
1977 as = us;
1995 if (proto < 0x8000 && (as = find_dest(us, proto)) != 0) {
2010 for (as = us->next; as != 0; as = as->next)
2020 if (us->lowerq != 0)
2021 qenable(RD(us->lowerq));
2060 ((uint *)(ud + 1))[0] = us->req_sap; /* dest SAP */
2061 ((uint *)(ud + 1))[1] = us->req_sap; /* src SAP */
2070 * can process any packets for us that might have got queued
2073 if (us->ppa)
2074 qenable(us->ppa->q);
2085 upperstr_t *us;
2087 for (us = ppa->next; us != 0; us = us->next)
2088 if (proto == us->sap)
2090 return us;
2099 find_promisc(us, proto)
2100 upperstr_t *us;
2107 for ( ; us; us = us->next) {
2108 if ((us->flags & US_PROMISC) && (us->state == DL_IDLE))
2109 return us;
2119 prepend_ether(us, mp, proto)
2120 upperstr_t *us;
2150 prepend_udind(us, mp, proto)
2151 upperstr_t *us;
2377 upperstr_t *us;
2381 for (us = minor_devs; us != 0; us = us->nextmn) {
2382 uq = us->q;
2384 us->mn, uq, (uq? qsize(uq): 0));
2386 us->flags, "\020\1priv\2control\3blocked\4last");
2387 DPRINT3(" state=%x sap=%x req_sap=%x", us->state, us->sap,
2388 us->req_sap);
2389 if (us->ppa == 0)
2392 DPRINT1(" ppa=%d\n", us->ppa->ppa_id);
2393 if (us->flags & US_CONTROL) {
2394 lq = us->lowerq;
2396 us->ppa_id, lq, (lq? qsize(RD(lq)): 0));
2398 (lq? qsize(lq): 0), us->mru, us->mtu);
2436 ip_hard_filter(us, mp, outbound)
2437 upperstr_t *us;
2450 if (us->flags & US_DBGLOG)
2451 DPRINT3("ppp/%d: filter, proto=0x%x, out=%d\n", us->mn, proto, outbound);
2463 us->mn, hlen);
2476 us->mn, hlen);
2503 if (us->flags & US_DBGLOG)
2505 us->mn, pft->proto, pft->port);