Make SES driver adequately react on simple enclosure devices -- read Short

Enclosure status to enclosure status field, clear previous state and exit.
This commit is contained in:
Alexander Motin 2013-09-06 15:41:37 +00:00
parent ffead710d5
commit f9004a5db0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255309

View File

@ -1555,6 +1555,18 @@ ses_process_status(enc_softc_t *enc, struct enc_fsm_state *state,
ENC_VLOG(enc, "Enclosure Status Page Too Long\n");
goto out;
}
/* Check for simple enclosure reporting short enclosure status. */
if (length >= 4 && page->hdr.page_code == SesShortStatus) {
ENC_DLOG(enc, "Got Short Enclosure Status page\n");
ses->ses_flags &= ~(SES_FLAG_ADDLSTATUS | SES_FLAG_DESC);
ses_cache_free(enc, enc_cache);
enc_cache->enc_status = page->hdr.page_specific_flags;
enc_update_request(enc, SES_PUBLISH_CACHE);
err = 0;
goto out;
}
/* Make sure the length contains at least one header and status */
if (length < (sizeof(*page) + sizeof(*page->elements))) {
ENC_VLOG(enc, "Enclosure Status Page Too Short\n");