f_generic.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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) 1999-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* f_generic.c :
* This file contains all the functionalities except format of
* floppy plug-in for libsm.so.
*/
#include <stdlib.h>
#include "f_defines.h"
void
my_perror(char *err_string)
{
int error_no;
if (errno == 0)
return;
perror("");
}
{
if (mtype == 0)
return (0);
}
return (-1);
}
_m_version_no(void)
{
return (SM_FD_VERSION_1);
}
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
"Signature expected=0x%x found=0x%x\n",
return (-1);
}
DPRINTF("Invalid file handle.\n");
return (-1);
}
PERROR("Ioctl failed :");
return (-1);
}
return (0);
}
/* ARGSUSED0 */
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
"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] = 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);
}
/* ARGSUSED1 */
{
int32_t j;
return (-1);
}
if (j & FDGC_CURWPROT)
else
return (0);
}
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
"Signature expected=0x%x found=0x%x\n",
return (-1);
}
DPRINTF("Invalid file handle.\n");
return (-1);
}
PERROR("Ioctl failed :");
return (-1);
}
return (-1);
}
/* MFM | MT | SK| FDRAW_RDCMD */
errno = 0;
if (ret_val < 0) {
PERROR("RAW READ failed:");
return (-1);
}
return (fdraw.fdr_nbytes);
}
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
"Signature expected=0x%x, found=0x%x\n",
return (-1);
}
DPRINTF("Invalid file handle.\n");
return (-1);
}
PERROR("Ioctl failed :");
return (-1);
}
return (-1);
}
/* MFM | MT | SK| FDRAW_WRCMD; */
errno = 0;
if (ret_val < 0) {
PERROR("RAW READ failed:");
return (-1);
}
return (fdraw.fdr_nbytes);
}
/* ARGSUSED */
{
/* Check for valid handle */
DPRINTF("Null Handle\n");
return (-1);
}
DPRINTF("Invalid signature in handle.\n");
"Signature expected=0x%x found=0x%x\n",
return (-1);
}
DPRINTF("Invalid file handle.\n");
return (-1);
}
#ifdef sparc
#else
return (-1);
#endif
}