Skip to contentSkip to conversation

set access flag in storage element descriptor

PATCH New Michael Ablassmeier 1 participant 1 message Jan 11, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 set access flag in storage element descriptor

hi,

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

Quoted 2 lines

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

usr/smc.c +1 -1
index bbc7b7f..7a9dec8 100644
@@ -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 */