audio_link.c revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e
/*
* 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
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <regex.h>
#include <devfsadm.h>
#include <strings.h>
#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <bsm/devalloc.h>
#define MAX_AUDIO_LINK 100
#define RE_SIZE 64
extern int system_labeled;
static void check_audio_link(char *secondary_link,
const char *primary_link_format);
static devfsadm_create_t audio_cbt[] = {
}
};
/*
* the following can't be one big RE with a bunch of alterations "|"
* because recurse_dev_re() would not work.
*/
static devfsadm_remove_t audio_remove_cbt[] = {
{ "audio",
"^audio(ctl)?$",
},
{ "audio",
"^sound/[0-9]+.*$",
},
{ "audio",
"^isdn/[0-9]+/mgt$",
},
{ "audio",
"^isdn/[0-9]+/aux/0(ctl)?$",
},
{ "audio",
"^isdn/[0-9]+/(nt)|(te)/((dtrace)|(mgt)|(b1)|(b2)|(d))$",
}
};
#define ISDN_RE "((nt)|(te)|(aux))\\,((0)|(0ctl)|(d)|(b1)|(b2)|(mgt)|(dtrace))"
#define F 1
#define S 5
int
minor_init(void)
{
devfsadm_errprint("SUNW_audio_link: minor_init: regular "
"expression bad: '%s'\n", ISDN_RE);
return (DEVFSADM_FAILURE);
} else {
return (DEVFSADM_SUCCESS);
}
}
int
minor_fini(void)
{
return (DEVFSADM_SUCCESS);
}
/*
* This function is called for every audio node.
* Calls enumerate to assign a logical unit id, and then
* devfsadm_mklink to make the link.
*/
static int
{
int flags = 0;
char *buf;
char *mn;
char m1[10];
char m2[10];
char *devfspath;
char *au_mn;
return (DEVFSADM_CONTINUE);
}
} else {
}
/*
* We want a match against the physical path
* without the minor name component.
*/
/*
* enumerate finds the logical audio id, and stuffs
* it in buf
*/
return (DEVFSADM_CONTINUE);
}
path[0] = '\0';
/* if this is a minor node, tack on the correct suffix */
/*
*/
}
}
pmatch, 0) == 0) {
}
}
if (path[0] == '\0') {
devfsadm_errprint("SUNW_audio_link: audio_process: can't find"
" match for'%s'\n", mn);
return (DEVFSADM_CONTINUE);
}
if (system_labeled)
return (DEVFSADM_CONTINUE);
}
static void
{
int i;
int flags = 0;
/* if link is present, return */
return;
}
if (system_labeled)
for (i = 0; i < MAX_AUDIO_LINK; i++) {
break;
}
}
}