Lines Matching full:lp

58 	int (*open)(struct iss_net_private *lp);
59 void (*close)(struct iss_net_private *lp);
60 int (*read)(struct iss_net_private *lp, struct sk_buff **skb);
61 int (*write)(struct iss_net_private *lp, struct sk_buff **skb);
63 int (*poll)(struct iss_net_private *lp);
157 static int tuntap_open(struct iss_net_private *lp) in tuntap_open() argument
160 char *dev_name = lp->tp.info.tuntap.dev_name; in tuntap_open()
167 lp->dev->name, fd, errno); in tuntap_open()
178 lp->dev->name, dev_name, err, errno); in tuntap_open()
183 lp->tp.info.tuntap.fd = fd; in tuntap_open()
187 static void tuntap_close(struct iss_net_private *lp) in tuntap_close() argument
189 simc_close(lp->tp.info.tuntap.fd); in tuntap_close()
190 lp->tp.info.tuntap.fd = -1; in tuntap_close()
193 static int tuntap_read(struct iss_net_private *lp, struct sk_buff **skb) in tuntap_read() argument
195 return simc_read(lp->tp.info.tuntap.fd, in tuntap_read()
199 static int tuntap_write(struct iss_net_private *lp, struct sk_buff **skb) in tuntap_write() argument
201 return simc_write(lp->tp.info.tuntap.fd, (*skb)->data, (*skb)->len); in tuntap_write()
209 static int tuntap_poll(struct iss_net_private *lp) in tuntap_poll() argument
211 return simc_poll(lp->tp.info.tuntap.fd); in tuntap_poll()
227 static int tuntap_probe(struct iss_net_private *lp, int index, char *init) in tuntap_probe() argument
229 struct net_device *dev = lp->dev; in tuntap_probe()
257 strscpy(lp->tp.info.tuntap.dev_name, dev_name, in tuntap_probe()
258 sizeof(lp->tp.info.tuntap.dev_name)); in tuntap_probe()
262 lp->mtu = TRANSPORT_TUNTAP_MTU; in tuntap_probe()
264 lp->tp.info.tuntap.fd = -1; in tuntap_probe()
265 lp->tp.net_ops = &tuntap_ops; in tuntap_probe()
274 struct iss_net_private *lp = netdev_priv(dev); in iss_net_rx() local
280 if (lp->tp.net_ops->poll(lp) == 0) in iss_net_rx()
287 spin_lock_bh(&lp->lock); in iss_net_rx()
288 lp->stats.rx_dropped++; in iss_net_rx()
289 spin_unlock_bh(&lp->lock); in iss_net_rx()
299 pkt_len = lp->tp.net_ops->read(lp, &skb); in iss_net_rx()
304 skb->protocol = lp->tp.net_ops->protocol(skb); in iss_net_rx()
306 spin_lock_bh(&lp->lock); in iss_net_rx()
307 lp->stats.rx_bytes += skb->len; in iss_net_rx()
308 lp->stats.rx_packets++; in iss_net_rx()
309 spin_unlock_bh(&lp->lock); in iss_net_rx()
317 static int iss_net_poll(struct iss_net_private *lp) in iss_net_poll() argument
321 if (!netif_running(lp->dev)) in iss_net_poll()
324 while ((err = iss_net_rx(lp->dev)) > 0) in iss_net_poll()
329 lp->dev->name, err); in iss_net_poll()
330 dev_close(lp->dev); in iss_net_poll()
332 /* FIXME reactivate_fd(lp->fd, ISS_ETH_IRQ); */ in iss_net_poll()
341 struct iss_net_private *lp = from_timer(lp, t, timer); in iss_net_timer() local
343 iss_net_poll(lp); in iss_net_timer()
344 mod_timer(&lp->timer, jiffies + lp->timer_val); in iss_net_timer()
350 struct iss_net_private *lp = netdev_priv(dev); in iss_net_open() local
353 err = lp->tp.net_ops->open(lp); in iss_net_open()
366 timer_setup(&lp->timer, iss_net_timer, 0); in iss_net_open()
367 lp->timer_val = ISS_NET_TIMER_VALUE; in iss_net_open()
368 mod_timer(&lp->timer, jiffies + lp->timer_val); in iss_net_open()
375 struct iss_net_private *lp = netdev_priv(dev); in iss_net_close() local
378 del_timer_sync(&lp->timer); in iss_net_close()
379 lp->tp.net_ops->close(lp); in iss_net_close()
386 struct iss_net_private *lp = netdev_priv(dev); in iss_net_start_xmit() local
391 len = lp->tp.net_ops->write(lp, &skb); in iss_net_start_xmit()
394 spin_lock_bh(&lp->lock); in iss_net_start_xmit()
395 lp->stats.tx_packets++; in iss_net_start_xmit()
396 lp->stats.tx_bytes += skb->len; in iss_net_start_xmit()
397 spin_unlock_bh(&lp->lock); in iss_net_start_xmit()
406 spin_lock_bh(&lp->lock); in iss_net_start_xmit()
407 lp->stats.tx_dropped++; in iss_net_start_xmit()
408 spin_unlock_bh(&lp->lock); in iss_net_start_xmit()
424 struct iss_net_private *lp = netdev_priv(dev); in iss_net_get_stats64() local
426 spin_lock_bh(&lp->lock); in iss_net_get_stats64()
427 *stats = lp->stats; in iss_net_get_stats64()
428 spin_unlock_bh(&lp->lock); in iss_net_get_stats64()
472 struct iss_net_private *lp = in iss_net_pdev_release() local
475 free_netdev(lp->dev); in iss_net_pdev_release()
481 struct iss_net_private *lp; in iss_net_configure() local
483 dev = alloc_etherdev(sizeof(*lp)); in iss_net_configure()
491 lp = netdev_priv(dev); in iss_net_configure()
492 *lp = (struct iss_net_private) { in iss_net_configure()
497 spin_lock_init(&lp->lock); in iss_net_configure()
507 * Note: more protocols can be added by adding '&& !X_init(lp, eth)'. in iss_net_configure()
510 if (!tuntap_probe(lp, index, init)) { in iss_net_configure()
526 lp->pdev.id = index; in iss_net_configure()
527 lp->pdev.name = DRIVER_NAME; in iss_net_configure()
528 lp->pdev.dev.release = iss_net_pdev_release; in iss_net_configure()
529 if (platform_device_register(&lp->pdev)) in iss_net_configure()
531 SET_NETDEV_DEV(dev, &lp->pdev.dev); in iss_net_configure()
534 dev->mtu = lp->mtu; in iss_net_configure()
542 platform_device_unregister(&lp->pdev); in iss_net_configure()
548 timer_setup(&lp->tl, iss_net_user_timer_expire, 0); in iss_net_configure()