view rathaxes_samples_e1000_add_alloc_sequences_in_socket.patch @ 119:d84bc9a46771

WIP, finally the alloc_skbuff method will be in the Ethernet subsystem since, the socket subsystem cannot depend on Ethernet (that would cause a circular dependency)
author Louis Opter <louis@lse.epita.fr>
date Fri, 26 Jul 2013 17:35:12 -0700
parents b22983cb9e3a
children cbd9b9a49b63
line wrap: on
line source

# HG changeset patch
# Parent 17641176926da447613bc9729bccf37d673276a0
rathaxes: add an alloc_rx_skbuff method to Ethernet::Device in e1000

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

diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti
--- a/rathaxes/samples/e1000/ethernet.rti
+++ b/rathaxes/samples/e1000/ethernet.rti
@@ -30,8 +30,10 @@
     {
         chunk       LKM::includes();
         decl        data_types();
+        pointcut    Ethernet::HardwareContext();
+
         method      init(Ethernet::AbstractDevice, PCI::AbstractDevice);
-        pointcut    Ethernet::HardwareContext();
+        method      alloc_rx_skbuff(Builtin::number, …);
 
         attribute   Device::AbstractDevice.ref      device;
         attribute   PCI::AbstractDevice.ref         pci_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, Builtin
 {
     /* The SKBuff type from the kernel */
     provided type   AbstractSKBuff
@@ -10,15 +10,15 @@
 
     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);
 
         attribute   Socket::AbstractSKBuff.ref      sk_buff;
         attribute   DMA::AbstractDMAHandle.scalar   dma_handle;