view rathaxes_samples_e1000_add_alloc_sequences_in_socket.patch @ 111:b072f682823d

Start a new series to refactor e1000::set_up_device
author Louis Opter <louis@lse.epita.fr>
date Sun, 14 Jul 2013 23:14:33 -0700
parents
children b22983cb9e3a
line wrap: on
line source

# HG changeset patch
# Parent 0082bea09b4bed6ed6215afb7a14d43a948cecd8
Add alloc_rx and alloc_tx in the Socket abstraction

This will help to hide platform dependent code from
e1000::set_up_device.


diff --git a/rathaxes/samples/e1000/socket.rti b/rathaxes/samples/e1000/socket.rti
--- a/rathaxes/samples/e1000/socket.rti
+++ b/rathaxes/samples/e1000/socket.rti
@@ -1,4 +1,4 @@
-interface Socket : LKM, Device
+interface Socket : LKM, Device, Ethernet, Builtin
 {
     /* The SKBuff type from the kernel */
     provided type   AbstractSKBuff
@@ -10,14 +10,24 @@
 
     provided type   SKBuff
     {
-        chunk       LKM::prototypes();
-        chunk       LKM::code();
-        decl        data_types();
-        method      init(Socket::AbstractSKBuff);
-        method      dump_infos();
-        method      map_to(Device::AbstractDevice);
-        method      map_from(Device::AbstractDevice);
-        method      unmap_to_and_free(Device::AbstractDevice);
-        method      unmap_from_and_free(Device::AbstractDevice);
+        chunk   LKM::prototypes();
+        chunk   LKM::code();
+        decl    data_types();
+        method  init(Socket::AbstractSKBuff);
+        method  dump_infos();
+        method  map_to(Device::AbstractDevice);
+        method  map_from(Device::AbstractDevice);
+        method  unmap_to_and_free(Device::AbstractDevice);
+        method  unmap_from_and_free(Device::AbstractDevice);
+    }
+
+    provided sequence   alloc_rx(Ethernet::Device, Builtin::number)
+    {
+        chunk   ::CALL();
+    }
+
+    provided sequence   alloc_tx(Ethernet::Device, Builtin::number)
+    {
+        chunk   ::CALL();
     }
 }