cfg_link.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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <devfsadm.h>
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
#include <limits.h>
#define SCSI_CFG_LINK_RE "^cfg/c[0-9]+$"
#define SBD_CFG_LINK_RE "^cfg/((((N[0-9]+[.])?(SB|IB))?[0-9]+)|[abcd])$"
#define USB_CFG_LINK_RE "^cfg/((usb[0-9]+)/([0-9]+)([.]([0-9])+)*)$"
#define PCI_CFG_LINK_RE "^cfg/[:alnum:]$"
#define IB_CFG_LINK_RE "^cfg/(hca[0-9A-F]+)$"
#define CFG_DIRNAME "cfg"
/*
* NOTE: The CREATE_DEFER flag is private to this module.
* NOT to be used by other modules
*/
static devfsadm_create_t cfg_create_cbt[] = {
},
},
},
},
},
}
};
static devfsadm_remove_t cfg_remove_cbt[] = {
},
},
},
},
},
}
};
static int
{
};
return (DEVFSADM_CONTINUE);
}
== DEVFSADM_FAILURE) {
/*
* Unlike the disks module we don't retry on failure.
* If we have multiple "c" numbers for a single physical
* controller due to bug 4045879, we will not assign a
*/
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/* create usbN and the symlink */
return (DEVFSADM_CONTINUE);
}
/*
* get_roothub:
*/
/* ARGSUSED */
static char *
{
int i, count = 0;
/* make a copy */
return (NULL);
}
/*
* physpath must always have a minor name component
*/
return (NULL);
}
*cp++ = '\0';
/*
* No '.' in the minor name indicates a roothub port.
*/
/* roothub device */
return (physpath);
}
while (*cp) {
if (*cp == '.')
count++;
cp++;
}
/* Remove as many trailing path components as there are '.'s */
for (i = 0; i < count; i++) {
return (NULL);
}
*cp = '\0';
}
return (physpath);
}
/*
* pci_cfg_creat_cb() search the <device mask> data from
* "slot-names" PROM property for the match device number,
* then create device link with the right slot label.
*/
static int
{
char *minor_name, *dev_path;
int *devlink_flags;
"ap-names", &devlink_flags)) > 0) {
}
}
(void) di_devfs_path_free(dev_path);
return (DEVFSADM_CONTINUE);
}
/*
* ib_cfg_creat_cb() creates two types of links
*/
static int
{
char *cp;
return (DEVFSADM_CONTINUE);
}
/* create fabric or hca:GUID and the symlink */
} else {
}
return (DEVFSADM_CONTINUE);
}