view rathaxes_samples_e1000_add_alloc_sequences_in_socket.patch @ 115:5a663f8f0e54

WIP, fix another small bug in rathaxes sequence calls
author Louis Opter <louis@lse.epita.fr>
date Mon, 22 Jul 2013 13:52:00 -0700
parents b22983cb9e3a
children d84bc9a46771
line wrap: on
line source

# HG changeset patch
# Parent 9f743313820393d900d65aa6f2532c7d820de04b
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, DMA
+interface Socket : LKM, Device, DMA, Ethernet, Builtin
 {
     /* The SKBuff type from the kernel */
     provided type   AbstractSKBuff
@@ -10,15 +10,25 @@
 
     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();
 
         attribute   Socket::AbstractSKBuff.ref      k_sk_buff;
         attribute   DMA::AbstractDMAHandle.scalar   k_dma_handle;