changeset 82:71f76c0f235f

Wip on the transmission
author Louis Opter <louis@lse.epitech.net>
date Mon, 21 May 2012 04:09:23 +0200
parents 78f2f1918398
children 27f0e70df342
files e1000_initialize_transmission.patch
diffstat 1 files changed, 43 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/e1000_initialize_transmission.patch	Sun May 20 07:51:04 2012 +0200
+++ b/e1000_initialize_transmission.patch	Mon May 21 04:09:23 2012 +0200
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent 675aa6c230476368c195b739218a4f18c2028325
+# Parent 1328cb41b1bb4d39588c1934c841b3e4362f7413
 rathaxes: initialize transmission on the e1000 sample:
 
 - This is documented in details in the sections 14.5 and 3.3 of the
@@ -8,17 +8,56 @@
 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
 --- a/rathaxes/samples/e1000/e1000.blt
 +++ b/rathaxes/samples/e1000/e1000.blt
-@@ -731,6 +731,14 @@
+@@ -34,6 +34,24 @@
+         }
+     }
+ 
++    template type   e1000:TxDescriptor()
++    {
++        chunk   LKM:includes()
++        {
++            typedef int ${e1000:TxDescriptor};
++
++            static const ${e1000:TxDescriptor} force_rtx_e1000_tx_descriptor_decl;
++        }
++
++        chunk   ::decl()
++        {
++            typedef struct rtx_e1000_tx_descriptor
++            {
++
++            }
++        }
++    }
++
+     /*
+      * Ring of e1000::RxDescriptors and their corresponding skbuffs.
+      *
+@@ -103,6 +121,7 @@
+ 
+                 /* we can't use the Rathaxes type here (#8) */
+                 struct rtx_e1000_rx_ring    rx_ring;
++                struct rtx_e1000_tx_ring    tx_ring;
+             } *rtx_e1000_ctx_p;
+         }
+ 
+@@ -736,6 +755,20 @@
              }
  
              /*
 +             * Transmission initialization (section 14.5):
 +             *
-+             * 1. Allocate the transmit descript ring and map it to make it
++             * 1. Allocate the transmit descriptors ring and map it to make it
 +             *    accessible by the device;
-+             * 2.
++             * 2. Write the start address of the ring in TDBAL/TDBAH and set
++             *    TDLEN to the size of the ring;
++             * 3. Set the TDH/TDT indexes to the beginning and end of the ring;
++             * 4. Set TCTL.PSP to pad short packets and TCTL.EN to enable the
++             *    transmitter.
 +             */
 +
++            /* 1. Allocate the tx ring */
++
 +            /*
               * XXX: We can't return here since we are not in a function but in
               * a chunk of code (injected in a function).