svn commit: r200554 - head/sys/dev/fdc

Jung-uk Kim jkim at FreeBSD.org
Mon Dec 14 14:28:32 PST 2009


Author: jkim
Date: Mon Dec 14 22:28:32 2009
New Revision: 200554
URL: http://svn.freebsd.org/changeset/base/200554

Log:
  Remove _FDE quirk handling as these quirks are automatically repaired
  by ACPICA layer since ACPICA 20091214.

Modified:
  head/sys/dev/fdc/fdc_acpi.c

Modified: head/sys/dev/fdc/fdc_acpi.c
==============================================================================
--- head/sys/dev/fdc/fdc_acpi.c	Mon Dec 14 22:24:04 2009	(r200553)
+++ head/sys/dev/fdc/fdc_acpi.c	Mon Dec 14 22:28:32 2009	(r200554)
@@ -97,9 +97,7 @@ fdc_acpi_attach(device_t dev)
 	struct fdc_data *sc;
 	ACPI_BUFFER buf;
 	device_t bus;
-	int error, fde_count, i;
-	ACPI_OBJECT *obj, *pkg;
-	uint32_t fde[ACPI_FDC_MAXDEVS];
+	int error;
 
 	/* Get our softc and use the same accessor as ISA. */
 	sc = device_get_softc(dev);
@@ -128,63 +126,12 @@ fdc_acpi_attach(device_t dev)
 	 */
 	bus = device_get_parent(dev);
 	if (ACPI_FAILURE(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf))) {
-		error = ENXIO;
-		goto out_hintsprobe;
-	}
-
-	/* Parse the output of _FDE in various ways. */
-	obj = pkg = (ACPI_OBJECT *)buf.Pointer;
-	switch (obj->Type) {
-	case ACPI_TYPE_BUFFER:
-		/*
-		 * The spec says _FDE should be a buffer of five 32-bit
-		 * integers.  In violation of the spec, some systems use
-		 * five bytes instead.
-		 */
-		switch (obj->Buffer.Length) {
-		case ACPI_FDC_FDE_LEN:
-			bcopy(obj->Buffer.Pointer, fde, ACPI_FDC_FDE_LEN);
-			break;
-		case ACPI_FDC_MAXDEVS:
-			for (i = 0; i < ACPI_FDC_MAXDEVS; i++)
-				fde[i] = ((uint8_t *)obj->Buffer.Pointer)[i];
-			break;
-		default:
-			device_printf(dev, "_FDE wrong length: %d\n",
-			    obj->Buffer.Length);
-			error = ENXIO;
-			goto out_hintsprobe;
-		}
-		break;
-	case ACPI_TYPE_PACKAGE:
-		/*
-		 * In violation of the spec, systems including the ASUS
-		 * K8V return a package of five integers instead of a
-		 * buffer of five 32-bit integers.
-		 */
-		fde_count = min(ACPI_FDC_MAXDEVS, pkg->Package.Count);
-		for (i = 0; i < fde_count; i++) {
-			obj = &pkg->Package.Elements[i];
-			if (obj->Type == ACPI_TYPE_INTEGER)
-				fde[i] = (uint32_t)obj->Integer.Value;
-		}
-		break;
-	default:
-		device_printf(dev, "invalid _FDE type %d\n", obj->Type);
-		error = ENXIO;
-		goto out_hintsprobe;
+		error = fdc_hints_probe(dev);
+		goto out;
 	}
 
 	/* Add fd child devices as specified. */
-	error = fdc_acpi_probe_children(bus, dev, fde);
-
-out_hintsprobe:
-	/*
-	 * If there was a problem with the _FDE drive enumeration, fall
-	 * back to the hints-based probe.
-	 */
-	if (error)
-		error = fdc_hints_probe(dev);
+	error = fdc_acpi_probe_children(bus, dev, buf.Pointer);
 
 out:
 	if (buf.Pointer)


More information about the svn-src-all mailing list