{
int err;
u8 model_index;
- u8 str_desc_buf[QUERY_DESC_STRING_MAX_SIZE];
+ u8 str_desc_buf[QUERY_DESC_STRING_MAX_SIZE + 1];
u8 desc_buf[QUERY_DESC_DEVICE_MAX_SIZE];
err = ufshcd_read_device_desc(hba, desc_buf,
if (err)
goto out;
- card_data->vendor = desc_buf[DEVICE_DESC_PARAM_MANF_ID + 1];
+ /*
+ * getting vendor (manufacturerID) and Bank Index in big endian
+ * format
+ */
+ card_data->wmanufacturerid = desc_buf[DEVICE_DESC_PARAM_MANF_ID] << 8 |
+ desc_buf[DEVICE_DESC_PARAM_MANF_ID + 1];
+
model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
memset(str_desc_buf, 0, QUERY_DESC_STRING_MAX_SIZE);
if (err)
goto out;
+ str_desc_buf[QUERY_DESC_STRING_MAX_SIZE] = '\0';
strlcpy(card_data->model, str_desc_buf, MAX_MODEL_LEN + 1);
out:
return err;
struct ufs_card_fix *f;
struct ufs_card_info card_data;
- card_data.vendor = 0;
+ card_data.wmanufacturerid = 0;
card_data.model = kmalloc(MAX_MODEL_LEN + 1, GFP_KERNEL);
if (!card_data.model)
goto out;
}
for (f = ufs_fixups; f->quirk; f++) {
- /* if same vendor */
- if (((f->card.vendor == card_data.vendor) ||
- (f->card.vendor == UFS_ANY_VENDOR)) &&
+ /* if same wmanufacturerid */
+ if (((f->card.wmanufacturerid == card_data.wmanufacturerid) ||
+ (f->card.wmanufacturerid == UFS_ANY_VENDOR)) &&
/* and same model */
(STR_PRFX_EQUAL(f->card.model, card_data.model) ||
!strcmp(f->card.model, UFS_ANY_MODEL)))
/**
* ufs_card_info - ufs device details
- * @vendor: card details
+ * @wmanufacturerid: card details
* @model: card model
*/
struct ufs_card_info {
- unsigned int vendor;
+ u16 wmanufacturerid;
char *model;
};
/* add specific device quirk */
#define UFS_FIX(_vendor, _model, _quirk) \
- { \
- .card.vendor = (_vendor),\
- .card.model = (_model), \
- .quirk = (_quirk), \
+ { \
+ .card.wmanufacturerid = (_vendor),\
+ .card.model = (_model), \
+ .quirk = (_quirk), \
}
/*