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

s390/qeth: split up L2 netdev_ops

Splitting up the netdev_ops allows for fine-tuning some of the ndo's
in subsequent patches.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Julian Wiedmann and committed by
Jakub Kicinski
2dbc7a1d 5e9756a6

+28 -4
+28 -4
drivers/s390/net/qeth_l2_main.c
··· 726 726 unsigned char addr[ETH_ALEN]; 727 727 }; 728 728 729 - static const struct net_device_ops qeth_l2_netdev_ops; 729 + static const struct net_device_ops qeth_l2_iqd_netdev_ops; 730 + static const struct net_device_ops qeth_l2_osa_netdev_ops; 730 731 731 732 static bool qeth_l2_must_learn(struct net_device *netdev, 732 733 struct net_device *dstdev) ··· 739 738 (priv->brport_features & BR_LEARNING_SYNC) && 740 739 !(br_port_flag_is_set(netdev, BR_ISOLATED) && 741 740 br_port_flag_is_set(dstdev, BR_ISOLATED)) && 742 - netdev->netdev_ops == &qeth_l2_netdev_ops); 741 + (netdev->netdev_ops == &qeth_l2_iqd_netdev_ops || 742 + netdev->netdev_ops == &qeth_l2_osa_netdev_ops)); 743 743 } 744 744 745 745 /** ··· 1053 1051 return rc; 1054 1052 } 1055 1053 1056 - static const struct net_device_ops qeth_l2_netdev_ops = { 1054 + static const struct net_device_ops qeth_l2_iqd_netdev_ops = { 1055 + .ndo_open = qeth_open, 1056 + .ndo_stop = qeth_stop, 1057 + .ndo_get_stats64 = qeth_get_stats64, 1058 + .ndo_start_xmit = qeth_l2_hard_start_xmit, 1059 + .ndo_features_check = qeth_features_check, 1060 + .ndo_select_queue = qeth_l2_select_queue, 1061 + .ndo_validate_addr = qeth_l2_validate_addr, 1062 + .ndo_set_rx_mode = qeth_l2_set_rx_mode, 1063 + .ndo_eth_ioctl = qeth_do_ioctl, 1064 + .ndo_siocdevprivate = qeth_siocdevprivate, 1065 + .ndo_set_mac_address = qeth_l2_set_mac_address, 1066 + .ndo_vlan_rx_add_vid = qeth_l2_vlan_rx_add_vid, 1067 + .ndo_vlan_rx_kill_vid = qeth_l2_vlan_rx_kill_vid, 1068 + .ndo_tx_timeout = qeth_tx_timeout, 1069 + .ndo_fix_features = qeth_fix_features, 1070 + .ndo_set_features = qeth_set_features, 1071 + .ndo_bridge_getlink = qeth_l2_bridge_getlink, 1072 + .ndo_bridge_setlink = qeth_l2_bridge_setlink, 1073 + }; 1074 + 1075 + static const struct net_device_ops qeth_l2_osa_netdev_ops = { 1057 1076 .ndo_open = qeth_open, 1058 1077 .ndo_stop = qeth_stop, 1059 1078 .ndo_get_stats64 = qeth_get_stats64, ··· 1097 1074 1098 1075 static int qeth_l2_setup_netdev(struct qeth_card *card) 1099 1076 { 1077 + card->dev->netdev_ops = IS_IQD(card) ? &qeth_l2_iqd_netdev_ops : 1078 + &qeth_l2_osa_netdev_ops; 1100 1079 card->dev->needed_headroom = sizeof(struct qeth_hdr); 1101 - card->dev->netdev_ops = &qeth_l2_netdev_ops; 1102 1080 card->dev->priv_flags |= IFF_UNICAST_FLT; 1103 1081 1104 1082 if (IS_OSM(card)) {