/*
* 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
*/
/*
*/
#include <fcntl.h>
#include <libdevinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stropts.h>
#include <unistd.h>
#include <sys/efi_partition.h>
#include "libdiskmgt.h"
#include "disks_private.h"
#include "partition.h"
int *errp);
/*
* This function gets the descriptors we are associated with.
*/
descriptor_t **
int *errp)
{
return (NULL);
}
switch (type) {
case DM_DRIVE:
case DM_PARTITION:
case DM_SLICE:
}
return (NULL);
}
/*
*/
descriptor_t **
{
/*
* require media.
*/
return (libdiskmgt_empty_desc_array(errp));
} else {
return (NULL);
}
}
/* make the snapshot */
return (NULL);
}
if (*errp != 0) {
return (NULL);
}
*errp = 0;
return (media);
}
nvlist_t *
{
int fd;
return (NULL);
}
return (NULL);
}
}
if (fd >= 0) {
}
return (attrs);
}
{
int i;
if (*errp != 0) {
return (NULL);
}
for (i = 0; media[i]; i++) {
} else {
/* clean up the unused descriptors */
}
}
}
return (medium);
}
descriptor_t **
{
if (*errp != 0) {
return (NULL);
}
if (*errp != 0) {
} else {
}
}
return (media);
}
char *
{
}
/* ARGSUSED */
nvlist_t *
{
/* There are no stat types defined for media */
return (NULL);
}
int
{
int error = 0;
int locked;
dp = cache_get_disklist();
}
return (error);
}
/*
* Read the media information.
*/
int
{
int status;
int tries = 0;
minfo->dki_media_type = 0;
/*
* This ioctl can fail if the media is not loaded or spun up.
* Retrying can sometimes succeed since the first ioctl will have
* started the media before the ioctl timed out so the media may be
* spun up on the subsequent attempt.
*/
tries++;
if (tries >= IOCTLRETRIES) {
break;
}
(void) sleep(IOCTLRETRYINTERVAL);
}
if (status < 0) {
return (0);
}
return (1);
}
/* return 1 if there is media, 0 if not. */
int
{
mname[0] = 0;
/* not removable, so media name is devid */
}
return (1);
}
/* This is a removable media drive. */
}
static descriptor_t **
{
int i;
int cnt = 0;
int pos;
/* count the number of media in the snapshot */
for (i = 0; media[i]; i++) {
cnt++;
}
return (NULL);
}
pos = 0;
for (i = 0; media[i]; i++) {
int fd;
continue;
}
int mtype;
int j;
int match;
match = 0;
for (j = 0; filter[j] != DM_FILTER_END; j++) {
match = 1;
break;
}
}
if (!match) {
}
}
}
*errp = 0;
return (found);
}
/* return 1 if the media descriptor is still valid, 0 if not. */
static int
{
/* First verify the media name for removable media */
return (0);
}
if (mname[0] == 0) {
} else {
}
}
return (1);
}
static int
{
char *buff;
return (ENOMEM);
}
if (dm_debug) {
"DKIOCSMBOOT: errono: %d\n", errno);
}
return (EIO);
}
return (ENOMEM);
}
return (0);
}
static int
{
int ret;
if (fd < 0) {
return (ENODEV);
}
/* The first thing to do is read the media */
return (ENODEV);
}
return (ENOMEM);
}
if (ret != 0) {
return (ret);
}
}
return (ENOMEM);
}
return (ENOMEM);
}
}
return (ENOMEM);
}
return (ENOMEM);
}
return (ENOMEM);
}
return (ENOMEM);
}
efip->efi_first_u_lba) != 0) {
return (ENOMEM);
}
/* partition 8 is reserved on EFI labels */
}
efip->efi_first_u_lba) != 0) {
return (ENOMEM);
}
/*
* Install relies on availability of DM_NHEADS and
* DM_NSECTORS to be able to re-write a GPT labeled disk
*/
return (ENOMEM);
return (ENOMEM);
}
#else
#endif
return (ENOMEM);
}
!= 0) {
return (ENOMEM);
}
!= 0) {
return (ENOMEM);
}
return (ENOMEM);
}
return (ENOMEM);
}
return (ENOMEM);
}
!= 0) {
return (ENOMEM);
}
return (ENOMEM);
}
return (ENOMEM);
}
}
}
return (0);
}
static int
{
switch (media_type) {
case DK_UNKNOWN:
return (DM_MT_UNKNOWN);
case DK_MO_ERASABLE:
return (DM_MT_MO_ERASABLE);
case DK_MO_WRITEONCE:
return (DM_MT_MO_WRITEONCE);
case DK_AS_MO:
return (DM_MT_AS_MO);
case DK_CDROM:
return (DM_MT_CDROM);
case DK_CDR:
return (DM_MT_CDR);
case DK_CDRW:
return (DM_MT_CDRW);
case DK_DVDROM:
return (DM_MT_DVDROM);
case DK_DVDR:
return (DM_MT_DVDR);
case DK_DVDRAM:
return (DM_MT_DVDRAM);
case DK_FIXED_DISK:
return (DM_MT_FIXED);
case DK_FLOPPY:
return (DM_MT_FLOPPY);
case DK_ZIP:
return (DM_MT_ZIP);
case DK_JAZ:
return (DM_MT_JAZ);
default:
return (DM_MT_UNKNOWN);
}
}
/*
* This function handles removable media.
*/
static int
{
int loaded;
int fd;
loaded = 0;
if (LEN_DKL_VVOL < size) {
} else {
}
}
}
}
}
return (loaded);
}