2011-06-03 22:40:41 +04:00
|
|
|
/* $NetBSD: acpi_acad.c,v 1.50 2011/06/03 18:40:41 jruoho Exp $ */
|
2001-09-29 09:35:06 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2001 Wasabi Systems, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Written by Jason R. Thorpe for Wasabi Systems, Inc.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed for the NetBSD Project by
|
|
|
|
* Wasabi Systems, Inc.
|
|
|
|
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
|
|
|
|
* or promote products derived from this software without specific prior
|
|
|
|
* written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ACPI AC Adapter driver.
|
|
|
|
*/
|
|
|
|
|
2001-11-13 16:01:57 +03:00
|
|
|
#include <sys/cdefs.h>
|
2011-06-03 22:40:41 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.50 2011/06/03 18:40:41 jruoho Exp $");
|
2001-11-13 16:01:57 +03:00
|
|
|
|
2001-09-29 09:35:06 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/device.h>
|
2010-02-28 20:22:41 +03:00
|
|
|
#include <sys/module.h>
|
2010-03-05 17:00:16 +03:00
|
|
|
#include <sys/systm.h>
|
2001-09-29 09:35:06 +04:00
|
|
|
|
|
|
|
#include <dev/acpi/acpireg.h>
|
|
|
|
#include <dev/acpi/acpivar.h>
|
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
#define _COMPONENT ACPI_ACAD_COMPONENT
|
|
|
|
ACPI_MODULE_NAME ("acpi_acad")
|
2010-01-30 21:07:06 +03:00
|
|
|
|
2010-04-27 09:57:43 +04:00
|
|
|
#define ACPI_NOTIFY_ACAD 0x80
|
|
|
|
#define ACPI_NOTIFY_ACAD_2 0x81 /* XXX. */
|
|
|
|
|
2001-09-29 09:35:06 +04:00
|
|
|
struct acpiacad_softc {
|
2010-01-31 14:16:18 +03:00
|
|
|
struct acpi_devnode *sc_node;
|
|
|
|
struct sysmon_envsys *sc_sme;
|
|
|
|
struct sysmon_pswitch sc_smpsw;
|
|
|
|
envsys_data_t sc_sensor;
|
|
|
|
int sc_status;
|
2001-09-29 09:35:06 +04:00
|
|
|
};
|
|
|
|
|
2003-11-03 09:03:47 +03:00
|
|
|
static const char * const acad_hid[] = {
|
|
|
|
"ACPI0003",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
static int acpiacad_match(device_t, cfdata_t, void *);
|
|
|
|
static void acpiacad_attach(device_t, device_t, void *);
|
|
|
|
static int acpiacad_detach(device_t, int);
|
2010-02-25 01:37:54 +03:00
|
|
|
static bool acpiacad_resume(device_t, const pmf_qual_t *);
|
2010-01-31 14:16:18 +03:00
|
|
|
static void acpiacad_get_status(void *);
|
|
|
|
static void acpiacad_notify_handler(ACPI_HANDLE, uint32_t, void *);
|
|
|
|
static void acpiacad_init_envsys(device_t);
|
2001-09-29 09:35:06 +04:00
|
|
|
|
2010-01-31 10:34:10 +03:00
|
|
|
CFATTACH_DECL_NEW(acpiacad, sizeof(struct acpiacad_softc),
|
|
|
|
acpiacad_match, acpiacad_attach, acpiacad_detach, NULL);
|
|
|
|
|
2001-09-29 09:35:06 +04:00
|
|
|
/*
|
|
|
|
* acpiacad_match:
|
|
|
|
*
|
|
|
|
* Autoconfiguration `match' routine.
|
|
|
|
*/
|
2004-05-01 16:03:27 +04:00
|
|
|
static int
|
2009-05-12 13:29:46 +04:00
|
|
|
acpiacad_match(device_t parent, cfdata_t match, void *aux)
|
2001-09-29 09:35:06 +04:00
|
|
|
{
|
|
|
|
struct acpi_attach_args *aa = aux;
|
|
|
|
|
|
|
|
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
|
2004-04-11 10:48:25 +04:00
|
|
|
return 0;
|
2001-09-29 09:35:06 +04:00
|
|
|
|
2004-04-11 10:48:25 +04:00
|
|
|
return acpi_match_hid(aa->aa_node->ad_devinfo, acad_hid);
|
2001-09-29 09:35:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* acpiacad_attach:
|
|
|
|
*
|
|
|
|
* Autoconfiguration `attach' routine.
|
|
|
|
*/
|
2004-05-01 16:03:27 +04:00
|
|
|
static void
|
2007-10-19 03:54:54 +04:00
|
|
|
acpiacad_attach(device_t parent, device_t self, void *aux)
|
2001-09-29 09:35:06 +04:00
|
|
|
{
|
2007-10-19 03:54:54 +04:00
|
|
|
struct acpiacad_softc *sc = device_private(self);
|
2001-09-29 09:35:06 +04:00
|
|
|
struct acpi_attach_args *aa = aux;
|
|
|
|
|
2006-02-20 15:17:49 +03:00
|
|
|
aprint_naive(": ACPI AC Adapter\n");
|
|
|
|
aprint_normal(": ACPI AC Adapter\n");
|
2001-09-29 09:35:06 +04:00
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
sc->sc_sme = NULL;
|
|
|
|
sc->sc_status = -1;
|
2001-09-29 09:35:06 +04:00
|
|
|
sc->sc_node = aa->aa_node;
|
2010-01-31 14:16:18 +03:00
|
|
|
|
2010-04-15 11:02:24 +04:00
|
|
|
acpiacad_init_envsys(self);
|
2001-09-29 09:35:06 +04:00
|
|
|
|
2007-10-19 03:54:54 +04:00
|
|
|
sc->sc_smpsw.smpsw_name = device_xname(self);
|
2004-05-03 11:44:36 +04:00
|
|
|
sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_ACADAPTER;
|
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
(void)sysmon_pswitch_register(&sc->sc_smpsw);
|
|
|
|
(void)pmf_device_register(self, NULL, acpiacad_resume);
|
2010-04-15 11:02:24 +04:00
|
|
|
(void)acpi_register_notify(sc->sc_node, acpiacad_notify_handler);
|
2001-09-29 09:35:06 +04:00
|
|
|
}
|
|
|
|
|
2010-01-31 10:34:10 +03:00
|
|
|
/*
|
|
|
|
* acpiacad_detach:
|
|
|
|
*
|
|
|
|
* Autoconfiguration `detach' routine.
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
acpiacad_detach(device_t self, int flags)
|
|
|
|
{
|
|
|
|
struct acpiacad_softc *sc = device_private(self);
|
|
|
|
|
2010-04-15 11:02:24 +04:00
|
|
|
acpi_deregister_notify(sc->sc_node);
|
2010-01-31 10:34:10 +03:00
|
|
|
|
|
|
|
if (sc->sc_sme != NULL)
|
|
|
|
sysmon_envsys_unregister(sc->sc_sme);
|
|
|
|
|
|
|
|
pmf_device_deregister(self);
|
|
|
|
sysmon_pswitch_unregister(&sc->sc_smpsw);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-03-23 19:22:00 +03:00
|
|
|
/*
|
|
|
|
* acpiacad_resume:
|
|
|
|
*
|
2010-01-31 14:16:18 +03:00
|
|
|
* Queue a new status check.
|
2008-03-23 19:22:00 +03:00
|
|
|
*/
|
|
|
|
static bool
|
2010-02-25 01:37:54 +03:00
|
|
|
acpiacad_resume(device_t dv, const pmf_qual_t *qual)
|
2008-03-23 19:22:00 +03:00
|
|
|
{
|
|
|
|
|
2011-01-04 08:48:48 +03:00
|
|
|
(void)AcpiOsExecute(OSL_NOTIFY_HANDLER, acpiacad_get_status, dv);
|
2010-01-31 14:16:18 +03:00
|
|
|
|
2008-03-23 19:22:00 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2001-09-29 09:35:06 +04:00
|
|
|
/*
|
|
|
|
* acpiacad_get_status:
|
|
|
|
*
|
|
|
|
* Get, and possibly display, the current AC line status.
|
|
|
|
*/
|
2004-05-01 16:03:27 +04:00
|
|
|
static void
|
2001-09-29 09:35:06 +04:00
|
|
|
acpiacad_get_status(void *arg)
|
|
|
|
{
|
2007-10-19 03:54:54 +04:00
|
|
|
device_t dv = arg;
|
|
|
|
struct acpiacad_softc *sc = device_private(dv);
|
2004-03-24 14:26:46 +03:00
|
|
|
ACPI_INTEGER status;
|
2003-11-03 21:07:10 +03:00
|
|
|
ACPI_STATUS rv;
|
2001-09-29 09:35:06 +04:00
|
|
|
|
2003-11-03 21:07:10 +03:00
|
|
|
rv = acpi_eval_integer(sc->sc_node->ad_handle, "_PSR", &status);
|
2010-01-31 14:16:18 +03:00
|
|
|
|
2003-11-03 21:07:10 +03:00
|
|
|
if (ACPI_FAILURE(rv))
|
2010-01-31 14:16:18 +03:00
|
|
|
goto fail;
|
2001-09-29 09:35:06 +04:00
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
if (status != 0 && status != 1) {
|
|
|
|
rv = AE_BAD_VALUE;
|
|
|
|
goto fail;
|
Imported envsys 2, a brief description of the new features:
(Part 2: drivers)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:37:12 +04:00
|
|
|
}
|
2002-12-31 08:26:56 +03:00
|
|
|
|
2010-10-25 11:48:03 +04:00
|
|
|
if (sc->sc_status != (int)status) {
|
2010-01-31 14:16:18 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If status has changed, send the event:
|
|
|
|
*
|
|
|
|
* PSWITCH_EVENT_PRESSED : _PSR = 1 : AC online.
|
|
|
|
* PSWITCH_EVENT_RELEASED : _PSR = 0 : AC offline.
|
|
|
|
*/
|
|
|
|
sysmon_pswitch_event(&sc->sc_smpsw, (status != 0) ?
|
Imported envsys 2, a brief description of the new features:
(Part 2: drivers)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:37:12 +04:00
|
|
|
PSWITCH_EVENT_PRESSED : PSWITCH_EVENT_RELEASED);
|
2010-01-31 14:16:18 +03:00
|
|
|
|
|
|
|
aprint_debug_dev(dv, "AC adapter %sconnected\n",
|
|
|
|
status == 0 ? "not " : "");
|
Imported envsys 2, a brief description of the new features:
(Part 2: drivers)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 11:37:12 +04:00
|
|
|
}
|
2003-02-16 19:50:09 +03:00
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
sc->sc_status = status;
|
|
|
|
sc->sc_sensor.state = ENVSYS_SVALID;
|
|
|
|
sc->sc_sensor.value_cur = sc->sc_status;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
fail:
|
|
|
|
sc->sc_status = -1;
|
2007-11-16 11:00:11 +03:00
|
|
|
sc->sc_sensor.state = ENVSYS_SINVALID;
|
2010-01-31 14:16:18 +03:00
|
|
|
|
|
|
|
aprint_debug_dev(dv, "failed to evaluate _PSR: %s\n",
|
|
|
|
AcpiFormatException(rv));
|
2001-09-29 09:35:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* acpiacad_notify_handler:
|
|
|
|
*
|
|
|
|
* Callback from ACPI interrupt handler to notify us of an event.
|
|
|
|
*/
|
2004-05-01 16:03:27 +04:00
|
|
|
static void
|
2010-01-31 14:16:18 +03:00
|
|
|
acpiacad_notify_handler(ACPI_HANDLE handle, uint32_t notify, void *context)
|
2001-09-29 09:35:06 +04:00
|
|
|
{
|
2010-01-31 14:16:18 +03:00
|
|
|
static const int handler = OSL_NOTIFY_HANDLER;
|
2007-10-19 03:54:54 +04:00
|
|
|
device_t dv = context;
|
2001-09-29 09:35:06 +04:00
|
|
|
|
|
|
|
switch (notify) {
|
|
|
|
/*
|
|
|
|
* XXX So, BusCheck is not exactly what I would expect,
|
|
|
|
* but at least my IBM T21 sends it on AC adapter status
|
|
|
|
* change. --thorpej@wasabisystems.com
|
|
|
|
*/
|
2006-05-01 00:44:35 +04:00
|
|
|
/*
|
|
|
|
* XXX My Acer TravelMate 291 sends DeviceCheck on AC
|
|
|
|
* adapter status change.
|
|
|
|
* --rpaulo@NetBSD.org
|
|
|
|
*/
|
2007-06-27 23:44:50 +04:00
|
|
|
/*
|
2010-04-27 09:57:43 +04:00
|
|
|
* XXX Sony VAIO VGN-N250E sends 0x81 on AC adapter status change.
|
2007-06-27 23:44:50 +04:00
|
|
|
* --jmcneill@NetBSD.org
|
|
|
|
*/
|
2010-04-27 09:57:43 +04:00
|
|
|
case ACPI_NOTIFY_ACAD:
|
|
|
|
case ACPI_NOTIFY_ACAD_2:
|
|
|
|
case ACPI_NOTIFY_BUS_CHECK:
|
|
|
|
case ACPI_NOTIFY_DEVICE_CHECK:
|
2010-01-31 14:16:18 +03:00
|
|
|
(void)AcpiOsExecute(handler, acpiacad_get_status, dv);
|
2001-09-29 09:35:06 +04:00
|
|
|
break;
|
|
|
|
|
2010-10-28 22:03:11 +04:00
|
|
|
case ACPI_NOTIFY_DEVICE_WAKE:
|
|
|
|
break;
|
|
|
|
|
2001-09-29 09:35:06 +04:00
|
|
|
default:
|
2010-10-28 22:03:11 +04:00
|
|
|
aprint_debug_dev(dv, "unknown notify 0x%02X\n", notify);
|
2001-09-29 09:35:06 +04:00
|
|
|
}
|
|
|
|
}
|
2002-12-31 08:26:56 +03:00
|
|
|
|
2004-05-01 16:03:27 +04:00
|
|
|
static void
|
2007-10-19 03:54:54 +04:00
|
|
|
acpiacad_init_envsys(device_t dv)
|
2002-12-31 08:26:56 +03:00
|
|
|
{
|
2007-10-19 03:54:54 +04:00
|
|
|
struct acpiacad_softc *sc = device_private(dv);
|
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
sc->sc_sme = sysmon_envsys_create();
|
2010-01-31 14:16:18 +03:00
|
|
|
|
|
|
|
sc->sc_sensor.state = ENVSYS_SINVALID;
|
2007-11-16 11:00:11 +03:00
|
|
|
sc->sc_sensor.units = ENVSYS_INDICATOR;
|
2010-01-31 14:16:18 +03:00
|
|
|
|
|
|
|
(void)strlcpy(sc->sc_sensor.desc, "connected", ENVSYS_DESCLEN);
|
2002-12-31 08:26:56 +03:00
|
|
|
|
2010-01-31 10:34:10 +03:00
|
|
|
if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor) != 0)
|
|
|
|
goto fail;
|
2002-12-31 08:26:56 +03:00
|
|
|
|
2007-11-16 11:00:11 +03:00
|
|
|
sc->sc_sme->sme_name = device_xname(dv);
|
|
|
|
sc->sc_sme->sme_class = SME_CLASS_ACADAPTER;
|
2010-01-31 14:16:18 +03:00
|
|
|
sc->sc_sme->sme_flags = SME_DISABLE_REFRESH;
|
2007-11-16 11:00:11 +03:00
|
|
|
|
2010-01-31 10:34:10 +03:00
|
|
|
if (sysmon_envsys_register(sc->sc_sme) != 0)
|
|
|
|
goto fail;
|
|
|
|
|
2010-01-31 14:16:18 +03:00
|
|
|
(void)AcpiOsExecute(OSL_NOTIFY_HANDLER, acpiacad_get_status, dv);
|
|
|
|
|
2010-01-31 10:34:10 +03:00
|
|
|
return;
|
|
|
|
|
|
|
|
fail:
|
|
|
|
aprint_error_dev(dv, "failed to initialize sysmon\n");
|
2011-06-03 22:40:41 +04:00
|
|
|
|
2010-01-31 10:34:10 +03:00
|
|
|
sysmon_envsys_destroy(sc->sc_sme);
|
|
|
|
sc->sc_sme = NULL;
|
2002-12-31 08:26:56 +03:00
|
|
|
}
|
2010-02-28 20:22:41 +03:00
|
|
|
|
|
|
|
MODULE(MODULE_CLASS_DRIVER, acpiacad, NULL);
|
|
|
|
|
2011-02-16 11:35:51 +03:00
|
|
|
#ifdef _MODULE
|
|
|
|
#include "ioconf.c"
|
|
|
|
#endif
|
2010-02-28 20:22:41 +03:00
|
|
|
|
|
|
|
static int
|
2011-02-16 11:35:51 +03:00
|
|
|
acpiacad_modcmd(modcmd_t cmd, void *aux)
|
2010-02-28 20:22:41 +03:00
|
|
|
{
|
2011-02-16 11:35:51 +03:00
|
|
|
int rv = 0;
|
2010-02-28 20:22:41 +03:00
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
|
|
|
|
case MODULE_CMD_INIT:
|
|
|
|
|
2011-02-16 11:35:51 +03:00
|
|
|
#ifdef _MODULE
|
|
|
|
rv = config_init_component(cfdriver_ioconf_acpiacad,
|
|
|
|
cfattach_ioconf_acpiacad, cfdata_ioconf_acpiacad);
|
|
|
|
#endif
|
|
|
|
break;
|
2010-02-28 20:22:41 +03:00
|
|
|
|
|
|
|
case MODULE_CMD_FINI:
|
|
|
|
|
2011-02-16 11:35:51 +03:00
|
|
|
#ifdef _MODULE
|
|
|
|
rv = config_fini_component(cfdriver_ioconf_acpiacad,
|
|
|
|
cfattach_ioconf_acpiacad, cfdata_ioconf_acpiacad);
|
|
|
|
#endif
|
|
|
|
break;
|
2010-02-28 20:22:41 +03:00
|
|
|
|
|
|
|
default:
|
2011-02-16 11:35:51 +03:00
|
|
|
rv = ENOTTY;
|
2010-02-28 20:22:41 +03:00
|
|
|
}
|
|
|
|
|
2011-02-16 11:35:51 +03:00
|
|
|
return rv;
|
|
|
|
}
|