/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
/*
* b_generic.c :
* This file contains the functions for generic block devices
* for libsmedia.
*/
#include <stdio.h>
#include <unistd.h>
#include <locale.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_BLKDEV_VERSION_1);
}
{
if (ctype == DKC_BLKDEV) {
if (mtype == 0)
return (0);
}
return (-1);
}
{
int ret_val;
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF2("Signature expected=0x%x, found=0x%x\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);
}
if (ret_val < 0) {
DPRINTF("DKIOCGGEOM ioctl failed");
return (ret_val);
}
return (0);
}
/* ARGSUSED0 */
{
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF2("Signature expected=0x%x, found=0x%x\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);
}
/* Note: we could potentially offer more here */
vendor_name[0] = 0;
product_name[0] = 0;
fw_version[0] = 0;
return (0);
}
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
return (-1);
}
return (0);
}