s390: some qeth driver fixes
Subsystems (4)
PATCH 2/2 s390: some qeth driver fixes
[patch 2/2] s390: some qeth driver fixes
From: Frank Pavlic <[email protected]>
- fixed kernel panic when using EDDP support in Layer 2 mode
- NULL pointer exception in qeth_set_offline fixed.
- setting EDDP in Layer 2 mode did not set NETIF_F_(SG/TSO) flags when device became online.
- use sscanf for parsing and converting IPv4 addresses from string to __u8 values.
- qeth_string_to_ipaddr6 fixed. in case of double colon the converted IPv6 address out from the string was not correct in previous implementation.
Signed-off-by Frank Pavlic <[email protected]>
diffstat:
qeth.h | 112 +++++++++++++++++++++++++----------------------------------- qeth_eddp.c | 11 ++++- qeth_main.c | 17 +++------ 3 files changed, 63 insertions(+), 77 deletions(-)
drivers/s390/net/qeth_eddp.c +9 -2
@@ -59,8 +59,7 @@ qeth_eddp_free_context(struct qeth_eddp_for (i =0 ; i < ctx->num_pages; ++i)free_page ((unsigned long )ctx->pages[i]);kfree (ctx->pages); -if (ctx->elements !=NULL ) -kfree (ctx->elements); +kfree (ctx->elements);kfree (ctx); }
@@ -413,6 +412,13 @@ __qeth_eddp_fill_context_tcp(struct qethQETH_DBF_TEXT (trace,5 ,"eddpftcp" ); eddp->skb_offset =sizeof (struct qeth_hdr ) + eddp->nhl + eddp->thl; +if (eddp->qh.hdr.l2.id ==QETH_HEADER_TYPE_LAYER2 ) { + eddp->skb_offset +=sizeof (struct ethhdr ); +#ifdef CONFIG_QETH_VLAN +if (eddp->mac.h_proto ==__constant_htons (ETH_P_8021Q )) + eddp->skb_offset +=VLAN_HLEN ; +#endif /* CONFIG_QETH_VLAN */ + } tcph = eddp->skb->h.th;while (eddp->skb_offset < eddp->skb->len) { data_len = min((int)skb_shinfo(eddp->skb)->tso_size,
@@ -483,6 +489,7 @@ qeth_eddp_fill_context_tcp(struct qeth_ereturn -ENOMEM ; }if (qhdr->hdr.l2.id ==QETH_HEADER_TYPE_LAYER2 ) { + skb->mac.raw = (skb->data) +sizeof (struct qeth_hdr );memcpy (&eddp->mac,eth_hdr (skb),ETH_HLEN );#ifdef CONFIG_QETH_VLAN if (eddp->mac.h_proto ==__constant_htons (ETH_P_8021Q )) {
drivers/s390/net/qeth.h +47 -65
132 lines not on this page · raw message
drivers/s390/net/qeth_main.c +7 -10
@@ -516,7 +516,8 @@ __qeth_set_offline(struct ccwgroup_devicQETH_DBF_TEXT (setup,3 ,"setoffl" );QETH_DBF_HEX (setup,3 , &card,sizeof (void *)); -netif_carrier_off (card->dev); +if (card->dev &&netif_carrier_ok (card->dev)) +netif_carrier_off (card->dev); recover_flag = card->state;if (qeth_stop_card (card, recovery_mode) == -ERESTARTSYS ){ PRINT_WARN("Stopping card %s interrupted by user!\n",
@@ -1679,6 +1680,7 @@ qeth_cmd_timeout(unsigned long data)spin_unlock_irqrestore (&reply->card->lock, flags); } +static struct qeth_ipa_cmd *qeth_check_ipa_data (struct qeth_card *card,struct qeth_cmd_buffer *iob) {
@@ -1699,7 +1701,8 @@ qeth_check_ipa_data(struct qeth_card *caQETH_CARD_IFNAME (card), card->info.chpid); card->lan_online =0 ; -netif_carrier_off (card->dev); +if (card->dev &&netif_carrier_ok (card->dev)) +netif_carrier_off (card->dev);return NULL ;case IPA_CMD_STARTLAN : PRINT_INFO("Link reestablished on %s "
@@ -5562,7 +5565,7 @@ qeth_set_multicast_list(struct net_devicif (card->info.type ==QETH_CARD_TYPE_OSN )return ; -QETH_DBF_TEXT (trace,3 ,"setmulti" ); +QETH_DBF_TEXT (trace,3 ,"setmulti" );qeth_delete_mc_addresses (card);if (card->options.layer2) {qeth_layer2_add_multicast (card);
@@ -5579,7 +5582,6 @@ out:return ;if (qeth_set_thread_start_bit (card,QETH_SET_PROMISC_MODE_THREAD )==0 )schedule_work (&card->kernel_thread_starter); - } static int
@@ -7452,6 +7454,7 @@ qeth_softsetup_card(struct qeth_card *ca card->lan_online =1 ;if (card->info.type==QETH_CARD_TYPE_OSN ) goto out; +qeth_set_large_send (card, card->options.large_send);if (card->options.layer2) { card->dev->features |= NETIF_F_HW_VLAN_FILTER |
@@ -7468,12 +7471,6 @@ qeth_softsetup_card(struct qeth_card *ca#endif goto out; } -if ((card->options.large_send ==QETH_LARGE_SEND_EDDP ) || - (card->options.large_send ==QETH_LARGE_SEND_TSO )) - card->dev->features |=NETIF_F_TSO |NETIF_F_SG ; -else - card->dev->features &= ~(NETIF_F_TSO |NETIF_F_SG ); -if ((rc =qeth_setadapter_parms (card)))QETH_DBF_TEXT_ (setup,2 ,"2err%d" , rc);if ((rc =qeth_start_ipassists (card)))