diff options
author | Ursula Braun <braunu@de.ibm.com> | 2005-09-30 04:17:24 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 22:05:38 -0400 |
commit | 9123e0d78990246304fe681167b8d8097f1e02d7 (patch) | |
tree | af538ea90ed4f64b448fd36f0379ec79db9f3c89 /drivers/s390/net/qeth_main.c | |
parent | bb53d6d0e70cd0749a7844efc62cefeb24b134b6 (diff) |
[PATCH] s390: qeth driver fixes
From: Peter Tiedemann <ptiedem@de.ibm.com>
From: Frank Pavlic <pavlic@de.ibm.com>
minor qeth fixes:
- free old skb in qeth_realloc_headroom after duplicating skb
- disable IPV6 support for Hipersockets devices
- call ccw_device_set_offline on every channel regardless
of the return value of the prior ccw_device_set_offline calls
- allocate qdio structures in DMA-area
- schedule recovery of appropriate card
when cable has been inserted again.
- add missing initialization of card->lock
- write sequence number in skb->cb for SNA protocol which
requires strictly serialized packets.
Signed-off-by: Frank Pavlic <pavlic@de.ibm.com>
diffstat:
qeth.h | 2 ++
qeth_main.c | 37 +++++++++++++++++--------------------
2 files changed, 19 insertions(+), 20 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/s390/net/qeth_main.c')
-rw-r--r-- | drivers/s390/net/qeth_main.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 71de834ece1..bd28e2438d7 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -511,7 +511,7 @@ static int | |||
511 | __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) | 511 | __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) |
512 | { | 512 | { |
513 | struct qeth_card *card = (struct qeth_card *) cgdev->dev.driver_data; | 513 | struct qeth_card *card = (struct qeth_card *) cgdev->dev.driver_data; |
514 | int rc = 0; | 514 | int rc = 0, rc2 = 0, rc3 = 0; |
515 | enum qeth_card_states recover_flag; | 515 | enum qeth_card_states recover_flag; |
516 | 516 | ||
517 | QETH_DBF_TEXT(setup, 3, "setoffl"); | 517 | QETH_DBF_TEXT(setup, 3, "setoffl"); |
@@ -523,11 +523,13 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) | |||
523 | CARD_BUS_ID(card)); | 523 | CARD_BUS_ID(card)); |
524 | return -ERESTARTSYS; | 524 | return -ERESTARTSYS; |
525 | } | 525 | } |
526 | if ((rc = ccw_device_set_offline(CARD_DDEV(card))) || | 526 | rc = ccw_device_set_offline(CARD_DDEV(card)); |
527 | (rc = ccw_device_set_offline(CARD_WDEV(card))) || | 527 | rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
528 | (rc = ccw_device_set_offline(CARD_RDEV(card)))) { | 528 | rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
529 | if (!rc) | ||
530 | rc = (rc2) ? rc2 : rc3; | ||
531 | if (rc) | ||
529 | QETH_DBF_TEXT_(setup, 2, "1err%d", rc); | 532 | QETH_DBF_TEXT_(setup, 2, "1err%d", rc); |
530 | } | ||
531 | if (recover_flag == CARD_STATE_UP) | 533 | if (recover_flag == CARD_STATE_UP) |
532 | card->state = CARD_STATE_RECOVER; | 534 | card->state = CARD_STATE_RECOVER; |
533 | qeth_notify_processes(); | 535 | qeth_notify_processes(); |
@@ -1046,6 +1048,7 @@ qeth_setup_card(struct qeth_card *card) | |||
1046 | spin_lock_init(&card->vlanlock); | 1048 | spin_lock_init(&card->vlanlock); |
1047 | card->vlangrp = NULL; | 1049 | card->vlangrp = NULL; |
1048 | #endif | 1050 | #endif |
1051 | spin_lock_init(&card->lock); | ||
1049 | spin_lock_init(&card->ip_lock); | 1052 | spin_lock_init(&card->ip_lock); |
1050 | spin_lock_init(&card->thread_mask_lock); | 1053 | spin_lock_init(&card->thread_mask_lock); |
1051 | card->thread_start_mask = 0; | 1054 | card->thread_start_mask = 0; |
@@ -1626,16 +1629,6 @@ qeth_cmd_timeout(unsigned long data) | |||
1626 | spin_unlock_irqrestore(&reply->card->lock, flags); | 1629 | spin_unlock_irqrestore(&reply->card->lock, flags); |
1627 | } | 1630 | } |
1628 | 1631 | ||
1629 | static void | ||
1630 | qeth_reset_ip_addresses(struct qeth_card *card) | ||
1631 | { | ||
1632 | QETH_DBF_TEXT(trace, 2, "rstipadd"); | ||
1633 | |||
1634 | qeth_clear_ip_list(card, 0, 1); | ||
1635 | /* this function will also schedule the SET_IP_THREAD */ | ||
1636 | qeth_set_multicast_list(card->dev); | ||
1637 | } | ||
1638 | |||
1639 | static struct qeth_ipa_cmd * | 1632 | static struct qeth_ipa_cmd * |
1640 | qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) | 1633 | qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) |
1641 | { | 1634 | { |
@@ -1664,9 +1657,8 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) | |||
1664 | "IP address reset.\n", | 1657 | "IP address reset.\n", |
1665 | QETH_CARD_IFNAME(card), | 1658 | QETH_CARD_IFNAME(card), |
1666 | card->info.chpid); | 1659 | card->info.chpid); |
1667 | card->lan_online = 1; | ||
1668 | netif_carrier_on(card->dev); | 1660 | netif_carrier_on(card->dev); |
1669 | qeth_reset_ip_addresses(card); | 1661 | qeth_schedule_recovery(card); |
1670 | return NULL; | 1662 | return NULL; |
1671 | case IPA_CMD_REGISTER_LOCAL_ADDR: | 1663 | case IPA_CMD_REGISTER_LOCAL_ADDR: |
1672 | QETH_DBF_TEXT(trace,3, "irla"); | 1664 | QETH_DBF_TEXT(trace,3, "irla"); |
@@ -2387,6 +2379,7 @@ qeth_layer2_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, | |||
2387 | skb_pull(skb, VLAN_HLEN); | 2379 | skb_pull(skb, VLAN_HLEN); |
2388 | } | 2380 | } |
2389 | #endif | 2381 | #endif |
2382 | *((__u32 *)skb->cb) = ++card->seqno.pkt_seqno; | ||
2390 | return vlan_id; | 2383 | return vlan_id; |
2391 | } | 2384 | } |
2392 | 2385 | ||
@@ -3014,7 +3007,7 @@ qeth_alloc_buffer_pool(struct qeth_card *card) | |||
3014 | return -ENOMEM; | 3007 | return -ENOMEM; |
3015 | } | 3008 | } |
3016 | for(j = 0; j < QETH_MAX_BUFFER_ELEMENTS(card); ++j){ | 3009 | for(j = 0; j < QETH_MAX_BUFFER_ELEMENTS(card); ++j){ |
3017 | ptr = (void *) __get_free_page(GFP_KERNEL); | 3010 | ptr = (void *) __get_free_page(GFP_KERNEL|GFP_DMA); |
3018 | if (!ptr) { | 3011 | if (!ptr) { |
3019 | while (j > 0) | 3012 | while (j > 0) |
3020 | free_page((unsigned long) | 3013 | free_page((unsigned long) |
@@ -3058,7 +3051,8 @@ qeth_alloc_qdio_buffers(struct qeth_card *card) | |||
3058 | if (card->qdio.state == QETH_QDIO_ALLOCATED) | 3051 | if (card->qdio.state == QETH_QDIO_ALLOCATED) |
3059 | return 0; | 3052 | return 0; |
3060 | 3053 | ||
3061 | card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), GFP_KERNEL); | 3054 | card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), |
3055 | GFP_KERNEL|GFP_DMA); | ||
3062 | if (!card->qdio.in_q) | 3056 | if (!card->qdio.in_q) |
3063 | return - ENOMEM; | 3057 | return - ENOMEM; |
3064 | QETH_DBF_TEXT(setup, 2, "inq"); | 3058 | QETH_DBF_TEXT(setup, 2, "inq"); |
@@ -3083,7 +3077,7 @@ qeth_alloc_qdio_buffers(struct qeth_card *card) | |||
3083 | } | 3077 | } |
3084 | for (i = 0; i < card->qdio.no_out_queues; ++i){ | 3078 | for (i = 0; i < card->qdio.no_out_queues; ++i){ |
3085 | card->qdio.out_qs[i] = kmalloc(sizeof(struct qeth_qdio_out_q), | 3079 | card->qdio.out_qs[i] = kmalloc(sizeof(struct qeth_qdio_out_q), |
3086 | GFP_KERNEL); | 3080 | GFP_KERNEL|GFP_DMA); |
3087 | if (!card->qdio.out_qs[i]){ | 3081 | if (!card->qdio.out_qs[i]){ |
3088 | while (i > 0) | 3082 | while (i > 0) |
3089 | kfree(card->qdio.out_qs[--i]); | 3083 | kfree(card->qdio.out_qs[--i]); |
@@ -6470,6 +6464,9 @@ qeth_query_ipassists_cb(struct qeth_card *card, struct qeth_reply *reply, | |||
6470 | if (cmd->hdr.prot_version == QETH_PROT_IPV4) { | 6464 | if (cmd->hdr.prot_version == QETH_PROT_IPV4) { |
6471 | card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported; | 6465 | card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported; |
6472 | card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled; | 6466 | card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled; |
6467 | /* Disable IPV6 support hard coded for Hipersockets */ | ||
6468 | if(card->info.type == QETH_CARD_TYPE_IQD) | ||
6469 | card->options.ipa4.supported_funcs &= ~IPA_IPV6; | ||
6473 | } else { | 6470 | } else { |
6474 | #ifdef CONFIG_QETH_IPV6 | 6471 | #ifdef CONFIG_QETH_IPV6 |
6475 | card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported; | 6472 | card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported; |