summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-10-24 18:53:16 +0000
committermav <mav@FreeBSD.org>2010-10-24 18:53:16 +0000
commit4e4dbb9f7a0bd6b10173651c98cf91d5e25a541b (patch)
tree32edaa455489329dea8ba55046af9e6cc6175fa1
parent0a39257e367237138974814b300278b6433e9ce9 (diff)
downloadFreeBSD-src-4e4dbb9f7a0bd6b10173651c98cf91d5e25a541b.zip
FreeBSD-src-4e4dbb9f7a0bd6b10173651c98cf91d5e25a541b.tar.gz
Make da driver to handle some probably broken Android devices, returning
zero media and sector size instead of "Medium not present" error, until some confirmation button is tapped on device.
-rw-r--r--sys/cam/scsi/scsi_da.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 7729ecc..b3b968c 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1667,7 +1667,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
* give them an 'illegal' value we'll avoid that
* here.
*/
- if (block_size >= MAXPHYS || block_size == 0) {
+ if (block_size == 0 && maxsector == 0) {
+ snprintf(announce_buf, sizeof(announce_buf),
+ "0MB (no media?)");
+ } else if (block_size >= MAXPHYS || block_size == 0) {
xpt_print(periph->path,
"unsupportable block size %ju\n",
(uintmax_t) block_size);
OpenPOWER on IntegriCloud