Commit c4216a83 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-smc-updates'

Wenjia Zhang says:

====================
smc: Updates 2023-03-01

The 1st patch is to make implements later do not need to adhere to a
specific SEID format. The 2nd patch does some cleanup.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 45ef71d1 298c91dc
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/pci.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/processor.h> #include <linux/processor.h>
...@@ -842,6 +841,12 @@ static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx, ...@@ -842,6 +841,12 @@ static int smcd_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
return ism_move(smcd->priv, dmb_tok, idx, sf, offset, data, size); return ism_move(smcd->priv, dmb_tok, idx, sf, offset, data, size);
} }
static int smcd_supports_v2(void)
{
return SYSTEM_EID.serial_number[0] != '0' ||
SYSTEM_EID.type[0] != '0';
}
static u64 smcd_get_local_gid(struct smcd_dev *smcd) static u64 smcd_get_local_gid(struct smcd_dev *smcd)
{ {
return ism_get_local_gid(smcd->priv); return ism_get_local_gid(smcd->priv);
...@@ -869,6 +874,7 @@ static const struct smcd_ops ism_ops = { ...@@ -869,6 +874,7 @@ static const struct smcd_ops ism_ops = {
.reset_vlan_required = smcd_reset_vlan_required, .reset_vlan_required = smcd_reset_vlan_required,
.signal_event = smcd_signal_ieq, .signal_event = smcd_signal_ieq,
.move_data = smcd_move, .move_data = smcd_move,
.supports_v2 = smcd_supports_v2,
.get_system_eid = ism_get_seid, .get_system_eid = ism_get_seid,
.get_local_gid = smcd_get_local_gid, .get_local_gid = smcd_get_local_gid,
.get_chid = smcd_get_chid, .get_chid = smcd_get_chid,
......
...@@ -67,6 +67,7 @@ struct smcd_ops { ...@@ -67,6 +67,7 @@ struct smcd_ops {
int (*move_data)(struct smcd_dev *dev, u64 dmb_tok, unsigned int idx, int (*move_data)(struct smcd_dev *dev, u64 dmb_tok, unsigned int idx,
bool sf, unsigned int offset, void *data, bool sf, unsigned int offset, void *data,
unsigned int size); unsigned int size);
int (*supports_v2)(void);
u8* (*get_system_eid)(void); u8* (*get_system_eid)(void);
u64 (*get_local_gid)(struct smcd_dev *dev); u64 (*get_local_gid)(struct smcd_dev *dev);
u16 (*get_chid)(struct smcd_dev *dev); u16 (*get_chid)(struct smcd_dev *dev);
......
...@@ -429,7 +429,7 @@ static void smcd_register_dev(struct ism_dev *ism) ...@@ -429,7 +429,7 @@ static void smcd_register_dev(struct ism_dev *ism)
u8 *system_eid = NULL; u8 *system_eid = NULL;
system_eid = smcd->ops->get_system_eid(); system_eid = smcd->ops->get_system_eid();
if (system_eid[24] != '0' || system_eid[28] != '0') { if (smcd->ops->supports_v2()) {
smc_ism_v2_capable = true; smc_ism_v2_capable = true;
memcpy(smc_ism_v2_system_eid, system_eid, memcpy(smc_ism_v2_system_eid, system_eid,
SMC_MAX_EID_LEN); SMC_MAX_EID_LEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment