Deleted Added
full compact
28c28
< /* $NetBSD: ncr53c9x.c,v 1.110 2003/11/02 11:07:45 wiz Exp $ */
---
> /* $NetBSD: ncr53c9x.c,v 1.114 2005/02/27 00:27:02 perry Exp $ */
107c107
< __FBSDID("$FreeBSD: head/sys/dev/esp/ncr53c9x.c 145535 2005-04-25 22:11:43Z scottl $");
---
> __FBSDID("$FreeBSD: head/sys/dev/esp/ncr53c9x.c 146392 2005-05-19 14:51:10Z marius $");
202a203,204
> "FAS100A",
> "FAS236",
228c230
< int i;
---
> int error, i;
252c254,255
< if (sc->sc_omess == NULL)
---
> if (sc->sc_omess == NULL) {
> sc->sc_omess_self = 1;
253a257,263
> if (sc->sc_omess == NULL) {
> device_printf(sc->sc_dev,
> "cannot allocate MSGOUT buffer\n");
> return (ENOMEM);
> }
> } else
> sc->sc_omess_self = 0;
255c265,266
< if (sc->sc_imess == NULL)
---
> if (sc->sc_imess == NULL) {
> sc->sc_imess_self = 1;
256a268,275
> if (sc->sc_imess == NULL) {
> device_printf(sc->sc_dev,
> "cannot allocate MSGIN buffer\n");
> error = ENOMEM;
> goto fail_omess;
> }
> } else
> sc->sc_imess_self = 0;
260,263c279,283
<
< if (!sc->sc_omess || !sc->sc_imess || !sc->sc_tinfo) {
< printf("out of memory\n");
< return (ENOMEM);
---
> if (sc->sc_tinfo == NULL) {
> device_printf(sc->sc_dev,
> "cannot allocate target info buffer\n");
> error = ENOMEM;
> goto fail_imess;
301,302c321,325
< if (devq == NULL)
< return (ENOMEM);
---
> if (devq == NULL) {
> device_printf(sc->sc_dev, "cannot allocate device queue\n");
> error = ENOMEM;
> goto fail_tinfo;
> }
308,309c331,333
< cam_simq_free(devq);
< return (ENOMEM);
---
> device_printf(sc->sc_dev, "cannot allocate SIM entry\n");
> error = ENOMEM;
> goto fail_devq;
312,313c336,338
< cam_sim_free(sim, TRUE);
< return (EIO);
---
> device_printf(sc->sc_dev, "cannot register bus\n");
> error = EIO;
> goto fail_sim;
319,321c344,346
< xpt_bus_deregister(cam_sim_path(sim));
< cam_sim_free(sim, TRUE);
< return (EIO);
---
> device_printf(sc->sc_dev, "cannot create path\n");
> error = EIO;
> goto fail_bus;
338c363,364
< return (ENOMEM);
---
> error = ENOMEM;
> goto fail_path;
349a376,393
>
> fail_path:
> xpt_free_path(path);
> fail_bus:
> xpt_bus_deregister(cam_sim_path(sim));
> fail_sim:
> cam_sim_free(sim, TRUE);
> fail_devq:
> cam_simq_free(devq);
> fail_tinfo:
> free(sc->sc_tinfo, M_DEVBUF);
> fail_imess:
> if (sc->sc_imess_self)
> free(sc->sc_imess, M_DEVBUF);
> fail_omess:
> if (sc->sc_omess_self)
> free(sc->sc_omess, M_DEVBUF);
> return (error);
353c397
< ncr53c9x_detach(struct ncr53c9x_softc *sc, int flags)
---
> ncr53c9x_detach(struct ncr53c9x_softc *sc)
356,359c400,413
< #if 0 /* don't allow detach for now */
< free(sc->sc_imess, M_DEVBUF);
< free(sc->sc_omess, M_DEVBUF);
< #endif
---
> callout_drain(&sc->sc_watchdog);
> mtx_lock(&sc->sc_lock);
> ncr53c9x_init(sc, 1);
> mtx_unlock(&sc->sc_lock);
> xpt_free_path(sc->sc_path);
> xpt_bus_deregister(cam_sim_path(sc->sc_sim));
> cam_sim_free(sc->sc_sim, TRUE);
> free(sc->ecb_array, M_DEVBUF);
> free(sc->sc_tinfo, M_DEVBUF);
> if (sc->sc_imess_self)
> free(sc->sc_imess, M_DEVBUF);
> if (sc->sc_omess_self)
> free(sc->sc_omess, M_DEVBUF);
> mtx_destroy(&sc->sc_lock);
361c415
< return (EINVAL);
---
> return (0);
390a445
> case NCR_VARIANT_FAS100A:
391a447
> case NCR_VARIANT_FAS236:
517a574,575
> sc->sc_flags = 0;
> sc->sc_msgpriq = sc->sc_msgout = sc->sc_msgoutq = 0;
518a577
>
1796,1797c1855
< if (ti->period <
< sc->sc_minsync)
---
> if (ti->period < sc->sc_minsync)
2497,2498c2555,2563
< ecb = sc->sc_nexus;
< if (ecb == NULL)
---
> if (ecb == NULL) {
> /*
> * When doing path inquiry during boot
> * FAS100A trigger a stray interrupt which
> * we just ignore instead of panicing.
> */
> if (sc->sc_state == NCR_IDLE &&
> sc->sc_espstep == 0)
> goto out;
2499a2565
> }
2616,2617c2682
< mtx_unlock(&sc->sc_lock);
< return;
---
> goto out;