Mercurial > archived > louis > epitech > mq > rathaxes
view e1000_add_register_unset.patch @ 80:0354cceee710
WIP on e1000, try to add the code to free the RX ring when shutting the interface down
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Sun, 15 Apr 2012 02:53:38 +0200 |
parents | 501bf9cf65dc |
children |
line wrap: on
line source
# HG changeset patch # Parent eb6bb1687169662741a6bd57191b750b3bcbb6b7 rathaxes: add the e1000::register_unset32() function diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt --- a/rathaxes/samples/e1000/e1000.blt +++ b/rathaxes/samples/e1000/e1000.blt @@ -339,6 +339,27 @@ } } + template sequence e1000::register_unset32(e1000::Context ctx, e1000::Register reg_offset, ::number value) + { + chunk LKM::prototypes() + { + static void rtx_e1000_register_unset32(struct rtx_e1000_ctx *, unsigned int, unsigned int); + } + + chunk LKM::code() + { + static void rtx_e1000_register_unset32(struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value) + { + iowrite32(rtx_e1000_register_read32(ctx, reg_offset) & ~value, ctx->ioaddr + reg_offset); + } + } + + chunk ::CALL() + { + rtx_e1000_register_unset32(${ctx}, ${reg_offset}, ${value}); + } + } + template sequence e1000::setup_interrupt_handler(Ethernet::Device ctx) { chunk LKM::includes() diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti --- a/rathaxes/samples/e1000/e1000.rti +++ b/rathaxes/samples/e1000/e1000.rti @@ -80,4 +80,11 @@ provided chunk LKM::code(); provided chunk ::CALL(); } + + provided sequence e1000::register_unset32(e1000::Context, e1000::Register, ::number) + { + provided chunk LKM::prototypes(); + provided chunk LKM::code(); + provided chunk ::CALL(); + } }