Mercurial > archived > louis > epitech > mq > rathaxes
annotate e1000_implement_the_frame_transmission_chunk.patch @ 89:a9b47a2f8b98
Wip on tx, fix ioaddr being incorrectly generated
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Thu, 04 Oct 2012 19:33:43 +0200 |
parents | 8ffcdd6aa410 |
children | 4968acb39c7b |
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 |
88 | 81 @@ -11,16 +11,15 @@ |
82 | |
83 chunk ::decl() | |
84 { | |
85 - typedef struct rtx_e1000_rx_descriptor | |
86 + struct rtx_e1000_rx_descriptor | |
87 { | |
88 - /* actual types are in comments */ | |
89 - unsigned long int /* __le64 */ buff_addr; | |
90 - unsigned short /* __le16 */ length; | |
91 - unsigned short /* __le16 */ csum; | |
92 - unsigned char status; | |
93 - unsigned char errors; | |
94 - unsigned short /* __le16 */ special; | |
95 - } *rtx_e1000_rx_descriptor_p; | |
96 + __le64 buff_addr; | |
97 + __le16 length; | |
98 + __le16 csum; | |
99 + unsigned char status; | |
100 + unsigned char errors; | |
101 + __le16 special; | |
102 + }; | |
103 } | |
104 | |
105 chunk ::init() | |
106 @@ -50,30 +49,30 @@ | |
107 | |
108 chunk ::decl() | |
109 { | |
110 - typedef struct rtx_e1000_tx_descriptor | |
111 + struct rtx_e1000_tx_descriptor | |
112 { | |
113 - unsigned long int /* __le64 */ buff_addr; | |
114 + __le64 buff_addr; | |
115 union | |
116 { | |
117 - unsigned int /* __le32 */ data; | |
118 + __le32 data; | |
119 struct | |
120 { | |
121 - unsigned short /* __le16 */ length; | |
122 - unsigned char csum_offset; /* CSO */ | |
123 - unsigned char cmd; | |
124 - } fields; | |
125 - } lower; | |
126 + __le16 length; | |
127 + unsigned char csum_offset; /* CSO */ | |
128 + unsigned char cmd; | |
129 + } fields; | |
130 + } lower; | |
131 union | |
132 { | |
133 - unsigned int /* __le32 */ data; | |
134 + __le32 data; | |
135 struct | |
136 { | |
137 - unsigned char status; | |
138 - unsigned char csum_start; /* CSS */ | |
139 - unsigned short /* __le16 */ special; | |
140 - } fields; | |
141 - } upper; | |
142 - } *rtx_e1000_tx_descriptor_p; | |
143 + unsigned char status; | |
144 + unsigned char csum_start; /* CSS */ | |
145 + __le16 special; | |
146 + } fields; | |
147 + } upper; | |
148 + }; | |
149 } | |
150 | |
151 chunk ::init() | |
152 @@ -93,9 +92,8 @@ | |
153 * CNorm unstrict); | |
154 * - dma_base: (physical) address of the ring where the device can access | |
155 * the different descriptors; | |
156 - * - skbuffs: array of the skbuffs associated with each descriptor; | |
157 - * - dma_skbuffs: (physical) address of each skbuff where the device can | |
158 - * write the received packets; | |
159 + * - skbuffs: array of the skbuffs and their dma (physical) address | |
160 + * associated with each descriptor. | |
161 */ | |
162 template type e1000::RxRing() | |
163 { | |
164 @@ -110,9 +108,8 @@ | |
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
|
165 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
166 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
|
167 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
|
168 - void* /* dma_addr_t */ dma_base; |
88 | 169 - struct sk_buff *skbuffs[256 /* ${config.rx_ring_size} */]; |
170 - void* /* dma_addr_t */ dma_skbuffs[256 /* ${config.rx_ring_size} */]; | |
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
|
171 + dma_addr_t dma_base; |
88 | 172 + ${Socket::SKBuff} skbuffs[${config.rx_ring_size}]; |
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
|
173 }; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
174 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
175 |
88 | 176 @@ -134,7 +131,13 @@ |
177 * - base: address of the ring (we can't use the typedef here until we get | |
178 * CNorm unstrict); | |
179 * - dma_base: (physical) address of the ring where the device can access | |
180 - * the different descriptors. | |
181 + * the different descriptors; | |
182 + * - skbuffs: the skbuffs associated with each descriptor of the ring; | |
183 + * - head: index on the head of the ring; | |
184 + * - tail: index on the tail of the ring. | |
185 + * | |
186 + * Keep in mind that the head and tail fields are, obviously, not | |
187 + * synchronized with TDT/TDH on the device. | |
188 */ | |
189 template type e1000::TxRing() | |
190 { | |
191 @@ -148,11 +151,88 @@ | |
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
|
192 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
|
193 { |
e9736ab70995
Add a couple of patches to 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 unsigned int size; |
88 | 195 - struct rtx_e1000_tx_descriptor *base; |
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
|
196 - void* /* dma_addr_t */ dma_base; |
88 | 197 + /* XXX: can't use ${e1000::TxDescriptor} here: */ |
198 + struct rtx_e1000_tx_descriptor *base; /* rename to descs */ | |
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
|
199 + dma_addr_t dma_base; |
88 | 200 + ${Socket::SKBuff} skbuffs[${config.tx_ring_size}]; |
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
|
201 + 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
|
202 + 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
|
203 }; |
e9736ab70995
Add a couple of patches to 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 } |
e9736ab70995
Add a couple of patches to 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 |
e9736ab70995
Add a couple of patches to 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 + 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
|
207 + { |
e9736ab70995
Add a couple of patches to 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 + 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
|
209 + static int rtx_e1000_tx_ring_tso_cksum_offload(struct rtx_e1000_tx_ring *, struct rtx_socket_skbuff *); |
88 | 210 + static void rtx_e1000_tx_ring_put(struct rtx_e1000_tx_ring *, struct rtx_socket_skbuff *); |
211 + static void rtx_e1000_tx_ring_start_xmit(struct rtx_e1000_tx_ring *, const struct rtx_e1000_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
|
212 + } |
e9736ab70995
Add a couple of patches to 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 + |
e9736ab70995
Add a couple of patches to 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 + 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
|
215 + { |
e9736ab70995
Add a couple of patches to 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 + 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
|
217 + { |
e9736ab70995
Add a couple of patches to 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 + 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
|
219 + 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
|
220 + 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
|
221 + /* 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
|
222 + 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
|
223 + 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
|
224 + } |
e9736ab70995
Add a couple of patches to 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 + |
e9736ab70995
Add a couple of patches to 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 + 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
|
227 + { |
e9736ab70995
Add a couple of patches to 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 + 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
|
229 + } |
e9736ab70995
Add a couple of patches to 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 + |
88 | 231 + static void rtx_e1000_tx_ring_put(struct rtx_e1000_tx_ring *self, struct rtx_socket_skbuff *skb) |
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
|
232 + { |
88 | 233 + WARN_ON(!skb); |
234 + | |
235 + /* | |
236 + * Mark it as the last buffer (EOP) and ask the card to | |
237 + * insert the Ethernet FCS (Frame Check Sequence). | |
238 + * | |
239 + * XXX: it sucks to use skb_headlen() here (this part of the | |
240 + * code shouldn't be aware of it and use something more | |
241 + * abstract. | |
242 + */ | |
243 + struct rtx_e1000_tx_descriptor *tx_desc = &self->base[self->tail]; | |
244 + tx_desc->lower.data = cpu_to_le32( | |
245 + E1000_TXD_CMD_EOP | | |
246 + E1000_TXD_CMD_IFCS | | |
247 + skb_headlen(skb->skbuff)); | |
248 + tx_desc->upper.data = 0; | |
249 + tx_desc->buff_addr = cpu_to_le64(skb->dma_handle); | |
250 + memcpy(&self->skbuffs[self->tail], skb, sizeof(*skb)); | |
251 + self->tail = (self->tail + 1) % 256 /* XXX: ${config.tx_ring_size} */; | |
252 + } | |
253 + | |
254 + static void rtx_e1000_tx_ring_start_xmit(struct rtx_e1000_tx_ring *self, const struct rtx_e1000_ctx *hw_ctx) | |
255 + { | |
256 + rtx_e1000_register_write32(hw_ctx, E1000_TDT, self->tail); | |
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
|
257 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
258 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
259 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
260 + 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
|
261 + { |
e9736ab70995
Add a couple of patches to 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 + 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
|
263 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
264 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
265 + 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
|
266 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
267 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
268 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
269 + 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
|
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 + 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
|
272 + } |
e9736ab70995
Add a couple of patches to 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 + |
88 | 274 + chunk start_xmit(e1000::Context ctx) |
275 + { | |
276 + rtx_e1000_tx_ring_start_xmit(${self}, ${ctx}); | |
277 + } | |
278 + | |
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
|
279 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
|
280 { |
e9736ab70995
Add a couple of patches to 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 } |
88 | 282 @@ -334,6 +414,45 @@ |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
283 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
284 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
285 |
88 | 286 + template type e1000::TxDescriptorFlags() |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
287 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
288 + chunk LKM::includes() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
289 + { |
88 | 290 + static const ${e1000::TxDescriptorFlags} force_enum_rtx_e1000_tx_descriptor_flags_decl; |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
291 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
292 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
293 + chunk ::decl() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
294 + { |
88 | 295 + enum rtx_e1000_tx_descriptor_flags |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
296 + { |
88 | 297 + E1000_TXD_DTYP_D = 0x00100000, /* Data Descriptor */ |
298 + E1000_TXD_DTYP_C = 0x00000000, /* Context Descriptor */ | |
299 + E1000_TXD_POPTS_IXSM = 0x01, /* Insert IP checksum */ | |
300 + E1000_TXD_POPTS_TXSM = 0x02, /* Insert TCP/UDP checksum */ | |
301 + E1000_TXD_CMD_EOP = 0x01000000, /* End of Packet */ | |
302 + E1000_TXD_CMD_IFCS = 0x02000000, /* Insert FCS (Ethernet CRC) */ | |
303 + E1000_TXD_CMD_IC = 0x04000000, /* Insert Checksum */ | |
304 + E1000_TXD_CMD_RS = 0x08000000, /* Report Status */ | |
305 + E1000_TXD_CMD_RPS = 0x10000000, /* Report Packet Sent */ | |
306 + E1000_TXD_CMD_DEXT = 0x20000000, /* Descriptor extension (0 = legacy) */ | |
307 + E1000_TXD_CMD_VLE = 0x40000000, /* Add VLAN tag */ | |
308 + E1000_TXD_CMD_IDE = 0x80000000, /* Enable Tidv register */ | |
309 + E1000_TXD_STAT_DD = 0x00000001, /* Descriptor Done */ | |
310 + E1000_TXD_STAT_EC = 0x00000002, /* Excess Collisions */ | |
311 + E1000_TXD_STAT_LC = 0x00000004, /* Late Collisions */ | |
312 + E1000_TXD_STAT_TU = 0x00000008, /* Transmit underrun */ | |
313 + E1000_TXD_CMD_TCP = 0x01000000, /* TCP packet */ | |
314 + E1000_TXD_CMD_IP = 0x02000000, /* IP packet */ | |
315 + E1000_TXD_CMD_TSE = 0x04000000, /* TCP Seg enable */ | |
316 + E1000_TXD_STAT_TC = 0x00000004, /* Tx Underrun */ | |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
317 + }; |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
318 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
319 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
320 + map |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
321 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
322 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
323 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
324 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
325 template sequence e1000::create_device() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
326 { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
327 chunk Ethernet::create_device(PCI::Device pdev, Ethernet::Device rtx_ether_ctx) |
88 | 328 @@ -376,8 +495,7 @@ |
329 udelay(10); | |
330 | |
331 /* Now we can load its mac address (thanks minix code) */ | |
332 - int i = 0; | |
333 - for (i = 0 /* < this is not generated! (cnorm bug) */; i < 3; ++i) | |
334 + for (int i = 0; i < 3; ++i) | |
335 { | |
336 rtx_e1000_register_write32(&${rtx_ether_ctx}->hw_ctx, E1000_EEPROM_READ, (i << 8) | 1); | |
337 | |
338 @@ -420,6 +538,7 @@ | |
339 } | |
340 } | |
341 | |
342 + /* TODO: make that a method of e1000::Context */ | |
343 template sequence e1000::print_status(Ethernet::Device ctx) | |
344 { | |
345 chunk LKM::prototypes() | |
346 @@ -466,17 +585,19 @@ | |
347 * ${e1000.init(E1000_STATUS); // didn't work, so we used the next line | |
348 * reg_status = E1000_STATUS; | |
349 * ${e1000::register_read32(rtx_ether_ctx->hw_ctx, reg_status)}; | |
350 + * | |
351 + * TODO: make them methods of e1000::Context | |
352 */ | |
353 template sequence e1000::register_read32(e1000::Context ctx, e1000::Register reg_offset) | |
354 { | |
355 chunk LKM::prototypes() | |
356 { | |
357 - static unsigned int rtx_e1000_register_read32(struct rtx_e1000_ctx *, unsigned int); | |
358 + static unsigned int rtx_e1000_register_read32(const struct rtx_e1000_ctx *, unsigned int); | |
359 } | |
360 | |
361 chunk LKM::code() | |
362 { | |
363 - static unsigned int rtx_e1000_register_read32(struct rtx_e1000_ctx *ctx, unsigned int reg_offset) | |
364 + static unsigned int rtx_e1000_register_read32(const struct rtx_e1000_ctx *ctx, unsigned int reg_offset) | |
365 { | |
366 return ioread32(ctx->ioaddr + reg_offset); | |
367 } | |
368 @@ -492,12 +613,12 @@ | |
369 { | |
370 chunk LKM::prototypes() | |
371 { | |
372 - static void rtx_e1000_register_write32(struct rtx_e1000_ctx *, unsigned int, unsigned int); | |
373 + static void rtx_e1000_register_write32(const struct rtx_e1000_ctx *, unsigned int, unsigned int); | |
374 } | |
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
|
375 |
88 | 376 chunk LKM::code() |
377 { | |
378 - static void rtx_e1000_register_write32(struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) | |
379 + static void rtx_e1000_register_write32(const struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) | |
380 { | |
381 iowrite32(value, ctx->ioaddr + reg_offset); | |
382 } | |
383 @@ -513,12 +634,12 @@ | |
384 { | |
385 chunk LKM::prototypes() | |
386 { | |
387 - static void rtx_e1000_register_set32(struct rtx_e1000_ctx *, unsigned int, unsigned int); | |
388 + static void rtx_e1000_register_set32(const struct rtx_e1000_ctx *, unsigned int, unsigned int); | |
389 } | |
390 | |
391 chunk LKM::code() | |
392 { | |
393 - static void rtx_e1000_register_set32(struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) | |
394 + static void rtx_e1000_register_set32(const struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) | |
395 { | |
396 iowrite32(rtx_e1000_register_read32(ctx, reg_offset) | value, ctx->ioaddr + reg_offset); | |
397 } | |
398 @@ -534,12 +655,12 @@ | |
399 { | |
400 chunk LKM::prototypes() | |
401 { | |
402 - static void rtx_e1000_register_unset32(struct rtx_e1000_ctx *, unsigned int, unsigned int); | |
403 + static void rtx_e1000_register_unset32(const struct rtx_e1000_ctx *, unsigned int, unsigned int); | |
404 } | |
405 | |
406 chunk LKM::code() | |
407 { | |
408 - static void rtx_e1000_register_unset32(struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) | |
409 + static void rtx_e1000_register_unset32(const struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) | |
410 { | |
411 iowrite32(rtx_e1000_register_read32(ctx, reg_offset) & ~value, ctx->ioaddr + reg_offset); | |
412 } | |
413 @@ -626,12 +747,18 @@ | |
414 } | |
415 } | |
416 | |
417 + /* TODO: refactor | |
418 + * | |
419 + * Split into two method methods: | |
420 + * - e1000::RxRing::init_rx() | |
421 + * - e1000::TxRing::init_tx() | |
422 + * | |
423 + * Also it should use the new methods in Socket::SKbuff. | |
424 + */ | |
425 template sequence set_up_device(Ethernet::Device 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
|
426 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
427 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
|
428 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
429 - 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
|
430 - |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
431 /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
432 * 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
|
433 * Software Developper manual. (You can find it in the doc/hardware |
88 | 434 @@ -663,6 +790,8 @@ |
435 * E1000_CRCERRS to E1000_TSCTFC. | |
436 */ | |
437 | |
438 + int i; | |
439 + | |
440 rtx_e1000_register_set32(hw_ctx, E1000_CTRL, | |
441 E1000_CMD_ASDE | | |
442 E1000_CMD_SLU); | |
443 @@ -676,7 +805,6 @@ | |
444 rtx_e1000_register_write32(hw_ctx, E1000_FCAL, 0); | |
445 rtx_e1000_register_write32(hw_ctx, E1000_FCT, 0); | |
446 rtx_e1000_register_write32(hw_ctx, E1000_FCTTV, 0); | |
447 - int i = 0; /* CNorm workaround, the init part of for isn't generated */ | |
448 for (i = 0; i != 64; ++i) | |
449 rtx_e1000_register_write32(hw_ctx, E1000_CRCERRS + i * 4, 0); | |
450 | |
451 @@ -719,7 +847,6 @@ | |
452 | |
453 /* 2. Initialize the MTA */ | |
454 | |
455 - i = 0; /* CNorm workaround, the init part of for isn't generated */ | |
456 for (i = 0; i != 128; ++i) | |
457 rtx_e1000_register_write32(hw_ctx, E1000_MTA + i * 4, 0); | |
458 | |
459 @@ -733,7 +860,7 @@ | |
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
|
460 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
|
461 &${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
|
462 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
|
463 - (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
|
464 + &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
|
465 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
|
466 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
|
467 { |
88 | 468 @@ -747,41 +874,37 @@ |
469 * Allocate the skbuffs, map them for DMA, and write their address | |
470 * in the corresponding descriptor. | |
471 */ | |
472 - i = 0; | |
473 for (i = 0; i != ${config.rx_ring_size}; ++i) | |
474 { | |
475 - hw_ctx->rx_ring.skbuffs[i] = netdev_alloc_skb( | |
476 + hw_ctx->rx_ring.skbuffs[i].skbuff = netdev_alloc_skb( | |
477 ${ctx}->net_dev, | |
478 ${config.rx_buffer_len}); | |
479 - if (!hw_ctx->rx_ring.skbuffs[i]) | |
480 + if (!hw_ctx->rx_ring.skbuffs[i].skbuff) | |
481 { | |
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
|
482 ${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
|
483 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
|
484 } |
e9736ab70995
Add a couple of patches to 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 - hw_ctx->rx_ring.dma_skbuffs[i] = (void *)dma_map_single( |
88 | 486 + hw_ctx->rx_ring.skbuffs[i].dma_handle = dma_map_single( |
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
|
487 &${ctx}->pci_dev->dev, |
88 | 488 - hw_ctx->rx_ring.skbuffs[i]->data, |
489 + hw_ctx->rx_ring.skbuffs[i].skbuff->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
|
490 ${config.rx_buffer_len}, |
88 | 491 DMA_FROM_DEVICE); |
492 - /* | |
493 - * Either this fails because, when compiling with gcc because | |
494 - * the last argument is not of the correct type (dma_addr_t). | |
495 - * Or it fails because of the lack of CNorm Unstrict. | |
496 - */ | |
497 - if (dma_mapping_error(&${ctx}->pci_dev->dev, (dma_addr_t)hw_ctx->rx_ring.dma_skbuffs[i])) | |
498 + int dma_error = dma_mapping_error(&${ctx}->pci_dev->dev, | |
499 + hw_ctx->rx_ring.skbuffs[i].dma_handle); | |
500 + if (dma_error) | |
501 { | |
502 ${Log::info("cannot dma-map a skbuff for the rx ring")}; | |
503 goto err_skbuffs_map; | |
504 } | |
505 - hw_ctx->rx_ring.base[i].buff_addr = (unsigned long int)cpu_to_le64( | |
506 - hw_ctx->rx_ring.dma_skbuffs[i]); | |
507 + hw_ctx->rx_ring.base[i].buff_addr = cpu_to_le64( | |
508 + hw_ctx->rx_ring.skbuffs[i].skbuff); | |
509 } | |
510 | |
511 ${Log::info("setup_device: skbuffs allocated")}; | |
512 | |
513 /* 5. Save the emplacement and the size of the ring in RDBA/RDLEN */ | |
514 - rtx_e1000_register_write32(hw_ctx, E1000_RDBAL, (dma_addr_t)hw_ctx->rx_ring.dma_base & 0xffffffff); | |
515 - rtx_e1000_register_write32(hw_ctx, E1000_RDBAH, (dma_addr_t)hw_ctx->rx_ring.dma_base >> 32); | |
516 + rtx_e1000_register_write32(hw_ctx, E1000_RDBAL, hw_ctx->rx_ring.dma_base & 0xffffffff); | |
517 + rtx_e1000_register_write32(hw_ctx, E1000_RDBAH, hw_ctx->rx_ring.dma_base >> 32); | |
518 rtx_e1000_register_write32(hw_ctx, E1000_RDLEN, hw_ctx->rx_ring.size); | |
519 | |
520 /* 6. Setup RDH/RDT */ | |
521 @@ -820,7 +943,7 @@ | |
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
|
522 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
|
523 &${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
|
524 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
|
525 - (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
|
526 + &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
|
527 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
|
528 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
|
529 { |
88 | 530 @@ -831,13 +954,15 @@ |
531 ${Log::info("setup_device: tx descriptors allocated")}; | |
532 | |
533 /* 2. Save the emplacement and the size of the ring in TDBA/TDLEN */ | |
534 - rtx_e1000_register_write32(hw_ctx, E1000_TDBAL, (dma_addr_t)hw_ctx->tx_ring.dma_base & 0xffffffff); | |
535 - rtx_e1000_register_write32(hw_ctx, E1000_TDBAH, (dma_addr_t)hw_ctx->tx_ring.dma_base >> 32); | |
536 + rtx_e1000_register_write32(hw_ctx, E1000_TDBAL, hw_ctx->tx_ring.dma_base & 0xffffffff); | |
537 + rtx_e1000_register_write32(hw_ctx, E1000_TDBAH, hw_ctx->tx_ring.dma_base >> 32); | |
538 rtx_e1000_register_write32(hw_ctx, E1000_TDLEN, hw_ctx->tx_ring.size); | |
539 | |
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
|
540 /* 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
|
541 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
|
542 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
|
543 + 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
|
544 + 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
|
545 |
e9736ab70995
Add a couple of patches to 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 /* 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
|
547 rtx_e1000_register_set32(hw_ctx, E1000_TCTL, E1000_TCTL_PSP|E1000_TCTL_PSP); |
88 | 548 @@ -860,15 +985,15 @@ |
549 { | |
550 dma_unmap_single( | |
551 &${ctx}->pci_dev->dev, | |
552 - (dma_addr_t)hw_ctx->rx_ring.dma_skbuffs[i], | |
553 + hw_ctx->rx_ring.skbuffs[i].dma_handle, | |
554 ${config.rx_buffer_len}, | |
555 DMA_FROM_DEVICE); | |
556 err_skbuffs_map: | |
557 - dev_kfree_skb(hw_ctx->rx_ring.skbuffs[i]); | |
558 + dev_kfree_skb(hw_ctx->rx_ring.skbuffs[i].skbuff); | |
559 } | |
560 | |
561 dma_free_coherent(&${ctx}->pci_dev->dev, hw_ctx->rx_ring.size, | |
562 - hw_ctx->rx_ring.base, (dma_addr_t)hw_ctx->rx_ring.dma_base); | |
563 + hw_ctx->rx_ring.base, hw_ctx->rx_ring.dma_base); | |
564 err_rx_ring_alloc: | |
565 return -ENOMEM; | |
566 | |
567 @@ -876,12 +1001,15 @@ | |
568 } | |
569 } | |
570 | |
571 + /* TODO: | |
572 + * | |
573 + * Refactor into two methods (one in RxRing and one in TxRing) and make use | |
574 + * of the new methods in Socket::SKBuff. | |
575 + */ | |
576 template sequence free_rx_tx(Ethernet::Device ctx) | |
577 { | |
578 chunk ::CALL() | |
579 { | |
580 - typedef unsigned long int dma_addr_t; | |
581 - | |
582 ${e1000::Context} *hw_ctx; | |
583 hw_ctx = &${ctx}->hw_ctx; | |
584 | |
585 @@ -890,18 +1018,17 @@ | |
586 * - Unmap and free the skbuffs; | |
587 * - Free the descriptors array. | |
588 */ | |
589 - int i = 0; | |
590 - for (i = 0; i != ${config.rx_ring_size}; ++i) | |
591 + for (int i = 0; i != ${config.rx_ring_size}; ++i) | |
592 { | |
593 dma_unmap_single( | |
594 &${ctx}->pci_dev->dev, | |
595 - (dma_addr_t)hw_ctx->rx_ring.dma_skbuffs[i], | |
596 + (dma_addr_t)hw_ctx->rx_ring.skbuffs[i].dma_handle, | |
597 ${config.rx_buffer_len}, | |
598 DMA_FROM_DEVICE); | |
599 - dev_kfree_skb(hw_ctx->rx_ring.skbuffs[i]); | |
600 + dev_kfree_skb(hw_ctx->rx_ring.skbuffs[i].skbuff); | |
601 } | |
602 dma_free_coherent(&${ctx}->pci_dev->dev, hw_ctx->rx_ring.size, | |
603 - hw_ctx->rx_ring.base, (dma_addr_t)hw_ctx->rx_ring.dma_base); | |
604 + hw_ctx->rx_ring.base, hw_ctx->rx_ring.dma_base); | |
605 ${Log::info("free_rx_tx: rx ring free'ed")}; | |
606 | |
607 /* | |
608 @@ -909,7 +1036,7 @@ | |
609 * - Free the descriptors array. | |
610 */ | |
611 dma_free_coherent(&${ctx}->pci_dev->dev, hw_ctx->tx_ring.size, | |
612 - hw_ctx->tx_ring.base, (dma_addr_t)hw_ctx->tx_ring.dma_base); | |
613 + hw_ctx->tx_ring.base, hw_ctx->tx_ring.dma_base); | |
614 ${Log::info("free_rx_tx: tx ring free'ed")}; | |
615 } | |
616 } | |
617 @@ -930,4 +1057,92 @@ | |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
618 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
619 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
620 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
621 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
622 + 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
|
623 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
624 + chunk ::CALL() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
625 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
626 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
627 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
628 + |
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
|
629 + 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
|
630 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
631 + chunk ::CALL() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
632 + { |
83
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
633 + /* |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
634 + * 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
|
635 + * 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
|
636 + */ |
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
|
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 + ${Socket::SKBuff} skb; |
88 | 639 + ${e1000::Context} *hw_ctx; |
640 + ${e1000::TxRing} *tx_ring; | |
641 + ${Device::Device} dev; | |
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 + |
88 | 643 + ${local.skb.init(kernel_skb)}; |
644 + hw_ctx = &${ctx}->hw_ctx; | |
645 + tx_ring = &hw_ctx->tx_ring; | |
646 + dev = &${ctx}->pci_dev->dev; | |
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
|
647 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
648 + ${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
|
649 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
650 + * 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
|
651 + * 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
|
652 + * 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
|
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 + /* |
e9736ab70995
Add a couple of patches to 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 + * 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
|
656 + * ${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
|
657 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
658 + 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
|
659 + |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
660 + /* |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
661 + * 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
|
662 + * 1. TCP Segmentation Offload & Checksum Offloading: pick a |
88 | 663 + * descriptor from the tx ring and fill it as a context |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
664 + * 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
|
665 + * according to the MSS; |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
666 + * 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
|
667 + * 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
|
668 + */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
669 + |
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
|
670 + /* 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
|
671 + 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
|
672 + 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
|
673 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
674 + /* 1. Offloading */ |
88 | 675 + |
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
|
676 + /* 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
|
677 + 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
|
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 + ${Log::info("xmit: the packet needs to be fragmented and/or checksummed but this not implemented yet!")}; |
88 | 680 + goto err_offload; |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
681 + } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
682 + |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
683 + /* 2. Map the data */ |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
684 + |
88 | 685 + /* XXX: ${local.skb.map_to(local.dev)}; */ |
686 + if (rtx_socket_skbuff_map(&skb, dev, DMA_TO_DEVICE)) | |
687 + { | |
688 + ${Log::info("xmit: can't DMA map a SKbuff")}; | |
689 + goto err_skb_map_to; | |
690 + } | |
691 + | |
692 + /* 3. Update the TX Ring and signal the hardware */ | |
693 + | |
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
|
694 + /* 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
|
695 + 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
|
696 + |
88 | 697 + /* XXX: ${local.tx_ring.start_xmit(hw_ctx)}; */ |
698 + rtx_e1000_tx_ring_start_xmit(tx_ring, hw_ctx); | |
699 + | |
700 + return NETDEV_TX_OK; | |
701 + | |
702 + err_offload: | |
703 + err_skb_map_to: | |
704 + /* XXX: ${local.skb.unmap_to_and_free(local.dev)}; */ | |
705 + rtx_socket_skbuff_unmap_and_free(&skb, dev, DMA_TO_DEVICE); | |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
706 + 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
|
707 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
708 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
709 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
710 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
|
711 --- 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
|
712 +++ b/rathaxes/samples/e1000/e1000.rti |
88 | 713 @@ -31,8 +31,15 @@ |
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
|
714 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
|
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 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
|
717 + 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
|
718 + 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
|
719 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
|
720 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
|
721 + |
e9736ab70995
Add a couple of patches to 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 + 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
|
723 + 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
|
724 + method put(Socket::SKBuff); |
88 | 725 + method start_xmit(e1000::Context); |
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
|
726 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
727 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
728 /* |
88 | 729 @@ -51,6 +58,12 @@ |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
730 method decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
731 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
732 |
88 | 733 + provided type TxDescriptorFlags |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
734 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
735 + chunk LKM::includes(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
736 + chunk ::decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
737 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
738 + |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
739 provided sequence create_device() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
740 { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
741 provided chunk Ethernet::create_device(PCI::Device, Ethernet::Device); |
88 | 742 @@ -109,6 +122,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
|
743 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
|
744 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
745 |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
746 + 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
|
747 + { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
748 + provided chunk ::CALL(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
749 + } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
750 + |
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
|
751 + 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
|
752 + { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
753 + 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
|
754 + } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
755 + |
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
|
756 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
|
757 { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
758 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
|
759 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
|
760 --- 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
|
761 +++ 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
|
762 @@ -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
|
763 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
|
764 { |
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
|
765 - 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
|
766 + 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
|
767 + { |
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
|
768 + 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
|
769 + { |
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
|
770 + 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
|
771 + } |
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
|
772 + |
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
|
773 + 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
|
774 + { |
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
|
775 + 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
|
776 + { |
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
|
777 + 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
|
778 + 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
|
779 + } 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
|
780 + { |
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
|
781 + { 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
|
782 + { 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
|
783 + { 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
|
784 + }; |
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
|
785 + } |
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
|
786 + |
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
|
787 + 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
|
788 + { |
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
|
789 + 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
|
790 + { |
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
|
791 + 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
|
792 + 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
|
793 + 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
|
794 + 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
|
795 + 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
|
796 + |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
797 + 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
|
798 + } |
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
|
799 + } |
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
|
800 + |
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
|
801 + 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
|
802 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
803 + 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
|
804 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
805 + |
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
|
806 + 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
|
807 + { |
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
|
808 + 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
|
809 + } |
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
|
810 + |
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
|
811 + 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
|
812 + { |
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
|
813 + } |
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
|
814 + } |
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
|
815 + |
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
|
816 + 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
|
817 { |
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
|
818 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
|
819 { |
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
|
820 @@ -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
|
821 } |
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
|
822 } |
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
|
823 |
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
|
824 - /* |
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
|
825 - * 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
|
826 - * 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
|
827 - * 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
|
828 - */ |
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
|
829 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
|
830 { |
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
|
831 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
|
832 @@ -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
|
833 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
|
834 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
|
835 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
836 - /* 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
|
837 - //${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
|
838 - // 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
|
839 - // 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
|
840 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
841 + * 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
|
842 + * 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
|
843 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
844 ${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
|
845 } *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
|
846 } |
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
|
847 |
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
|
848 - 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
|
849 + 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
|
850 { |
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
|
851 ${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
|
852 /* |
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
|
853 @@ -82,9 +127,8 @@ |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
854 { |
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
|
855 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
|
856 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
857 - 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
|
858 + ${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
|
859 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
860 - ${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
|
861 ${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
|
862 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
863 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
|
864 @@ -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
|
865 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
866 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
867 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
868 - 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
|
869 + 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
|
870 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
871 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
|
872 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
873 @@ -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
|
874 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
875 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
|
876 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
877 - 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
|
878 + 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
|
879 { |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
880 - ${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
|
881 - ${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
|
882 - ${pointcut ::IMPLEMENTATION(local.dev, local.skb)}; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
883 - |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
884 - 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
|
885 + ${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
|
886 + ${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
|
887 + ${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
|
888 } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
889 } |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
890 } |
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
|
891 @@ -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
|
892 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
893 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
|
894 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
895 - 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
|
896 + ${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
|
897 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
898 - ${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
|
899 ${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
|
900 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
901 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
|
902 @@ -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
|
903 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
904 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
|
905 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
906 - 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
|
907 - 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
|
908 + ${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
|
909 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
910 - 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
|
911 - ${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
|
912 ${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
|
913 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
914 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
|
915 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
|
916 --- 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
|
917 +++ 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
|
918 @@ -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
|
919 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
|
920 { |
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
|
921 - 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
|
922 + 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
|
923 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
924 + 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
|
925 + 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
|
926 + 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
|
927 + 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
|
928 + 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
|
929 + } |
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
|
930 + |
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
|
931 + 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
|
932 { |
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
|
933 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
|
934 - 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
|
935 + 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
|
936 } |
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
|
937 |
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
|
938 + /* |
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
|
939 + * 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
|
940 + * 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
|
941 + * 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
|
942 + */ |
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
|
943 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
|
944 { |
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
|
945 chunk LKM::includes(); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
946 method decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
947 - method init(Ethernet::Net, PCI::Device); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
948 + 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
|
949 pointcut Ethernet::SubContext(); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
950 } |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
951 |
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
|
952 @@ -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
|
953 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
|
954 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
955 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
956 - 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
|
957 + 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
|
958 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
959 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
|
960 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
|
961 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
|
962 --- 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
|
963 +++ 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
|
964 @@ -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
|
965 -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
|
966 +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
|
967 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
968 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
|
969 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
970 @@ -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
|
971 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
|
972 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
973 |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
974 - 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
|
975 + 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
|
976 { |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
977 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
|
978 + 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
|
979 } |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
980 |
27f0e70df342
Wip on the transmission, tx init done, and tx hooked from Ethernet send
Louis Opter <louis@lse.epitech.net>
parents:
diff
changeset
|
981 LKM::init() |
85
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
982 @@ -79,4 +80,10 @@ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
983 * 4096, 8192 and 16384 bytes: |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
984 */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
985 e1000::rx_buffer_len = 2048; |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
986 + /* |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
987 + * 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
|
988 + * 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
|
989 + * 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
|
990 + */ |
5dda73e7d728
Add my WIP on the actual tx
Louis Opter <louis@lse.epitech.net>
parents:
84
diff
changeset
|
991 + 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
|
992 } |
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
|
993 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
|
994 --- 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
|
995 +++ b/rathaxes/samples/e1000/socket.blt |
88 | 996 @@ -1,20 +1,153 @@ |
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
|
997 -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
|
998 +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
|
999 { |
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
|
1000 + 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
|
1001 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1002 + 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
|
1003 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1004 + #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
|
1005 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1006 + 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
|
1007 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1008 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1009 + 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
|
1010 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1011 + 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
|
1012 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1013 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1014 + 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
|
1015 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1016 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1017 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1018 + |
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
|
1019 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
|
1020 { |
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
|
1021 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
|
1022 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1023 - #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
|
1024 - 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
|
1025 + 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
|
1026 } |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
1027 |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
1028 chunk ::decl() |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
1029 { |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
1030 - 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
|
1031 + 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
|
1032 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1033 + 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
|
1034 + 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
|
1035 + }; |
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
|
1036 } |
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
|
1037 |
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
|
1038 - 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
|
1039 + 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
|
1040 { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1041 + static void rtx_socket_skbuff_dump_infos(struct rtx_socket_skbuff *); |
88 | 1042 + static int rtx_socket_skbuff_map(struct rtx_socket_skbuff *, struct device *, enum dma_data_direction); |
1043 + static void rtx_socket_skbuff_unmap_and_free(struct rtx_socket_skbuff *, struct device *, enum dma_data_direction); | |
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
|
1044 + } |
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
|
1045 + |
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
|
1046 + 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
|
1047 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1048 + 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
|
1049 + { |
88 | 1050 + WARN_ON(!self->skbuff); |
1051 + | |
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
|
1052 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1053 + * 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
|
1054 + * 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
|
1055 + * 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
|
1056 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1057 + ${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
|
1058 + 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
|
1059 + "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
|
1060 + }; |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1061 + 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
|
1062 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1063 + 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
|
1064 + "\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
|
1065 + "\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
|
1066 + "\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
|
1067 + "\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
|
1068 + "\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
|
1069 + 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
|
1070 + 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
|
1071 + 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
|
1072 + 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
|
1073 + ); |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1074 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1075 + |
88 | 1076 + static int rtx_socket_skbuff_map(struct rtx_socket_skbuff *self, |
1077 + struct device *dev, | |
1078 + enum dma_data_direction direction) | |
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
|
1079 + { |
88 | 1080 + WARN_ON(!self->skbuff); |
1081 + WARN_ON(!self->skbuff->data); | |
1082 + WARN_ON(self->dma_handle); | |
1083 + | |
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
|
1084 + 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
|
1085 + 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
|
1086 + 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
|
1087 + skb_headlen(self->skbuff), |
88 | 1088 + direction); |
1089 + int err = dma_mapping_error(dev, self->dma_handle); | |
1090 + if (err) | |
1091 + { | |
1092 + self->dma_handle = 0; | |
1093 + return err; | |
1094 + } | |
1095 + return 0; | |
1096 + } | |
1097 + | |
1098 + static void rtx_socket_skbuff_unmap_and_free(struct rtx_socket_skbuff *self, | |
1099 + struct device *dev, | |
1100 + enum dma_data_direction direction) | |
1101 + { | |
1102 + WARN_ON(!self->skbuff); | |
1103 + WARN_ON(!self->skbuff->data); | |
1104 + | |
1105 + if (self->dma_handle) | |
1106 + { | |
1107 + dma_unmap_single(dev, | |
1108 + self->dma_handle, | |
1109 + skb_headlen(self->skbuff), | |
1110 + direction); | |
1111 + self->dma_handle = 0; | |
1112 + } | |
1113 + dev_kfree_skb_any(self->skbuff); | |
1114 + self->skbuff = 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
|
1115 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1116 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1117 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1118 + /* |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1119 + * 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
|
1120 + * 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
|
1121 + * 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
|
1122 + */ |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1123 + 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
|
1124 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1125 + ${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
|
1126 + ${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
|
1127 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1128 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1129 + 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
|
1130 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1131 + 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
|
1132 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1133 + |
88 | 1134 + chunk map_to(Device::Device dev) |
1135 + { | |
1136 + rtx_socket_skbuff_map(${self}, ${dev}, DMA_TO_DEVICE); | |
1137 + } | |
1138 + | |
1139 + chunk map_from(Device::Device dev) | |
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
|
1140 + { |
88 | 1141 + rtx_socket_skbuff_map(${self}, ${dev}, DMA_FROM_DEVICE); |
1142 + } | |
1143 + | |
1144 + chunk unmap_to_and_free(Device::Device dev) | |
1145 + { | |
1146 + rtx_socket_skbuff_unmap_and_free(${self}, ${dev}, DMA_TO_DEVICE); | |
1147 + } | |
1148 + | |
1149 + chunk unmap_from_and_free(Device::Device dev) | |
1150 + { | |
1151 + rtx_socket_skbuff_unmap_and_free(${self}, ${dev}, DMA_FROM_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
|
1152 } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1153 |
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
|
1154 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
|
1155 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
|
1156 --- 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
|
1157 +++ b/rathaxes/samples/e1000/socket.rti |
88 | 1158 @@ -1,8 +1,22 @@ |
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
|
1159 -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
|
1160 +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
|
1161 { |
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
|
1162 - 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
|
1163 - chunk LKM::includes(); |
86
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
1164 - method decl(); |
c99e69966dd3
WIP/Cleanup on the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
85
diff
changeset
|
1165 - 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
|
1166 + 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
|
1167 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1168 + 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
|
1169 + 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
|
1170 + } |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1171 + |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1172 + 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
|
1173 + { |
e9736ab70995
Add a couple of patches to the build system and WIP on the e1000 code architecture to implement the tranmission
Louis Opter <louis@lse.epitech.net>
parents:
86
diff
changeset
|
1174 + 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
|
1175 + 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
|
1176 + 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
|
1177 + 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
|
1178 + 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
|
1179 + method dump_infos(); |
88 | 1180 + method map_to(Device::Device); |
1181 + method map_from(Device::Device); | |
1182 + method unmap_to_and_free(Device::Device); | |
1183 + method unmap_from_and_free(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
|
1184 } |
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
|
1185 } |