mei: add vtag support bit in client properties

Vtag support is on a client basis, meaning not every client
supports it. The vtag capability is communicated via the client properties
structure during client enumeration process.
Export the propertiy via sysfs.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20200818115147.2567012-4-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alexander Usyskin 2020-08-18 14:51:37 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель beb4e1e503
Коммит 2dd1e5ae8c
5 изменённых файлов: 48 добавлений и 4 удалений

Просмотреть файл

@ -41,6 +41,13 @@ Contact: Tomas Winkler <tomas.winkler@intel.com>
Description: Stores mei client fixed address, if any Description: Stores mei client fixed address, if any
Format: %d Format: %d
What: /sys/bus/mei/devices/.../vtag
Date: Nov 2020
KernelVersion: 5.9
Contact: Tomas Winkler <tomas.winkler@intel.com>
Description: Stores mei client vtag support status
Format: %d
What: /sys/bus/mei/devices/.../max_len What: /sys/bus/mei/devices/.../max_len
Date: Nov 2019 Date: Nov 2019
KernelVersion: 5.5 KernelVersion: 5.5

Просмотреть файл

@ -810,6 +810,16 @@ static ssize_t fixed_show(struct device *dev, struct device_attribute *a,
} }
static DEVICE_ATTR_RO(fixed); static DEVICE_ATTR_RO(fixed);
static ssize_t vtag_show(struct device *dev, struct device_attribute *a,
char *buf)
{
struct mei_cl_device *cldev = to_mei_cl_device(dev);
bool vt = mei_me_cl_vt(cldev->me_cl);
return sprintf(buf, "%d", vt);
}
static DEVICE_ATTR_RO(vtag);
static ssize_t max_len_show(struct device *dev, struct device_attribute *a, static ssize_t max_len_show(struct device *dev, struct device_attribute *a,
char *buf) char *buf)
{ {
@ -827,6 +837,7 @@ static struct attribute *mei_cldev_attrs[] = {
&dev_attr_modalias.attr, &dev_attr_modalias.attr,
&dev_attr_max_conn.attr, &dev_attr_max_conn.attr,
&dev_attr_fixed.attr, &dev_attr_fixed.attr,
&dev_attr_vtag.attr,
&dev_attr_max_len.attr, &dev_attr_max_len.attr,
NULL, NULL,
}; };

Просмотреть файл

@ -93,6 +93,18 @@ static inline u8 mei_me_cl_fixed(const struct mei_me_client *me_cl)
return me_cl->props.fixed_address; return me_cl->props.fixed_address;
} }
/**
* mei_me_cl_vt - return me client vtag supported status
*
* @me_cl: me client
*
* Return: true if me client supports vt tagging
*/
static inline bool mei_me_cl_vt(const struct mei_me_client *me_cl)
{
return me_cl->props.vt_supported == 1;
}
/** /**
* mei_me_cl_max_len - return me client max msg length * mei_me_cl_max_len - return me client max msg length
* *

Просмотреть файл

@ -27,7 +27,7 @@ static int mei_dbgfs_meclients_show(struct seq_file *m, void *unused)
down_read(&dev->me_clients_rwsem); down_read(&dev->me_clients_rwsem);
seq_puts(m, " |id|fix| UUID |con|msg len|sb|refc|\n"); seq_puts(m, " |id|fix| UUID |con|msg len|sb|refc|vt|\n");
/* if the driver is not enabled the list won't be consistent */ /* if the driver is not enabled the list won't be consistent */
if (dev->dev_state != MEI_DEV_ENABLED) if (dev->dev_state != MEI_DEV_ENABLED)
@ -37,14 +37,15 @@ static int mei_dbgfs_meclients_show(struct seq_file *m, void *unused)
if (!mei_me_cl_get(me_cl)) if (!mei_me_cl_get(me_cl))
continue; continue;
seq_printf(m, "%2d|%2d|%3d|%pUl|%3d|%7d|%2d|%4d|\n", seq_printf(m, "%2d|%2d|%3d|%pUl|%3d|%7d|%2d|%4d|%2d|\n",
i++, me_cl->client_id, i++, me_cl->client_id,
me_cl->props.fixed_address, me_cl->props.fixed_address,
&me_cl->props.protocol_name, &me_cl->props.protocol_name,
me_cl->props.max_number_of_connections, me_cl->props.max_number_of_connections,
me_cl->props.max_msg_length, me_cl->props.max_msg_length,
me_cl->props.single_recv_buf, me_cl->props.single_recv_buf,
kref_read(&me_cl->refcnt)); kref_read(&me_cl->refcnt),
me_cl->props.vt_supported);
mei_me_cl_put(me_cl); mei_me_cl_put(me_cl);
} }

Просмотреть файл

@ -314,13 +314,26 @@ struct hbm_host_enum_response {
u8 valid_addresses[32]; u8 valid_addresses[32];
} __packed; } __packed;
/**
* struct mei_client_properties - mei client properties
*
* @protocol_name: guid of the client
* @protocol_version: client protocol version
* @max_number_of_connections: number of possible connections.
* @fixed_address: fixed me address (0 if the client is dynamic)
* @single_recv_buf: 1 if all connections share a single receive buffer.
* @vt_supported: the client support vtag
* @reserved: reserved
* @max_msg_length: MTU of the client
*/
struct mei_client_properties { struct mei_client_properties {
uuid_le protocol_name; uuid_le protocol_name;
u8 protocol_version; u8 protocol_version;
u8 max_number_of_connections; u8 max_number_of_connections;
u8 fixed_address; u8 fixed_address;
u8 single_recv_buf:1; u8 single_recv_buf:1;
u8 reserved:7; u8 vt_supported:1;
u8 reserved:6;
u32 max_msg_length; u32 max_msg_length;
} __packed; } __packed;