|
|
#include <sys/types.h> #include <sys/hpci.h> #include <sys/ddi.h>int hpci_detach(int hpcid);
``Hotplug devices'' in HDK Technical Reference
``PCI'' in HDK Technical Reference
1 int
2 xxx_config(cfg_func_t func, void *idata, rm_key_t key)
3 {
4 hpcd_t *hpcdp;
5 int err = -1;
6 switch(func)
7 {
8 case CFG_ADD:
/* see hpci_attach(D3hpci) for example */
9 break;
10 case CFG_REMOVE:
11 hpcdp=((hpcd_t *) idata);
/* unregister with hpci */
12 if ((err=hpci_detach(hpcdp->hpcid))<0)
13 {
14 cmn_err(CE_WARN, "hpci_detach() failed\n");
15 return -1;
16 }
/* detach interrupts, deallocate memory, locks, etc */
17 cleanup(hpcdp);
18 break;
19 case CFG_xxxx: /* handle other CFG_* cases here */
20 break;
21 default:
22 cmn_err(CE_WARN, "%s:
23 xxx_config: unexpected request 0x%x for rm_key=%d\n",
24 modname, func, key);
25 return(EINVAL);
26 }
27 return(0);
28 }