stgt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ablassmeier <abi@grinser.de>
To: stgt@vger.kernel.org
Subject: [PATCH] set access flag in storage element descriptor
Date: Mon, 11 Jan 2021 16:00:39 +0100	[thread overview]
Message-ID: <20210111150039.tqfosbfu27ddsbbf@lrrr.dead-link.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

hi,

the storage element descriptor has an access parameter value which most
storage vendors[0] and also mhvtl[1] do implement:

 >  Indicates that the medium transport element cannot access the
 >  media at the storage location [..]

TGT's smc unfortunately does not handle at all and only sets information
wether if slot is filled or not. I have seen that commercial products
care about the access flag in some way and if missing, will show an
empty slot, even if filled.

Attached patch sets access bit if slot is filled.

[0] https://support.spectralogic.com/documentation/default-source/user-guides/12-8-t-seriesscsidevguide.pdf?sfvrsn=79ecf946_6
(Page 80)
[1] https://github.com/markh794/mhvtl/blob/master/usr/smc.c#L512

bye,
    - michael

[-- Attachment #2: access_flag.diff --]
[-- Type: text/x-diff, Size: 474 bytes --]

diff --git a/usr/smc.c b/usr/smc.c
index bbc7b7f..7a9dec8 100644
--- a/usr/smc.c
+++ b/usr/smc.c
@@ -146,7 +146,7 @@ static int add_element_descriptor(uint8_t *data, struct slot *s,
 	int i;	/* data[] index */
 
 	*(uint16_t *)(data) = __cpu_to_be16(s->slot_addr);
-	data[2] = s->status;
+	data[2] = s->status | 0x8;
 	data[3] = 0;	/* Reserved */
 	data[4] = (s->asc >> 8) & 0xff;	/* Additional Sense Code */
 	data[5] = s->asc & 0xff;	/* Additional Sense Code Qualifier */

                 reply	other threads:[~2021-01-11 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210111150039.tqfosbfu27ddsbbf@lrrr.dead-link.org \
    --to=abi@grinser.de \
    --cc=stgt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).