netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ursula Braun <ubraun@linux.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	raspl@linux.ibm.com, kgraul@linux.ibm.com, ubraun@linux.ibm.com
Subject: [PATCH net-next 2/6] s390/net: convert pnetids to ascii
Date: Thu, 21 Feb 2019 13:00:59 +0100	[thread overview]
Message-ID: <20190221120103.10866-3-ubraun@linux.ibm.com> (raw)
In-Reply-To: <20190221120103.10866-1-ubraun@linux.ibm.com>

From: Hans Wippel <hwippel@linux.ibm.com>

Pnetids are retrieved from the underlying hardware as EBCDIC. This patch
converts pnetids to ASCII.

Signed-off-by: Hans Wippel <hwippel@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
 arch/s390/net/pnet.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/s390/net/pnet.c b/arch/s390/net/pnet.c
index 9ecdbdf59781..79211bec0fc8 100644
--- a/arch/s390/net/pnet.c
+++ b/arch/s390/net/pnet.c
@@ -12,6 +12,7 @@
 #include <asm/ccwgroup.h>
 #include <asm/ccwdev.h>
 #include <asm/pnet.h>
+#include <asm/ebcdic.h>
 
 #define PNETIDS_LEN		64	/* Total utility string length in bytes
 					 * to cover up to 4 PNETIDs of 16 bytes
@@ -48,6 +49,7 @@ static int pnet_ids_by_device(struct device *dev, u8 *pnetids)
 		if (!util_str)
 			return -ENOMEM;
 		memcpy(pnetids, util_str, PNETIDS_LEN);
+		EBCASC(pnetids, PNETIDS_LEN);
 		kfree(util_str);
 		return 0;
 	}
@@ -55,6 +57,7 @@ static int pnet_ids_by_device(struct device *dev, u8 *pnetids)
 		struct zpci_dev *zdev = to_zpci(to_pci_dev(dev));
 
 		memcpy(pnetids, zdev->util_str, sizeof(zdev->util_str));
+		EBCASC(pnetids, sizeof(zdev->util_str));
 		return 0;
 	}
 	return -EOPNOTSUPP;
-- 
2.16.4


  parent reply	other threads:[~2019-02-21 12:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 12:00 [PATCH net-next 0/6] net/smc: patches 2019-02-21 Ursula Braun
2019-02-21 12:00 ` [PATCH net-next 1/6] net/smc: cleanup for smcr_tx_sndbuf_nonempty Ursula Braun
2019-02-21 12:00 ` Ursula Braun [this message]
2019-02-21 12:01 ` [PATCH net-next 3/6] net/smc: rework pnet table Ursula Braun
2019-02-21 12:01 ` [PATCH net-next 4/6] net/smc: add smcd support to the " Ursula Braun
2019-02-21 12:01 ` [PATCH net-next 5/6] net/smc: add pnet table namespace support Ursula Braun
2019-02-21 12:01 ` [PATCH net-next 6/6] net/smc: allow PCI IDs as ib device names in the pnet table Ursula Braun
2019-02-21 18:36 ` [PATCH net-next 0/6] net/smc: patches 2019-02-21 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190221120103.10866-3-ubraun@linux.ibm.com \
    --to=ubraun@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raspl@linux.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).