Mercurial > archived > louis > epitech > mq > rathaxes
diff rathaxes_samples_e1000_add_ethernet_device_alloc_rx_skbuff.patch @ 121:6f600f83a763
WIP, fix Ethernet::Device::alloc_rx_skbuff
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Sat, 27 Jul 2013 16:08:40 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rathaxes_samples_e1000_add_ethernet_device_alloc_rx_skbuff.patch Sat Jul 27 16:08:40 2013 -0700 @@ -0,0 +1,36 @@ +# HG changeset patch +# Parent 41459510ac5d22377872c977cbd635f93623c75e +rathaxes: add an alloc_rx_skbuff method to Ethernet::Device in e1000 + +This will help to hide platform dependent code from e1000::set_up_device. + +diff --git a/rathaxes/samples/e1000/ethernet.blt b/rathaxes/samples/e1000/ethernet.blt +--- a/rathaxes/samples/e1000/ethernet.blt ++++ b/rathaxes/samples/e1000/ethernet.blt +@@ -107,6 +107,11 @@ + ${self}->net_dev = ${rtx_net_dev}; + } + ++ method alloc_rx_skbuff(Builtin::number size) ++ { ++ (${Socket::Skbuff.ref})netdev_alloc_skb(${self}, ${size}); ++ } ++ + map + { + /* +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 +@@ -30,8 +30,10 @@ + { + chunk LKM::includes(); + decl data_types(); ++ pointcut Ethernet::HardwareContext(); ++ + method init(Ethernet::AbstractDevice, PCI::AbstractDevice); +- pointcut Ethernet::HardwareContext(); ++ method alloc_rx_skbuff(Builtin::number); /* -> Socket::Skbuff.ref */ + + attribute Device::AbstractDevice.ref device; + attribute PCI::AbstractDevice.ref pci_device;