summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pfinet/ethernet.c17
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);
+ }
+}
+