aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Pavlic <fpavlic@de.ibm.com>2006-04-13 14:19:12 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-20 17:27:54 -0400
commit56347a2e7287377c35c2bac2e8643bf88690425f (patch)
treee312b0378db979377c96f2395e617c03d1184f43
parent9707b27100a48950f1e15e08a7c5028786e47f55 (diff)
[PATCH] s390: remove tty support from ctc network device driver [1/2]
Hi jeff, after the first shot I sent to you did not apply I resend two new patches I've made today to remove tty from ctc network driver. Please apply .... Thank you ... Frank From: Peter Tiedemann <ptiedem@de.ibm.com> [1/2]: tty support code will be removed from the ctc network device driver. Today we have a couple of alternatives which are performing much better. The second thing is that ctc should be a network device driver only. We should not mix tty and networking here. This first patch will remove the tty code from ctcmain.c . It also removes the build entry from the Makefile as well as TTY definitions from ctcmain.h. The second patch will remove two files, ctctty.c and ctctty.h. Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/s390/net/Makefile3
-rw-r--r--drivers/s390/net/ctcmain.c45
-rw-r--r--drivers/s390/net/ctcmain.h12
3 files changed, 16 insertions, 44 deletions
diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile
index 90d4d0ef3dd4..6775a837d646 100644
--- a/drivers/s390/net/Makefile
+++ b/drivers/s390/net/Makefile
@@ -2,7 +2,7 @@
2# S/390 network devices 2# S/390 network devices
3# 3#
4 4
5ctc-objs := ctcmain.o ctctty.o ctcdbug.o 5ctc-objs := ctcmain.o ctcdbug.o
6 6
7obj-$(CONFIG_IUCV) += iucv.o 7obj-$(CONFIG_IUCV) += iucv.o
8obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o 8obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o
@@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o
10obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o 10obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o
11obj-$(CONFIG_LCS) += lcs.o cu3088.o 11obj-$(CONFIG_LCS) += lcs.o cu3088.o
12obj-$(CONFIG_CLAW) += claw.o cu3088.o 12obj-$(CONFIG_CLAW) += claw.o cu3088.o
13obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o
13qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o 14qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o
14qeth-$(CONFIG_PROC_FS) += qeth_proc.o 15qeth-$(CONFIG_PROC_FS) += qeth_proc.o
15obj-$(CONFIG_QETH) += qeth.o 16obj-$(CONFIG_QETH) += qeth.o
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index af9f212314b3..e2ccaf55961c 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
2034dev_action_chup(fsm_instance * fi, int event, void *arg) 2029dev_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)
2086static void 2076static void
2087dev_action_chdown(fsm_instance * fi, int event, void *arg) 2077dev_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
2617static int 2598static int
2618ctc_netdev_register(struct net_device * dev) 2599ctc_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
2627static void 2604static 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;
diff --git a/drivers/s390/net/ctcmain.h b/drivers/s390/net/ctcmain.h
index d2e835c0c134..7f305d119f3d 100644
--- a/drivers/s390/net/ctcmain.h
+++ b/drivers/s390/net/ctcmain.h
@@ -35,7 +35,9 @@
35#include <asm/ccwdev.h> 35#include <asm/ccwdev.h>
36#include <asm/ccwgroup.h> 36#include <asm/ccwgroup.h>
37 37
38#include "ctctty.h" 38#include <linux/skbuff.h>
39#include <linux/netdevice.h>
40
39#include "fsm.h" 41#include "fsm.h"
40#include "cu3088.h" 42#include "cu3088.h"
41 43
@@ -50,9 +52,7 @@
50 52
51#define CTC_PROTO_S390 0 53#define CTC_PROTO_S390 0
52#define CTC_PROTO_LINUX 1 54#define CTC_PROTO_LINUX 1
53#define CTC_PROTO_LINUX_TTY 2
54#define CTC_PROTO_OS390 3 55#define CTC_PROTO_OS390 3
55#define CTC_PROTO_MAX 3
56 56
57#define CTC_BUFSIZE_LIMIT 65535 57#define CTC_BUFSIZE_LIMIT 65535
58#define CTC_BUFSIZE_DEFAULT 32768 58#define CTC_BUFSIZE_DEFAULT 32768
@@ -257,15 +257,13 @@ static __inline__ void
257ctc_clear_busy(struct net_device * dev) 257ctc_clear_busy(struct net_device * dev)
258{ 258{
259 clear_bit(0, &(((struct ctc_priv *) dev->priv)->tbusy)); 259 clear_bit(0, &(((struct ctc_priv *) dev->priv)->tbusy));
260 if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY) 260 netif_wake_queue(dev);
261 netif_wake_queue(dev);
262} 261}
263 262
264static __inline__ int 263static __inline__ int
265ctc_test_and_set_busy(struct net_device * dev) 264ctc_test_and_set_busy(struct net_device * dev)
266{ 265{
267 if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY) 266 netif_stop_queue(dev);
268 netif_stop_queue(dev);
269 return test_and_set_bit(0, &((struct ctc_priv *) dev->priv)->tbusy); 267 return test_and_set_bit(0, &((struct ctc_priv *) dev->priv)->tbusy);
270} 268}
271 269