comparison e1000_initialize_transmission.patch @ 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
comparison
equal deleted inserted replaced
81:78f2f1918398 82:71f76c0f235f
1 # HG changeset patch 1 # HG changeset patch
2 # Parent 675aa6c230476368c195b739218a4f18c2028325 2 # Parent 1328cb41b1bb4d39588c1934c841b3e4362f7413
3 rathaxes: initialize transmission on the e1000 sample: 3 rathaxes: initialize transmission on the e1000 sample:
4 4
5 - This is documented in details in the sections 14.5 and 3.3 of the 5 - This is documented in details in the sections 14.5 and 3.3 of the
6 Intel Gigabit Controller Software Developer manual. 6 Intel Gigabit Controller Software Developer manual.
7 7
8 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt 8 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
9 --- a/rathaxes/samples/e1000/e1000.blt 9 --- a/rathaxes/samples/e1000/e1000.blt
10 +++ b/rathaxes/samples/e1000/e1000.blt 10 +++ b/rathaxes/samples/e1000/e1000.blt
11 @@ -731,6 +731,14 @@ 11 @@ -34,6 +34,24 @@
12 }
13 }
14
15 + template type e1000:TxDescriptor()
16 + {
17 + chunk LKM:includes()
18 + {
19 + typedef int ${e1000:TxDescriptor};
20 +
21 + static const ${e1000:TxDescriptor} force_rtx_e1000_tx_descriptor_decl;
22 + }
23 +
24 + chunk ::decl()
25 + {
26 + typedef struct rtx_e1000_tx_descriptor
27 + {
28 +
29 + }
30 + }
31 + }
32 +
33 /*
34 * Ring of e1000::RxDescriptors and their corresponding skbuffs.
35 *
36 @@ -103,6 +121,7 @@
37
38 /* we can't use the Rathaxes type here (#8) */
39 struct rtx_e1000_rx_ring rx_ring;
40 + struct rtx_e1000_tx_ring tx_ring;
41 } *rtx_e1000_ctx_p;
42 }
43
44 @@ -736,6 +755,20 @@
12 } 45 }
13 46
14 /* 47 /*
15 + * Transmission initialization (section 14.5): 48 + * Transmission initialization (section 14.5):
16 + * 49 + *
17 + * 1. Allocate the transmit descript ring and map it to make it 50 + * 1. Allocate the transmit descriptors ring and map it to make it
18 + * accessible by the device; 51 + * accessible by the device;
19 + * 2. 52 + * 2. Write the start address of the ring in TDBAL/TDBAH and set
53 + * TDLEN to the size of the ring;
54 + * 3. Set the TDH/TDT indexes to the beginning and end of the ring;
55 + * 4. Set TCTL.PSP to pad short packets and TCTL.EN to enable the
56 + * transmitter.
20 + */ 57 + */
58 +
59 + /* 1. Allocate the tx ring */
21 + 60 +
22 + /* 61 + /*
23 * XXX: We can't return here since we are not in a function but in 62 * XXX: We can't return here since we are not in a function but in
24 * a chunk of code (injected in a function). 63 * a chunk of code (injected in a function).
25 */ 64 */