# HG changeset patch # User Louis Opter # Date 1330883720 -3600 # Node ID 501bf9cf65dc8819db34d651d6f266aa91947106 # Parent 892b3bc7e43b1a84d113f344d828d5b6508c7a08 wip on e1000 add some fixes for the generation and check that it works on tip diff -r 892b3bc7e43b -r 501bf9cf65dc e1000_add_register_unset.patch --- a/e1000_add_register_unset.patch Sun Mar 04 18:35:43 2012 +0100 +++ b/e1000_add_register_unset.patch Sun Mar 04 18:55:20 2012 +0100 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent cd5050576637389b1ec0086faafc035596de237c +# Parent eb6bb1687169662741a6bd57191b750b3bcbb6b7 rathaxes: add the e1000::register_unset32() function diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt @@ -24,7 +24,7 @@ + } + } + -+ chunk ::CALL ++ chunk ::CALL() + { + rtx_e1000_register_unset32(${ctx}, ${reg_offset}, ${value}); + } @@ -36,15 +36,15 @@ 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 -@@ -82,4 +82,11 @@ - provided chunk LKM::code; - provided chunk ::CALL; +@@ -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; ++ provided chunk LKM::prototypes(); ++ provided chunk LKM::code(); ++ provided chunk ::CALL(); + } } diff -r 892b3bc7e43b -r 501bf9cf65dc e1000_initialize_reception.patch --- a/e1000_initialize_reception.patch Sun Mar 04 18:35:43 2012 +0100 +++ b/e1000_initialize_reception.patch Sun Mar 04 18:55:20 2012 +0100 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 40e5b7402e64e301b898fa4da1056a5348522fbb +# Parent 0d14f4eef173e65c3430393966e5f7e3bef7a8b2 rathaxes: initialize reception on the e1000 sample: - This is documented in details in the sections 14.4 and 3.2 of the @@ -33,7 +33,7 @@ } *rtx_e1000_ctx_p; } -@@ -36,6 +39,78 @@ +@@ -36,6 +39,82 @@ } } @@ -91,9 +91,13 @@ + */ + struct rtx_e1000_rx_ring + { -+ unsigned int size; -+ rtx_e1000_rx_descriptor_p base; -+ void *dma_base; ++ unsigned int size; ++ /* ++ * we can't use the typedef here because will not understand it ++ * in __std__ mode ++ */ ++ struct rtx_e1000_rx_descriptor *base; ++ void *dma_base; + + struct sk_buff *skbuffs[256 /* ${config.rx_ring_size} */]; + void *dma_skbuffs[256 /* ${config.rx_ring_size} */]; @@ -112,7 +116,7 @@ template type e1000::Register() { chunk LKM::includes() -@@ -64,6 +139,9 @@ +@@ -64,6 +143,9 @@ E1000_FCT = 0x00030, /* Flow Control Type */ E1000_FCTTV = 0x00170, /* Flow Control Transmit Timer Value */ E1000_CRCERRS = 0x04000, /* CRC Error Count (base address of the statistic register spaces) */ @@ -122,7 +126,7 @@ }; } -@@ -132,7 +210,8 @@ +@@ -132,7 +214,8 @@ E1000_INTR_RXDMT0 = 0x00000010, /* rx desc min. threshold (0) */ E1000_INTR_RXO = 0x00000040, /* rx overrun */ E1000_INTR_RXT0 = 0x00000080, /* rx timer intr (ring 0) */ @@ -132,8 +136,8 @@ }; } -@@ -458,14 +537,23 @@ - chunk ::CALL +@@ -458,14 +541,24 @@ + chunk ::CALL() { /* - * This is documented in the Intel Gigabit Ethernet Controller @@ -151,6 +155,7 @@ + * e1000::Context? (but we would need to make it point back to + * the struct net_device) + */ ++ typedef int ${e1000::Context}; + ${e1000::Context} hw_ctx; + hw_ctx = &${ctx}->hw_ctx; + @@ -158,7 +163,7 @@ * "General Configuration" (section 14.3): * * - CTRL.ASDE/CTRL.SLU: Let the PHY handle the speed detection & -@@ -478,22 +566,111 @@ +@@ -478,22 +571,111 @@ * - Finally, initialize all the statistic registers from * E1000_CRCERRS to E1000_TSCTFC. */ @@ -272,7 +277,7 @@ + + template sequence e1000::free_rx_tx(Ethernet::Device ctx) + { -+ chunk ::CALL ++ chunk ::CALL() + { + } @@ -291,22 +296,22 @@ /* * These two types should actually be registers definitions in the frontend: */ -@@ -57,6 +60,11 @@ - provided chunk ::CALL; +@@ -55,6 +58,11 @@ + provided chunk ::CALL(); } + provided sequence e1000::free_rx_tx(Ethernet::Device dev) + { -+ provided chunk ::CALL; ++ provided chunk ::CALL(); + } + provided sequence e1000::handle_interrupt(Ethernet::Device) { - provided chunk ::CALL; + provided chunk ::CALL(); 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 -@@ -102,7 +102,7 @@ +@@ -105,7 +105,7 @@ { static int rtx_ethernet_close(struct net_device *dev) { @@ -314,7 +319,7 @@ + struct rtx_ethernet_dev* rtx_ether_dev = netdev_priv(dev); struct rtx_e1000_ctx* ctx = &rtx_ether_dev->hw_ctx; - ${pointcut ::IMPLEMENTATION(local.rtx_ether_dev)}; + ${cast local.rtx_ether_dev as Ethernet::Device}; diff --git a/rathaxes/samples/e1000/lkm.rtx b/rathaxes/samples/e1000/lkm.rtx --- a/rathaxes/samples/e1000/lkm.rtx +++ b/rathaxes/samples/e1000/lkm.rtx