open-source-firmware / go-tcg-storage

Go library for interfacing TCG Storage functions on storage devices
BSD 3-Clause "New" or "Revised" License
21 stars 10 forks source link

minor(session): add option params to set MaxComPacketSize #95

Closed yogev-lb closed 2 years ago

yogev-lb commented 2 years ago

some SEDs are apparently unable to handle some Properties() Session Manager method request arguments gracefully if they exceed the values supported by the TPer.

e.g., as of FW version E2MU110, if Micron 7450 family devices are passed HostProperties.MaxComPacketSize of >128kB (and possibly the related Max*PacketSize values) on Properties() invocation, the subsequent IF-RECV calls might sporadically fail with EINVAL (22) error.

the recommended vendor workaround is to always pass in a value <= 128kB to HostProperties.MaxComPacketSize, regardless of host capabilities.

this patch adds option params to core.NewControlSession() and locking.Initialize() allowing to override the MaxComPacketSize value.

issue: LBM1-20784

yogev-lb commented 2 years ago

@ChriMarMe please take a look

yogev-lb commented 2 years ago

hey @ChriMarMe I don't see any merge button. Might there is a need to update permissions?