/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* a_generic.c :
* This file contains generic PCATA related functions for pcata plug-in
* for libsm.so.
*/
#include <dirent.h>
#include <fcntl.h>
#include <string.h>
#include "../../../library/common/l_defines.h"
static void
{
int error_no;
if (errno == 0)
return;
perror("");
}
_m_version_no(void)
{
return (SM_PCATA_VERSION_1);
}
{
if (ctype == DKC_PCMCIA_ATA) {
if (mtype == 0)
return (0);
}
return (-1);
}
{
DPRINTF("Null Handle\n");
return (-1);
}
"Signature expected=0x%x, found=0x%x\n",
return (-1);
}
DPRINTF("Invalid file handle.\n");
return (-1);
}
PERROR("DKIOCSTATE failed");
return (-1);
}
if (state != DKIO_INSERTED) {
DPRINTF("No media.\n");
return (0);
}
if (ret_val < 0) {
DPRINTF("DKIOCGMEDIAINFO ioctl failed");
return (ret_val);
}
/* Is it a removable magnetic disk? */
if (ret_val < 0) {
DPRINTF("DKIOCREMOVABLE ioctl failed");
return (ret_val);
}
if (removable) {
}
}
if (ret_val < 0) {
#ifdef sparc
DPRINTF("DKIOCGGEOM ioctl failed");
return (ret_val);
#else /* !sparc */
/*
* Try getting Physical geometry on x86.
*/
if (ret_val < 0) {
DPRINTF("DKIOCG_PHYGEOM ioctl failed");
return (ret_val);
}
#endif /* sparc */
}
return (0);
}
/* ARGSUSED0 */
{
DPRINTF("Null Handle\n");
return (-1);
}
"Signature expected=0x%x, found=0x%x\n",
return (-1);
}
DPRINTF("Invalid file handle.\n");
return (-1);
}
if (vendor_name == NULL) {
if (!errno)
return (-1);
}
if (product_name == NULL) {
if (!errno)
return (-1);
}
if (fw_version == NULL) {
if (!errno)
return (-1);
}
vendor_name[0] = NULL;
product_name[0] = NULL;
fw_version[0] = NULL;
return (0);
}
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
return (-1);
}
return (0);
}