Mercurial > archived > louis > epitech > mq > rathaxes
annotate e1000_implement_the_frame_transmission_chunk.patch @ 87:e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Mon, 24 Sep 2012 09:13:15 +0200 |
parents | c99e69966dd3 |
children | 8ffcdd6aa410 |
rev | line source |
---|---|
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
1 # HG changeset patch |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
2 # Parent 87ba2a19a59fb7be346ad40a57439b6b752b152e |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
3 rathaxes: start to queue up packets in the TX ring on the e1000 sample |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
4 |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
5 diff --git a/rathaxes/samples/e1000/CMakeLists.txt b/rathaxes/samples/e1000/CMakeLists.txt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
6 --- a/rathaxes/samples/e1000/CMakeLists.txt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
7 +++ b/rathaxes/samples/e1000/CMakeLists.txt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
8 @@ -1,6 +1,22 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
9 -ADD_RATHAXES_SOURCES(e1000_src lkm.rtx |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
10 - RTI builtin.rti log.rti lkm.rti pci.rti socket.rti ethernet.rti e1000.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
11 - BLT log.blt lkm.blt pci.blt socket.blt ethernet.blt e1000.blt) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
12 +ADD_RATHAXES_SOURCES(e1000_src |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
13 + lkm.rtx |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
14 + RTI |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
15 + builtin.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
16 + log.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
17 + lkm.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
18 + device.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
19 + pci.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
20 + socket.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
21 + ethernet.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
22 + e1000.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
23 + BLT |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
24 + log.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
25 + lkm.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
26 + pci.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
27 + device.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
28 + socket.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
29 + ethernet.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
30 + e1000.blt) |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
31 |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
32 IF (LINUX_KBUILD_DIR) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
33 ADD_RATHAXES_LKM(e1000 e1000_src) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
34 diff --git a/rathaxes/samples/e1000/device.blt b/rathaxes/samples/e1000/device.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
35 new file mode 100644 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
36 --- /dev/null |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
37 +++ b/rathaxes/samples/e1000/device.blt |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
38 @@ -0,0 +1,25 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
39 +with Device, LKM |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
40 +{ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
41 + template type Device::Device() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
42 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
43 + chunk LKM::includes() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
44 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
45 + #include <linux/device.h> |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
46 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
47 + static const ${Device::Device} force_rtx_device_decl; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
48 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
49 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
50 + chunk decl() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
51 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
52 + typedef struct device *rtx_device_p; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
53 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
54 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
55 + chunk init() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
56 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
57 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
58 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
59 + map |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
60 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
61 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
62 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
63 +} |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
64 diff --git a/rathaxes/samples/e1000/device.rti b/rathaxes/samples/e1000/device.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
65 new file mode 100644 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
66 --- /dev/null |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
67 +++ b/rathaxes/samples/e1000/device.rti |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
68 @@ -0,0 +1,9 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
69 +interface Device : LKM |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
70 +{ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
71 + provided type Device |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
72 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
73 + chunk LKM::includes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
74 + method decl(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
75 + method init(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
76 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
77 +} |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
78 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
79 --- a/rathaxes/samples/e1000/e1000.blt |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
80 +++ b/rathaxes/samples/e1000/e1000.blt |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
81 @@ -110,9 +110,9 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
82 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
83 unsigned int size; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
84 struct rtx_e1000_rx_descriptor *base; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
85 - void* /* dma_addr_t */ dma_base; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
86 + dma_addr_t dma_base; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
87 struct sk_buff *skbuffs[256 /* ${config.rx_ring_size} */]; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
88 - void* /* dma_addr_t */ dma_skbuffs[256 /* ${config.rx_ring_size} */]; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
89 + dma_addr_t dma_skbuffs[256 /* ${config.rx_ring_size} */]; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
90 }; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
91 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
92 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
93 @@ -148,11 +148,59 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
94 struct rtx_e1000_tx_ring |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
95 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
96 unsigned int size; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
97 + /* We should probably use ${e1000::TxDescriptor} here: */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
98 struct rtx_e1000_tx_descriptor *base; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
99 - void* /* dma_addr_t */ dma_base; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
100 + dma_addr_t dma_base; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
101 + /* indexes on base */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
102 + unsigned int head; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
103 + unsigned int tail; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
104 }; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
105 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
106 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
107 + chunk LKM::prototypes() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
108 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
109 + static unsigned int rtx_e1000_tx_ring_descriptors_remaining(struct rtx_e1000_tx_ring *); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
110 + static int rtx_e1000_tx_ring_tso_cksum_offload(struct rtx_e1000_tx_ring *, struct rtx_socket_skbuff *); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
111 + static int rtx_e1000_tx_ring_put(struct rtx_e1000_tx_ring *, struct rtx_socket_skbuff *); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
112 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
113 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
114 + chunk LKM::code() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
115 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
116 + static unsigned int rtx_e1000_tx_ring_descriptors_remaining(struct rtx_e1000_tx_ring *self) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
117 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
118 + if (self->tail == self->head) /* ring is empty */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
119 + return 256; /* XXX: ${config.tx_ring_size}; */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
120 + if (self->tail > self->head) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
121 + /* XXX: ${config.tx_ring_size} */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
122 + return 256 - (self->tail - self->head); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
123 + return self->head - self->tail; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
124 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
125 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
126 + static int rtx_e1000_tx_ring_tso_cksum_offload(struct rtx_e1000_tx_ring *self, struct rtx_socket_skbuff *skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
127 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
128 + return skb_is_gso(skb->skbuff) || skb->skbuff->ip_summed == CHECKSUM_PARTIAL; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
129 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
130 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
131 + static int rtx_e1000_tx_ring_put(struct rtx_e1000_tx_ring *self, struct rtx_socket_skbuff *skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
132 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
133 + return NETDEV_TX_OK; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
134 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
135 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
136 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
137 + chunk descriptors_remaining() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
138 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
139 + rtx_e1000_tx_ring_descriptors_remaining(${self}); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
140 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
141 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
142 + chunk tso_cksum_offload(Socket::SKBuff skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
143 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
144 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
145 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
146 + chunk put(Socket::SKBuff skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
147 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
148 + rtx_e1000_tx_ring_put(${self}, &${skb}); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
149 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
150 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
151 chunk ::init() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
152 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
153 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
154 @@ -183,7 +231,7 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
155 struct rtx_e1000_ctx |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
156 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
157 int bars; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
158 - unsigned char /* __iomem */ *ioaddr; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
159 + unsigned char __iomem *ioaddr; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
160 int irq; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
161 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
162 /* we can't use the Rathaxes type here (#8) */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
163 @@ -334,6 +382,30 @@ |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
164 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
165 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
166 |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
167 + template type e1000::TxFlags() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
168 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
169 + chunk LKM::includes() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
170 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
171 + static const ${e1000::TxFlags} force_enum_rtx_e1000_tx_flags_decl; |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
172 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
173 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
174 + chunk ::decl() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
175 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
176 + enum rtx_e1000_tx_flags |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
177 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
178 + E1000_TX_FLAGS_CSUM = 0x00000001, |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
179 + E1000_TX_FLAGS_VLAN = 0x00000002, |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
180 + E1000_TX_FLAGS_TSO = 0x00000004, |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
181 + E1000_TX_FLAGS_IPV4 = 0x00000008, |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
182 + E1000_TX_FLAGS_NO_FCS = 0x00000010, |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
183 + }; |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
184 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
185 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
186 + map |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
187 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
188 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
189 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
190 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
191 template sequence e1000::create_device() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
192 { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
193 chunk Ethernet::create_device(PCI::Device pdev, Ethernet::Device rtx_ether_ctx) |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
194 @@ -358,8 +430,8 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
195 ${Log::info("e1000::create: pci_enable_device_mem failed")}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
196 if (pci_request_selected_regions(${pdev}, ${rtx_ether_ctx}->hw_ctx.bars, ${config.name})) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
197 ${Log::info("e1000::create: pci_request_selected_regions failed")}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
198 - if (${config.set_master}) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
199 - pci_set_master(${pdev}); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
200 +// XXX if (${config.set_master}) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
201 +// XXX pci_set_master(${pdev}); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
202 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
203 /* 0 here is for BAR_0: */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
204 ${rtx_ether_ctx}->hw_ctx.ioaddr = pci_ioremap_bar(${pdev}, 0); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
205 @@ -630,8 +702,6 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
206 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
207 chunk ::CALL() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
208 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
209 - typedef unsigned long int dma_addr_t; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
210 - |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
211 /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
212 * This part is documented in the Intel Gigabit Ethernet Controller |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
213 * Software Developper manual. (You can find it in the doc/hardware |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
214 @@ -733,7 +803,7 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
215 hw_ctx->rx_ring.base = dma_alloc_coherent( |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
216 &${ctx}->pci_dev->dev, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
217 hw_ctx->rx_ring.size, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
218 - (dma_addr_t *)&hw_ctx->rx_ring.dma_base, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
219 + &hw_ctx->rx_ring.dma_base, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
220 GFP_KERNEL); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
221 if (!hw_ctx->rx_ring.base) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
222 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
223 @@ -758,7 +828,7 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
224 ${Log::info("cannot allocate a skbuff for the rx ring")}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
225 goto err_skbuffs_alloc; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
226 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
227 - hw_ctx->rx_ring.dma_skbuffs[i] = (void *)dma_map_single( |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
228 + hw_ctx->rx_ring.dma_skbuffs[i] = dma_map_single( |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
229 &${ctx}->pci_dev->dev, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
230 hw_ctx->rx_ring.skbuffs[i]->data, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
231 ${config.rx_buffer_len}, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
232 @@ -820,7 +890,7 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
233 hw_ctx->tx_ring.base = dma_alloc_coherent( |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
234 &${ctx}->pci_dev->dev, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
235 hw_ctx->tx_ring.size, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
236 - (dma_addr_t *)&hw_ctx->tx_ring.dma_base, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
237 + &hw_ctx->tx_ring.dma_base, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
238 GFP_KERNEL); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
239 if (!hw_ctx->rx_ring.base) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
240 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
241 @@ -838,6 +908,8 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
242 /* 3. Setup TDH/TDT to zero: the queue is empty */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
243 rtx_e1000_register_write32(hw_ctx, E1000_TDH, 0); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
244 rtx_e1000_register_write32(hw_ctx, E1000_TDT, 0); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
245 + hw_ctx->tx_ring.head = 0; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
246 + hw_ctx->tx_ring.tail = 0; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
247 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
248 /* 4. Set TCTL.PSP and enable the transmitter */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
249 rtx_e1000_register_set32(hw_ctx, E1000_TCTL, E1000_TCTL_PSP|E1000_TCTL_PSP); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
250 @@ -930,4 +1002,81 @@ |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
251 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
252 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
253 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
254 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
255 + template sequence e1000::_xmit_tso_cksum_offload(Ethernet::Device ctx, Socket::SKBuff skb) |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
256 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
257 + chunk ::CALL() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
258 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
259 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
260 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
261 + |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
262 + template sequence e1000::xmit(Ethernet::Device ctx, Socket::KernelSKBuff kernel_skb) |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
263 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
264 + chunk ::CALL() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
265 + { |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
266 + /* |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
267 + * Put packets on the TX ring, must return NETDEV_TX_OK or |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
268 + * NETDEV_TX_BUSY. |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
269 + */ |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
270 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
271 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
272 + * XXX: This leaves a placeholder if I cast local.tx_ring as |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
273 + * e1000::TxRing below. |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
274 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
275 + ${Socket::SKBuff} skb; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
276 + ${local.skb.init(kernel_skb)}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
277 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
278 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
279 + * XXX: can't write ${e1000::TxRing} * (the placeholder isn't |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
280 + * resolved). |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
281 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
282 + struct rtx_e1000_tx_ring *tx_ring = &${ctx}->hw_ctx.tx_ring; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
283 + //${cast local.tx_ring as e1000::TxRing}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
284 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
285 + ${Log::info("xmit: skbuff details:")}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
286 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
287 + * skb is not expand on the bound C variable (should be rtx_skbuff), |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
288 + * which is funny because it works for the sequence template call |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
289 + * right after. |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
290 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
291 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
292 + * XXX: doesn't work (I tried to pass self explicitely too): |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
293 + * ${local.skb.dump_infos()}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
294 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
295 + rtx_socket_skbuff_dump_infos(&skb); |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
296 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
297 + /* |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
298 + * The transmission is going to be several steps: |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
299 + * 1. TCP Segmentation Offload & Checksum Offloading: pick a |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
300 + * descriptor from the tx ring and fill it as a contex |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
301 + * descriptor to allow the card to slice into several packets |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
302 + * according to the MSS; |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
303 + * 2. DMA Map the skbuff data as slices of 4096; |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
304 + * 3. Signal the hardware that data is available via a tx desc. |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
305 + */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
306 + |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
307 + /* XXX: same thing wanted to use: ${local.tx_ring.descriptors_remaining()} */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
308 + if (!rtx_e1000_tx_ring_descriptors_remaining(tx_ring)) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
309 + return NETDEV_TX_BUSY; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
310 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
311 + /* 1. Offloading */ |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
312 + /* XXX: ${local.tx_ring.tso_cksum_offload(skb)}; */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
313 + if (rtx_e1000_tx_ring_tso_cksum_offload(tx_ring, &skb)) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
314 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
315 + ${Log::info("xmit: the packet needs to be fragmented and/or checksummed but this not implemented yet!")}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
316 + return NETDEV_TX_OK; |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
317 + } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
318 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
319 + /* 2. Map the data */ |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
320 + ${Device::Device} dev = &${ctx}->pci_dev->dev; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
321 + /* XXX: ${local.skb.dma_map(local.dev)}; */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
322 + rtx_socket_dma_map(&skb, dev); |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
323 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
324 + /* 3. Update the TX Ring */ |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
325 + /* XXX: ${local.tx_ring.put(skb)}; */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
326 + rtx_e1000_tx_ring_put(tx_ring, &skb); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
327 + |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
328 + return NETDEV_TX_OK; |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
329 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
330 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
331 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
332 diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
333 --- a/rathaxes/samples/e1000/e1000.rti |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
334 +++ b/rathaxes/samples/e1000/e1000.rti |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
335 @@ -31,8 +31,14 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
336 provided type TxRing |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
337 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
338 chunk LKM::includes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
339 + chunk LKM::prototypes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
340 + chunk LKM::code(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
341 method decl(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
342 method init(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
343 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
344 + method descriptors_remaining(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
345 + method tso_cksum_offload(Socket::SKBuff); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
346 + method put(Socket::SKBuff); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
347 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
348 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
349 /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
350 @@ -51,6 +57,12 @@ |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
351 method decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
352 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
353 |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
354 + provided type TxFlags |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
355 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
356 + chunk LKM::includes(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
357 + chunk ::decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
358 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
359 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
360 provided sequence create_device() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
361 { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
362 provided chunk Ethernet::create_device(PCI::Device, Ethernet::Device); |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
363 @@ -109,6 +121,16 @@ |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
364 provided chunk ::CALL(); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
365 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
366 |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
367 + provided sequence _xmit_tso_cksum_offload(Ethernet::Device, Socket::SKBuff) |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
368 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
369 + provided chunk ::CALL(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
370 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
371 + |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
372 + provided sequence xmit(Ethernet::Device, Socket::KernelSKBuff) |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
373 + { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
374 + provided chunk ::CALL(); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
375 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
376 + |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
377 provided sequence register_read32(e1000::Context, e1000::Register) |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
378 { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
379 provided chunk LKM::prototypes(); |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
380 diff --git a/rathaxes/samples/e1000/ethernet.blt b/rathaxes/samples/e1000/ethernet.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
381 --- a/rathaxes/samples/e1000/ethernet.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
382 +++ b/rathaxes/samples/e1000/ethernet.blt |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
383 @@ -1,6 +1,56 @@ |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
384 with Ethernet, PCI, LKM, Log |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
385 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
386 - template type Ethernet::Net() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
387 + template type Ethernet::ProtocolId() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
388 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
389 + chunk LKM::prototypes() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
390 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
391 + static const char *rtx_ethernet_protocol_id_to_str(unsigned short); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
392 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
393 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
394 + chunk LKM::data() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
395 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
396 + static const struct |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
397 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
398 + const unsigned short id; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
399 + const char *name; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
400 + } rtx_ethernet_proto_table[] = |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
401 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
402 + { ETH_P_IP, "IPv4" }, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
403 + { ETH_P_IPV6, "IPv6" }, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
404 + { ETH_P_ARP, "ARP" }, |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
405 + }; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
406 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
407 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
408 + chunk LKM::code() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
409 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
410 + static const char *rtx_ethernet_protocol_id_to_str(unsigned short proto_id) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
411 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
412 + for (int i = 0; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
413 + i != sizeof(rtx_ethernet_proto_table[0]) / sizeof(rtx_ethernet_proto_table); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
414 + i++) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
415 + if (proto_id == rtx_ethernet_proto_table[i].id) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
416 + return rtx_ethernet_proto_table[i].name; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
417 + |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
418 + return "Unknown"; |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
419 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
420 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
421 + |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
422 + chunk decl() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
423 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
424 + typedef unsigned short rtx_ether_protocol_id; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
425 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
426 + |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
427 + chunk to_str() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
428 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
429 + rtx_ethernet_protocol_id_to_str(${self}); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
430 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
431 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
432 + map |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
433 + { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
434 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
435 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
436 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
437 + template type Ethernet::AbstractDevice() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
438 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
439 chunk LKM::includes() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
440 { |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
441 @@ -17,11 +67,6 @@ |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
442 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
443 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
444 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
445 - /* |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
446 - * Unlike PCI::Device, Ethernet::Device doesn't match the struct net_device |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
447 - * from Linux. Ethernet::Device is the type that we use in the private |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
448 - * field of the struct net_device. |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
449 - */ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
450 template type Ethernet::Device() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
451 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
452 chunk LKM::includes() |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
453 @@ -47,15 +92,15 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
454 struct pci_dev *pci_dev; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
455 struct net_device *net_dev; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
456 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
457 - /* while waiting on issue #8 */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
458 - //${e1000::Context} hw_ctx; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
459 - // In the long-term, this may disappear for a new concept allowing |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
460 - // to embbed a descriptor defined and manipulated by the front-end |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
461 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
462 + * In the long-term, this may disappear for a new concept allowing |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
463 + * to embbed a descriptor defined and manipulated by the front-end |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
464 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
465 ${pointcut Ethernet::SubContext()}; |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
466 } *rtx_ethernet_dev_p; |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
467 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
468 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
469 - chunk ::init(Ethernet::Net net_dev, PCI::Device pci_dev) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
470 + chunk ::init(Ethernet::AbstractDevice net_dev, PCI::Device pci_dev) |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
471 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
472 ${self} = netdev_priv(${net_dev}); |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
473 /* |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
474 @@ -82,9 +127,8 @@ |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
475 { |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
476 static int rtx_ethernet_open(struct net_device *dev) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
477 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
478 - struct rtx_ethernet_dev* rtx_ether_dev = netdev_priv(dev); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
479 + ${Ethernet::Device} rtx_ether_dev = netdev_priv(dev); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
480 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
481 - ${cast local.rtx_ether_dev as Ethernet::Device}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
482 ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
483 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
484 return 0; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
485 @@ -92,7 +136,7 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
486 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
487 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
488 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
489 - template sequence Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
490 + template sequence Ethernet::send(Ethernet::Device dev, Socket::KernelSKBuff skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
491 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
492 chunk LKM::prototypes() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
493 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
494 @@ -101,13 +145,11 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
495 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
496 chunk LKM::code() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
497 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
498 - static int rtx_ethernet_xmit(struct sk_buff* skb, struct net_device *dev) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
499 + static int rtx_ethernet_xmit(struct sk_buff* kernel_skb, struct net_device *net_dev) |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
500 { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
501 - ${cast local.dev as Ethernet::Device}; |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
502 - ${cast local.skb as Socket::SKBuff}; |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
503 - ${pointcut ::IMPLEMENTATION(local.dev, local.skb)}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
504 - |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
505 - return 0; |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
506 + ${Ethernet::Device} rtx_ethernet_dev = netdev_priv(net_dev); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
507 + ${cast local.kernel_skb as Socket::KernelSKBuff}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
508 + ${pointcut ::IMPLEMENTATION(local.rtx_ethernet_dev, local.kernel_skb)}; |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
509 } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
510 } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
511 } |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
512 @@ -123,9 +165,8 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
513 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
514 static int rtx_ethernet_close(struct net_device *dev) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
515 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
516 - struct rtx_ethernet_dev* rtx_ether_dev = netdev_priv(dev); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
517 + ${Ethernet::Device} rtx_ether_dev = netdev_priv(dev); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
518 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
519 - ${cast local.rtx_ether_dev as Ethernet::Device}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
520 ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
521 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
522 return 0; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
523 @@ -148,11 +189,8 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
524 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
525 static enum irqreturn rtx_ethernet_interrupt_handler(int irq, void *dev_id) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
526 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
527 - struct rtx_ethernet_dev* rtx_ether_dev; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
528 - struct rtx_e1000_ctx* ctx; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
529 + ${Ethernet::Device} rtx_ether_dev = dev_id; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
530 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
531 - rtx_ether_dev = dev_id; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
532 - ${cast local.rtx_ether_dev as Ethernet::Device}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
533 ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
534 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
535 return IRQ_NONE; |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
536 diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
537 --- a/rathaxes/samples/e1000/ethernet.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
538 +++ b/rathaxes/samples/e1000/ethernet.rti |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
539 @@ -1,16 +1,30 @@ |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
540 interface Ethernet : Socket, PCI, LKM |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
541 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
542 - provided type Net |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
543 + provided type ProtocolId |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
544 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
545 + chunk LKM::prototypes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
546 + chunk LKM::data(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
547 + chunk LKM::code(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
548 + method decl(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
549 + method to_str(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
550 + } |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
551 + |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
552 + provided type AbstractDevice |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
553 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
554 chunk LKM::includes(); |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
555 - method decl(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
556 + method decl(); |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
557 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
558 |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
559 + /* |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
560 + * Unlike PCI::Device, Ethernet::Device doesn't match the struct net_device |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
561 + * from Linux. Ethernet::Device is the type that we use in the private |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
562 + * field of the struct net_device. |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
563 + */ |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
564 provided type Device |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
565 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
566 chunk LKM::includes(); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
567 method decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
568 - method init(Ethernet::Net, PCI::Device); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
569 + method init(Ethernet::AbstractDevice, PCI::Device); |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
570 pointcut Ethernet::SubContext(); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
571 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
572 |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
573 @@ -22,7 +36,7 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
574 provided chunk LKM::code(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
575 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
576 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
577 - required sequence send(Ethernet::Device dev, Socket::SKBuff skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
578 + required sequence send(Ethernet::Device, Socket::KernelSKBuff) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
579 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
580 provided chunk LKM::prototypes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
581 provided chunk LKM::code(); |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
582 diff --git a/rathaxes/samples/e1000/lkm.rtx b/rathaxes/samples/e1000/lkm.rtx |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
583 --- a/rathaxes/samples/e1000/lkm.rtx |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
584 +++ b/rathaxes/samples/e1000/lkm.rtx |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
585 @@ -1,4 +1,4 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
586 -device LKM use LKM, PCI, Ethernet, Log |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
587 +device LKM use LKM, PCI, Ethernet, Log, Socket |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
588 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
589 Ethernet::open(Ethernet::Device dev) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
590 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
591 @@ -43,9 +43,10 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
592 e1000::handle_interrupt(dev); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
593 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
594 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
595 - Ethernet::send(Ethernet::Device dev, Socket::SKBuff skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
596 + Ethernet::send(Ethernet::Device dev, Socket::KernelSKBuff skb) |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
597 { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
598 Log::info("we have one packet to transmit!"); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
599 + e1000::xmit(dev, skb); |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
600 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
601 |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
602 LKM::init() |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
603 @@ -79,4 +80,10 @@ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
604 * 4096, 8192 and 16384 bytes: |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
605 */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
606 e1000::rx_buffer_len = 2048; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
607 + /* |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
608 + * 4096 bytes maximum per transmit descriptor is used on Linux and FreeBSD, |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
609 + * 2048 on Minix and HelenOS, I can't find why. If I understand the Intel |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
610 + * man correctly, the maximum should be 16288 (see section 3.3.3). |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
611 + */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
612 + e1000::tx_max_data_per_desc = 4096; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
613 } |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
614 diff --git a/rathaxes/samples/e1000/socket.blt b/rathaxes/samples/e1000/socket.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
615 --- a/rathaxes/samples/e1000/socket.blt |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
616 +++ b/rathaxes/samples/e1000/socket.blt |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
617 @@ -1,20 +1,104 @@ |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
618 -with Socket, LKM |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
619 +with Socket, LKM, Device, Ethernet |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
620 { |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
621 + template type Socket::KernelSKBuff() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
622 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
623 + chunk LKM::includes() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
624 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
625 + #include <linux/skbuff.h> |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
626 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
627 + static const ${Socket::KernelSKBuff} force_rtx_socket_kernel_skbuff_decl; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
628 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
629 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
630 + chunk ::decl() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
631 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
632 + typedef struct sk_buff *rtx_socket_kernel_skbuff_p; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
633 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
634 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
635 + map |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
636 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
637 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
638 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
639 + |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
640 template type Socket::SKBuff() |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
641 { |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
642 chunk LKM::includes() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
643 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
644 - #include <linux/skbuff.h> |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
645 - static const ${Socket::SKBuff} force_rtx_lnux_skbuf_decl; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
646 + static const ${Socket::SKBuff} force_rtx_socket_skbuff_decl; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
647 } |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
648 |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
649 chunk ::decl() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
650 { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
651 - struct sk_buff; |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
652 + struct rtx_socket_skbuff |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
653 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
654 + struct sk_buff *skbuff; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
655 + dma_addr_t dma_handle; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
656 + }; |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
657 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
658 |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
659 - chunk ::init() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
660 + chunk LKM::prototypes() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
661 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
662 + static void rtx_socket_skbuff_dump_infos(struct rtx_socket_skbuff *); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
663 + static int rtx_socket_dma_map(struct rtx_socket_skbuff *, struct device *); |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
664 + } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
665 + |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
666 + chunk LKM::code() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
667 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
668 + static void rtx_socket_skbuff_dump_infos(struct rtx_socket_skbuff *self) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
669 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
670 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
671 + * We should use a Rathaxes log abstraction instead of pr_info here, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
672 + * but Rathaxes doesn't support functions with a variable number of |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
673 + * arguments yet. |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
674 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
675 + ${Ethernet::ProtocolId} ethernet_proto = be16_to_cpu(self->skbuff->protocol); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
676 + static const char * const ip_summed_values[] = { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
677 + "none", "unnecessary", "complete", "partial" |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
678 + }; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
679 + struct skb_shared_info *shinfo = skb_shinfo(self->skbuff); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
680 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
681 + pr_info( |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
682 + "\t protocol = %#-5x (%s)\n" |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
683 + "\t len = %-5u data_len = %-5u head_len = %-5u\n" |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
684 + "\t nr_frags = %u\n" |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
685 + "\t gso_size = %-5u gso_segs = %-5u gso_type = %-5u\n" |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
686 + "\tip_summed = %d (%s)", |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
687 + ethernet_proto, rtx_ethernet_protocol_id_to_str(ethernet_proto) /* XXX: ${local.ethernet_proto.to_str()} */, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
688 + self->skbuff->len, self->skbuff->data_len, skb_headlen(self->skbuff), |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
689 + shinfo->nr_frags, shinfo->gso_size, shinfo->gso_segs, shinfo->gso_type, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
690 + self->skbuff->ip_summed, ip_summed_values[self->skbuff->ip_summed] |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
691 + ); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
692 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
693 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
694 + static int rtx_socket_dma_map(struct rtx_socket_skbuff *self, struct device *dev) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
695 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
696 + self->dma_handle = dma_map_single( |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
697 + dev, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
698 + self->skbuff->data, |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
699 + skb_headlen(self->skbuff), |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
700 + DMA_TO_DEVICE); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
701 + return dma_mapping_error(dev, self->dma_handle); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
702 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
703 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
704 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
705 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
706 + * XXX: the rathaxes argument kernel_skb is not actually bound to the |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
707 + * correct C variable from Ethernet::send() (so I named it as the C |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
708 + * variable I needed) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
709 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
710 + chunk ::init(Socket::KernelSKBuff kernel_skb) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
711 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
712 + ${self}.skbuff = kernel_skb; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
713 + ${self}.dma_handle = 0; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
714 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
715 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
716 + chunk dump_infos() |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
717 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
718 + rtx_socket_skbuff_dump_infos(${self}); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
719 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
720 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
721 + chunk dma_map(Device::Device dev) |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
722 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
723 + rtx_socket_dma_map(${self}, ${dev}); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
724 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
725 |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
726 map |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
727 diff --git a/rathaxes/samples/e1000/socket.rti b/rathaxes/samples/e1000/socket.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
728 --- a/rathaxes/samples/e1000/socket.rti |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
729 +++ b/rathaxes/samples/e1000/socket.rti |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
730 @@ -1,8 +1,19 @@ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
731 -interface Socket : LKM |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
732 +interface Socket : LKM, Device |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
733 { |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
734 - provided type Socket::SKBuff { |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
735 - chunk LKM::includes(); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
736 - method decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
737 - method init(); |
87
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
738 + provided type KernelSKBuff |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
739 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
740 + chunk LKM::includes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
741 + method decl(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
742 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
743 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
744 + provided type SKBuff |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
745 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
746 + chunk LKM::includes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
747 + chunk LKM::prototypes(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
748 + chunk LKM::code(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
749 + method decl(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
750 + method init(Socket::KernelSKBuff); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
751 + method dump_infos(); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
752 + method dma_map(Device::Device); |
84
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
753 } |
6432998a8245
Finish the patches on the rx/tx init and wip on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
83
diff
changeset
|
754 } |