139 int dr_initialized;
140 } dr_softstate_t;
141
142 /*
143 * dr Global data elements
144 */
145 struct dr_global {
146 dr_softstate_t *softsp; /* pointer to initialize soft state */
147 kmutex_t lock;
148 } dr_g;
149
150 dr_unsafe_devs_t dr_unsafe_devs;
151
152 /*
153 * Table of known passthru commands.
154 */
155 struct {
156 char *pt_name;
157 int (*pt_func)(dr_handle_t *);
158 } pt_arr[] = {
159 "quiesce", dr_pt_test_suspend,
160 };
161
162 int dr_modunload_okay = 0; /* set to non-zero to allow unload */
163
164 /*
165 * State transition table. States valid transitions for "board" state.
166 * Recall that non-zero return value terminates operation, however
167 * the herrno value is what really indicates an error , if any.
168 */
169 static int
170 _cmd2index(int c)
171 {
172 /*
173 * Translate DR CMD to index into dr_state_transition.
174 */
175 switch (c) {
176 case SBD_CMD_CONNECT: return (0);
177 case SBD_CMD_DISCONNECT: return (1);
178 case SBD_CMD_CONFIGURE: return (2);
179 case SBD_CMD_UNCONFIGURE: return (3);
412 dr_probe, /* probe */
413 dr_attach, /* attach */
414 dr_detach, /* detach */
415 nodev, /* reset */
416 &dr_cb_ops, /* cb_ops */
417 (struct bus_ops *)NULL, /* bus ops */
418 NULL, /* power */
419 ddi_quiesce_not_needed, /* quiesce */
420 };
421
422 extern struct mod_ops mod_driverops;
423
424 static struct modldrv modldrv = {
425 &mod_driverops,
426 "Dynamic Reconfiguration",
427 &dr_dev_ops
428 };
429
430 static struct modlinkage modlinkage = {
431 MODREV_1,
432 (void *)&modldrv,
433 NULL
434 };
435
436 /*
437 * Driver entry points.
438 */
439 int
440 _init(void)
441 {
442 int err;
443
444 /*
445 * If you need to support multiple nodes (instances), then
446 * whatever the maximum number of supported nodes is would
447 * need to passed as the third parameter to ddi_soft_state_init().
448 * Alternative would be to dynamically fini and re-init the
449 * soft state structure each time a node is attached.
450 */
451 err = ddi_soft_state_init((void **)&dr_g.softsp,
452 sizeof (dr_softstate_t), 1);
453 if (err)
|
139 int dr_initialized;
140 } dr_softstate_t;
141
142 /*
143 * dr Global data elements
144 */
145 struct dr_global {
146 dr_softstate_t *softsp; /* pointer to initialize soft state */
147 kmutex_t lock;
148 } dr_g;
149
150 dr_unsafe_devs_t dr_unsafe_devs;
151
152 /*
153 * Table of known passthru commands.
154 */
155 struct {
156 char *pt_name;
157 int (*pt_func)(dr_handle_t *);
158 } pt_arr[] = {
159 { "quiesce", dr_pt_test_suspend }
160 };
161
162 int dr_modunload_okay = 0; /* set to non-zero to allow unload */
163
164 /*
165 * State transition table. States valid transitions for "board" state.
166 * Recall that non-zero return value terminates operation, however
167 * the herrno value is what really indicates an error , if any.
168 */
169 static int
170 _cmd2index(int c)
171 {
172 /*
173 * Translate DR CMD to index into dr_state_transition.
174 */
175 switch (c) {
176 case SBD_CMD_CONNECT: return (0);
177 case SBD_CMD_DISCONNECT: return (1);
178 case SBD_CMD_CONFIGURE: return (2);
179 case SBD_CMD_UNCONFIGURE: return (3);
412 dr_probe, /* probe */
413 dr_attach, /* attach */
414 dr_detach, /* detach */
415 nodev, /* reset */
416 &dr_cb_ops, /* cb_ops */
417 (struct bus_ops *)NULL, /* bus ops */
418 NULL, /* power */
419 ddi_quiesce_not_needed, /* quiesce */
420 };
421
422 extern struct mod_ops mod_driverops;
423
424 static struct modldrv modldrv = {
425 &mod_driverops,
426 "Dynamic Reconfiguration",
427 &dr_dev_ops
428 };
429
430 static struct modlinkage modlinkage = {
431 MODREV_1,
432 { (void *)&modldrv,
433 NULL }
434 };
435
436 /*
437 * Driver entry points.
438 */
439 int
440 _init(void)
441 {
442 int err;
443
444 /*
445 * If you need to support multiple nodes (instances), then
446 * whatever the maximum number of supported nodes is would
447 * need to passed as the third parameter to ddi_soft_state_init().
448 * Alternative would be to dynamically fini and re-init the
449 * soft state structure each time a node is attached.
450 */
451 err = ddi_soft_state_init((void **)&dr_g.softsp,
452 sizeof (dr_softstate_t), 1);
453 if (err)
|