Lines Matching refs:lp

31 static void isdn_ppp_push_higher(isdn_net_dev *net_dev, isdn_net_local *lp,
37 static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
41 static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
67 static int isdn_ppp_mp_init(isdn_net_local *lp, ippp_bundle *add_to);
68 static void isdn_ppp_mp_receive(isdn_net_dev *net_dev, isdn_net_local *lp,
70 static void isdn_ppp_mp_cleanup(isdn_net_local *lp);
105 * in this case we bind another lp to the master device
108 isdn_ppp_free(isdn_net_local *lp)
112 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
114 __func__, lp->ppp_slot);
119 spin_lock(&lp->netdev->pb->lock);
121 isdn_net_rm_from_bundle(lp);
123 if (lp->netdev->pb->ref_ct == 1) /* last link in queue? */
124 isdn_ppp_mp_cleanup(lp);
126 lp->netdev->pb->ref_ct--;
127 spin_unlock(&lp->netdev->pb->lock);
129 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
131 __func__, lp->ppp_slot);
134 is = ippp_table[lp->ppp_slot];
136 isdn_ppp_closewait(lp->ppp_slot); /* force wakeup on ippp device */
141 printk(KERN_DEBUG "isdn_ppp_free %d %lx %lx\n", lp->ppp_slot, (long) lp, (long) is->lp);
143 is->lp = NULL; /* link is down .. set lp to NULL */
144 lp->ppp_slot = -1; /* is this OK ?? */
156 isdn_ppp_bind(isdn_net_local *lp)
163 if (lp->pppbind < 0) { /* device bounded to ippp device ? */
168 isdn_net_local *lp = net_dev->local;
169 if (lp->pppbind >= 0)
170 exclusive[lp->pppbind] = 1;
183 if (ippp_table[i]->minor == lp->pppbind &&
195 unit = isdn_ppp_if_get_unit(lp->netdev->dev->name);
198 lp->netdev->dev->name);
203 lp->ppp_slot = i;
205 is->lp = lp;
209 retval = isdn_ppp_mp_init(lp, NULL);
214 retval = lp->ppp_slot;
226 isdn_ppp_wakeup_daemon(isdn_net_local *lp)
228 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
230 __func__, lp->ppp_slot);
233 ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK;
234 wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
305 is->lp = NULL;
351 printk(KERN_DEBUG "ippp: release, minor: %d %lx\n", min, (long) is->lp);
353 if (is->lp) { /* a lp address says: this link is still up */
354 isdn_net_dev *p = is->lp->netdev;
357 printk(KERN_ERR "%s: no lp->netdev\n", __func__);
363 * isdn_ppp_free() sets is->lp to NULL and lp->ppp_slot to -1
475 isdn_net_local *lp;
480 lp = is->lp;
507 if (!lp)
509 if ((r = set_arg(argp, lp->netdev->dev->name,
510 strlen(lp->netdev->dev->name))))
531 if (lp) {
534 netif_wake_queue(lp->netdev->dev);
541 if (lp) {
543 pidle.xmit_idle = pidle.recv_idle = lp->huptimer;
612 if (lp)
614 strncpy(pci.local_num, lp->msn, 63);
615 if (lp->dial) {
616 strncpy(pci.remote_num, lp->dial->num, 63);
618 pci.charge_units = lp->charge;
619 if (lp->outgoing)
623 if (lp->flags & ISDN_NET_CALLBACK)
824 isdn_net_local *lp;
834 lp = is->lp;
838 if (!lp)
839 printk(KERN_DEBUG "isdn_ppp_write: lp == NULL\n");
849 lp->huptimer = 0;
851 if (lp->isdn_device < 0 || lp->isdn_channel < 0)
854 if ((dev->drv[lp->isdn_device]->flags & DRV_FLAG_RUNNING) &&
855 lp->dialstate == 0 &&
856 (lp->flags & ISDN_NET_CONNECTED)) {
864 hl = dev->drv[lp->isdn_device]->interface->hl_hdrlen;
878 isdn_ppp_frame_log("xmit", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
881 isdn_ppp_send_ccp(lp->netdev, lp, skb); /* keeps CCP/compression states in sync */
883 isdn_net_write_super(lp, skb);
994 void isdn_ppp_receive(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
1002 slot = lp->ppp_slot;
1004 printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot(%d)\n",
1005 lp->ppp_slot);
1012 printk(KERN_DEBUG "ippp_receive: is:%08lx lp:%08lx slot:%d unit:%d len:%d\n",
1013 (long)is, (long)lp, lp->ppp_slot, is->unit, (int)skb->len);
1014 isdn_ppp_frame_log("receive", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
1036 isdn_ppp_mp_receive(net_dev, lp, skb);
1041 isdn_ppp_push_higher(net_dev, lp, skb, proto);
1050 isdn_ppp_push_higher(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb, int proto)
1057 slot = lp->ppp_slot;
1059 printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot(%d)\n",
1060 lp->ppp_slot);
1065 if (lp->master) { // FIXME?
1066 mlp = ISDN_MASTER_PRIV(lp);
1070 lp->ppp_slot);
1078 isdn_ppp_frame_log("rpush", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
1149 isdn_ppp_receive_ccp(net_dev, lp, skb, proto);
1157 isdn_ppp_fill_rq(skb->data, skb->len, proto, lp->ppp_slot); /* push data to pppd device */
1185 lp->huptimer = 0;
1191 lp->huptimer = 0;
1242 isdn_net_local *lp, *mlp;
1249 nd = mlp->netdev; /* get master lp */
1253 printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
1281 lp = isdn_net_get_locked_lp(nd);
1282 if (!lp) {
1287 /* we have our lp locked from now on */
1289 slot = lp->ppp_slot;
1291 printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
1292 lp->ppp_slot);
1331 lp->huptimer = 0;
1335 lp->huptimer = 0;
1341 isdn_ppp_frame_log("xmit0", skb->data, skb->len, 32, ipts->unit, lp->ppp_slot);
1352 hl = dev->drv[lp->isdn_device]->interface->hl_hdrlen + IPPP_MAX_HEADER;
1468 isdn_ppp_frame_log("xmit", skb->data, skb->len, 32, ipt->unit, lp->ppp_slot);
1471 isdn_net_writebuf_skb(lp, skb);
1474 spin_unlock_bh(&lp->xmit_lock);
1484 int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
1486 struct ippp_struct *is = ippp_table[lp->ppp_slot];
1571 static int isdn_ppp_mp_init(isdn_net_local *lp, ippp_bundle *add_to)
1575 if (lp->ppp_slot < 0) {
1576 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
1577 __func__, lp->ppp_slot);
1581 is = ippp_table[lp->ppp_slot];
1583 if (lp->netdev->pb)
1584 lp->netdev->pb->ref_ct--;
1585 lp->netdev->pb = add_to;
1588 if ((lp->netdev->pb = isdn_ppp_mp_bundle_alloc()) == NULL)
1590 lp->next = lp->last = lp; /* nobody else in a queue */
1591 lp->netdev->pb->frags = NULL;
1592 lp->netdev->pb->frames = 0;
1593 lp->netdev->pb->seq = UINT_MAX;
1595 lp->netdev->pb->ref_ct++;
1605 static void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp,
1610 static void isdn_ppp_mp_receive(isdn_net_dev *net_dev, isdn_net_local *lp,
1625 slot = lp->ppp_slot;
1627 printk(KERN_ERR "%s: lp->ppp_slot(%d)\n",
1628 __func__, lp->ppp_slot);
1639 isdn_ppp_mp_print_recv_pkt(lp->ppp_slot, skb);
1761 isdn_ppp_mp_reassembly(net_dev, lp, start, nextf);
1831 static void isdn_ppp_mp_cleanup(isdn_net_local *lp)
1833 struct sk_buff *frag = lp->netdev->pb->frags;
1837 isdn_ppp_mp_free_skb(lp->netdev->pb, frag);
1840 lp->netdev->pb->frags = NULL;
1889 void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp,
1897 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
1898 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
1899 __func__, lp->ppp_slot);
1903 if (ippp_table[lp->ppp_slot]->debug & 0x40)
1916 if (ippp_table[lp->ppp_slot]->debug & 0x40)
1939 isdn_ppp_push_higher(net_dev, lp, skb, proto);
1961 isdn_net_local *lp, *nlp;
1974 nlp = is->lp;
1975 lp = p->queue;
1977 lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
1980 nlp->ppp_slot : lp->ppp_slot);
1987 ippp_table[nlp->ppp_slot]->unit = ippp_table[lp->ppp_slot]->unit;
1990 ippp_table[nlp->ppp_slot]->pppcfg |= ippp_table[lp->ppp_slot]->pppcfg &
1992 ippp_table[nlp->ppp_slot]->mpppcfg |= ippp_table[lp->ppp_slot]->mpppcfg &
2011 isdn_net_local *lp = netdev_priv(dev);
2020 t.p.ppp_ipackets = lp->stats.rx_packets;
2021 t.p.ppp_ibytes = lp->stats.rx_bytes;
2022 t.p.ppp_ierrors = lp->stats.rx_errors;
2023 t.p.ppp_opackets = lp->stats.tx_packets;
2024 t.p.ppp_obytes = lp->stats.tx_bytes;
2025 t.p.ppp_oerrors = lp->stats.tx_errors;
2050 isdn_net_local *lp = netdev_priv(dev);
2053 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
2065 error = isdn_ppp_dev_ioctl_stats(lp->ppp_slot, ifr, dev);
2106 isdn_net_local *lp;
2111 lp = ndev->local;
2112 if (!(lp->flags & ISDN_NET_CONNECTED))
2115 sdev = lp->slave;
2137 isdn_net_local *lp;
2142 lp = ndev->local;
2143 if (!(lp->flags & ISDN_NET_CONNECTED))
2146 sdev = lp->slave;
2180 isdn_ppp_fill_rq(NULL, 0, PPP_COMP, is->lp->ppp_slot);
2226 isdn_net_local *lp = is->lp;
2229 hl = dev->drv[lp->isdn_device]->interface->hl_hdrlen;
2263 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
2265 isdn_net_write_super(lp, skb);
2666 static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
2676 lp->ppp_slot);
2677 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
2678 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
2679 __func__, lp->ppp_slot);
2682 is = ippp_table[lp->ppp_slot];
2683 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
2685 if (lp->master) {
2686 int slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
2843 static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
2846 int proto, slot = lp->ppp_slot;
2852 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
2870 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
2872 if (lp->master) {
2873 slot = ISDN_MASTER_PRIV(lp)->ppp_slot;