From 45f0b7b92034e5d89a267a3cb2f1537240e5b7ee Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 17 Aug 1995 18:18:03 +0000 Subject: Formerly ethernet.c.~2~ --- pfinet/ethernet.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'pfinet') diff --git a/pfinet/ethernet.c b/pfinet/ethernet.c index 4f01b4ae..241467c8 100644 --- a/pfinet/ethernet.c +++ b/pfinet/ethernet.c @@ -19,7 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -device_t etherdevice; +device_t ether_port; +struct device *ether_dev; void ethernet_main_loop (void) @@ -27,13 +28,14 @@ ethernet_main_loop (void) error_t err; vm_address_t packet; vm_size_t packetlen; + struct sk_buff *skb; /* Listen to packets forever. When one arrives, it's an "interrupt", so drop to interrupt layer, and call the generic code. */ for (;;) { - err = device_read (etherdevice, 0, 0, vm_page_size, &packet, + err = device_read (ether_port, 0, 0, vm_page_size, &packet, &packetlen); if (err) { @@ -41,7 +43,16 @@ ethernet_main_loop (void) continue; } - + begin_interrupt (); + + skb = alloc_skb (packetlen, GFP_ATOMIC); + skb->len = packetlen; + skb->dev = ether_dev; + bcopy (packet, skb->data); + netif_rx (skb); + } +} + -- cgit v1.2.3