hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/s390/net/pnet.c
....@@ -12,6 +12,15 @@
1212 #include <asm/ccwgroup.h>
1313 #include <asm/ccwdev.h>
1414 #include <asm/pnet.h>
15
+#include <asm/ebcdic.h>
16
+
17
+#define PNETIDS_LEN 64 /* Total utility string length in bytes
18
+ * to cover up to 4 PNETIDs of 16 bytes
19
+ * for up to 4 device ports
20
+ */
21
+#define MAX_PNETID_LEN 16 /* Max.length of a single port PNETID */
22
+#define MAX_PNETID_PORTS (PNETIDS_LEN / MAX_PNETID_LEN)
23
+ /* Max. # of ports with a PNETID */
1524
1625 /*
1726 * Get the PNETIDs from a device.
....@@ -40,6 +49,7 @@
4049 if (!util_str)
4150 return -ENOMEM;
4251 memcpy(pnetids, util_str, PNETIDS_LEN);
52
+ EBCASC(pnetids, PNETIDS_LEN);
4353 kfree(util_str);
4454 return 0;
4555 }
....@@ -47,6 +57,7 @@
4757 struct zpci_dev *zdev = to_zpci(to_pci_dev(dev));
4858
4959 memcpy(pnetids, zdev->util_str, sizeof(zdev->util_str));
60
+ EBCASC(pnetids, sizeof(zdev->util_str));
5061 return 0;
5162 }
5263 return -EOPNOTSUPP;