Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/net: convert pnetids to ascii

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hans Wippel and committed by
David S. Miller
390dde08 cecc7a31

+3
+3
arch/s390/net/pnet.c
··· 12 12 #include <asm/ccwgroup.h> 13 13 #include <asm/ccwdev.h> 14 14 #include <asm/pnet.h> 15 + #include <asm/ebcdic.h> 15 16 16 17 #define PNETIDS_LEN 64 /* Total utility string length in bytes 17 18 * to cover up to 4 PNETIDs of 16 bytes ··· 49 48 if (!util_str) 50 49 return -ENOMEM; 51 50 memcpy(pnetids, util_str, PNETIDS_LEN); 51 + EBCASC(pnetids, PNETIDS_LEN); 52 52 kfree(util_str); 53 53 return 0; 54 54 } ··· 57 55 struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); 58 56 59 57 memcpy(pnetids, zdev->util_str, sizeof(zdev->util_str)); 58 + EBCASC(pnetids, sizeof(zdev->util_str)); 60 59 return 0; 61 60 } 62 61 return -EOPNOTSUPP;