@@ -880,11 +880,21 @@ static int qeth_l2_stop(struct net_device *dev)
880880 return 0 ;
881881}
882882
883+ static const struct device_type qeth_l2_devtype = {
884+ .name = "qeth_layer2" ,
885+ .groups = qeth_l2_attr_groups ,
886+ };
887+
883888static int qeth_l2_probe_device (struct ccwgroup_device * gdev )
884889{
885890 struct qeth_card * card = dev_get_drvdata (& gdev -> dev );
891+ int rc ;
886892
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+ }
888898 INIT_LIST_HEAD (& card -> vid_list );
889899 hash_init (card -> mac_htable );
890900 card -> options .layer2 = 1 ;
@@ -896,7 +906,8 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)
896906{
897907 struct qeth_card * card = dev_get_drvdata (& cgdev -> dev );
898908
899- qeth_l2_remove_device_attributes (& cgdev -> dev );
909+ if (cgdev -> dev .type == & qeth_generic_devtype )
910+ qeth_l2_remove_device_attributes (& cgdev -> dev );
900911 qeth_set_allowed_threads (card , 0 , 1 );
901912 wait_event (card -> wait_q , qeth_threads_running (card , 0xffffffff ) == 0 );
902913
@@ -954,7 +965,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
954965 case QETH_CARD_TYPE_OSN :
955966 card -> dev = alloc_netdev (0 , "osn%d" , NET_NAME_UNKNOWN ,
956967 ether_setup );
957- card -> dev -> flags |= IFF_NOARP ;
958968 break ;
959969 default :
960970 card -> dev = alloc_etherdev (0 );
@@ -969,9 +979,12 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
969979 card -> dev -> min_mtu = 64 ;
970980 card -> dev -> max_mtu = ETH_MAX_MTU ;
971981 card -> dev -> netdev_ops = & qeth_l2_netdev_ops ;
972- card -> dev -> ethtool_ops =
973- (card -> info .type != QETH_CARD_TYPE_OSN ) ?
974- & qeth_l2_ethtool_ops : & qeth_l2_osn_ops ;
982+ if (card -> info .type == QETH_CARD_TYPE_OSN ) {
983+ card -> dev -> ethtool_ops = & qeth_l2_osn_ops ;
984+ card -> dev -> flags |= IFF_NOARP ;
985+ } else {
986+ card -> dev -> ethtool_ops = & qeth_l2_ethtool_ops ;
987+ }
975988 card -> dev -> features |= NETIF_F_HW_VLAN_CTAG_FILTER ;
976989 if (card -> info .type == QETH_CARD_TYPE_OSD && !card -> info .guestlan ) {
977990 card -> dev -> hw_features = NETIF_F_SG ;
@@ -1269,6 +1282,7 @@ static int qeth_l2_control_event(struct qeth_card *card,
12691282}
12701283
12711284struct qeth_discipline qeth_l2_discipline = {
1285+ .devtype = & qeth_l2_devtype ,
12721286 .start_poll = qeth_qdio_start_poll ,
12731287 .input_handler = (qdio_handler_t * ) qeth_qdio_input_handler ,
12741288 .output_handler = (qdio_handler_t * ) qeth_qdio_output_handler ,
0 commit comments