Mercurial > archived > louis > epitech > mq > rathaxes
diff rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch @ 105:fb20f01ea997
Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Fri, 22 Mar 2013 00:25:52 -0700 |
parents | c4c33ac02b93 |
children | 976a4b87803f |
line wrap: on
line diff
--- a/rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch Fri Mar 22 00:06:00 2013 -0700 +++ b/rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch Fri Mar 22 00:25:52 2013 -0700 @@ -1,5 +1,10 @@ # HG changeset patch -# Parent 68c4f142af579e558314cdeebd091fc5abd62014 +# Parent 1e9f01563db8cac05d81f26c5e100d9629b67f1e +Move the interrupt handler init/cleanup out of e1000.blt + +This is not device dependant and can be done from the Ethernet subsystem +right now, (plus the interrupt handler itself was already in the +Ethernet subsytem). diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt --- a/rathaxes/samples/e1000/e1000.blt @@ -141,7 +146,13 @@ { template type Ethernet::ProtocolId() { -@@ -111,6 +111,11 @@ +@@ -106,11 +106,17 @@ + net_device: ${self}->net_dev; + perm_addr: ${self}->net_dev->ndev.perm_addr; + dev_addr: ${self}->net_dev->ndev.dev_addr; ++ irq: ${self}->pci_dev->data.irq; + } + } template sequence Ethernet::open(Ethernet::Device dev) { @@ -153,7 +164,7 @@ chunk LKM::prototypes() { static int rtx_ethernet_open(struct net_device *); -@@ -123,9 +128,28 @@ +@@ -123,9 +129,28 @@ ${Ethernet::Device} *rtx_ether_ctx = netdev_priv(dev); ${cast local.rtx_ether_ctx as Ethernet::Device}; @@ -166,7 +177,7 @@ + rtx_ethernet_interrupt_handler, + IRQF_SHARED, + ${config.name}, -+ ${local.rtx_net_dev.k_net_dev}); ++ dev); + if (error) + { + ${Log::info("Cannot register the interrupt handler")}; @@ -182,7 +193,7 @@ } } } -@@ -165,7 +189,16 @@ +@@ -165,7 +190,16 @@ ${Ethernet::Device} *rtx_ether_ctx = netdev_priv(dev); ${cast local.rtx_ether_ctx as Ethernet::Device}; @@ -193,14 +204,14 @@ + ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)}; + } + -+ free_irq(${local.rtx_ether_ctx.irq}, ${local.rtx_net_dev.k_net_dev}); ++ free_irq(${local.rtx_ether_ctx.irq}, dev); + { + ${Log::info("interrupt handler free'ed")}; + } return 0; } -@@ -267,14 +300,11 @@ +@@ -267,14 +301,11 @@ */ int bars = ${rtx_pci_dev.bars}; unsigned char /* __iomem */ *ioaddr = ${rtx_pci_dev.ioaddr}; @@ -219,7 +230,12 @@ diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti --- a/rathaxes/samples/e1000/ethernet.rti +++ b/rathaxes/samples/e1000/ethernet.rti -@@ -40,6 +40,7 @@ +@@ -36,10 +36,12 @@ + */ + attribute Builtin::symbol perm_addr; + attribute Builtin::symbol dev_addr; ++ attribute Builtin::symbol irq; + } required sequence open(Ethernet::Device) { @@ -227,7 +243,7 @@ provided chunk LKM::prototypes(); provided chunk LKM::code(); } -@@ -69,8 +70,7 @@ +@@ -69,8 +71,7 @@ provided pointcut Ethernet::adapter_init_context(Ethernet::Device, Builtin::number,