misc_link.c revision 5d41001a9500cedff204767de21831d30c455733
/*
* 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 <regex.h>
#include <devfsadm.h>
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/cpuid_drv.h>
static devfsadm_create_t misc_cbt[] = {
{ "pseudo", "ddi_pseudo", "(^sad$)",
},
{ "pseudo", "ddi_pseudo", "zsh",
},
},
},
},
},
},
{ "pseudo", "ddi_pseudo", "(^winlock$)|(^pm$)",
},
{ "pseudo", "ddi_pseudo", "conskbd",
},
{ "pseudo", "ddi_pseudo", "consms",
},
{ "pseudo", "ddi_pseudo", "rsm",
},
{ "pseudo", "ddi_pseudo",
"(^lockstat$)|(^SUNW,rtvc$)|(^vol$)|(^log$)|(^sy$)|"
"(^ksyms$)|(^clone$)|(^tl$)|(^tnf$)|(^kstat$)|(^mdesc$)|(^eeprom$)|"
"(^ptsl$)|(^mm$)|(^wc$)|(^dump$)|(^cn$)|(^svvslo$)|(^ptm$)|"
"(^ptc$)|(^openeepr$)|(^poll$)|(^sysmsg$)|(^random$)|(^trapstat$)|"
"(^cryptoadm$)|(^crypto$)|(^pool$)|(^poolctl$)|(^bl$)|(^kmdb$)|"
"(^sysevent$)|(^kssl$)|(^physmem$)",
},
{ "pseudo", "ddi_pseudo",
"(^ip$)|(^tcp$)|(^udp$)|(^icmp$)|"
"(^ip6$)|(^tcp6$)|(^udp6$)|(^icmp6$)|"
"(^rts$)|(^arp$)|(^ipsecah$)|(^ipsecesp$)|(^keysock$)|(^spdsock$)|"
"(^nca$)|(^rds$)|(^sdp$)|(^ipnet$)|(^dlpistub$)|(^bpf$)",
},
{ "pseudo", "ddi_pseudo",
"(^ipf$)|(^ipnat$)|(^ipstate$)|(^ipauth$)|"
"(^ipsync$)|(^ipscan$)|(^iplookup$)",
},
{ "pseudo", "ddi_pseudo", "dld",
},
{ "pseudo", "ddi_pseudo",
"(^kdmouse$)|(^rootprop$)",
},
{ "pseudo", "ddi_pseudo", "tod",
},
{ "pseudo", "ddi_pseudo", "envctrl(two)?",
},
{ "pseudo", "ddi_pseudo", "fcode",
},
},
{ "FC port", "ddi_ctl:devctl", "fp",
},
},
{ "pseudo", "ddi_pseudo", "se",
},
},
{ "pseudo", "ddi_pseudo", "gpio_87317",
},
{ "pseudo", "ddi_pseudo", "sckmdrv",
},
{ "pseudo", "ddi_pseudo", "oplkmdrv",
},
},
{ "pseudo", "ddi_pseudo", "tsalarm",
},
{ "pseudo", "ddi_pseudo", "ntwdt",
},
{ "pseudo", "ddi_pseudo", "daplt",
},
{ "pseudo", "ddi_pseudo", "zcons",
},
},
{ "pseudo", "ddi_pseudo", "glvc",
},
{ "pseudo", "ddi_pseudo", "dm2s",
},
{ "pseudo", "ddi_pseudo", "nsmb",
},
{ "pseudo", "ddi_pseudo", "mem_cache",
},
{ "pseudo", "ddi_pseudo", "fm",
},
{ "pseudo", "ddi_pseudo", "tpm",
},
};
static devfsadm_remove_t misc_remove_cbt[] = {
{ "pseudo", "^profile$",
},
{ "pseudo", "^rsm$",
},
{ "printer", "^printers/[0-9]+$",
},
{ "av", "^av/[0-9]+/(async|isoch)$",
},
{ "pseudo", "^daplt$",
},
ZCONS_SLAVE_NAME ")$",
},
},
},
{ "pseudo", "^pfil$",
},
{ "pseudo", "^tpm$",
},
{ "pseudo", "^sctp|sctp6$",
}
};
/* Rules for gpio devices */
/*
* Handles minor node type "ddi_display".
*
* type=ddi_display fbs/\M0 fb\N0
*/
static int
{
/* create fbs/\M0 primary link */
/* create fb\N0 which links to fbs/\M0 */
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/*
* Handles minor node type "ddi_parallel".
* type=ddi_parallel;name=mcpp mcpp\N0
*/
static int
{
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
static int
{
char *buf;
char *devfspath;
/* find devices path -- need to free mem */
return (DEVFSADM_CONTINUE);
}
/* find next number to use; buf is an ascii number */
/* free memory */
return (DEVFSADM_CONTINUE);
}
/* free memory */
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
/*
* Handles links of the form:
* type=ddi_pseudo;name=xyz \D
*/
static int
{
return (DEVFSADM_CONTINUE);
}
/*
* Handles links of the form:
* type=ddi_pseudo;name=xyz \M0
*/
static int
{
}
}
}
return (DEVFSADM_CONTINUE);
}
/*
*/
static int
{
char buf[256];
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
static int
{
char *ptr;
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/*
* Handles:
* minor node type "ddi_printer".
* rules of the form: type=ddi_printer;name=bpp \M0
*/
static int
{
char *mn;
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/*
* Handles links of the form:
* type=ddi_pseudo;name=se;minor2=hdlc se_hdlc\N0
* type=ddi_pseudo;name=serial;minor2=hdlc se_hdlc\N0
*/
static int
{
char *ptr;
char *mn;
/* minor node should be of the form: "?,hdlc" */
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
static int
{
return (DEVFSADM_CONTINUE);
}
/* build the physical path from the components */
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/*
*/
static int
{
return (DEVFSADM_CONTINUE);
}
/*
* Handles:
*/
static int
{
char *minor_str;
char *buf;
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/*
*/
static int
{
return (DEVFSADM_CONTINUE);
}
/*
*/
static int
{
return (DEVFSADM_CONTINUE);
}
static int
{
char *minor_str;
char *zonename;
char path[MAXPATHLEN];
&zonename) == -1) {
return (DEVFSADM_CONTINUE);
}
return (DEVFSADM_CONTINUE);
}
/*
*/
static int
{
return (DEVFSADM_CONTINUE);
}
/*
* For device
* /dev/spfma -> /devices/virtual-devices/fma@5:glvc
*/
static int
{
/* Only one fma channel */
}
return (DEVFSADM_CONTINUE);
}
/*
* Handles links of the form:
* type=ddi_pseudo;name=sckmdrv kmdrv\M0
* type=ddi_pseudo;name=oplkmdrv kmdrv\M0
*/
static int
{
return (DEVFSADM_CONTINUE);
}