Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Feb 2009 22:09:49 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188346 - in stable/7/sys: . contrib/pf dev/acpi_support dev/ath/ath_hal dev/cxgb
Message-ID:  <200902082209.n18M9nIo036273@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Sun Feb  8 22:09:49 2009
New Revision: 188346
URL: http://svn.freebsd.org/changeset/base/188346

Log:
  MFC r180268:
  	Fix my previous commit. We actually should pass evaluation args in
  	AcpiEvaluateObject() calls, otherwise, we are not able to bring devices
  	back up (NULL means 0, hence always off).
  	While there add missing WLAN on/off support.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/acpi_support/acpi_asus.c
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/acpi_support/acpi_asus.c
==============================================================================
--- stable/7/sys/dev/acpi_support/acpi_asus.c	Sun Feb  8 22:08:48 2009	(r188345)
+++ stable/7/sys/dev/acpi_support/acpi_asus.c	Sun Feb  8 22:09:49 2009	(r188346)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 #define ACPI_ASUS_METHOD_LCD	3
 #define ACPI_ASUS_METHOD_CAMERA	4
 #define ACPI_ASUS_METHOD_CARDRD 5
+#define ACPI_ASUS_METHOD_WLAN	6
 
 #define _COMPONENT	ACPI_OEM
 ACPI_MODULE_NAME("ASUS")
@@ -88,6 +89,9 @@ struct acpi_asus_model {
 	char	*crd_get;
 	char	*crd_set;
 
+	char	*wlan_get;
+	char	*wlan_set;
+
 	void	(*n_func)(ACPI_HANDLE, UINT32, void *);
 
 	char	*lcdd;
@@ -130,6 +134,7 @@ struct acpi_asus_softc {
 	int			s_lcd;
 	int			s_cam;
 	int			s_crd;
+	int			s_wlan;
 };
 
 static void	acpi_asus_lcdd_notify(ACPI_HANDLE h, UINT32 notify,
@@ -423,6 +428,8 @@ static struct acpi_asus_model acpi_eeepc
 		.cam_set	= "\\_SB.ATKD.CAMS",
 		.crd_set	= "\\_SB.ATKD.CRDS",
 		.crd_get	= "\\_SB.ATKD.CRDG",
+		.wlan_get	= "\\_SB.ATKD.WLDG",
+		.wlan_set	= "\\_SB.ATKD.WLDS",
 		.n_func		= acpi_asus_eeepc_notify
 	},
 
@@ -465,6 +472,12 @@ static struct {
 		.description	= "internal card reader state",
 		.flags 		= CTLTYPE_INT | CTLFLAG_RW
 	},
+	{
+		.name		= "wlan",
+		.method		= ACPI_ASUS_METHOD_WLAN,
+		.description	= "wireless lan state",
+		.flags		= CTLTYPE_INT | CTLFLAG_RW
+	},
 
 	{ .name = NULL }
 };
@@ -950,6 +963,9 @@ acpi_asus_sysctl_get(struct acpi_asus_so
 	case ACPI_ASUS_METHOD_CARDRD:
 		val = sc->s_crd;
 		break;
+	case ACPI_ASUS_METHOD_WLAN:
+		val = sc->s_wlan;
+		break;
 	}
 
 	return (val);
@@ -958,11 +974,18 @@ acpi_asus_sysctl_get(struct acpi_asus_so
 static int
 acpi_asus_sysctl_set(struct acpi_asus_softc *sc, int method, int arg)
 {
-	ACPI_STATUS	status = AE_OK;
+	ACPI_STATUS		status = AE_OK;
+	ACPI_OBJECT_LIST 	acpiargs;
+	ACPI_OBJECT		acpiarg[0];
 
 	ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 	ACPI_SERIAL_ASSERT(asus);
 
+	acpiargs.Count = 1;
+	acpiargs.Pointer = acpiarg;
+	acpiarg[0].Type = ACPI_TYPE_INTEGER;
+	acpiarg[0].Integer.Value = arg;
+
 	switch (method) {
 	case ACPI_ASUS_METHOD_BRN:
 		if (arg < 0 || arg > 15)
@@ -1015,7 +1038,7 @@ acpi_asus_sysctl_set(struct acpi_asus_so
 			return (EINVAL);
 
 		status = AcpiEvaluateObject(sc->handle,
-		    sc->model->cam_set, NULL, NULL);
+		    sc->model->cam_set, &acpiargs, NULL);
 
 		if (ACPI_SUCCESS(status))
 			sc->s_cam = arg;
@@ -1025,11 +1048,21 @@ acpi_asus_sysctl_set(struct acpi_asus_so
 			return (EINVAL);
 
 		status = AcpiEvaluateObject(sc->handle,
-		    sc->model->crd_set, NULL, NULL);
+		    sc->model->crd_set, &acpiargs, NULL);
 
 		if (ACPI_SUCCESS(status))
 			sc->s_crd = arg;
 		break;
+	case ACPI_ASUS_METHOD_WLAN:
+		if (arg < 0 || arg > 1)
+			return (EINVAL);
+
+		status = AcpiEvaluateObject(sc->handle,
+		    sc->model->wlan_set, &acpiargs, NULL);
+
+		if (ACPI_SUCCESS(status))
+			sc->s_wlan = arg;
+		break;
 	}
 
 	return (0);
@@ -1140,6 +1173,14 @@ acpi_asus_sysctl_init(struct acpi_asus_s
 				return (TRUE);
 		}
 		return (FALSE);
+	case ACPI_ASUS_METHOD_WLAN:
+		if (sc->model->wlan_get) {
+			status = acpi_GetInteger(sc->handle,
+			    sc->model->wlan_get, &sc->s_wlan);
+			if (ACPI_SUCCESS(status))
+				return (TRUE);
+		}
+		return (FALSE);
 	}
 	return (FALSE);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902082209.n18M9nIo036273>