# HG changeset patch # User Thomas Sanchez # Date 1325980963 -3600 # Node ID 62fba8b9db063c903442e953474fe6ac514666ed # Parent 60a59bf708df82548a103bdffa69021b81f647ea Minor fixes diff -r 60a59bf708df -r 62fba8b9db06 e1000_rework_without_explicit_call.patch --- a/e1000_rework_without_explicit_call.patch Sun Jan 08 00:39:56 2012 +0100 +++ b/e1000_rework_without_explicit_call.patch Sun Jan 08 01:02:43 2012 +0100 @@ -1,10 +1,10 @@ # HG changeset patch -# Parent c3265ca219d51aa493db9639444eba7d72812e69 +# Parent 1cfa6a46c673fae191ce982e2ebd471f9a53ee90 rathaxes: initialize the e1000 sepcific code in an elegant implicit way -diff -r c3265ca219d5 -r 5c8bb469d5a5 rathaxes/samples/lkm/e1000.blt ---- a/rathaxes/samples/lkm/e1000.blt Sun Jan 08 00:13:22 2012 +0100 -+++ b/rathaxes/samples/lkm/e1000.blt Sun Jan 08 00:35:30 2012 +0100 +diff -r 1cfa6a46c673 rathaxes/samples/lkm/e1000.blt +--- a/rathaxes/samples/lkm/e1000.blt Sun Jan 08 01:01:14 2012 +0100 ++++ b/rathaxes/samples/lkm/e1000.blt Sun Jan 08 01:02:13 2012 +0100 @@ -27,9 +27,9 @@ } } @@ -17,7 +17,7 @@ { rtx_ether_ctx->hw_ctx.bars = pci_select_bars(pdev, IORESOURCE_MEM); if (pci_enable_device_mem(pdev)) -@@ -54,11 +54,15 @@ +@@ -54,18 +54,25 @@ ${Log::info("e1000::create: pci_ioremap_bar failed")}; } } @@ -35,19 +35,20 @@ { // XXX: add a check in order to avoid freeing none allocated // resources. -@@ -67,5 +71,9 @@ + struct rtx_ethernet_dev* rtx_ether_ctx = netdev_priv(net_dev); + iounmap(rtx_ether_ctx->hw_ctx.ioaddr); pci_release_selected_regions(pdev, rtx_ether_ctx->hw_ctx.bars); - pci_release_region(pdev, 0); - } +- pci_release_region(pdev, 0); ++ } + + chunk ::CALL + { -+ } + } } } -diff -r c3265ca219d5 -r 5c8bb469d5a5 rathaxes/samples/lkm/e1000.rti ---- a/rathaxes/samples/lkm/e1000.rti Sun Jan 08 00:13:22 2012 +0100 -+++ b/rathaxes/samples/lkm/e1000.rti Sun Jan 08 00:35:30 2012 +0100 +diff -r 1cfa6a46c673 rathaxes/samples/lkm/e1000.rti +--- a/rathaxes/samples/lkm/e1000.rti Sun Jan 08 01:01:14 2012 +0100 ++++ b/rathaxes/samples/lkm/e1000.rti Sun Jan 08 01:02:13 2012 +0100 @@ -3,13 +3,15 @@ provided type e1000::Context; @@ -66,9 +67,9 @@ provided chunk ::CALL; } } -diff -r c3265ca219d5 -r 5c8bb469d5a5 rathaxes/samples/lkm/ethernet.blt ---- a/rathaxes/samples/lkm/ethernet.blt Sun Jan 08 00:13:22 2012 +0100 -+++ b/rathaxes/samples/lkm/ethernet.blt Sun Jan 08 00:35:30 2012 +0100 +diff -r 1cfa6a46c673 rathaxes/samples/lkm/ethernet.blt +--- a/rathaxes/samples/lkm/ethernet.blt Sun Jan 08 01:01:14 2012 +0100 ++++ b/rathaxes/samples/lkm/ethernet.blt Sun Jan 08 01:02:13 2012 +0100 @@ -173,6 +173,7 @@ /* same problem as above with ${pdev} */ //pci_set_drvdata(${pdev}, net_dev); @@ -86,9 +87,9 @@ unregister_netdev(net_dev); /* * If we had some cleanup todo with struct rtx_ether_ctx we would -diff -r c3265ca219d5 -r 5c8bb469d5a5 rathaxes/samples/lkm/ethernet.rti ---- a/rathaxes/samples/lkm/ethernet.rti Sun Jan 08 00:13:22 2012 +0100 -+++ b/rathaxes/samples/lkm/ethernet.rti Sun Jan 08 00:35:30 2012 +0100 +diff -r 1cfa6a46c673 rathaxes/samples/lkm/ethernet.rti +--- a/rathaxes/samples/lkm/ethernet.rti Sun Jan 08 01:01:14 2012 +0100 ++++ b/rathaxes/samples/lkm/ethernet.rti Sun Jan 08 01:02:13 2012 +0100 @@ -33,6 +33,8 @@ provided chunk LKM::data; provided chunk PCI::pci_probe_hook; @@ -106,3 +107,37 @@ + provided pointcut Ethernet::destroy_device; } } +diff -r 1cfa6a46c673 rathaxes/samples/lkm/lkm.rtx +--- a/rathaxes/samples/lkm/lkm.rtx Sun Jan 08 01:01:14 2012 +0100 ++++ b/rathaxes/samples/lkm/lkm.rtx Sun Jan 08 01:02:13 2012 +0100 +@@ -20,30 +20,14 @@ + Log::info("We have one packet to transmit!"); + } + +-// PCI::probe(PCI::Device dev) +-// { +-// Log::info("Probe the device"); +-// Ethernet::init(dev); +-// e1000::create(); +-// } +- +-// PCI::remove(PCI::Device dev) +-// { +-// Log::info("Remove the pci device"); +-// e1000::destroy(); +-// Ethernet::exit(dev); +-// } +- + LKM::init() + { + Log::info("Hello this is LKM"); +- // PCI::register(); + } + + LKM::exit() + { + Log::info("Good bye this was LKM"); +- // PCI::unregister(); + } + } + diff -r 60a59bf708df -r 62fba8b9db06 rathaxes_add_a_patch_to_illustrate_issue_8.patch --- a/rathaxes_add_a_patch_to_illustrate_issue_8.patch Sun Jan 08 00:39:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -# HG changeset patch -# Parent f91d274916763989466df5f948ee32a48930b028 -Add a patch to illustrate pointcuts in type definition to illustrate #8 - -diff --git a/rathaxes/samples/lkm/e1000.blt b/rathaxes/samples/lkm/e1000.blt ---- a/rathaxes/samples/lkm/e1000.blt -+++ b/rathaxes/samples/lkm/e1000.blt -@@ -2,25 +2,20 @@ - { - template type e1000::Context() - { -- chunk LKM::includes() -+ chunk Ethernet::Context() - { -- /* -- * Force the generation of the structure in the "headers part, we -- * have to do this since we do not use the structure in this blt -- * (we hacked a bit and used it in ethernet.blt directly). -- */ -- typedef int ${e1000::Context}; /* CNorm __std__ workaround */ -- ${e1000::Context} force_declaration_in_includes; -+ struct -+ { -+ int bars; -+ unsigned char /* __iomem */ *ioaddr; -+ } rtx_e1000_ctx; - } - -- chunk ::decl() -- { -- struct rtx_e1000_ctx -- { -- int bars; -- unsigned char /* __iomem */ *ioaddr; -- }; -- } -+ /* -+ * Not sure about how chunk ::init will look in that case maybe we -+ * would need a second pointcut that would insert code in chunk ::init -+ * in Ethernet::Context? (and this chunk would be implemented here). -+ */ - - map - { -diff --git a/rathaxes/samples/lkm/e1000.rti b/rathaxes/samples/lkm/e1000.rti ---- a/rathaxes/samples/lkm/e1000.rti -+++ b/rathaxes/samples/lkm/e1000.rti -@@ -1,6 +1,9 @@ - interface e1000 : Socket, Ethernet, PCI, LKM - { -- provided type e1000::Context; -+ provided type e1000::Context -+ { -+ provided chunk Ethernet::Context; -+ } - - /* Not sure if we need the argument */ - provided sequence e1000::create() -diff --git a/rathaxes/samples/lkm/ethernet.blt b/rathaxes/samples/lkm/ethernet.blt ---- a/rathaxes/samples/lkm/ethernet.blt -+++ b/rathaxes/samples/lkm/ethernet.blt -@@ -22,7 +22,8 @@ - struct net_device *net_dev; - - /* while waiting on issue #8 */ -- struct rtx_e1000_ctx hw_ctx; -+ /* struct rtx_e1000_ctx hw_ctx; */ -+ ${pointcut Ethernet::Context}; - }; - } - -diff --git a/rathaxes/samples/lkm/ethernet.rti b/rathaxes/samples/lkm/ethernet.rti ---- a/rathaxes/samples/lkm/ethernet.rti -+++ b/rathaxes/samples/lkm/ethernet.rti -@@ -1,6 +1,9 @@ - interface Ethernet : Socket, PCI, LKM - { -- provided type Ethernet::Device; -+ provided type Ethernet::Device -+ { -+ provided pointcut Ethernet::Context; -+ } - - required variable ::string Ethernet::ifname; - diff -r 60a59bf708df -r 62fba8b9db06 series --- a/series Sun Jan 08 00:39:56 2012 +0100 +++ b/series Sun Jan 08 01:02:43 2012 +0100 @@ -3,7 +3,6 @@ rathaxes_start_to_implement_pci_stuff_in_the_lkm.patch rathaxes_start_to_implement_the_ethernet_subsystem_in_the_lkm.patch rathaxes_start_to_implement_sk_buff_in_the_lkm.patch -rathaxes_add_a_patch_to_illustrate_issue_8.patch pci_rework_without_explicit_call.patch ethernet_rework_without_explicit_call.patch e1000_rework_without_explicit_call.patch