Mercurial > archived > louis > epitech > mq > rathaxes
diff rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch @ 108:7efe3212db3a
Put the patches on e1000 above the patches on the compiler
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Sun, 31 Mar 2013 20:00:09 -0700 |
parents | f42751b8ca99 |
children |
line wrap: on
line diff
--- a/rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch Sun Mar 24 21:47:39 2013 -0700 +++ b/rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch Sun Mar 31 20:00:09 2013 -0700 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent a611642de7f291e4749a7f44027f9ebaa0cde75c +# Parent 7be52c02870a053b3a12e75423226c252e256c6b Move the interrupt handler init/cleanup out of e1000.blt This is not device dependant and can be done from the Ethernet subsystem @@ -9,7 +9,7 @@ diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt --- a/rathaxes/samples/e1000/e1000.blt +++ b/rathaxes/samples/e1000/e1000.blt -@@ -249,7 +249,6 @@ +@@ -247,7 +247,6 @@ { int bars; unsigned char /* __iomem */ *ioaddr; @@ -17,7 +17,7 @@ ${e1000::RxRing} rx_ring; ${e1000::TxRing} tx_ring; -@@ -267,14 +266,12 @@ +@@ -265,14 +264,12 @@ chunk Ethernet::adapter_init_context(Ethernet::Device rtx_ether_ctx, Builtin::number bars, @@ -26,14 +26,14 @@ + Builtin::symbol ioaddr) { { - ${e1000::Context} *hw_ctx = &${rtx_ether_ctx}->hw_ctx; + ${e1000::Context.ref} hw_ctx = &${rtx_ether_ctx}->hw_ctx; hw_ctx->bars = ${bars}; hw_ctx->ioaddr = ${ioaddr}; - hw_ctx->irq = ${irq}; } } -@@ -606,68 +603,6 @@ +@@ -605,68 +602,6 @@ } } @@ -175,11 +175,10 @@ chunk LKM::prototypes() { static int rtx_ethernet_open(struct net_device *); -@@ -123,9 +131,28 @@ - ${Ethernet::Device} *rtx_ether_ctx = netdev_priv(dev); +@@ -122,6 +130,20 @@ + { + ${Ethernet::Device.ref} rtx_ether_ctx = netdev_priv(dev); - ${cast local.rtx_ether_ctx as Ethernet::Device}; -+ + int error; + { + ${Log::info("installing the interrupt handler")}; @@ -192,24 +191,16 @@ + if (error) + { + ${Log::info("Cannot register the interrupt handler")}; -+ goto error; ++ return error; + } -+ ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)}; return 0; -+ -+ error: -+ return error; - } - } - } -@@ -165,7 +192,16 @@ - ${Ethernet::Device} *rtx_ether_ctx = netdev_priv(dev); +@@ -161,7 +183,15 @@ + { + ${Ethernet::Device.ref} rtx_ether_ctx = netdev_priv(dev); - ${cast local.rtx_ether_ctx as Ethernet::Device}; - ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)}; -+ + /* TODO: change this pointcut into a pointcut/adapter/callback: */ + { + ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)}; @@ -222,29 +213,24 @@ return 0; } -@@ -187,9 +223,12 @@ +@@ -183,7 +213,9 @@ { static enum irqreturn rtx_ethernet_interrupt_handler(int irq, void *dev_id) { -- ${Ethernet::Device} *rtx_ether_ctx = dev_id; -+ ${Ethernet::AbstractDevice} *rtx_net_dev = dev_id; -+ ${cast local.rtx_net_dev as Ethernet::AbstractDevice}; -+ ${Ethernet::Device} *rtx_ether_ctx; -+ ${cast local.rtx_ether_ctx as Ethernet::Device}; +- ${Ethernet::Device.ref} rtx_ether_ctx = dev_id; ++ ${Ethernet::AbstractDevice.ref} rtx_net_dev = dev_id; ++ ${Ethernet::Device.ref} rtx_ether_ctx; + rtx_ether_ctx = ${local.rtx_net_dev.rtx_ether_ctx}; -- ${cast local.rtx_ether_ctx as Ethernet::Device}; ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)}; - return IRQ_NONE; -@@ -267,14 +306,11 @@ +@@ -260,13 +292,10 @@ */ int bars = ${rtx_pci_dev.bars}; unsigned char /* __iomem */ *ioaddr = ${rtx_pci_dev.ioaddr}; - int irq = ${rtx_pci_dev.irq}; ${cast local.bars as Builtin::number}; - ${cast local.irq as Builtin::number}; - ${cast local.rtx_ether_ctx as Ethernet::Device}; ${pointcut Ethernet::adapter_init_context(local.rtx_ether_ctx, local.bars, - local.ioaddr, @@ -264,15 +250,19 @@ + * XXX: should be a Ethernet::Device, but that causes a circular + * dependency: + */ -+ attribute Builtin::symbol rtx_ether_ctx; ++ attribute Builtin::symbol.scalar rtx_ether_ctx; } provided type Device -@@ -36,10 +41,12 @@ +@@ -34,12 +39,14 @@ + * I'd like to use better names here, but I'd like to understand the + * difference between the two first: */ - attribute Builtin::symbol.scalar perm_addr; - attribute Builtin::symbol.scalar dev_addr; -+ attribute Builtin::symbol.scalar irq; +- attribute Builtin::symbol.ref perm_addr; +- attribute Builtin::symbol.ref dev_addr; ++ attribute Builtin::symbol.ref perm_addr; ++ attribute Builtin::symbol.ref dev_addr; ++ attribute Builtin::symbol.scalar irq; } required sequence open(Ethernet::Device)