• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/src/router/ppp/solaris/

Lines Matching refs:us

131  * us by the streams framework.
137 * now use ppp_lower_lock to give us an existence guarantee on the
206 #define US_LASTMOD 8 /* no PPP modules below us */
587 upperstr_t *us, *ppa, *nps;
605 us = (upperstr_t *) q->q_ptr;
606 if (us == 0) {
611 DPRINT1("pppuwput/%d: mp = 0!\n", us->mn);
615 DPRINT1("pppuwput/%d: mp->b_datap = 0!\n", us->mn);
622 dlpi_request(q, mp, us);
627 if (us->flags & US_DBGLOG)
629 us->mn, msgdsize(mp), us->flags);
630 if (us->ppa == 0 || msgdsize(mp) > us->ppa->mtu + PPP_HDRLEN
632 || (us->flags & US_CONTROL) == 0
640 if ((us->flags & US_CONTROL) == 0 && !pass_packet(us, mp, 1))
643 if (!send_data(mp, us))
650 if (us->flags & US_DBGLOG)
652 us->mn, iop->ioc_cmd, iop->ioc_count);
656 us->flags |= US_RAWDATA;
661 if ((us->flags & US_CONTROL) == 0 || us->lowerq != 0)
664 DPRINT1("pppuwput/%d: ioctl I_LINK b_cont = 0!\n", us->mn);
670 DPRINT1("pppuwput/%d: ioctl I_LINK l_qbot = 0!\n", us->mn);
674 us->lowerq = lq;
676 RD(lq)->q_ptr = (caddr_t) us->q;
680 us->flags &= ~US_LASTMOD;
684 are now linked below us. */
685 putctl2(lq, M_CTL, PPPCTL_UNIT, us->ppa_id);
686 putctl4(lq, M_CTL, PPPCTL_MRU, us->mru);
687 putctl4(lq, M_CTL, PPPCTL_MTU, us->mtu);
704 DPRINT1("pppuwput/%d: ioctl I_UNLINK b_cont = 0!\n", us->mn);
709 if (us->lowerq != lb->l_qbot) {
711 us->lowerq, lb->l_qbot);
721 if (us->flags & US_CONTROL)
723 if ((us->flags & US_PRIV) == 0) {
749 if (iop->ioc_count != sizeof(int) || us->ppa != 0)
752 DPRINT1("pppuwput/%d: ioctl PPPIO_ATTACH b_cont = 0!\n", us->mn);
761 us->ppa = ppa;
770 if (iop->ioc_count != sizeof(int) || us->ppa == 0)
773 DPRINT1("pppuwput/%d: ioctl PPPIO_BIND b_cont = 0!\n", us->mn);
781 for (os = us->ppa; os != 0; os = os->next)
786 us->sap = n;
793 if (iop->ioc_count != sizeof(int) || (us->flags & US_CONTROL) == 0)
796 DPRINT1("pppuwput/%d: ioctl PPPIO_MRU b_cont = 0!\n", us->mn);
804 us->mru = n;
805 if (us->lowerq)
806 putctl4(us->lowerq, M_CTL, PPPCTL_MRU, n);
812 if (iop->ioc_count != sizeof(int) || (us->flags & US_CONTROL) == 0)
815 DPRINT1("pppuwput/%d: ioctl PPPIO_MTU b_cont = 0!\n", us->mn);
821 us->mtu = n;
824 us->ifstats.ifs_mtu = n;
826 if (us->lowerq)
827 putctl4(us->lowerq, M_CTL, PPPCTL_MTU, n);
833 us->flags |= US_LASTMOD;
841 DPRINT1("pppuwput/%d: ioctl PPPIO_DEBUG b_cont = 0!\n", us->mn);
850 DPRINT1("ppp/%d: debug log enabled\n", us->mn);
851 us->flags |= US_DBGLOG;
855 if (us->ppa == 0 || us->ppa->lowerq == 0)
857 putnext(us->ppa->lowerq, mp);
865 if ((us->flags & US_CONTROL) == 0)
868 DPRINT1("pppuwput/%d: ioctl PPPIO_NPMODE b_cont = 0!\n", us->mn);
872 for (nps = us->next; nps != 0; nps = nps->next) {
873 if (us->flags & US_DBGLOG)
874 DPRINT2("us = 0x%x, us->next->sap = 0x%x\n", nps, nps->sap);
879 if (us->flags & US_DBGLOG)
880 DPRINT2("ppp/%d: no stream for sap %x\n", us->mn, sap);
891 if ((ppa = us->ppa) == 0)
912 /* Sent from IP down to us. Attach the ifstats structure. */
913 if (iop->ioc_count != sizeof(struct ifreq) || us->ppa == 0)
923 us->ifname[i] = ifr->ifr_name[i];
925 us->ifname[i] = 0;
938 if (us->ppa->ppa_id != n)
940 ppa = us->ppa;
943 strncpy (ppa->ifname, us->ifname, IFNAMSIZ);
947 ppa->ifstats.ifs_active = us->state != DL_UNBOUND;
959 if (!(us->flags & US_CONTROL)) {
960 if (us->ppa)
961 us = us->ppa;
965 ((struct iocblk_in *)iop)->ioc_ifflags = us->ifflags;
970 if (!(us->flags & US_CONTROL)) {
971 if (us->ppa)
972 us = us->ppa;
976 us->ifflags = ((struct iocblk_in *)iop)->ioc_ifflags;
981 if (!(us->flags & US_CONTROL)) {
982 if (us->ppa)
983 us = us->ppa;
987 us->ifflags |= IFF_RUNNING;
1003 dlpi_request(q, mq, us);
1018 if (us->ppa == 0 || us->ppa->lowerq == 0)
1020 us->ioc_id = iop->ioc_id;
1025 if (us->flags & US_LASTMOD) {
1029 putnext(us->ppa->lowerq, mp);
1032 if (us->flags & US_PRIV)
1033 putnext(us->ppa->lowerq, mp);
1054 if (us->flags & US_DBGLOG)
1055 DPRINT2("ppp/%d: flush %x\n", us->mn, *mp->b_rptr);
1074 dlpi_request(q, mp, us)
1077 upperstr_t *us;
1091 if (us->flags & US_DBGLOG)
1092 DPRINT3("ppp/%d: dlpi prim %x len=%d\n", us->mn,
1105 info->dl_max_sdu = us->ppa? us->ppa->mtu: PPP_MAXMTU;
1109 info->dl_current_state = us->state;
1122 if (us->state != DL_UNATTACHED || us->ppa != 0) {
1123 dlpi_error(q, us, DL_ATTACH_REQ, DL_OUTSTATE, 0);
1130 dlpi_error(q, us, DL_ATTACH_REQ, DL_BADPPA, 0);
1133 us->ppa = ppa;
1140 if (us->state != DL_UNBOUND || us->ppa == 0) {
1141 dlpi_error(q, us, DL_DETACH_REQ, DL_OUTSTATE, 0);
1150 if (us->state != DL_UNBOUND || us->ppa == 0) {
1151 dlpi_error(q, us, DL_BIND_REQ, DL_OUTSTATE, 0);
1158 us->req_sap = sap;
1161 if (us->flags & US_DBGLOG)
1162 DPRINT2("DL_BIND_REQ: ip gives sap = 0x%x, us = 0x%x", sap, us);
1171 DPRINT2("DL_BIND_REQ: unrecognized sap = 0x%x, us = 0x%x", sap, us);
1172 dlpi_error(q, us, DL_BIND_REQ, DL_BADADDR, 0);
1179 dlpi_error(q, us, DL_BIND_REQ, DL_BADADDR, 0);
1185 for (os = us->ppa; os != 0; os = os->next)
1189 dlpi_error(q, us, DL_BIND_REQ, DL_NOADDR, 0);
1193 us->sap = sap;
1194 us->state = DL_IDLE;
1214 if (us->state != DL_IDLE) {
1215 dlpi_error(q, us, DL_UNBIND_REQ, DL_OUTSTATE, 0);
1218 us->sap = -1;
1219 us->state = DL_UNBOUND;
1221 us->ppa->ifstats.ifs_active = 0;
1229 if (us->state != DL_IDLE) {
1230 dlpi_error(q, us, DL_UNITDATA_REQ, DL_OUTSTATE, 0);
1233 if ((ppa = us->ppa) == 0) {
1249 promisc_sendup(ppa, mp->b_cont, us->sap, 0);
1256 if (mp->b_datap->db_type == M_PROTO && us->sap == PPP_IP
1328 mp->b_rptr[2] = us->sap >> 8;
1329 mp->b_rptr[3] = us->sap;
1330 if (pass_packet(us, mp, 1)) {
1331 if (!send_data(mp, us))
1364 us->flags |= US_PROMISC;
1371 us->flags &= ~US_PROMISC;
1394 dlpi_error(q, us, d->dl_primitive, DL_NOTSUPPORTED, 0);
1401 dlpi_error(q, us, d->dl_primitive, DL_OUTSTATE, 0);
1405 dlpi_error(q, us, d->dl_primitive, DL_BADQOSTYPE, 0);
1418 dlpi_error(q, us, d->dl_primitive, DL_BADPRIM, 0);
1425 dlpi_error(q, us, prim, err, uerr)
1427 upperstr_t *us;
1433 if (us->flags & US_DBGLOG)
1434 DPRINT3("ppp/%d: dlpi error, prim=%x, err=%x\n", us->mn, prim, err);
1469 pass_packet(us, mp, outbound)
1470 upperstr_t *us;
1477 if ((ppa = us->ppa) == 0) {
1483 pass = ip_hard_filter(us, mp, outbound);
1516 send_data(mp, us)
1518 upperstr_t *us;
1522 if ((us->flags & US_BLOCKED) || us->npmode == NPMODE_QUEUE)
1524 ppa = us->ppa;
1525 if (ppa == 0 || us->npmode == NPMODE_DROP || us->npmode == NPMODE_ERROR) {
1526 if (us->flags & US_DBGLOG)
1527 DPRINT2("ppp/%d: dropping pkt (npmode=%d)\n", us->mn, us->npmode);
1562 us->flags |= US_BLOCKED;
1576 upperstr_t *us, *up, **usp;
1579 us = (upperstr_t *) q->q_ptr;
1580 if (us == 0) {
1591 us->ppa_id = ppa_id;
1592 us->ppa = us;
1593 us->next = 0;
1594 us->nextppa = *usp;
1595 *usp = us;
1596 us->flags |= US_CONTROL;
1597 us->npmode = NPMODE_PASS;
1599 us->mtu = PPP_MTU;
1600 us->mru = PPP_MRU;
1606 if (us->kstats == 0) {
1609 sprintf(unit, "ppp%d", us->ppa->ppa_id);
1610 us->kstats = kstat_create("ppp", us->ppa->ppa_id, unit,
1612 if (us->kstats != 0) {
1613 kstat_named_t *kn = KSTAT_NAMED_PTR(us->kstats);
1623 kstat_install(us->kstats);
1638 upperstr_t *us, *t;
1640 us = (upperstr_t *) q->q_ptr;
1641 if (us == 0) {
1647 us->state = DL_UNBOUND;
1649 for (t = us->ppa; t->next != 0; t = t->next)
1651 t->next = us;
1652 us->next = 0;
1668 upperstr_t *us, *t;
1670 us = (upperstr_t *) q->q_ptr;
1671 if (us == 0) {
1676 for (t = us->ppa; t->next != 0; t = t->next)
1677 if (t->next == us) {
1678 t->next = us->next;
1681 us->next = 0;
1682 us->ppa = 0;
1684 us->state = DL_UNATTACHED;
1699 upperstr_t *us;
1701 us = (upperstr_t *) q->q_ptr;
1702 if (us == 0) {
1708 us->lowerq->q_ptr = 0;
1709 RD(us->lowerq)->q_ptr = 0;
1710 us->lowerq = 0;
1714 qenable(us->q);
1724 upperstr_t *us, *as;
1727 us = (upperstr_t *) q->q_ptr;
1728 if (us == 0) {
1740 if (us->flags & US_CONTROL) {
1741 for (as = us->next; as != 0; as = as->next)
1746 us->flags &= ~US_BLOCKED;
1748 if (!send_data(mp, us)) {
1794 upperstr_t *ppa, *us;
1832 for (us = ppa; us != 0; us = us->next)
1833 if (us->ioc_id == iop->ioc_id)
1835 if (us == 0)
1838 putnext(us->q, mp);
1845 * us from using the control stream any more. Instead we
1885 if (proto < 0x8000 && (us = find_dest(ppa, proto)) != 0) {
1886 if (!pass_packet(us, mp, 0))
1888 if (!us->rblocked && !canput(us->q))
1889 us->rblocked = 1;
1890 if (!us->rblocked)
1891 putq(us->q, mp);
1916 upperstr_t *us, *as;
1923 us = (upperstr_t *) q->q_ptr;
1924 if (us == 0) {
1929 if (us->flags & US_CONTROL) {
1935 if (us->lowerq == 0) {
1936 as = us;
1954 if (proto < 0x8000 && (as = find_dest(us, proto)) != 0) {
1968 for (as = us->next; as != 0; as = as->next)
1972 if (us->lowerq != 0)
1973 qenable(RD(us->lowerq));
2011 ((uint *)(ud + 1))[0] = us->req_sap; /* dest SAP */
2012 ((uint *)(ud + 1))[1] = us->req_sap; /* src SAP */
2021 * can process any packets for us that might have got queued
2024 if (us->ppa)
2025 qenable(us->ppa->q);
2036 upperstr_t *us;
2038 for (us = ppa->next; us != 0; us = us->next)
2039 if (proto == us->sap)
2041 return us;
2050 find_promisc(us, proto)
2051 upperstr_t *us;
2058 for ( ; us; us = us->next) {
2059 if ((us->flags & US_PROMISC) && (us->state == DL_IDLE))
2060 return us;
2070 prepend_ether(us, mp, proto)
2071 upperstr_t *us;
2101 prepend_udind(us, mp, proto)
2102 upperstr_t *us;
2326 upperstr_t *us;
2330 for (us = minor_devs; us != 0; us = us->nextmn) {
2331 uq = us->q;
2333 us->mn, uq, (uq? qsize(uq): 0));
2335 us->flags, "\020\1priv\2control\3blocked\4last");
2336 DPRINT3(" state=%x sap=%x req_sap=%x", us->state, us->sap,
2337 us->req_sap);
2338 if (us->ppa == 0)
2341 DPRINT1(" ppa=%d\n", us->ppa->ppa_id);
2342 if (us->flags & US_CONTROL) {
2343 lq = us->lowerq;
2345 us->ppa_id, lq, (lq? qsize(RD(lq)): 0));
2347 (lq? qsize(lq): 0), us->mru, us->mtu);
2382 ip_hard_filter(us, mp, outbound)
2383 upperstr_t *us;
2396 if (us->flags & US_DBGLOG)
2397 DPRINT3("ppp/%d: filter, proto=0x%x, out=%d\n", us->mn, proto, outbound);
2409 us->mn, hlen);
2422 us->mn, hlen);
2449 if (us->flags & US_DBGLOG)
2451 us->mn, pft->proto, pft->port);