summaryrefslogtreecommitdiff
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.ibm.com>2023-03-13 11:10:31 +0100
committerDavid S. Miller <davem@davemloft.net>2023-03-15 08:18:35 +0000
commitf947568e258038d3c2f8f38a9a7dabaca36643ec (patch)
tree431528050109cb67610a278c977301a723c1125a /drivers/s390/net
parent45ef71d108e6f1545e2981d8af03be13f2e39411 (diff)
downloadlwn-f947568e258038d3c2f8f38a9a7dabaca36643ec.tar.gz
lwn-f947568e258038d3c2f8f38a9a7dabaca36643ec.zip
net/smc: Introduce explicit check for v2 support
Previously, v2 support was derived from a very specific format of the SEID as part of the SMC-D codebase. Make this part of the SMC-D device API, so implementers do not need to adhere to a specific SEID format. Signed-off-by: Stefan Raspl <raspl@linux.ibm.com> Reviewed-and-tested-by: Jan Karcher <jaka@linux.ibm.com> Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com> Signed-off-by: Wenjia Zhang <wenjia@linux.ibm.com> Reviewed-by: Tony Lu <tonylu@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/ism_drv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c
index eb7e13486087..1c73d32966f1 100644
--- a/drivers/s390/net/ism_drv.c
+++ b/drivers/s390/net/ism_drv.c
@@ -842,6 +842,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);
}
+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)
{
return ism_get_local_gid(smcd->priv);
@@ -869,6 +875,7 @@ static const struct smcd_ops ism_ops = {
.reset_vlan_required = smcd_reset_vlan_required,
.signal_event = smcd_signal_ieq,
.move_data = smcd_move,
+ .supports_v2 = smcd_supports_v2,
.get_system_eid = ism_get_seid,
.get_local_gid = smcd_get_local_gid,
.get_chid = smcd_get_chid,