diff options
Diffstat (limited to 'drivers/s390/net/qeth_l2_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 1b07f382d74c..bd2df62a5cdf 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -880,11 +880,21 @@ static int qeth_l2_stop(struct net_device *dev) | |||
880 | return 0; | 880 | return 0; |
881 | } | 881 | } |
882 | 882 | ||
883 | static const struct device_type qeth_l2_devtype = { | ||
884 | .name = "qeth_layer2", | ||
885 | .groups = qeth_l2_attr_groups, | ||
886 | }; | ||
887 | |||
883 | static int qeth_l2_probe_device(struct ccwgroup_device *gdev) | 888 | static int qeth_l2_probe_device(struct ccwgroup_device *gdev) |
884 | { | 889 | { |
885 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 890 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
891 | int rc; | ||
886 | 892 | ||
887 | qeth_l2_create_device_attributes(&gdev->dev); | 893 | if (gdev->dev.type == &qeth_generic_devtype) { |
894 | rc = qeth_l2_create_device_attributes(&gdev->dev); | ||
895 | if (rc) | ||
896 | return rc; | ||
897 | } | ||
888 | INIT_LIST_HEAD(&card->vid_list); | 898 | INIT_LIST_HEAD(&card->vid_list); |
889 | hash_init(card->mac_htable); | 899 | hash_init(card->mac_htable); |
890 | card->options.layer2 = 1; | 900 | card->options.layer2 = 1; |
@@ -896,7 +906,8 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev) | |||
896 | { | 906 | { |
897 | struct qeth_card *card = dev_get_drvdata(&cgdev->dev); | 907 | struct qeth_card *card = dev_get_drvdata(&cgdev->dev); |
898 | 908 | ||
899 | qeth_l2_remove_device_attributes(&cgdev->dev); | 909 | if (cgdev->dev.type == &qeth_generic_devtype) |
910 | qeth_l2_remove_device_attributes(&cgdev->dev); | ||
900 | qeth_set_allowed_threads(card, 0, 1); | 911 | qeth_set_allowed_threads(card, 0, 1); |
901 | wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); | 912 | wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); |
902 | 913 | ||
@@ -954,7 +965,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) | |||
954 | case QETH_CARD_TYPE_OSN: | 965 | case QETH_CARD_TYPE_OSN: |
955 | card->dev = alloc_netdev(0, "osn%d", NET_NAME_UNKNOWN, | 966 | card->dev = alloc_netdev(0, "osn%d", NET_NAME_UNKNOWN, |
956 | ether_setup); | 967 | ether_setup); |
957 | card->dev->flags |= IFF_NOARP; | ||
958 | break; | 968 | break; |
959 | default: | 969 | default: |
960 | card->dev = alloc_etherdev(0); | 970 | card->dev = alloc_etherdev(0); |
@@ -969,9 +979,12 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) | |||
969 | card->dev->min_mtu = 64; | 979 | card->dev->min_mtu = 64; |
970 | card->dev->max_mtu = ETH_MAX_MTU; | 980 | card->dev->max_mtu = ETH_MAX_MTU; |
971 | card->dev->netdev_ops = &qeth_l2_netdev_ops; | 981 | card->dev->netdev_ops = &qeth_l2_netdev_ops; |
972 | card->dev->ethtool_ops = | 982 | if (card->info.type == QETH_CARD_TYPE_OSN) { |
973 | (card->info.type != QETH_CARD_TYPE_OSN) ? | 983 | card->dev->ethtool_ops = &qeth_l2_osn_ops; |
974 | &qeth_l2_ethtool_ops : &qeth_l2_osn_ops; | 984 | card->dev->flags |= IFF_NOARP; |
985 | } else { | ||
986 | card->dev->ethtool_ops = &qeth_l2_ethtool_ops; | ||
987 | } | ||
975 | card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; | 988 | card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; |
976 | if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) { | 989 | if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) { |
977 | card->dev->hw_features = NETIF_F_SG; | 990 | card->dev->hw_features = NETIF_F_SG; |
@@ -1269,6 +1282,7 @@ static int qeth_l2_control_event(struct qeth_card *card, | |||
1269 | } | 1282 | } |
1270 | 1283 | ||
1271 | struct qeth_discipline qeth_l2_discipline = { | 1284 | struct qeth_discipline qeth_l2_discipline = { |
1285 | .devtype = &qeth_l2_devtype, | ||
1272 | .start_poll = qeth_qdio_start_poll, | 1286 | .start_poll = qeth_qdio_start_poll, |
1273 | .input_handler = (qdio_handler_t *) qeth_qdio_input_handler, | 1287 | .input_handler = (qdio_handler_t *) qeth_qdio_input_handler, |
1274 | .output_handler = (qdio_handler_t *) qeth_qdio_output_handler, | 1288 | .output_handler = (qdio_handler_t *) qeth_qdio_output_handler, |