Author: uwe Date: 2007-09-28 17:02:17 +0200 (Fri, 28 Sep 2007) New Revision: 2812
Modified: trunk/util/superiotool/smsc.c Log: Fix up the SMSC detection code to probe _both_ old- and new-style Super I/Os from SMSC. Otherwise not all of them are detected (and there could theoretically be _two_ of them in a system, so we should probe for both types anyway).
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/util/superiotool/smsc.c =================================================================== --- trunk/util/superiotool/smsc.c 2007-09-27 14:29:57 UTC (rev 2811) +++ trunk/util/superiotool/smsc.c 2007-09-28 15:02:17 UTC (rev 2812) @@ -129,23 +129,16 @@ outb(0xaa, port); }
-void probe_idregs_smsc(uint16_t port) +static void probe_idregs_smsc_helper(uint16_t port, uint8_t idreg, + uint8_t revreg) { uint8_t id, rev;
enter_conf_mode_smsc(port);
- /* Check for older SMSC Super I/Os. */ - id = regval(port, DEVICE_ID_REG_OLD); - rev = regval(port, DEVICE_REV_REG_OLD); + id = regval(port, idreg); + rev = regval(port, revreg);
- if (superio_unknown(reg_table, id)) - no_superio_found(port); - - /* Check for newer SMSC Super I/Os. */ - id = regval(port, DEVICE_ID_REG); - rev = regval(port, DEVICE_REV_REG); - if (superio_unknown(reg_table, id)) { no_superio_found(port); exit_conf_mode_smsc(port); @@ -162,3 +155,9 @@ exit_conf_mode_smsc(port); }
+void probe_idregs_smsc(uint16_t port) +{ + probe_idregs_smsc_helper(port, DEVICE_ID_REG, DEVICE_REV_REG); + probe_idregs_smsc_helper(port, DEVICE_ID_REG_OLD, DEVICE_REV_REG_OLD); +} +