• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/ppp-2.4.4/modules/

Lines Matching defs: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 */
595 upperstr_t *us, *ppa, *nps;
613 us = (upperstr_t *) q->q_ptr;
614 if (us == 0) {
619 DPRINT1("pppuwput/%d: mp = 0!\n", us->mn);
623 DPRINT1("pppuwput/%d: mp->b_datap = 0!\n", us->mn);
630 dlpi_request(q, mp, us);
635 if (us->flags & US_DBGLOG)
637 us->mn, msgdsize(mp), us->flags);
638 if (us->ppa == 0 || msgdsize(mp) > us->ppa->mtu + PPP_HDRLEN
640 || (us->flags & US_CONTROL) == 0
648 if ((us->flags & US_CONTROL) == 0 && !pass_packet(us, mp, 1))
651 if (!send_data(mp, us))
658 if (us->flags & US_DBGLOG)
660 us->mn, iop->ioc_cmd, iop->ioc_count);
664 us->flags |= US_RAWDATA;
669 if ((us->flags & US_CONTROL) == 0 || us->lowerq != 0)
672 DPRINT1("pppuwput/%d: ioctl I_LINK b_cont = 0!\n", us->mn);
678 DPRINT1("pppuwput/%d: ioctl I_LINK l_qbot = 0!\n", us->mn);
682 us->lowerq = lq;
684 RD(lq)->q_ptr = (caddr_t) us->q;
688 us->flags &= ~US_LASTMOD;
692 are now linked below us. */
693 putctl2(lq, M_CTL, PPPCTL_UNIT, us->ppa_id);
694 putctl4(lq, M_CTL, PPPCTL_MRU, us->mru);
695 putctl4(lq, M_CTL, PPPCTL_MTU, us->mtu);
712 DPRINT1("pppuwput/%d: ioctl I_UNLINK b_cont = 0!\n", us->mn);
717 if (us->lowerq != lb->l_qbot) {
719 us->lowerq, lb->l_qbot);
729 if (us->flags & US_CONTROL)
731 if ((us->flags & US_PRIV) == 0) {
757 if (iop->ioc_count != sizeof(int) || us->ppa != 0)
760 DPRINT1("pppuwput/%d: ioctl PPPIO_ATTACH b_cont = 0!\n", us->mn);
769 us->ppa = ppa;
778 if (iop->ioc_count != sizeof(int) || us->ppa == 0)
781 DPRINT1("pppuwput/%d: ioctl PPPIO_BIND b_cont = 0!\n", us->mn);
789 for (os = us->ppa; os != 0; os = os->next)
794 us->sap = n;
801 if (iop->ioc_count != sizeof(int) || (us->flags & US_CONTROL) == 0)
804 DPRINT1("pppuwput/%d: ioctl PPPIO_MRU b_cont = 0!\n", us->mn);
812 us->mru = n;
813 if (us->lowerq)
814 putctl4(us->lowerq, M_CTL, PPPCTL_MRU, n);
820 if (iop->ioc_count != sizeof(int) || (us->flags & US_CONTROL) == 0)
823 DPRINT1("pppuwput/%d: ioctl PPPIO_MTU b_cont = 0!\n", us->mn);
829 us->mtu = n;
832 us->ifstats.ifs_mtu = n;
834 if (us->lowerq)
835 putctl4(us->lowerq, M_CTL, PPPCTL_MTU, n);
841 us->flags |= US_LASTMOD;
849 DPRINT1("pppuwput/%d: ioctl PPPIO_DEBUG b_cont = 0!\n", us->mn);
858 DPRINT1("ppp/%d: debug log enabled\n", us->mn);
859 us->flags |= US_DBGLOG;
863 if (us->ppa == 0 || us->ppa->lowerq == 0)
865 putnext(us->ppa->lowerq, mp);
873 if ((us->flags & US_CONTROL) == 0)
876 DPRINT1("pppuwput/%d: ioctl PPPIO_NPMODE b_cont = 0!\n", us->mn);
880 for (nps = us->next; nps != 0; nps = nps->next) {
881 if (us->flags & US_DBGLOG)
882 DPRINT2("us = 0x%x, us->next->sap = 0x%x\n", nps, nps->sap);
887 if (us->flags & US_DBGLOG)
888 DPRINT2("ppp/%d: no stream for sap %x\n", us->mn, sap);
900 if ((ppa = us->ppa) == 0)
921 /* Sent from IP down to us. Attach the ifstats structure. */
922 if (iop->ioc_count != sizeof(struct ifreq) || us->ppa == 0)
932 us->ifname[i] = ifr->ifr_name[i];
934 us->ifname[i] = 0;
947 if (us->ppa->ppa_id != n)
949 ppa = us->ppa;
952 strncpy (ppa->ifname, us->ifname, IFNAMSIZ);
956 ppa->ifstats.ifs_active = us->state != DL_UNBOUND;
968 if (!(us->flags & US_CONTROL)) {
969 if (us->ppa)
970 us = us->ppa;
974 ((struct iocblk_in *)iop)->ioc_ifflags = us->ifflags;
979 if (!(us->flags & US_CONTROL)) {
980 if (us->ppa)
981 us = us->ppa;
985 us->ifflags = ((struct iocblk_in *)iop)->ioc_ifflags;
990 if (!(us->flags & US_CONTROL)) {
991 if (us->ppa)
992 us = us->ppa;
996 us->ifflags |= IFF_RUNNING;
1012 dlpi_request(q, mq, us);
1027 if (us->ppa == 0 || us->ppa->lowerq == 0)
1029 us->ioc_id = iop->ioc_id;
1034 if (us->flags & US_LASTMOD) {
1038 putnext(us->ppa->lowerq, mp);
1041 if (us->flags & US_PRIV)
1042 putnext(us->ppa->lowerq, mp);
1063 if (us->flags & US_DBGLOG)
1064 DPRINT2("ppp/%d: flush %x\n", us->mn, *mp->b_rptr);
1083 dlpi_request(q, mp, us)
1086 upperstr_t *us;
1100 if (us->flags & US_DBGLOG)
1101 DPRINT3("ppp/%d: dlpi prim %x len=%d\n", us->mn,
1114 info->dl_max_sdu = us->ppa? us->ppa->mtu: PPP_MAXMTU;
1118 info->dl_current_state = us->state;
1131 if (us->state != DL_UNATTACHED || us->ppa != 0) {
1132 dlpi_error(q, us, DL_ATTACH_REQ, DL_OUTSTATE, 0);
1139 dlpi_error(q, us, DL_ATTACH_REQ, DL_BADPPA, 0);
1142 us->ppa = ppa;
1149 if (us->state != DL_UNBOUND || us->ppa == 0) {
1150 dlpi_error(q, us, DL_DETACH_REQ, DL_OUTSTATE, 0);
1159 if (us->state != DL_UNBOUND || us->ppa == 0) {
1160 dlpi_error(q, us, DL_BIND_REQ, DL_OUTSTATE, 0);
1166 dlpi_error(q, us, DL_BIND_REQ, DL_UNSUPPORTED, 0);
1174 us->req_sap = sap;
1177 if (us->flags & US_DBGLOG)
1178 DPRINT2("DL_BIND_REQ: ip gives sap = 0x%x, us = 0x%x", sap, us);
1187 DPRINT2("DL_BIND_REQ: unrecognized sap = 0x%x, us = 0x%x", sap, us);
1188 dlpi_error(q, us, DL_BIND_REQ, DL_BADADDR, 0);
1195 dlpi_error(q, us, DL_BIND_REQ, DL_BADADDR, 0);
1201 for (os = us->ppa; os != 0; os = os->next)
1205 dlpi_error(q, us, DL_BIND_REQ, DL_NOADDR, 0);
1209 us->sap = sap;
1210 us->state = DL_IDLE;
1230 if (us->state != DL_IDLE) {
1231 dlpi_error(q, us, DL_UNBIND_REQ, DL_OUTSTATE, 0);
1234 us->sap = -1;
1235 us->state = DL_UNBOUND;
1237 us->ppa->ifstats.ifs_active = 0;
1245 if (us->state != DL_IDLE) {
1246 dlpi_error(q, us, DL_UNITDATA_REQ, DL_OUTSTATE, 0);
1249 if ((ppa = us->ppa) == 0) {
1265 promisc_sendup(ppa, mp->b_cont, us->sap, 0);
1272 if (mp->b_datap->db_type == M_PROTO && us->sap == PPP_IP
1346 mp->b_rptr[2] = us->sap >> 8;
1347 mp->b_rptr[3] = us->sap;
1348 if (pass_packet(us, mp, 1)) {
1349 if (!send_data(mp, us))
1382 us->flags |= US_PROMISC;
1389 us->flags &= ~US_PROMISC;
1412 dlpi_error(q, us, d->dl_primitive, DL_NOTSUPPORTED, 0);
1419 dlpi_error(q, us, d->dl_primitive, DL_OUTSTATE, 0);
1423 dlpi_error(q, us, d->dl_primitive, DL_BADQOSTYPE, 0);
1436 dlpi_error(q, us, d->dl_primitive, DL_BADPRIM, 0);
1443 dlpi_error(q, us, prim, err, uerr)
1445 upperstr_t *us;
1451 if (us->flags & US_DBGLOG)
1452 DPRINT3("ppp/%d: dlpi error, prim=%x, err=%x\n", us->mn, prim, err);
1487 pass_packet(us, mp, outbound)
1488 upperstr_t *us;
1495 if ((ppa = us->ppa) == 0) {
1501 pass = ip_hard_filter(us, mp, outbound);
1534 send_data(mp, us)
1536 upperstr_t *us;
1540 if ((us->flags & US_BLOCKED) || us->npmode == NPMODE_QUEUE)
1542 ppa = us->ppa;
1543 if (ppa == 0 || us->npmode == NPMODE_DROP || us->npmode == NPMODE_ERROR) {
1544 if (us->flags & US_DBGLOG)
1545 DPRINT2("ppp/%d: dropping pkt (npmode=%d)\n", us->mn, us->npmode);
1580 us->flags |= US_BLOCKED;
1594 upperstr_t *us, *up, **usp;
1597 us = (upperstr_t *) q->q_ptr;
1598 if (us == 0) {
1609 us->ppa_id = ppa_id;
1610 us->ppa = us;
1611 us->next = 0;
1612 us->nextppa = *usp;
1613 *usp = us;
1614 us->flags |= US_CONTROL;
1615 us->npmode = NPMODE_PASS;
1617 us->mtu = PPP_MTU;
1618 us->mru = PPP_MRU;
1624 if (us->kstats == 0) {
1627 sprintf(unit, "ppp%d", us->ppa->ppa_id);
1628 us->kstats = kstat_create("ppp", us->ppa->ppa_id, unit,
1630 if (us->kstats != 0) {
1631 kstat_named_t *kn = KSTAT_NAMED_PTR(us->kstats);
1641 kstat_install(us->kstats);
1656 upperstr_t *us, *t;
1658 us = (upperstr_t *) q->q_ptr;
1659 if (us == 0) {
1665 us->state = DL_UNBOUND;
1667 for (t = us->ppa; t->next != 0; t = t->next)
1669 t->next = us;
1670 us->next = 0;
1686 upperstr_t *us, *t;
1688 us = (upperstr_t *) q->q_ptr;
1689 if (us == 0) {
1694 for (t = us->ppa; t->next != 0; t = t->next)
1695 if (t->next == us) {
1696 t->next = us->next;
1699 us->next = 0;
1700 us->ppa = 0;
1702 us->state = DL_UNATTACHED;
1717 upperstr_t *us;
1719 us = (upperstr_t *) q->q_ptr;
1720 if (us == 0) {
1726 us->lowerq->q_ptr = 0;
1727 RD(us->lowerq)->q_ptr = 0;
1728 us->lowerq = 0;
1732 qenable(us->q);
1742 upperstr_t *us, *as;
1745 us = (upperstr_t *) q->q_ptr;
1746 if (us == 0) {
1758 if (us->flags & US_CONTROL) {
1759 for (as = us->next; as != 0; as = as->next)
1764 us->flags &= ~US_BLOCKED;
1766 if (!send_data(mp, us)) {
1812 upperstr_t *ppa, *us;
1850 for (us = ppa; us != 0; us = us->next)
1851 if (us->ioc_id == iop->ioc_id)
1853 if (us == 0)
1856 putnext(us->q, mp);
1863 * us from using the control stream any more. Instead we
1903 if (proto < 0x8000 && (us = find_dest(ppa, proto)) != 0) {
1911 if (!pass_packet(us, mp, 0))
1913 if (!us->rblocked && !canput(us->q))
1914 us->rblocked = 1;
1915 if (!us->rblocked)
1916 putq(us->q, mp);
1941 upperstr_t *us, *as;
1948 us = (upperstr_t *) q->q_ptr;
1949 if (us == 0) {
1954 if (us->flags & US_CONTROL) {
1960 if (us->lowerq == 0) {
1961 as = us;
1979 if (proto < 0x8000 && (as = find_dest(us, proto)) != 0) {
1993 for (as = us->next; as != 0; as = as->next)
2003 if (us->lowerq != 0)
2004 qenable(RD(us->lowerq));
2043 ((uint *)(ud + 1))[0] = us->req_sap; /* dest SAP */
2044 ((uint *)(ud + 1))[1] = us->req_sap; /* src SAP */
2053 * can process any packets for us that might have got queued
2056 if (us->ppa)
2057 qenable(us->ppa->q);
2068 upperstr_t *us;
2070 for (us = ppa->next; us != 0; us = us->next)
2071 if (proto == us->sap)
2073 return us;
2082 find_promisc(us, proto)
2083 upperstr_t *us;
2090 for ( ; us; us = us->next) {
2091 if ((us->flags & US_PROMISC) && (us->state == DL_IDLE))
2092 return us;
2102 prepend_ether(us, mp, proto)
2103 upperstr_t *us;
2133 prepend_udind(us, mp, proto)
2134 upperstr_t *us;
2358 upperstr_t *us;
2362 for (us = minor_devs; us != 0; us = us->nextmn) {
2363 uq = us->q;
2365 us->mn, uq, (uq? qsize(uq): 0));
2367 us->flags, "\020\1priv\2control\3blocked\4last");
2368 DPRINT3(" state=%x sap=%x req_sap=%x", us->state, us->sap,
2369 us->req_sap);
2370 if (us->ppa == 0)
2373 DPRINT1(" ppa=%d\n", us->ppa->ppa_id);
2374 if (us->flags & US_CONTROL) {
2375 lq = us->lowerq;
2377 us->ppa_id, lq, (lq? qsize(RD(lq)): 0));
2379 (lq? qsize(lq): 0), us->mru, us->mtu);
2414 ip_hard_filter(us, mp, outbound)
2415 upperstr_t *us;
2428 if (us->flags & US_DBGLOG)
2429 DPRINT3("ppp/%d: filter, proto=0x%x, out=%d\n", us->mn, proto, outbound);
2441 us->mn, hlen);
2454 us->mn, hlen);
2481 if (us->flags & US_DBGLOG)
2483 us->mn, pft->proto, pft->port);