aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l3_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_l3_main.c')
-rw-r--r--drivers/s390/net/qeth_l3_main.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 091ca0efa1c5..8710337dab3e 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -623,7 +623,7 @@ static int qeth_l3_send_setrouting(struct qeth_card *card,
623 return rc; 623 return rc;
624} 624}
625 625
626static void qeth_l3_correct_routing_type(struct qeth_card *card, 626static int qeth_l3_correct_routing_type(struct qeth_card *card,
627 enum qeth_routing_types *type, enum qeth_prot_versions prot) 627 enum qeth_routing_types *type, enum qeth_prot_versions prot)
628{ 628{
629 if (card->info.type == QETH_CARD_TYPE_IQD) { 629 if (card->info.type == QETH_CARD_TYPE_IQD) {
@@ -632,7 +632,7 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card,
632 case PRIMARY_CONNECTOR: 632 case PRIMARY_CONNECTOR:
633 case SECONDARY_CONNECTOR: 633 case SECONDARY_CONNECTOR:
634 case MULTICAST_ROUTER: 634 case MULTICAST_ROUTER:
635 return; 635 return 0;
636 default: 636 default:
637 goto out_inval; 637 goto out_inval;
638 } 638 }
@@ -641,17 +641,18 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card,
641 case NO_ROUTER: 641 case NO_ROUTER:
642 case PRIMARY_ROUTER: 642 case PRIMARY_ROUTER:
643 case SECONDARY_ROUTER: 643 case SECONDARY_ROUTER:
644 return; 644 return 0;
645 case MULTICAST_ROUTER: 645 case MULTICAST_ROUTER:
646 if (qeth_is_ipafunc_supported(card, prot, 646 if (qeth_is_ipafunc_supported(card, prot,
647 IPA_OSA_MC_ROUTER)) 647 IPA_OSA_MC_ROUTER))
648 return; 648 return 0;
649 default: 649 default:
650 goto out_inval; 650 goto out_inval;
651 } 651 }
652 } 652 }
653out_inval: 653out_inval:
654 *type = NO_ROUTER; 654 *type = NO_ROUTER;
655 return -EINVAL;
655} 656}
656 657
657int qeth_l3_setrouting_v4(struct qeth_card *card) 658int qeth_l3_setrouting_v4(struct qeth_card *card)
@@ -660,8 +661,10 @@ int qeth_l3_setrouting_v4(struct qeth_card *card)
660 661
661 QETH_CARD_TEXT(card, 3, "setrtg4"); 662 QETH_CARD_TEXT(card, 3, "setrtg4");
662 663
663 qeth_l3_correct_routing_type(card, &card->options.route4.type, 664 rc = qeth_l3_correct_routing_type(card, &card->options.route4.type,
664 QETH_PROT_IPV4); 665 QETH_PROT_IPV4);
666 if (rc)
667 return rc;
665 668
666 rc = qeth_l3_send_setrouting(card, card->options.route4.type, 669 rc = qeth_l3_send_setrouting(card, card->options.route4.type,
667 QETH_PROT_IPV4); 670 QETH_PROT_IPV4);
@@ -683,8 +686,10 @@ int qeth_l3_setrouting_v6(struct qeth_card *card)
683 686
684 if (!qeth_is_supported(card, IPA_IPV6)) 687 if (!qeth_is_supported(card, IPA_IPV6))
685 return 0; 688 return 0;
686 qeth_l3_correct_routing_type(card, &card->options.route6.type, 689 rc = qeth_l3_correct_routing_type(card, &card->options.route6.type,
687 QETH_PROT_IPV6); 690 QETH_PROT_IPV6);
691 if (rc)
692 return rc;
688 693
689 rc = qeth_l3_send_setrouting(card, card->options.route6.type, 694 rc = qeth_l3_send_setrouting(card, card->options.route6.type,
690 QETH_PROT_IPV6); 695 QETH_PROT_IPV6);
@@ -2898,7 +2903,9 @@ static inline int qeth_l3_tso_elements(struct sk_buff *skb)
2898 tcp_hdr(skb)->doff * 4; 2903 tcp_hdr(skb)->doff * 4;
2899 int tcpd_len = skb->len - (tcpd - (unsigned long)skb->data); 2904 int tcpd_len = skb->len - (tcpd - (unsigned long)skb->data);
2900 int elements = PFN_UP(tcpd + tcpd_len - 1) - PFN_DOWN(tcpd); 2905 int elements = PFN_UP(tcpd + tcpd_len - 1) - PFN_DOWN(tcpd);
2901 elements += skb_shinfo(skb)->nr_frags; 2906
2907 elements += qeth_get_elements_for_frags(skb);
2908
2902 return elements; 2909 return elements;
2903} 2910}
2904 2911
@@ -3348,7 +3355,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
3348 rc = -ENODEV; 3355 rc = -ENODEV;
3349 goto out_remove; 3356 goto out_remove;
3350 } 3357 }
3351 qeth_trace_features(card);
3352 3358
3353 if (!card->dev && qeth_l3_setup_netdev(card)) { 3359 if (!card->dev && qeth_l3_setup_netdev(card)) {
3354 rc = -ENODEV; 3360 rc = -ENODEV;
@@ -3425,6 +3431,7 @@ contin:
3425 qeth_l3_set_multicast_list(card->dev); 3431 qeth_l3_set_multicast_list(card->dev);
3426 rtnl_unlock(); 3432 rtnl_unlock();
3427 } 3433 }
3434 qeth_trace_features(card);
3428 /* let user_space know that device is online */ 3435 /* let user_space know that device is online */
3429 kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); 3436 kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
3430 mutex_unlock(&card->conf_mutex); 3437 mutex_unlock(&card->conf_mutex);