diff options
Diffstat (limited to 'sys/dev/ips/ips.c')
-rw-r--r-- | sys/dev/ips/ips.c | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/sys/dev/ips/ips.c b/sys/dev/ips/ips.c index 0cbcf6b..165ebb0 100644 --- a/sys/dev/ips/ips.c +++ b/sys/dev/ips/ips.c @@ -46,6 +46,25 @@ static struct cdevsw ips_cdevsw = { .d_maj = IPS_CDEV_MAJOR, }; +static const char* ips_adapter_name[] = { + "N/A", + "ServeRAID (copperhead)", + "ServeRAID II (copperhead refresh)", + "ServeRAID onboard (copperhead)", + "ServeRAID onboard (copperhead)", + "ServeRAID 3H (clarinet)", + "ServeRAID 3L (clarinet lite)", + "ServeRAID 4H (trombone)", + "ServeRAID 4M (morpheus)", + "ServeRAID 4L (morpheus lite)", + "ServeRAID 4Mx (neo)", + "ServeRAID 4Lx (neo lite)", + "ServeRAID 5i II (sarasota)", + "ServeRAID 5i (sarasota)", + "ServeRAID 6M (marco)", + "ServeRAID 6i (sebring)" +}; + static int ips_open(dev_t dev, int flags, int fmt, struct thread *td) { @@ -240,12 +259,44 @@ void ips_insert_free_cmd(ips_softc_t *sc, ips_command_t *command) if(!(sc->state & IPS_TIMEOUT)) ips_run_waiting_command(sc); } +static const char* ips_diskdev_statename(u_int8_t state) +{ + static char statebuf[20]; + switch(state){ + case IPS_LD_OFFLINE: + return("OFFLINE"); + break; + case IPS_LD_OKAY: + return("OK"); + break; + case IPS_LD_DEGRADED: + return("DEGRADED"); + break; + case IPS_LD_FREE: + return("FREE"); + break; + case IPS_LD_SYS: + return("SYS"); + break; + case IPS_LD_CRS: + return("CRS"); + break; + } + sprintf(statebuf,"UNKNOWN(0x%02x)", state); + return(statebuf); +} static int ips_diskdev_init(ips_softc_t *sc) { int i; for(i=0; i < IPS_MAX_NUM_DRIVES; i++){ - if(sc->drives[i].state & IPS_LD_OKAY){ + if(sc->drives[i].state == IPS_LD_FREE) continue; + device_printf(sc->dev, "Logical Drive %d: RAID%d sectors: %u, state %s\n", + i, sc->drives[i].raid_lvl, + sc->drives[i].sector_count, + ips_diskdev_statename(sc->drives[i].state)); + if(sc->drives[i].state == IPS_LD_OKAY || + sc->drives[i].state == IPS_LD_DEGRADED){ sc->diskdev[i] = device_add_child(sc->dev, NULL, -1); device_set_ivars(sc->diskdev[i],(void *)(uintptr_t) i); } @@ -369,15 +420,26 @@ int ips_adapter_init(ips_softc_t *sc) goto error; mtx_init(&sc->cmd_mtx, "ips command mutex", NULL, MTX_DEF); + + /* initialize ffdc values */ + microtime(&sc->ffdc_resettime); + sc->ffdc_resetcount = 1; + if ((i = ips_ffdc_reset(sc)) != 0) { + device_printf(sc->dev, "failed to send ffdc reset to device (%d)\n", i); + goto error; + } if ((i = ips_get_adapter_info(sc)) != 0) { device_printf(sc->dev, "failed to get adapter configuration data from device (%d)\n", i); goto error; } + ips_update_nvram(sc); /* no error check as failure doesn't matter */ + if(sc->adapter_type > 0 && sc->adapter_type <= IPS_ADAPTER_MAX_T){ + device_printf(sc->dev, "adapter type: %s\n", ips_adapter_name[sc->adapter_type]); + } if ((i = ips_get_drive_info(sc)) != 0) { device_printf(sc->dev, "failed to get drive configuration data from device (%d)\n", i); goto error; } - ips_update_nvram(sc); /* no error check as failure doesn't matter */ ips_cmdqueue_free(sc); if(sc->adapter_info.max_concurrent_cmds) |