summaryrefslogtreecommitdiffstats
path: root/sys/cam/ata/ata_xpt.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-05-29 14:28:46 +0000
committermav <mav@FreeBSD.org>2012-05-29 14:28:46 +0000
commit1805c47af3282197f17b4a7a54117e7abbfca73d (patch)
tree4ec8b5c9c9a23b122f2de0dcaccf4be11b4a7240 /sys/cam/ata/ata_xpt.c
parentce59e84fbe903b8c54083cbe8ebece53d25e4c39 (diff)
downloadFreeBSD-src-1805c47af3282197f17b4a7a54117e7abbfca73d.zip
FreeBSD-src-1805c47af3282197f17b4a7a54117e7abbfca73d.tar.gz
Allow to change number of openings (used tags) for ATA/SATA devices
via `camcontrol tags ... -N ...`. There is no need to tune it in usual cases, but some users want to have it for debugging purposes. MFC after: 2 weeks
Diffstat (limited to 'sys/cam/ata/ata_xpt.c')
-rw-r--r--sys/cam/ata/ata_xpt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c
index ee2e409..3a25b69 100644
--- a/sys/cam/ata/ata_xpt.c
+++ b/sys/cam/ata/ata_xpt.c
@@ -65,6 +65,7 @@ struct ata_quirk_entry {
struct scsi_inquiry_pattern inq_pat;
u_int8_t quirks;
#define CAM_QUIRK_MAXTAGS 0x01
+ u_int mintags;
u_int maxtags;
};
@@ -153,7 +154,7 @@ static struct ata_quirk_entry ata_quirk_table[] =
T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
/*vendor*/"*", /*product*/"*", /*revision*/"*"
},
- /*quirks*/0, /*maxtags*/0
+ /*quirks*/0, /*mintags*/0, /*maxtags*/0
},
};
@@ -1019,7 +1020,8 @@ noerror:
path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
}
if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) {
- path->device->mintags = path->device->maxtags =
+ path->device->mintags = 2;
+ path->device->maxtags =
ATA_QUEUE_LEN(ident_buf->queue) + 1;
}
ata_find_quirk(path->device);
@@ -1355,8 +1357,10 @@ ata_find_quirk(struct cam_ed *device)
quirk = (struct ata_quirk_entry *)match;
device->quirk = quirk;
- if (quirk->quirks & CAM_QUIRK_MAXTAGS)
- device->mintags = device->maxtags = quirk->maxtags;
+ if (quirk->quirks & CAM_QUIRK_MAXTAGS) {
+ device->mintags = quirk->mintags;
+ device->maxtags = quirk->maxtags;
+ }
}
typedef struct {
OpenPOWER on IntegriCloud