diff options
author | Sherry Moore <Sherry.Moore@Sun.COM> | 2008-09-22 16:30:26 -0700 |
---|---|---|
committer | Sherry Moore <Sherry.Moore@Sun.COM> | 2008-09-22 16:30:26 -0700 |
commit | 193974072f41a843678abf5f61979c748687e66b (patch) | |
tree | e3ecefacab3ff99bf48c8bf91fbb4306a6dbcbf5 /usr/src/uts/common/io/bge/bge_main2.c | |
parent | 0679f7940009223c7b2cee3abbea957e8dbccd26 (diff) | |
download | illumos-gate-193974072f41a843678abf5f61979c748687e66b.tar.gz |
PSARC 2008/382 Fast Reboot
6714038 Fast Reboot support for x86 platforms
Diffstat (limited to 'usr/src/uts/common/io/bge/bge_main2.c')
-rw-r--r-- | usr/src/uts/common/io/bge/bge_main2.c | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/usr/src/uts/common/io/bge/bge_main2.c b/usr/src/uts/common/io/bge/bge_main2.c index afcee86726..01bff956aa 100644 --- a/usr/src/uts/common/io/bge/bge_main2.c +++ b/usr/src/uts/common/io/bge/bge_main2.c @@ -32,7 +32,7 @@ * This is the string displayed by modinfo, etc. * Make sure you keep the version ID up to date! */ -static char bge_ident[] = "Broadcom Gb Ethernet v0.69"; +static char bge_ident[] = "Broadcom Gb Ethernet"; /* * Property names @@ -3407,6 +3407,8 @@ bge_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd) } #endif #endif + + ddi_report_dev(devinfo); return (DDI_SUCCESS); attach_fail: @@ -3453,6 +3455,41 @@ bge_suspend(bge_t *bgep) } /* + * quiesce(9E) entry point. + * + * This function is called when the system is single-threaded at high + * PIL with preemption disabled. Therefore, this function must not be + * blocked. + * + * This function returns DDI_SUCCESS on success, or DDI_FAILURE on failure. + * DDI_FAILURE indicates an error condition and should almost never happen. + */ +#ifdef __sparc +#define bge_quiesce ddi_quiesce_not_supported +#else +static int +bge_quiesce(dev_info_t *devinfo) +{ + bge_t *bgep = ddi_get_driver_private(devinfo); + + if (bgep == NULL) + return (DDI_FAILURE); + + if (bgep->intr_type == DDI_INTR_TYPE_FIXED) { + bge_reg_set32(bgep, PCI_CONF_BGE_MHCR, + MHCR_MASK_PCI_INT_OUTPUT); + } else { + bge_reg_clr32(bgep, MSI_MODE_REG, MSI_MSI_ENABLE); + } + + /* Stop the chip */ + bge_chip_stop_nonblocking(bgep); + + return (DDI_SUCCESS); +} +#endif + +/* * detach(9E) -- Detach a device from the system */ static int @@ -3538,8 +3575,17 @@ bge_detach(dev_info_t *devinfo, ddi_detach_cmd_t cmd) #undef BGE_DBG #define BGE_DBG BGE_DBG_INIT /* debug flag for this code */ -DDI_DEFINE_STREAM_OPS(bge_dev_ops, nulldev, nulldev, bge_attach, bge_detach, - nodev, NULL, D_MP, NULL); +DDI_DEFINE_STREAM_OPS(bge_dev_ops, + nulldev, /* identify */ + nulldev, /* probe */ + bge_attach, /* attach */ + bge_detach, /* detach */ + nodev, /* reset */ + NULL, /* cb_ops */ + D_MP, /* bus_ops */ + NULL, /* power */ + bge_quiesce /* quiesce */ +); static struct modldrv bge_modldrv = { &mod_driverops, /* Type of module. This one is a driver */ |