version 1.33.2.4, 2002/01/08 00:31:55 |
version 1.33.2.5, 2002/08/01 02:45:46 |
Line 146 ssattach(struct device *parent, struct d |
|
Line 146 ssattach(struct device *parent, struct d |
|
printf("\n"); |
printf("\n"); |
|
|
/* |
/* |
|
* Set up the buf queue for this device |
|
*/ |
|
bufq_alloc(&ss->buf_queue, BUFQ_FCFS); |
|
|
|
/* |
* look for non-standard scanners with help of the quirk table |
* look for non-standard scanners with help of the quirk table |
* and install functions for special handling |
* and install functions for special handling |
*/ |
*/ |
Line 159 ssattach(struct device *parent, struct d |
|
Line 164 ssattach(struct device *parent, struct d |
|
/* XXX add code to restart a SCSI2 scanner, if any */ |
/* XXX add code to restart a SCSI2 scanner, if any */ |
} |
} |
|
|
/* |
|
* Set up the buf queue for this device |
|
*/ |
|
BUFQ_INIT(&ss->buf_queue); |
|
ss->flags &= ~SSF_AUTOCONF; |
ss->flags &= ~SSF_AUTOCONF; |
} |
} |
|
|
Line 181 ssdetach(struct device *self, int flags) |
|
Line 182 ssdetach(struct device *self, int flags) |
|
s = splbio(); |
s = splbio(); |
|
|
/* Kill off any queued buffers. */ |
/* Kill off any queued buffers. */ |
while ((bp = BUFQ_FIRST(&ss->buf_queue)) != NULL) { |
while ((bp = BUFQ_GET(&ss->buf_queue)) != NULL) { |
BUFQ_REMOVE(&ss->buf_queue, bp); |
|
bp->b_error = EIO; |
bp->b_error = EIO; |
bp->b_flags |= B_ERROR; |
bp->b_flags |= B_ERROR; |
bp->b_resid = bp->b_bcount; |
bp->b_resid = bp->b_bcount; |
biodone(bp); |
biodone(bp); |
} |
} |
|
|
|
bufq_free(&ss->buf_queue); |
|
|
/* Kill off any pending commands. */ |
/* Kill off any pending commands. */ |
scsipi_kill_pending(ss->sc_periph); |
scsipi_kill_pending(ss->sc_periph); |
|
|
|
|
* at the end (a bit silly because we only have on user.. |
* at the end (a bit silly because we only have on user.. |
* (but it could fork())) |
* (but it could fork())) |
*/ |
*/ |
BUFQ_INSERT_TAIL(&ss->buf_queue, bp); |
BUFQ_PUT(&ss->buf_queue, bp); |
|
|
/* |
/* |
* Tell the device to get going on the transfer if it's |
* Tell the device to get going on the transfer if it's |
|
|
/* |
/* |
* See if there is a buf with work for us to do.. |
* See if there is a buf with work for us to do.. |
*/ |
*/ |
if ((bp = BUFQ_FIRST(&ss->buf_queue)) == NULL) |
if ((bp = BUFQ_GET(&ss->buf_queue)) == NULL) |
return; |
return; |
BUFQ_REMOVE(&ss->buf_queue, bp); |
|
|
|
if (ss->special && ss->special->read) { |
if (ss->special && ss->special->read) { |
(ss->special->read)(ss, bp); |
(ss->special->read)(ss, bp); |