cardbus.c revision bb3a048dd74d073e10c2a5d4aa060b4405ba7dfd
/*
* 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.
*/
/*
* Copyright (c) * Copyright (c) 2001 Tadpole Technology plc
* All rights reserved.
* From "@(#)pcicfg.c 1.31 99/06/18 SMI"
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Cardbus module
*/
#include <sys/ddi_impldefs.h>
#include <sys/sservice.h>
#include <sys/pcic_reg.h>
#include <sys/pcic_var.h>
#ifdef sparc
#include <sys/ddi_subrdefs.h>
#include <sys/pci_intr_lib.h>
#include <sys/mach_intr.h>
#endif
#include "cardbus.h"
#include "cardbus_parse.h"
#include "cardbus_hp.h"
#include "cardbus_cfg.h"
static int cardbus_command_default = PCI_COMM_SERR_ENABLE |
static int cardbus_next_instance = 0;
static int cardbus_count = 0;
int number_of_cardbus_cards = 0;
ddi_ctl_enum_t, void *arg, void *);
dev_info_t *, void *);
static int cardbus_name_child(dev_info_t *, char *, int);
static int parse_token(char *token);
/*
* driver global data
*/
void *cardbus_state;
int cardbus_latency_timer = 0x40;
int cardbus_debug = 0;
/*
* Module linkage information for the kernel.
*/
extern struct mod_ops mod_miscops;
"Cardbus Configurator support %I%",
};
static struct modlinkage modlinkage = {
&modlmisc,
};
int
_init(void)
{
int error;
if (error != 0)
return (error);
}
return (error);
}
int
_fini(void)
{
int error;
}
return (error);
}
int
{
}
static
struct bus_ops cardbusbus_ops = {
NULL,
NULL,
NULL,
cardbus_ctlops, /* (*bus_ctl)(); */
cardbus_get_eventcookie, /* (*bus_get_eventcookie)(); */
cardbus_add_eventcall, /* (*bus_add_eventcall)(); */
cardbus_remove_eventcall, /* (*bus_remove_eventcall)(); */
cardbus_post_event, /* (*bus_post_event)(); */
NULL, /* (*bus_intr_ctl)(); */
NULL, /* (*bus_config)(); */
NULL, /* (*bus_unconfig)(); */
NULL, /* (*bus_fm_init)(); */
NULL, /* (*bus_fm_fini)(); */
NULL, /* (*bus_enter)(); */
NULL, /* (*bus_exit)(); */
NULL, /* (*bus_power)(); */
cardbus_intr_ops /* (*bus_intr_op)(); */
};
#define CB_EVENT_TAG_INSERT 0
#define CB_EVENT_TAG_REMOVE 1
static ndi_event_definition_t cb_ndi_event_defs[] = {
};
#define CB_N_NDI_EVENTS \
(sizeof (cb_ndi_event_defs) / sizeof (cb_ndi_event_defs[0]))
#ifdef sparc
struct busnum_ctrl {
int rv;
};
static int
{
struct busnum_ctrl *ctrl;
int len;
/* check if this is a PCI bus node */
"device_type",
return (0); /* (DDI_WALK_PRUNECHILD); */
return (0); /* (DDI_WALK_PRUNECHILD); */
/* look for the bus-range property */
len = sizeof (struct cardbus_bus_range);
"cardbus_claim_pci_busnum: claim %u -> %u \n",
/* claim the bus range from the bus resource map */
NDI_RA_TYPE_PCI_BUSNUM, 0) == NDI_SUCCESS)
return (0); /* (DDI_WALK_PRUNECHILD); */
}
}
/*
* never Error return.
*/
return (DDI_WALK_TERMINATE);
}
static void
int (*f)(dev_info_t *, void *), void *arg)
{
int ret;
if (ret)
return;
}
}
{
struct busnum_ctrl ctrl;
int len;
0) != NDI_SUCCESS) {
== NDI_FAILURE) {
"NDI_RA_TYPE_PCI_BUSNUM setup fail\n");
return;
}
(void) ndi_ra_free(dip,
(void*)&ctrl);
"cardbus_walk_node_child fails\n");
} else {
"already set up %x\n", (int)next_bus);
}
}
static dev_info_t *
{
while (pdip) {
break;
}
return (pdip);
}
#endif /* sparc */
/*
* Attach a device to the cardbus infrastructure.
*/
int
{
int cb_instance;
/*
* Make sure that it is not already initialized.
*/
"cbus-instance") == 1) {
"%s%d: cardbus instance already initialized!\n",
return (DDI_FAILURE);
}
/*
* initialize soft state structure for the bus instance.
*/
return (DDI_FAILURE);
}
/*
* Save the instance number of the soft state structure for
* this bus as a devinfo property.
*/
sizeof (cb_instance)) != DDI_SUCCESS) {
"%s%d: failed to add the property 'cbus-instance'",
return (DDI_FAILURE);
}
/*
* TODO - Should probably be some sort of locking on the devinfo here.
*/
NDI_SLEEP) == NDI_SUCCESS) {
&cbp->cb_ndi_events,
NDI_SLEEP) != NDI_SUCCESS) {
"cardbus_attach: ndi_event_bind_set failed\n");
}
}
/*
* Check for device initialization property.
*/
return (DDI_FAILURE);
}
#ifdef sparc
/* a hack to fix the bus-range problem on pci root nodes */
{
}
#endif
return (DDI_SUCCESS);
}
#ifdef TODO
static int
{
int cb_instance;
/* get the instance number for the cardbus soft state data */
if (cb_instance < 0) {
return (DDI_FAILURE); /* no instance is setup for this bus */
}
while (cbdp) {
}
}
/*
* Unregister the bus with the HPS.
*
* (Note: It is assumed that the HPS framework uninstalls
* event handlers for all the hot plug slots on this bus.)
*/
(void) hpc_nexus_unregister_bus(dip);
}
if (cbp->nexus_path)
/* remove the 'cbus-instance' property from the devinfo node */
ASSERT(cardbus_count != 0);
return (DDI_SUCCESS);
}
#endif
{
#ifndef HOTPLUG
struct cardbus_config_ctrl ctrl;
int circular_count;
#endif
int cb_instance;
#if defined(CARDBUS_DEBUG)
#endif
ASSERT(cb_instance >= 0);
if (cbp->fatal_problem)
return (B_FALSE);
return (B_FALSE);
#ifdef HOTPLUG
#else
#if defined(CARDBUS_DEBUG)
#endif
return (B_FALSE);
}
/*
* The child of the dip is the cardbus dip. The child of the
* cardbus dip is the device itself
*/
#if defined(CARDBUS_DEBUG)
#endif
"cardbus_load_cardbus (%s%d): failed to attach (%d)\n",
/*
* Returning error here will cause the pcic_load_cardbus() call
* to fail. This will invoke pcic_unload_cardbus() which calls
* cardbus_unload_cardbus() below.
*/
return (B_FALSE);
}
#endif
#if defined(CARDBUS_DEBUG)
#endif
return (B_TRUE);
}
/*
* Unload the cardbus module
*/
void
{
int cb_instance;
#ifndef HOTPLUG
int rval;
#endif
ASSERT(cb_instance >= 0);
if (number_of_cardbus_cards == 0)
return;
#ifdef HOTPLUG
#else
"cardbus_unload_cardbus: calling cardbus_unconfigure_node\n");
if (rval != NDI_SUCCESS) {
"cardbus_unload_cardbus: "
"cardbus_unconfigure_node failed\n");
"cardbus(%s%d): Failed to remove device tree: "
"Slot disabled",
return;
}
(void) cardbus_unconfigure(cbp);
#endif
/*
* Inform the lower drivers that the card has been removed
*/
}
}
}
{
#ifdef HOTPLUG
int cb_instance;
ASSERT(cb_instance >= 0);
return (B_TRUE);
#endif
return (B_FALSE);
}
static int
{
int range_len, range_entries, i;
int avail_len, avail_entries;
#if defined(CARDBUS_DEBUG)
#endif
"failed to update #address-cells property\n");
return (DDI_FAILURE);
}
"failed to update #size-cells property\n");
return (DDI_FAILURE);
}
"no available property for pcmcia\n");
} else {
KM_SLEEP);
for (i = 0; i < avail_entries;
i++, old_avail_p++, new_avail_p++) {
new_avail_p->pci_phys_mid = 0;
new_avail_p->pci_size_hi = 0;
}
"available",
(int *)cb_avail_p,
(sizeof (pci_regspec_t) * avail_entries)/sizeof (int));
}
"no ranges property for pcmcia\n");
} else {
for (i = 0; i < range_entries;
i++, old_range_p++, new_range_p++) {
new_range_p->child_mid = 0;
new_range_p->size_hi = 0;
}
(int *)cb_range_p,
(sizeof (cardbus_range_t) * range_entries)/sizeof (int));
}
return (DDI_SUCCESS);
}
static void
{
#if defined(CARDBUS_DEBUG)
#endif
}
static int
{
#if defined(CARDBUS_DEBUG)
"cardbus_prop_op(%s) (dip=0x%p, op=%d, name=%s)\n",
#endif
}
static int
{
ASSERT(number_of_cardbus_cards != 0);
"cardbus_ctlops(%p, %p, %d, %p, %p)\n",
switch (ctlop) {
case DDI_CTLOPS_UNINITCHILD:
return (DDI_SUCCESS);
default:
/*
* Do Nothing
*/
"cardbus_ctlops: Unsupported DDI_CTLOP %d\n", ctlop);
case DDI_CTLOPS_SIDDEV: /* see ddi_dev_is_sid(9F) */
return (DDI_SUCCESS);
case DDI_CTLOPS_SLAVEONLY: /* see ddi_slaveonly(9F) */
return (DDI_FAILURE); /* cardbus */
case DDI_CTLOPS_REGSIZE:
case DDI_CTLOPS_NREGS:
*(int *)result = 0;
return (DDI_FAILURE);
}
break;
case DDI_CTLOPS_IOMIN:
/*
* If we are using the streaming cache, align at
* least on a cache line boundary. Otherwise use
* whatever alignment is passed in.
*/
if (arg) {
#ifdef PCI_SBUF_LINE_SIZE
#else
#endif
}
return (DDI_SUCCESS);
case DDI_CTLOPS_INITCHILD:
result));
case DDI_CTLOPS_REPORTDEV:
if (rdip == (dev_info_t *)0)
return (DDI_FAILURE);
"cardbus_ctlops: PCCard socket %d at %s@%s\n",
else {
int length;
return (DDI_FAILURE);
if (pci_rp->pci_phys_hi == 0)
else {
"Bus %3d Device %2d Function %2d",
"vendor-id", -1);
if (val32 != -1) {
val32);
}
"device-id", -1);
if (val32 != -1) {
val32);
}
"class-code", -1);
if (val32 != -1) {
const char *name;
NULL)
name);
else
}
*ptr++ = '\n';
sizeof (buf));
*ptr = '\0';
}
}
return (DDI_SUCCESS);
}
*(int *)result = 0;
return (DDI_FAILURE);
if (ctlop == DDI_CTLOPS_NREGS) {
"cardbus_ctlops, returning NREGS = %d\n", totreg);
} else if (ctlop == DDI_CTLOPS_REGSIZE) {
return (DDI_FAILURE);
"cardbus_ctlops, returning REGSIZE(%d) = %d\n",
}
return (DDI_SUCCESS);
}
static void
{
#endif
uint_t n;
/*
* Map the child configuration space to for initialization.
*
* Set the latency-timer register to values appropriate
* for the devices on the bus (based on other devices
* MIN_GNT and MAX_LAT registers.
*
* Set the fast back-to-back enable bit in the command
* register if it's supported and all devices on the bus
* have the capability.
*
*/
return;
/*
* Determine the configuration header type.
*/
/*
* Support for "command-preserve" property. Note that we
* add PCI_COMM_BACK2BACK_ENAB to the bits to be preserved
* since the obp will set this if the device supports and
* all targets on the same bus support it. Since psycho
* doesn't support PCI_COMM_BACK2BACK_ENAB, it will never
* be set. This is just here in case future revs do support
* PCI_COMM_BACK2BACK_ENAB.
*/
"command-preserve", 0);
/*
* If the device has a bus control register then program it
* based on the settings in the command register.
*/
}
#endif
/*
* Initialize cache-line-size configuration register if needed.
*/
"cache-line-size", 0) == 0) {
if (n != 0)
"cache-line-size", n);
}
/*
* Initialize latency timer registers if needed.
*/
"latency-timer", 0) == 0) {
} else {
/*
* Cardbus os only 33Mhz
*/
if (min_gnt != 0) {
}
}
if (n != 0)
"latency-timer", n);
}
}
static int
void *result)
{
char name[MAXNAMELEN];
/*
* Name the child
*/
return (DDI_FAILURE);
if (ndi_dev_is_persistent_node(child) == 0) {
/*
* Try to merge the properties from this prototype
* node into real h/w nodes.
*/
/*
* Merged ok - return failure to remove the node.
*/
return (DDI_FAILURE);
}
/*
* The child was not merged into a h/w node,
* but there's not much we can do with it other
* than return failure to cause the node to be removed.
*/
return (DDI_NOT_WELL_FORMED);
}
return (DDI_FAILURE);
}
/*
* Create ppd if needed.
*/
struct cardbus_parent_private_data *ppd;
#ifdef sparc
ppd = (struct cardbus_parent_private_data *)
kmem_zalloc(sizeof (struct cardbus_parent_private_data),
KM_SLEEP);
ppd = (struct cardbus_parent_private_data *)
kmem_zalloc(sizeof (struct cardbus_parent_private_data)
#endif
"interrupts", -1) != -1)
"cardbus_initchild: Creating empty ppd\n");
}
return (DDI_SUCCESS);
}
static int
{
char **unit_addr;
uint_t n;
/*
* Pseudo nodes indicate a prototype node with per-instance
* properties to be merged into the real h/w device node.
* The interpretation of the unit-address is DD[,F]
* where DD is the device id and F is the function.
*/
if (ndi_dev_is_persistent_node(child) == 0) {
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* Get the address portion of the node name based on
* the function and device number.
*/
return (DDI_FAILURE);
}
if (func != 0)
else
"cardbus_name_child: system init done [%x][%x][%x]"
" for %s [%s] nodeid: %x @%s\n",
return (DDI_SUCCESS);
}
static void
{
struct cardbus_parent_private_data *ppd;
#ifdef sparc
sizeof (struct intrspec));
#endif
"cardbus_removechild: ddi_set_parent_data(NULL)\n");
}
}
static char cb_bnamestr[] = "binding_name";
static char cb_venidstr[] = "VendorID";
static char cb_devidstr[] = "DeviceID";
static char cb_nnamestr[] = "nodename";
static cb_props_parse_tree_t cb_props_parse_tree[] = {
{ cb_venidstr, PT_STATE_HEX_VAR },
{ cb_devidstr, PT_STATE_HEX_VAR } };
static int
{
int state = PT_STATE_DEC_VAR;
char c;
'X')) {
token += 2;
}
while (c = *token++) {
if (isdigit(c))
continue;
if (c == PARSE_COMMA) {
il++;
token += 2;
}
continue;
}
if (!isxdigit(c)) {
return (PT_STATE_STRING_VAR);
}
}
return (state);
}
static char *
{
(**cp == PARSE_UNDERSCORE) ||
(**cp == PARSE_COMMA) ||
(**cp == PARSE_DASH)))) {
(*cp)++;
(*l)++;
}
return (cpp);
}
static int
parse_token(char *token)
{
int k = sizeof (cb_props_parse_tree) /
sizeof (cb_props_parse_tree_t);
while (k--) {
pt++;
}
return (PT_STATE_UNKNOWN);
}
static int
{
uchar_t c;
*val = 0;
token += 2;
}
while (*token) {
if (*token == PARSE_COMMA) {
if (!(--len))
return (1);
val++;
*val = 0;
token++;
token += 2;
}
continue;
}
return (0);
}
if (c >= 'A')
c = c - 'A' + 10 + '0';
token++;
}
return (1);
}
static int
{
*val = 0;
while (*token) {
if (*token == PARSE_COMMA) {
if (!(--len))
return (1);
val++;
*val = 0;
token++;
continue;
}
return (0);
}
token++;
}
return (1);
}
static void
{
}
static void
{
len + 1);
}
static void
{
switch (propp->prop_flags) {
case DDI_PROP_TYPE_STRING:
break;
case DDI_PROP_TYPE_INT:
break;
}
}
}
static void
{
while (propp) {
}
if (cbdp->binding_name)
1);
}
/*
* Format of "cb-device-init-props" property:
* Anything before the semi-colon is an identifying equate, anything
* after the semi-colon is a setting equate.
*
* "binding_name=xXxXxX VendorID=NNNN DeviceID=NNNN; nodename=NewName
* Prop=PropVal"
*
*/
static int
{
int length;
char *token = "beginning of line";
struct cb_deviceset_props *cdsp;
KM_SLEEP);
/*
* Check for escaped characters
*/
if (*cp == PARSE_ESCAPE) {
em = 1;
if (!qm) {
"escape not allowed outside "
"of quotes at [%s]\n", token);
return (DDI_FAILURE);
} /* if (!qm) */
while (*cppp)
l++;
} /* PARSE_ESCAPE */
/*
* Check for quoted strings
*/
qm ^= 1;
if (qm) {
} else {
if (state == PT_STATE_CHECK) {
KM_SLEEP);
quote);
} else
} else if (state != PT_STATE_STRING_VAR) {
"cardbus_parse_devprop: "
"unexpected string [%s] after "
return (DDI_FAILURE);
} else {
KM_SLEEP);
(void) strcpy(
}
}
} /* if (qm) */
} /* PARSE_QUOTE */
em = 0;
smc = 1;
}
/*
* Check for tokens
*/
int tl;
unsigned *intp;
switch (state) {
case PT_STATE_TOKEN:
if (smc) {
if (eq == PARSE_EQUALS)
else
NULL, 0);
} else if (eq == PARSE_EQUALS)
case PT_STATE_UNKNOWN:
"cardbus_parse_devprop: "
"unknown token [%s]\n",
token);
} /* switch (parse_token) */
else
break;
case PT_STATE_CHECK:
case PT_STATE_DEC_VAR:
intp = (unsigned *)kmem_alloc(
sizeof (int)*tl,
KM_SLEEP);
else
sizeof (int)*tl);
break;
case PT_STATE_HEX_VAR:
intp = (unsigned *)kmem_alloc(
sizeof (int)*tl,
KM_SLEEP);
else
sizeof (int)*tl);
break;
case PT_STATE_STRING_VAR:
token);
} else
break;
}
break;
case PT_STATE_HEX_VAR:
}
break;
case PT_STATE_DEC_VAR:
}
break;
case PT_STATE_STRING_VAR:
token);
}
break;
default:
"unknown state machine state = %d\n",
state);
return (DDI_FAILURE);
} /* switch (state) */
if (eq == PARSE_SEMICOLON)
smc = 1;
}
cp++;
l++;
} /* while (*cp) */
if (qm) {
"string = [%s]\n", quote);
return (DDI_FAILURE);
}
if (state != PT_STATE_TOKEN) {
"requires value\n", token);
return (DDI_FAILURE);
}
"requires VendorID and DeviceID\n");
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static void
{
char **prop_array;
uint_t i, n;
"cb-device-init-props", &prop_array,
&n) != DDI_PROP_SUCCESS)
return;
for (i = 0; i < n; i++)
}
static int
{
int rc;
"cardbus_bus_map(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
/* A child has asked us to set something up */
"cardbus_bus_map(%s) calling %s - 0x%p, "
"offset 0x%x, len 0x%x\n",
/* rc = ddi_map(dip, mp, offset, len, vaddrp); */
if (rc != DDI_SUCCESS) {
return (DDI_FAILURE);
} else {
return (DDI_SUCCESS);
}
}
static void
{
/* bus = PCI_REG_BUS_G(pci_rp->pci_phys_hi); */
/* I/O */
} else {
/* memory */
rp->regspec_bustype = 0;
}
}
static int
{
"cardbus_dma_allochdl(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_allochdl calling %s - 0x%p\n",
}
static int
{
"cardbus_dma_freehdl(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_freehdl calling %s - 0x%p\n",
}
static int
{
"cardbus_dma_bindhdl(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_bindhdl calling %s - 0x%p\n",
}
static int
{
"cardbus_dma_unbindhdl(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_unbindhdl calling %s - 0x%p\n",
}
static int
{
"cardbus_dma_flush(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_flush calling %s - 0x%p\n",
}
static int
{
"cardbus_dma_win(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_win calling %s - 0x%p\n",
}
static int
{
"cardbus_dma_map(dip=0x%p, rdip=0x%p)\n",
return (DDI_FAILURE);
"cardbus_dma_map calling %s - 0x%p\n",
}
static int
{
int cb_instance;
int rc;
/*
* get the soft state structure for the bus instance.
*/
ASSERT(cb_instance >= 0);
ASSERT(number_of_cardbus_cards != 0);
/*
* We can't handle up (probably called at the attachment
* point) so pass it on up
*/
"cardbus_get_eventcookie calling %s - 0x%p\n",
(void *)
}
"cardbus_get_eventcookie calling ndi_event_retrieve_cookie\n");
return (rc);
}
static int
{
int cb_instance;
int rc;
/*
* get the soft state structure for the bus instance.
*/
ASSERT(cb_instance >= 0);
ASSERT(number_of_cardbus_cards != 0);
/*
* We can't handle up (probably called at the attachment
* point) so pass it on up
*/
"cardbus_add_eventcall calling %s - 0x%p\n",
(void *)
}
"cardbus_add_eventcall calling ndi_event_add_callback\n");
return (rc);
}
static int
{
int cb_instance;
/*
* get the soft state structure for the bus instance.
*/
ASSERT(cb_instance >= 0);
ASSERT(number_of_cardbus_cards != 0);
/*
* We can't handle up (probably called at the attachment
* point) so pass it on up
*/
"cardbus_remove_eventcall calling %s - 0x%p\n",
(void *)
}
}
static int
{
return (DDI_FAILURE);
}
static int
{
"interrupt-priorities", 6);
}
static int
{
int ret = DDI_SUCCESS;
#if defined(CARDBUS_DEBUG)
#endif
switch (intr_op) {
case DDI_INTROP_GETCAP:
*(int *)result = DDI_INTR_FLAG_LEVEL;
break;
case DDI_INTROP_ALLOC:
break;
case DDI_INTROP_FREE:
break;
case DDI_INTROP_GETPRI:
break;
case DDI_INTROP_SETPRI:
break;
case DDI_INTROP_ADDISR:
case DDI_INTROP_REMISR:
return (DDI_FAILURE);
}
break;
case DDI_INTROP_ENABLE:
break;
case DDI_INTROP_DISABLE:
break;
case DDI_INTROP_NINTRS:
case DDI_INTROP_NAVAIL:
#ifdef sparc
#else
*(int *)result = 1;
#endif
break;
*(int *)result = DDI_INTR_TYPE_FIXED;
break;
default:
ret = DDI_ENOTSUP;
break;
}
return (ret);
}
static int
{
/* with one socket per function */
"cardbus_enable_intr_impl, intr=0x%p, arg1=0x%p, arg2=0x%p"
"rdip=0x%p(%s)\n",
(void *) hdlp->ih_cb_func,
return (DDI_FAILURE);
}
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
static int
{
/* function. */
"cardbus_disable_intr_impl, intr=0x%p, arg1=0x%p, arg2=0x%p"
"rdip=0x%p(%s%d)\n",
(void *) hdlp->ih_cb_func,
return (DDI_FAILURE);
}
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
#if defined(CARDBUS_DEBUG)
static int cardbus_do_pprintf = 0;
#endif
/*PRINTFLIKE3*/
void
{
int instance;
char buf[256];
const char *name;
char *nl = "";
#if !defined(CARDBUS_DEBUG)
int ce;
char qmark = 0;
if (level <= 3)
else
if (level == 4)
qmark = 1;
#endif
if (dip) {
/* name = ddi_binding_name(dip); */
} else {
instance = 0;
name = "";
}
/* vcmn_err(ce, fmt, adx); */
/* vprintf(fmt, adx); */
/* prom_vprintf(fmt, adx); */
nl = "\n";
#if defined(CARDBUS_DEBUG)
if (cardbus_do_pprintf) {
if (dip) {
if (instance >= 0)
prom_printf("%s(%d),0x%p: %s%s",
else
} else
} else {
if (dip) {
if (instance >= 0)
else
} else
}
#else
if (dip)
else
#endif
}
}
{
int len;
else {
NDI_RA_PASS)) != NDI_SUCCESS)
if (ret != NDI_SUCCESS) {
"fail to allocate bus number\n");
goto exit;
}
"fail to update bus-range property\n");
goto exit;
}
"fail to pci_config_setup\n");
goto exit;
}
"parent dip %u -> %u\n",
!= NDI_SUCCESS) {
"fail to ndi_ra_map_setup of bus number\n");
goto exit;
}
(void) ndi_ra_free(pdip,
}
0)) != NDI_SUCCESS)
"cardbus dip base %u length %d\n",
if (ret != NDI_SUCCESS) {
"fail to allocate bus number of length %d "
"from parent\n",
goto exit;
}
!= NDI_SUCCESS) {
"fail to ndi_ra_map_setup of bus numbers\n");
goto exit;
}
(void) ndi_ra_free(dip,
exit:
} else
"parent dip doesn't have busrange prop\n");
}