diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-08-17 18:18:03 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-08-17 18:18:03 +0000 |
commit | 45f0b7b92034e5d89a267a3cb2f1537240e5b7ee (patch) | |
tree | 8c8f0f11bd205d2814e307e85c7764af13e361e8 /pfinet | |
parent | df1a6442d470db1cc6cdf38f7ed74f4e98e00c86 (diff) |
Formerly ethernet.c.~2~
Diffstat (limited to 'pfinet')
-rw-r--r-- | pfinet/ethernet.c | 17 |
1 files changed, 14 insertions, 3 deletions
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); + } +} + |