changeset 16:41a434b0676b

WIP on the ethernet part of the LKM sample: set ifname + the irq in the net_device struct
author Louis Opter <louis@lse.epitech.net>
date Sat, 07 Jan 2012 11:22:10 +0100
parents 74d9d18d4732
children efe054f0989b
files rathaxes_start_to_implement_the_ethernet_subsystem_in_the_lkm.patch
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rathaxes_start_to_implement_the_ethernet_subsystem_in_the_lkm.patch	Fri Jan 06 22:46:33 2012 +0100
+++ b/rathaxes_start_to_implement_the_ethernet_subsystem_in_the_lkm.patch	Sat Jan 07 11:22:10 2012 +0100
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent 93035f60f6725e2e0f25dcb5276c45d3a44d12fa
+# Parent dd0e6d18bdef3c6ef7df3b0ed8bdbbea00406508
 rathaxes: start to implement the Ethernet subsystem in linux LKM sample
 
 diff --git a/rathaxes/samples/lkm/CMakeLists.txt b/rathaxes/samples/lkm/CMakeLists.txt
@@ -18,7 +18,7 @@
 new file mode 100644
 --- /dev/null
 +++ b/rathaxes/samples/lkm/ethernet.blt
-@@ -0,0 +1,162 @@
+@@ -0,0 +1,164 @@
 +with Ethernet, PCI, LKM
 +{
 +    template type   Ethernet::Device()
@@ -138,6 +138,8 @@
 +            net_dev = alloc_etherdev(sizeof(*rtx_ether_ctx));
 +            //if (net_dev == NULL)
 +                // How should we raise the error in the parent context?
++            strlcpy(net_dev->name, ${config.ifname}, sizeof(net_dev->name));
++            dev->irq = pdev->irq;
 +            // Maybe we should try ${rtx_ether_ctx.init()} here:
 +            rtx_ether_ctx = netdev_priv(net_dev);
 +            //rtx_ether_ctx->pci_dev = ${pdev};
@@ -185,11 +187,13 @@
 new file mode 100644
 --- /dev/null
 +++ b/rathaxes/samples/lkm/ethernet.rti
-@@ -0,0 +1,35 @@
+@@ -0,0 +1,37 @@
 +interface Ethernet : PCI, LKM
 +{
 +    provided type       Ethernet::Device;
 +
++    required variable ::string  Ethernet::ifname;
++
 +    required sequence   Ethernet::open(Ethernet::Device)
 +    {
 +        provided chunk  LKM::prototypes;
@@ -252,6 +256,13 @@
      }
  
      LKM::init()
+@@ -32,4 +44,6 @@
+ 
+     PCI::vendor_id = 0x8086;
+     PCI::product_id = 0x100f;
++
++    Ethernet::ifname = "rtx";
+ }
 diff --git a/rathaxes/samples/lkm/pci.blt b/rathaxes/samples/lkm/pci.blt
 --- a/rathaxes/samples/lkm/pci.blt
 +++ b/rathaxes/samples/lkm/pci.blt