s390/net: set HW port number in netdevice
authorUrsula Braun <ursula.braun@de.ibm.com>
Thu, 26 Apr 2018 07:42:15 +0000 (09:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Apr 2018 17:38:47 +0000 (13:38 -0400)
struct net_device contains a dev_port field. Store the OSA port number
in this field.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Reviewed-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/lcs.c
drivers/s390/net/qeth_core_sys.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 0ee8f33efb544877c37af645d348918078d88957..2d9fe7e4ee400d8df5d7837f46d4c4569d1780ed 100644 (file)
@@ -1928,6 +1928,8 @@ lcs_portno_store (struct device *dev, struct device_attribute *attr, const char
                return -EINVAL;
         /* TODO: sanity checks */
         card->portno = value;
+       if (card->dev)
+               card->dev->dev_port = card->portno;
 
         return count;
 
@@ -2158,6 +2160,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
        card->dev = dev;
        card->dev->ml_priv = card;
        card->dev->netdev_ops = &lcs_netdev_ops;
+       card->dev->dev_port = card->portno;
        memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH);
 #ifdef CONFIG_IP_MULTICAST
        if (!lcs_check_multicast_support(card))
index ae81534de91228910fd877fce0e1e262cc24fddf..c3f18afb368b1118a1ca56c89bf8115f84db088f 100644 (file)
@@ -144,6 +144,8 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
                goto out;
        }
        card->info.portno = portno;
+       if (card->dev)
+               card->dev->dev_port = portno;
 out:
        mutex_unlock(&card->conf_mutex);
        return rc ? rc : count;
index 896c919e7658f798bcfe99910e55e0fa5625b590..3239b2546ac7ba38590d078108ec2cebb5c5b5bc 100644 (file)
@@ -984,6 +984,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
        card->dev->mtu = card->info.initial_mtu;
        card->dev->min_mtu = 64;
        card->dev->max_mtu = ETH_MAX_MTU;
+       card->dev->dev_port = card->info.portno;
        card->dev->netdev_ops = &qeth_l2_netdev_ops;
        if (card->info.type == QETH_CARD_TYPE_OSN) {
                card->dev->ethtool_ops = &qeth_l2_osn_ops;
index 53c5470be7d5f1773e6bd6bd98bfa1010dd7e45c..64f27de079ca6d32e7494464ad79a87f117c1f70 100644 (file)
@@ -2576,6 +2576,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
        card->dev->mtu = card->info.initial_mtu;
        card->dev->min_mtu = 64;
        card->dev->max_mtu = ETH_MAX_MTU;
+       card->dev->dev_port = card->info.portno;
        card->dev->ethtool_ops = &qeth_l3_ethtool_ops;
        card->dev->features |=  NETIF_F_HW_VLAN_CTAG_TX |
                                NETIF_F_HW_VLAN_CTAG_RX |