Mercurial > archived > louis > epitech > mq > rathaxes
annotate 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 |
rev | line source |
---|---|
81
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
1 # HG changeset patch |
82 | 2 # Parent 1328cb41b1bb4d39588c1934c841b3e4362f7413 |
81
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
3 rathaxes: initialize transmission on the e1000 sample: |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
4 |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
5 - This is documented in details in the sections 14.5 and 3.3 of the |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
6 Intel Gigabit Controller Software Developer manual. |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
7 |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
8 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
9 --- a/rathaxes/samples/e1000/e1000.blt |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
10 +++ b/rathaxes/samples/e1000/e1000.blt |
82 | 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 @@ | |
81
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
45 } |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
46 |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
47 /* |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
48 + * Transmission initialization (section 14.5): |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
49 + * |
82 | 50 + * 1. Allocate the transmit descriptors ring and map it to make it |
81
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
51 + * accessible by the device; |
82 | 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. | |
81
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
57 + */ |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
58 + |
82 | 59 + /* 1. Allocate the tx ring */ |
60 + | |
81
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
61 + /* |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
62 * XXX: We can't return here since we are not in a function but in |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
63 * a chunk of code (injected in a function). |
78f2f1918398
Push the rx init, start a patch for the tx init
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
64 */ |