comparison rathaxes_correctly_use_chunk_and_template_sequences_parameters_in_e1000.patch @ 73:c189b4b44060

Automated merge with https://www.kalessin.fr/projs/hg/epitech/mq/rathaxes/
author Louis Opter <louis@lse.epita.fr>
date Sun, 19 Feb 2012 12:08:54 +0100
parents 3d37fa01b19c 6e9dcbd120c5
children
comparison
equal deleted inserted replaced
71:3d37fa01b19c 73:c189b4b44060
174 { 174 {
175 + rtx_e1000_print_status(&${ctx}->hw_ctx); 175 + rtx_e1000_print_status(&${ctx}->hw_ctx);
176 } 176 }
177 } 177 }
178 178
179 @@ -275,7 +293,7 @@ 179 @@ -273,9 +291,9 @@
180 180 }
181 chunk ::CALL() 181 }
182
183 - chunk ::CALL()
184 + chunk ::CALL
182 { 185 {
183 - rtx_e1000_register_read32(&${ctx}, ${reg_offset}); 186 - rtx_e1000_register_read32(&${ctx}, ${reg_offset});
184 + rtx_e1000_register_read32(${ctx}, ${reg_offset}); 187 + rtx_e1000_register_read32(${ctx}, ${reg_offset});
185 } 188 }
186 } 189 }
191 194
192 - chunk ::CALL() 195 - chunk ::CALL()
193 + chunk ::CALL 196 + chunk ::CALL
194 { 197 {
195 - rtx_e1000_register_write32(&${ctx}, ${reg_offset}); 198 - rtx_e1000_register_write32(&${ctx}, ${reg_offset});
196 + rtx_e1000_register_write32(${ctx}, ${reg_offset}); 199 + rtx_e1000_register_write32(${ctx}, ${reg_offset}, ${value});
197 } 200 }
198 } 201 }
199 202
200 @@ -315,17 +333,18 @@ 203 @@ -315,17 +333,19 @@
201 } 204 }
202 } 205 }
203 206
204 - chunk ::CALL() 207 - chunk ::CALL()
205 + chunk ::CALL 208 + chunk ::CALL
206 { 209 {
210 + rtx_e1000_register_set32(${ctx}, ${reg_offset}, ${value});
207 } 211 }
208 } 212 }
209 213
210 - template sequence e1000::setup_interrupt_handler() 214 - template sequence e1000::setup_interrupt_handler()
211 + template sequence e1000::setup_interrupt_handler(Ethernet::Device ctx) 215 + template sequence e1000::setup_interrupt_handler(Ethernet::Device ctx)
216 } 220 }
217 + 221 +
218 chunk LKM::prototypes() 222 chunk LKM::prototypes()
219 { 223 {
220 static int e1000_setup_interrupt_handler(struct rtx_ethernet_dev *); 224 static int e1000_setup_interrupt_handler(struct rtx_ethernet_dev *);
221 @@ -345,20 +364,20 @@ 225 @@ -345,20 +365,20 @@
222 226
223 if (error) 227 if (error)
224 { 228 {
225 - ${Log::info("Cannot register the interruption")}; 229 - ${Log::info("Cannot register the interruption")};
226 + ${Log::info("cannot register the interrupt handler")}; 230 + ${Log::info("cannot register the interrupt handler")};
240 - error = e1000_setup_interrupt_handler(rtx_ether_dev); 244 - error = e1000_setup_interrupt_handler(rtx_ether_dev);
241 + error = e1000_setup_interrupt_handler(${ctx}); 245 + error = e1000_setup_interrupt_handler(${ctx});
242 if (error) 246 if (error)
243 { 247 {
244 return error; 248 return error;
245 @@ -367,7 +386,7 @@ 249 @@ -367,7 +387,7 @@
246 } 250 }
247 } 251 }
248 252
249 - template sequence e1000::free_interrupt_handler() 253 - template sequence e1000::free_interrupt_handler()
250 + template sequence e1000::free_interrupt_handler(Ethernet::Device ctx) 254 + template sequence e1000::free_interrupt_handler(Ethernet::Device ctx)
251 { 255 {
252 chunk LKM::prototypes() 256 chunk LKM::prototypes()
253 { 257 {
254 @@ -378,22 +397,21 @@ 258 @@ -378,22 +398,21 @@
255 { 259 {
256 static void e1000_free_interrupt_handler(struct rtx_ethernet_dev *ethernet_ctx) 260 static void e1000_free_interrupt_handler(struct rtx_ethernet_dev *ethernet_ctx)
257 { 261 {
258 - 262 -
259 free_irq(ethernet_ctx->hw_ctx.irq, ethernet_ctx); 263 free_irq(ethernet_ctx->hw_ctx.irq, ethernet_ctx);
277 - rtx_e1000_register_write32(ctx, E1000_IMS, 281 - rtx_e1000_register_write32(ctx, E1000_IMS,
278 + rtx_e1000_register_write32(&${ctx}->hw_ctx, E1000_IMS, 282 + rtx_e1000_register_write32(&${ctx}->hw_ctx, E1000_IMS,
279 E1000_INTR_TXDW | 283 E1000_INTR_TXDW |
280 E1000_INTR_TXQE | 284 E1000_INTR_TXQE |
281 E1000_INTR_LSC | 285 E1000_INTR_LSC |
282 @@ -402,11 +420,11 @@ 286 @@ -402,11 +421,11 @@
283 } 287 }
284 } 288 }
285 289
286 - template sequence e1000::set_up_device() 290 - template sequence e1000::set_up_device()
287 + template sequence e1000::set_up_device(Ethernet::Device ctx) 291 + template sequence e1000::set_up_device(Ethernet::Device ctx)
292 - rtx_e1000_register_set32(ctx, E1000_CTRL, 296 - rtx_e1000_register_set32(ctx, E1000_CTRL,
293 + rtx_e1000_register_set32(&${ctx}->hw_ctx, E1000_CTRL, 297 + rtx_e1000_register_set32(&${ctx}->hw_ctx, E1000_CTRL,
294 E1000_CMD_ASDE | 298 E1000_CMD_ASDE |
295 E1000_CMD_SLU | 299 E1000_CMD_SLU |
296 E1000_CMD_LRST | 300 E1000_CMD_LRST |
297 @@ -414,20 +432,20 @@ 301 @@ -414,20 +433,20 @@
298 } 302 }
299 } 303 }
300 304
301 - template sequence e1000::handle_intr() 305 - template sequence e1000::handle_intr()
302 + template sequence e1000::handle_interrupt(Ethernet::Device ctx) 306 + template sequence e1000::handle_interrupt(Ethernet::Device ctx)
723 LKM::description = "Hello World Loadable Kernel Module (LKM)"; 727 LKM::description = "Hello World Loadable Kernel Module (LKM)";
724 LKM::license = "GPL"; 728 LKM::license = "GPL";
725 729
726 PCI::vendor_id = 0x8086; 730 PCI::vendor_id = 0x8086;
727 - PCI::product_id = 0x100f; 731 - PCI::product_id = 0x100f;
728 + PCI::product_id = 0x100e; 732 + PCI::product_id = 0x100e; /* e100f on vmware by default it seems */
729 PCI::set_master = true; 733 PCI::set_master = true;
730 734
731 Ethernet::ifname = "rtx%d"; 735 Ethernet::ifname = "rtx%d";
732 diff --git a/rathaxes/samples/e1000/log.blt b/rathaxes/samples/e1000/log.blt 736 diff --git a/rathaxes/samples/e1000/log.blt b/rathaxes/samples/e1000/log.blt
733 --- a/rathaxes/samples/e1000/log.blt 737 --- a/rathaxes/samples/e1000/log.blt