# HG changeset patch # User Louis Opter # Date 1374885312 25200 # Node ID d84bc9a4677114b0ec848c078ab12ca683c4ff3a # Parent ad21d8a182add372225a44eafd7b62fc84dcb0ac WIP, finally the alloc_skbuff method will be in the Ethernet subsystem since, the socket subsystem cannot depend on Ethernet (that would cause a circular dependency) diff -r ad21d8a182ad -r d84bc9a46771 rathaxes_samples_e1000_add_a_dma_abstraction.patch --- a/rathaxes_samples_e1000_add_a_dma_abstraction.patch Fri Jul 26 16:44:08 2013 -0700 +++ b/rathaxes_samples_e1000_add_a_dma_abstraction.patch Fri Jul 26 17:35:12 2013 -0700 @@ -1,6 +1,6 @@ # HG changeset patch -# Parent 61470dc5e775a696da551b5227663bf2659f8f4b -e1000: start a DMA allocation/mapping abstraction +# Parent fb28afe4be73b2dc25945c07dcac93718b0f3e3e +rathaxes: start a DMA allocation/mapping abstraction in the e1000 sample It currently matches a lot the Linux DMA API but it should be usable by other OSes too. The Linux DMA API is described at the end of the chapter diff -r ad21d8a182ad -r d84bc9a46771 rathaxes_samples_e1000_add_alloc_sequences_in_socket.patch --- a/rathaxes_samples_e1000_add_alloc_sequences_in_socket.patch Fri Jul 26 16:44:08 2013 -0700 +++ b/rathaxes_samples_e1000_add_alloc_sequences_in_socket.patch Fri Jul 26 17:35:12 2013 -0700 @@ -1,20 +1,35 @@ # HG changeset patch -# Parent 9f743313820393d900d65aa6f2532c7d820de04b -Add alloc_rx and alloc_tx in the Socket abstraction +# Parent 17641176926da447613bc9729bccf37d673276a0 +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.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, …); + + attribute Device::AbstractDevice.ref device; + attribute PCI::AbstractDevice.ref pci_device; diff --git a/rathaxes/samples/e1000/socket.rti b/rathaxes/samples/e1000/socket.rti --- a/rathaxes/samples/e1000/socket.rti +++ b/rathaxes/samples/e1000/socket.rti @@ -1,4 +1,4 @@ -interface Socket : LKM, Device, DMA -+interface Socket : LKM, Device, DMA, Ethernet, Builtin ++interface Socket : LKM, Device, DMA, Builtin { /* The SKBuff type from the kernel */ provided type AbstractSKBuff -@@ -10,15 +10,25 @@ +@@ -10,15 +10,15 @@ provided type SKBuff { @@ -36,16 +51,6 @@ + method map_from(Device::AbstractDevice); + method unmap_to_and_free(Device::AbstractDevice); + method unmap_from_and_free(Device::AbstractDevice); -+ } -+ -+ provided sequence alloc_rx(Ethernet::Device, Builtin::number) -+ { -+ chunk ::CALL(); -+ } -+ -+ provided sequence alloc_tx(Ethernet::Device, Builtin::number) -+ { -+ chunk ::CALL(); - attribute Socket::AbstractSKBuff.ref k_sk_buff; - attribute DMA::AbstractDMAHandle.scalar k_dma_handle; + attribute Socket::AbstractSKBuff.ref sk_buff; + attribute DMA::AbstractDMAHandle.scalar dma_handle; diff -r ad21d8a182ad -r d84bc9a46771 rathaxes_samples_e1000_use_the_dma_abstraction_in_socket.patch --- a/rathaxes_samples_e1000_use_the_dma_abstraction_in_socket.patch Fri Jul 26 16:44:08 2013 -0700 +++ b/rathaxes_samples_e1000_use_the_dma_abstraction_in_socket.patch Fri Jul 26 17:35:12 2013 -0700 @@ -1,6 +1,8 @@ # HG changeset patch -# Parent 0645a1612cc02ac70c718cabeaaa726cb2ecfdfd -Replace Linux specific code in Socket by DMA calls +# Parent c096b6162035042fbafb60b040180a6a5beb2a47 +rathaxes: remove some Linux DMA specific code in the socket abstraction in e1000 + +By using the new DMA abstraction. diff --git a/rathaxes/samples/e1000/socket.blt b/rathaxes/samples/e1000/socket.blt --- a/rathaxes/samples/e1000/socket.blt