4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /*
27 * PCMCIA NEXUS
28 * The PCMCIA module is a generalized interface for
29 * implementing PCMCIA nexus drivers. It preserves
30 * the logical socket name space while allowing multiple
31 * instances of the hardware to be properly represented
32 * in the device tree.
33 *
34 * The nexus also exports events to an event manager
35 * driver if it has registered.
36 */
37
38 #include <sys/types.h>
39 #include <sys/systm.h>
40 #include <sys/user.h>
41 #include <sys/buf.h>
42 #include <sys/file.h>
43 #include <sys/uio.h>
833 proplen = ppd->ppd_nreg * sizeof (struct pcm_regs);
834 break;
835 case PCMCIA_PROP_INTR:
836 propptr = (caddr_t)&ppd->ppd_intr;
837 break;
838
839 /* the next set are boolean values */
840 case PCMCIA_PROP_ACTIVE:
841 propptr = NULL;
842 if (!ppd->ppd_active) {
843 return (DDI_PROP_NOT_FOUND);
844 }
845 break;
846 case PCMCIA_PROP_R2TYPE:
847 propptr = NULL;
848 if (ppd->ppd_flags & PPD_CARD_CARDBUS)
849 return (DDI_PROP_NOT_FOUND);
850 break;
851 case PCMCIA_PROP_CARDBUS:
852 propptr = NULL;
853 if (!(ppd->ppd_flags * PPD_CARD_CARDBUS))
854 return (DDI_PROP_NOT_FOUND);
855 break;
856 }
857
858 break;
859
860 case PCMCIA_PROP_CIS:
861 /*
862 * once we have the lookup code in place
863 * it is sufficient to break out of the switch
864 * once proplen and propptr are set.
865 * The common prop_op code deals with the rest.
866 */
867 case PCMCIA_PROP_UNKNOWN:
868 return (ddi_bus_prop_op(dev, dip, ch_dip, prop_op,
869 mod_flags | DDI_PROP_NOTPROM,
870 name, valuep, lengthp));
871 }
872
873 if (prop_op == PROP_LEN) {
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 *
25 * Copyright 2017 RackTop Systems.
26 */
27
28 /*
29 * PCMCIA NEXUS
30 * The PCMCIA module is a generalized interface for
31 * implementing PCMCIA nexus drivers. It preserves
32 * the logical socket name space while allowing multiple
33 * instances of the hardware to be properly represented
34 * in the device tree.
35 *
36 * The nexus also exports events to an event manager
37 * driver if it has registered.
38 */
39
40 #include <sys/types.h>
41 #include <sys/systm.h>
42 #include <sys/user.h>
43 #include <sys/buf.h>
44 #include <sys/file.h>
45 #include <sys/uio.h>
835 proplen = ppd->ppd_nreg * sizeof (struct pcm_regs);
836 break;
837 case PCMCIA_PROP_INTR:
838 propptr = (caddr_t)&ppd->ppd_intr;
839 break;
840
841 /* the next set are boolean values */
842 case PCMCIA_PROP_ACTIVE:
843 propptr = NULL;
844 if (!ppd->ppd_active) {
845 return (DDI_PROP_NOT_FOUND);
846 }
847 break;
848 case PCMCIA_PROP_R2TYPE:
849 propptr = NULL;
850 if (ppd->ppd_flags & PPD_CARD_CARDBUS)
851 return (DDI_PROP_NOT_FOUND);
852 break;
853 case PCMCIA_PROP_CARDBUS:
854 propptr = NULL;
855 if (!(ppd->ppd_flags & PPD_CARD_CARDBUS))
856 return (DDI_PROP_NOT_FOUND);
857 break;
858 }
859
860 break;
861
862 case PCMCIA_PROP_CIS:
863 /*
864 * once we have the lookup code in place
865 * it is sufficient to break out of the switch
866 * once proplen and propptr are set.
867 * The common prop_op code deals with the rest.
868 */
869 case PCMCIA_PROP_UNKNOWN:
870 return (ddi_bus_prop_op(dev, dip, ch_dip, prop_op,
871 mod_flags | DDI_PROP_NOTPROM,
872 name, valuep, lengthp));
873 }
874
875 if (prop_op == PROP_LEN) {
|