scsi_sa.c (112260) | scsi_sa.c (112946) |
---|---|
1/* | 1/* |
2 * $FreeBSD: head/sys/cam/scsi/scsi_sa.c 112260 2003-03-15 10:50:44Z phk $ | 2 * $FreeBSD: head/sys/cam/scsi/scsi_sa.c 112946 2003-04-01 15:06:26Z phk $ |
3 * 4 * Implementation of SCSI Sequential Access Peripheral driver for CAM. 5 * 6 * Copyright (c) 1999, 2000 Matthew Jacob 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 1265 unchanged lines hidden (view full) --- 1276 "due to status 0x%x!\n", status); 1277 } 1278} 1279 1280static void 1281saoninvalidate(struct cam_periph *periph) 1282{ 1283 struct sa_softc *softc; | 3 * 4 * Implementation of SCSI Sequential Access Peripheral driver for CAM. 5 * 6 * Copyright (c) 1999, 2000 Matthew Jacob 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 1265 unchanged lines hidden (view full) --- 1276 "due to status 0x%x!\n", status); 1277 } 1278} 1279 1280static void 1281saoninvalidate(struct cam_periph *periph) 1282{ 1283 struct sa_softc *softc; |
1284 struct bio *q_bp; | |
1285 struct ccb_setasync csa; 1286 int s; 1287 1288 softc = (struct sa_softc *)periph->softc; 1289 1290 /* 1291 * De-register any async callbacks. 1292 */ --- 14 unchanged lines hidden (view full) --- 1307 */ 1308 s = splbio(); 1309 1310 /* 1311 * Return all queued I/O with ENXIO. 1312 * XXX Handle any transactions queued to the card 1313 * with XPT_ABORT_CCB. 1314 */ | 1284 struct ccb_setasync csa; 1285 int s; 1286 1287 softc = (struct sa_softc *)periph->softc; 1288 1289 /* 1290 * De-register any async callbacks. 1291 */ --- 14 unchanged lines hidden (view full) --- 1306 */ 1307 s = splbio(); 1308 1309 /* 1310 * Return all queued I/O with ENXIO. 1311 * XXX Handle any transactions queued to the card 1312 * with XPT_ABORT_CCB. 1313 */ |
1315 while ((q_bp = bioq_first(&softc->bio_queue)) != NULL){ 1316 bioq_remove(&softc->bio_queue, q_bp); 1317 q_bp->bio_resid = q_bp->bio_bcount; 1318 biofinish(q_bp, NULL, ENXIO); 1319 } | 1314 bioq_flush(&softc->bio_queue, NULL, ENXIO); |
1320 softc->queue_count = 0; 1321 splx(s); 1322 1323 xpt_print_path(periph->path); 1324 printf("lost device\n"); 1325 1326} 1327 --- 365 unchanged lines hidden (view full) --- 1693 * A retry was scheduled, so just return. 1694 */ 1695 return; 1696 } 1697 } 1698 1699 if (error == EIO) { 1700 int s; | 1315 softc->queue_count = 0; 1316 splx(s); 1317 1318 xpt_print_path(periph->path); 1319 printf("lost device\n"); 1320 1321} 1322 --- 365 unchanged lines hidden (view full) --- 1688 * A retry was scheduled, so just return. 1689 */ 1690 return; 1691 } 1692 } 1693 1694 if (error == EIO) { 1695 int s; |
1701 struct bio *q_bp; | |
1702 1703 /* 1704 * Catastrophic error. Mark the tape as frozen 1705 * (we no longer know tape position). 1706 * 1707 * Return all queued I/O with EIO, and unfreeze 1708 * our queue so that future transactions that 1709 * attempt to fix this problem can get to the 1710 * device. 1711 * 1712 */ 1713 1714 s = splbio(); 1715 softc->flags |= SA_FLAG_TAPE_FROZEN; | 1696 1697 /* 1698 * Catastrophic error. Mark the tape as frozen 1699 * (we no longer know tape position). 1700 * 1701 * Return all queued I/O with EIO, and unfreeze 1702 * our queue so that future transactions that 1703 * attempt to fix this problem can get to the 1704 * device. 1705 * 1706 */ 1707 1708 s = splbio(); 1709 softc->flags |= SA_FLAG_TAPE_FROZEN; |
1716 while ((q_bp = bioq_first(&softc->bio_queue)) != NULL) { 1717 bioq_remove(&softc->bio_queue, q_bp); 1718 q_bp->bio_resid = q_bp->bio_bcount; 1719 biofinish(q_bp, NULL, EIO); 1720 } | 1710 bioq_flush(&softc->bio_queue, NULL, EIO); |
1721 splx(s); 1722 } 1723 if (error != 0) { 1724 bp->bio_resid = bp->bio_bcount; 1725 bp->bio_error = error; 1726 bp->bio_flags |= BIO_ERROR; 1727 /* 1728 * In the error case, position is updated in saerror. --- 1856 unchanged lines hidden --- | 1711 splx(s); 1712 } 1713 if (error != 0) { 1714 bp->bio_resid = bp->bio_bcount; 1715 bp->bio_error = error; 1716 bp->bio_flags |= BIO_ERROR; 1717 /* 1718 * In the error case, position is updated in saerror. --- 1856 unchanged lines hidden --- |