# HG changeset patch # User Louis Opter # Date 1337566163 -7200 # Node ID 71f76c0f235ffc0f8743ada95e73d57a13a1d982 # Parent 78f2f1918398ce2334c4a6c249ff66680552e2c6 Wip on the transmission diff -r 78f2f1918398 -r 71f76c0f235f e1000_initialize_transmission.patch --- 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).