# HG changeset patch # User Louis Opter # Date 1330790852 -3600 # Node ID c076a41a753c8b4b47795b1bf10dae9f330387aa # Parent ff90ee2fe1c4dc4ff31313df36ef88d8659f953f Build fixes + use Log::info in print_card_status diff -r ff90ee2fe1c4 -r c076a41a753c e1000_fix_and_improve_set_up_device.patch --- a/e1000_fix_and_improve_set_up_device.patch Sat Mar 03 16:00:49 2012 +0100 +++ b/e1000_fix_and_improve_set_up_device.patch Sat Mar 03 17:07:32 2012 +0100 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent b3d5483b07f7d22ea9be1ae5e7562306ea1d0024 +# Parent 0a4c7ad60a68bfd1e797c0779bc035c20780ec9f Fix and improve the e1000::set_up_device function: - The LRST and PHY_RST commands were set instead of *unset* on the @@ -8,11 +8,10 @@ manuals: unset some registers, zero out the control flow registers and the statistics registers. - 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 -@@ -58,7 +58,11 @@ +@@ -58,7 +58,12 @@ E1000_MDIC = 0x00020, /* MDI Control - RW */ E1000_IMS = 0x000D0, /* Interrupt Mask Set */ E1000_IMC = 0x000D8, /* Interrupt Mask Clear */ @@ -22,10 +21,11 @@ + E1000_FCAH = 0x0002c, /* Flow Control Address High */ + 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) */ }; } -@@ -446,11 +450,43 @@ +@@ -446,11 +451,43 @@ { chunk ::CALL { @@ -47,8 +47,8 @@ + * - CTRL.ILOS: Unset it (ILOS is Invert Loss Of Signal); + * - CTRL.VME: Make sure it's not set to disable VLAN support; + * - Set the control flow registers to 0; -+ * - Finally, initialize all the statistic registers from -+ * E1000_REG_CRCERRS to E1000_REG_TSCTFC. ++ * - Finally, initialize all the statistic registers from ++ * E1000_CRCERRS to E1000_TSCTFC. + */ rtx_e1000_register_set32(&${ctx}->hw_ctx, E1000_CTRL, E1000_CMD_ASDE | @@ -68,7 +68,7 @@ + rtx_e1000_register_write32(&${ctx}->hw_ctx, E1000_FCTTV, 0); + int i = 0; + for (i = 0; i != 64; ++i) -+ rtx_e1000_register_write32(&${ctx}->hw_ctx, E1000_REG_CRCERRS + i * 4, 0) ++ rtx_e1000_register_write32(&${ctx}->hw_ctx, E1000_CRCERRS + i * 4, 0); } } diff -r ff90ee2fe1c4 -r c076a41a753c e1000_use_log_info_in_card_status.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e1000_use_log_info_in_card_status.patch Sat Mar 03 17:07:32 2012 +0100 @@ -0,0 +1,33 @@ +# HG changeset patch +# Parent cc24d4f527d5ebe52a1880e393717c30b39ab0e3 +rathaxes: use in e1000::print_status() + +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 +@@ -249,7 +249,13 @@ + static void rtx_e1000_print_status(struct rtx_e1000_ctx *ctx) + { + unsigned int status = rtx_e1000_register_read32(ctx, E1000_STATUS); +- pr_info("card status: \n"); ++ { /* < workaround issue #10 */ ++ ${Log::info("card status:")}; ++ } ++ /* ++ * we can't use Log::info below because it just accept a string ++ * (as opposed to a format string with its parameters). ++ */ + pr_info("\tRegister value: 0x%x\n", status); + pr_info("\tMode: %s\n", (status & 1) ? "Full": "Half"); + pr_info("\tLink: %s\n", (status & 2) ? "Up" : "Down"); +@@ -469,8 +475,8 @@ + * - CTRL.ILOS: Unset it (ILOS is Invert Loss Of Signal); + * - CTRL.VME: Make sure it's not set to disable VLAN support; + * - Set the control flow registers to 0; +- * - Finally, initialize all the statistic registers from +- * E1000_CRCERRS to E1000_TSCTFC. ++ * - Finally, initialize all the statistic registers from ++ * E1000_CRCERRS to E1000_TSCTFC. + */ + rtx_e1000_register_set32(&${ctx}->hw_ctx, E1000_CTRL, + E1000_CMD_ASDE | diff -r ff90ee2fe1c4 -r c076a41a753c series --- a/series Sat Mar 03 16:00:49 2012 +0100 +++ b/series Sat Mar 03 17:07:32 2012 +0100 @@ -1,2 +1,3 @@ e1000_add_register_unset.patch e1000_fix_and_improve_set_up_device.patch +e1000_use_log_info_in_card_status.patch