#define PNETIDS_LEN 64 /* Total utility string length in bytes * to cover up to 4 PNETIDs of 16 bytes * for up to 4 device ports
*/ #define MAX_PNETID_LEN 16 /* Max.length of a single port PNETID */ #define MAX_PNETID_PORTS (PNETIDS_LEN / MAX_PNETID_LEN) /* Max. # of ports with a PNETID */
/* * Get the PNETIDs from a device. * s390 hardware supports the definition of a so-called Physical Network * Identifier (short PNETID) per network device port. These PNETIDs can be * used to identify network devices that are attached to the same physical * network (broadcast domain). * * The device can be * - a ccwgroup device with all bundled subchannels having the same PNETID * - a PCI attached network device * * Returns: * 0: PNETIDs extracted from device. * -ENOMEM: No memory to extract utility string. * -EOPNOTSUPP: Device type without utility string support
*/ staticint pnet_ids_by_device(struct device *dev, u8 *pnetids)
{
memset(pnetids, 0, PNETIDS_LEN); if (dev_is_ccwgroup(dev)) { struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
u8 *util_str;
/* * Extract the pnetid for a device port. * * Return 0 if a pnetid is found and -ENOENT otherwise.
*/ int pnet_id_by_dev_port(struct device *dev, unsignedshort port, u8 *pnetid)
{
u8 pnetids[MAX_PNETID_PORTS][MAX_PNETID_LEN]; staticconst u8 zero[MAX_PNETID_LEN] = { 0 }; int rc = 0;
if (!dev || port >= MAX_PNETID_PORTS) return -ENOENT;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.