Perform an Inquiry to page 0xC4 when loading IOA Capabilities to check if adapter supports Sync Write Cache.
Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com> --- iprlib.c | 8 ++++++++ iprlib.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/iprlib.c b/iprlib.c index 94bcdca..a31a60d 100644 --- a/iprlib.c +++ b/iprlib.c @@ -5976,6 +5976,7 @@ static void get_ioa_cap(struct ipr_ioa *ioa) struct ipr_inquiry_ioa_cap ioa_cap; struct ipr_mode_page24 *page24; struct ipr_mode_pages mode_pages; + struct ipr_cache_cap_vpd cc_vpd; ioa->af_block_size = IPR_DEFAULT_AF_BLOCK_SIZE; ioa->tcq_mode = ioa_get_tcq_mode(ioa); @@ -5994,6 +5995,13 @@ static void get_ioa_cap(struct ipr_ioa *ioa) } if (page0_inq.supported_page_codes[j] == 0xC4) { ioa->has_cache = 1; + + memset(&cc_vpd, 0, sizeof(cc_vpd)); + ipr_inquiry(&ioa->ioa, 0xC4, &cc_vpd, sizeof(cc_vpd)); + + if (htonl(cc_vpd.cache_cap) & + IPR_CACHE_CAP_VSET_WRITE_CACHE) + ioa->has_vset_write_cache = 1; continue; } if (page0_inq.supported_page_codes[j] != 0xD0) diff --git a/iprlib.h b/iprlib.h index 9c09cba..fa01186 100644 --- a/iprlib.h +++ b/iprlib.h @@ -1499,6 +1499,9 @@ struct ipr_ioa { char host_name[16]; char physical_location[1024]; u8 yl_serial_num[YL_SERIAL_NUM_LEN]; + + u8 has_vset_write_cache:1; + struct ipr_dev dev[IPR_MAX_IOA_DEVICES]; struct ipr_multi_ioa_status ioa_status; struct ipr_array_query_data *qac_data; @@ -1992,6 +1995,7 @@ struct ipr_dram_vpd { }; struct ipr_cache_cap_vpd { +#define IPR_CACHE_CAP_VSET_WRITE_CACHE 0x08000000 u8 peri_dev_type; u8 page_code; u8 reserved1; -- 2.1.0 ------------------------------------------------------------------------------ _______________________________________________ Iprdd-devel mailing list Iprdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iprdd-devel