diff options
Diffstat (limited to 'drivers/s390/net/ctcmain.c')
| -rw-r--r-- | drivers/s390/net/ctcmain.c | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index fe986af884f8..20c8eb16f464 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * Fixes by : Jochen Röhrig (roehrig@de.ibm.com) | 6 | * Fixes by : Jochen Röhrig (roehrig@de.ibm.com) |
| 7 | * Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 7 | * Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
| 8 | Peter Tiedemann (ptiedem@de.ibm.com) | 8 | Peter Tiedemann (ptiedem@de.ibm.com) |
| 9 | * Driver Model stuff by : Cornelia Huck <huckc@de.ibm.com> | 9 | * Driver Model stuff by : Cornelia Huck <cornelia.huck@de.ibm.com> |
| 10 | * | 10 | * |
| 11 | * Documentation used: | 11 | * Documentation used: |
| 12 | * - Principles of Operation (IBM doc#: SA22-7201-06) | 12 | * - Principles of Operation (IBM doc#: SA22-7201-06) |
| @@ -65,7 +65,6 @@ | |||
| 65 | 65 | ||
| 66 | #include <asm/idals.h> | 66 | #include <asm/idals.h> |
| 67 | 67 | ||
| 68 | #include "ctctty.h" | ||
| 69 | #include "fsm.h" | 68 | #include "fsm.h" |
| 70 | #include "cu3088.h" | 69 | #include "cu3088.h" |
| 71 | 70 | ||
| @@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb) | |||
| 479 | skb->dev = pskb->dev; | 478 | skb->dev = pskb->dev; |
| 480 | skb->protocol = pskb->protocol; | 479 | skb->protocol = pskb->protocol; |
| 481 | pskb->ip_summed = CHECKSUM_UNNECESSARY; | 480 | pskb->ip_summed = CHECKSUM_UNNECESSARY; |
| 482 | if (ch->protocol == CTC_PROTO_LINUX_TTY) | 481 | netif_rx_ni(skb); |
| 483 | ctc_tty_netif_rx(skb); | ||
| 484 | else | ||
| 485 | netif_rx_ni(skb); | ||
| 486 | /** | 482 | /** |
| 487 | * Successful rx; reset logflags | 483 | * Successful rx; reset logflags |
| 488 | */ | 484 | */ |
| @@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsigned char sense) | |||
| 557 | DBF_TEXT(trace, 5, __FUNCTION__); | 553 | DBF_TEXT(trace, 5, __FUNCTION__); |
| 558 | if (sense & SNS0_INTERVENTION_REQ) { | 554 | if (sense & SNS0_INTERVENTION_REQ) { |
| 559 | if (sense & 0x01) { | 555 | if (sense & 0x01) { |
| 560 | if (ch->protocol != CTC_PROTO_LINUX_TTY) | 556 | ctc_pr_debug("%s: Interface disc. or Sel. reset " |
| 561 | ctc_pr_debug("%s: Interface disc. or Sel. reset " | ||
| 562 | "(remote)\n", ch->id); | 557 | "(remote)\n", ch->id); |
| 563 | fsm_event(ch->fsm, CH_EVENT_UC_RCRESET, ch); | 558 | fsm_event(ch->fsm, CH_EVENT_UC_RCRESET, ch); |
| 564 | } else { | 559 | } else { |
| @@ -2034,7 +2029,6 @@ static void | |||
| 2034 | dev_action_chup(fsm_instance * fi, int event, void *arg) | 2029 | dev_action_chup(fsm_instance * fi, int event, void *arg) |
| 2035 | { | 2030 | { |
| 2036 | struct net_device *dev = (struct net_device *) arg; | 2031 | struct net_device *dev = (struct net_device *) arg; |
| 2037 | struct ctc_priv *privptr = dev->priv; | ||
| 2038 | 2032 | ||
| 2039 | DBF_TEXT(trace, 3, __FUNCTION__); | 2033 | DBF_TEXT(trace, 3, __FUNCTION__); |
| 2040 | switch (fsm_getstate(fi)) { | 2034 | switch (fsm_getstate(fi)) { |
| @@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int event, void *arg) | |||
| 2049 | fsm_newstate(fi, DEV_STATE_RUNNING); | 2043 | fsm_newstate(fi, DEV_STATE_RUNNING); |
| 2050 | ctc_pr_info("%s: connected with remote side\n", | 2044 | ctc_pr_info("%s: connected with remote side\n", |
| 2051 | dev->name); | 2045 | dev->name); |
| 2052 | if (privptr->protocol == CTC_PROTO_LINUX_TTY) | ||
| 2053 | ctc_tty_setcarrier(dev, 1); | ||
| 2054 | ctc_clear_busy(dev); | 2046 | ctc_clear_busy(dev); |
| 2055 | } | 2047 | } |
| 2056 | break; | 2048 | break; |
| @@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int event, void *arg) | |||
| 2059 | fsm_newstate(fi, DEV_STATE_RUNNING); | 2051 | fsm_newstate(fi, DEV_STATE_RUNNING); |
| 2060 | ctc_pr_info("%s: connected with remote side\n", | 2052 | ctc_pr_info("%s: connected with remote side\n", |
| 2061 | dev->name); | 2053 | dev->name); |
| 2062 | if (privptr->protocol == CTC_PROTO_LINUX_TTY) | ||
| 2063 | ctc_tty_setcarrier(dev, 1); | ||
| 2064 | ctc_clear_busy(dev); | 2054 | ctc_clear_busy(dev); |
| 2065 | } | 2055 | } |
| 2066 | break; | 2056 | break; |
| @@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int event, void *arg) | |||
| 2086 | static void | 2076 | static void |
| 2087 | dev_action_chdown(fsm_instance * fi, int event, void *arg) | 2077 | dev_action_chdown(fsm_instance * fi, int event, void *arg) |
| 2088 | { | 2078 | { |
| 2089 | struct net_device *dev = (struct net_device *) arg; | ||
| 2090 | struct ctc_priv *privptr = dev->priv; | ||
| 2091 | 2079 | ||
| 2092 | DBF_TEXT(trace, 3, __FUNCTION__); | 2080 | DBF_TEXT(trace, 3, __FUNCTION__); |
| 2093 | switch (fsm_getstate(fi)) { | 2081 | switch (fsm_getstate(fi)) { |
| 2094 | case DEV_STATE_RUNNING: | 2082 | case DEV_STATE_RUNNING: |
| 2095 | if (privptr->protocol == CTC_PROTO_LINUX_TTY) | ||
| 2096 | ctc_tty_setcarrier(dev, 0); | ||
| 2097 | if (event == DEV_EVENT_TXDOWN) | 2083 | if (event == DEV_EVENT_TXDOWN) |
| 2098 | fsm_newstate(fi, DEV_STATE_STARTWAIT_TX); | 2084 | fsm_newstate(fi, DEV_STATE_STARTWAIT_TX); |
| 2099 | else | 2085 | else |
| @@ -2397,8 +2383,6 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev) | |||
| 2397 | */ | 2383 | */ |
| 2398 | if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { | 2384 | if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { |
| 2399 | fsm_event(privptr->fsm, DEV_EVENT_START, dev); | 2385 | fsm_event(privptr->fsm, DEV_EVENT_START, dev); |
| 2400 | if (privptr->protocol == CTC_PROTO_LINUX_TTY) | ||
| 2401 | return -EBUSY; | ||
| 2402 | dev_kfree_skb(skb); | 2386 | dev_kfree_skb(skb); |
| 2403 | privptr->stats.tx_dropped++; | 2387 | privptr->stats.tx_dropped++; |
| 2404 | privptr->stats.tx_errors++; | 2388 | privptr->stats.tx_errors++; |
| @@ -2608,20 +2592,13 @@ ctc_netdev_unregister(struct net_device * dev) | |||
| 2608 | if (!dev) | 2592 | if (!dev) |
| 2609 | return; | 2593 | return; |
| 2610 | privptr = (struct ctc_priv *) dev->priv; | 2594 | privptr = (struct ctc_priv *) dev->priv; |
| 2611 | if (privptr->protocol != CTC_PROTO_LINUX_TTY) | 2595 | unregister_netdev(dev); |
| 2612 | unregister_netdev(dev); | ||
| 2613 | else | ||
| 2614 | ctc_tty_unregister_netdev(dev); | ||
| 2615 | } | 2596 | } |
| 2616 | 2597 | ||
| 2617 | static int | 2598 | static int |
| 2618 | ctc_netdev_register(struct net_device * dev) | 2599 | ctc_netdev_register(struct net_device * dev) |
| 2619 | { | 2600 | { |
| 2620 | struct ctc_priv *privptr = (struct ctc_priv *) dev->priv; | 2601 | return register_netdev(dev); |
| 2621 | if (privptr->protocol != CTC_PROTO_LINUX_TTY) | ||
| 2622 | return register_netdev(dev); | ||
| 2623 | else | ||
| 2624 | return ctc_tty_register_netdev(dev); | ||
| 2625 | } | 2602 | } |
| 2626 | 2603 | ||
| 2627 | static void | 2604 | static void |
| @@ -2667,7 +2644,9 @@ ctc_proto_store(struct device *dev, struct device_attribute *attr, const char *b | |||
| 2667 | if (!priv) | 2644 | if (!priv) |
| 2668 | return -ENODEV; | 2645 | return -ENODEV; |
| 2669 | sscanf(buf, "%u", &value); | 2646 | sscanf(buf, "%u", &value); |
| 2670 | if ((value < 0) || (value > CTC_PROTO_MAX)) | 2647 | if (!((value == CTC_PROTO_S390) || |
| 2648 | (value == CTC_PROTO_LINUX) || | ||
| 2649 | (value == CTC_PROTO_OS390))) | ||
| 2671 | return -EINVAL; | 2650 | return -EINVAL; |
| 2672 | priv->protocol = value; | 2651 | priv->protocol = value; |
| 2673 | 2652 | ||
| @@ -2897,10 +2876,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) | |||
| 2897 | goto out; | 2876 | goto out; |
| 2898 | } | 2877 | } |
| 2899 | 2878 | ||
| 2900 | if (privptr->protocol == CTC_PROTO_LINUX_TTY) | 2879 | strlcpy(dev->name, "ctc%d", IFNAMSIZ); |
| 2901 | strlcpy(dev->name, "ctctty%d", IFNAMSIZ); | ||
| 2902 | else | ||
| 2903 | strlcpy(dev->name, "ctc%d", IFNAMSIZ); | ||
| 2904 | 2880 | ||
| 2905 | for (direction = READ; direction <= WRITE; direction++) { | 2881 | for (direction = READ; direction <= WRITE; direction++) { |
| 2906 | privptr->channel[direction] = | 2882 | privptr->channel[direction] = |
| @@ -3046,7 +3022,6 @@ ctc_exit(void) | |||
| 3046 | { | 3022 | { |
| 3047 | DBF_TEXT(setup, 3, __FUNCTION__); | 3023 | DBF_TEXT(setup, 3, __FUNCTION__); |
| 3048 | unregister_cu3088_discipline(&ctc_group_driver); | 3024 | unregister_cu3088_discipline(&ctc_group_driver); |
| 3049 | ctc_tty_cleanup(); | ||
| 3050 | ctc_unregister_dbf_views(); | 3025 | ctc_unregister_dbf_views(); |
| 3051 | ctc_pr_info("CTC driver unloaded\n"); | 3026 | ctc_pr_info("CTC driver unloaded\n"); |
| 3052 | } | 3027 | } |
| @@ -3073,10 +3048,8 @@ ctc_init(void) | |||
| 3073 | ctc_pr_crit("ctc_init failed with ctc_register_dbf_views rc = %d\n", ret); | 3048 | ctc_pr_crit("ctc_init failed with ctc_register_dbf_views rc = %d\n", ret); |
| 3074 | return ret; | 3049 | return ret; |
| 3075 | } | 3050 | } |
| 3076 | ctc_tty_init(); | ||
| 3077 | ret = register_cu3088_discipline(&ctc_group_driver); | 3051 | ret = register_cu3088_discipline(&ctc_group_driver); |
| 3078 | if (ret) { | 3052 | if (ret) { |
| 3079 | ctc_tty_cleanup(); | ||
| 3080 | ctc_unregister_dbf_views(); | 3053 | ctc_unregister_dbf_views(); |
| 3081 | } | 3054 | } |
| 3082 | return ret; | 3055 | return ret; |
