Commit 56347a2e authored by Frank Pavlic's avatar Frank Pavlic Committed by Jeff Garzik

[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: default avatarFrank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 9707b271
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# S/390 network devices # S/390 network devices
# #
ctc-objs := ctcmain.o ctctty.o ctcdbug.o ctc-objs := ctcmain.o ctcdbug.o
obj-$(CONFIG_IUCV) += iucv.o obj-$(CONFIG_IUCV) += iucv.o
obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o
...@@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o ...@@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o
obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o
obj-$(CONFIG_LCS) += lcs.o cu3088.o obj-$(CONFIG_LCS) += lcs.o cu3088.o
obj-$(CONFIG_CLAW) += claw.o cu3088.o obj-$(CONFIG_CLAW) += claw.o cu3088.o
obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o
qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o
qeth-$(CONFIG_PROC_FS) += qeth_proc.o qeth-$(CONFIG_PROC_FS) += qeth_proc.o
obj-$(CONFIG_QETH) += qeth.o obj-$(CONFIG_QETH) += qeth.o
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Fixes by : Jochen Rhrig (roehrig@de.ibm.com) * Fixes by : Jochen Rhrig (roehrig@de.ibm.com)
* Arnaldo Carvalho de Melo <acme@conectiva.com.br> * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Peter Tiedemann (ptiedem@de.ibm.com) Peter Tiedemann (ptiedem@de.ibm.com)
* Driver Model stuff by : Cornelia Huck <huckc@de.ibm.com> * Driver Model stuff by : Cornelia Huck <cornelia.huck@de.ibm.com>
* *
* Documentation used: * Documentation used:
* - Principles of Operation (IBM doc#: SA22-7201-06) * - Principles of Operation (IBM doc#: SA22-7201-06)
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
#include <asm/idals.h> #include <asm/idals.h>
#include "ctctty.h"
#include "fsm.h" #include "fsm.h"
#include "cu3088.h" #include "cu3088.h"
...@@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb) ...@@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
skb->dev = pskb->dev; skb->dev = pskb->dev;
skb->protocol = pskb->protocol; skb->protocol = pskb->protocol;
pskb->ip_summed = CHECKSUM_UNNECESSARY; pskb->ip_summed = CHECKSUM_UNNECESSARY;
if (ch->protocol == CTC_PROTO_LINUX_TTY) netif_rx_ni(skb);
ctc_tty_netif_rx(skb);
else
netif_rx_ni(skb);
/** /**
* Successful rx; reset logflags * Successful rx; reset logflags
*/ */
...@@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsigned char sense) ...@@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsigned char sense)
DBF_TEXT(trace, 5, __FUNCTION__); DBF_TEXT(trace, 5, __FUNCTION__);
if (sense & SNS0_INTERVENTION_REQ) { if (sense & SNS0_INTERVENTION_REQ) {
if (sense & 0x01) { if (sense & 0x01) {
if (ch->protocol != CTC_PROTO_LINUX_TTY) ctc_pr_debug("%s: Interface disc. or Sel. reset "
ctc_pr_debug("%s: Interface disc. or Sel. reset "
"(remote)\n", ch->id); "(remote)\n", ch->id);
fsm_event(ch->fsm, CH_EVENT_UC_RCRESET, ch); fsm_event(ch->fsm, CH_EVENT_UC_RCRESET, ch);
} else { } else {
...@@ -2034,7 +2029,6 @@ static void ...@@ -2034,7 +2029,6 @@ static void
dev_action_chup(fsm_instance * fi, int event, void *arg) dev_action_chup(fsm_instance * fi, int event, void *arg)
{ {
struct net_device *dev = (struct net_device *) arg; struct net_device *dev = (struct net_device *) arg;
struct ctc_priv *privptr = dev->priv;
DBF_TEXT(trace, 3, __FUNCTION__); DBF_TEXT(trace, 3, __FUNCTION__);
switch (fsm_getstate(fi)) { switch (fsm_getstate(fi)) {
...@@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int event, void *arg) ...@@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int event, void *arg)
fsm_newstate(fi, DEV_STATE_RUNNING); fsm_newstate(fi, DEV_STATE_RUNNING);
ctc_pr_info("%s: connected with remote side\n", ctc_pr_info("%s: connected with remote side\n",
dev->name); dev->name);
if (privptr->protocol == CTC_PROTO_LINUX_TTY)
ctc_tty_setcarrier(dev, 1);
ctc_clear_busy(dev); ctc_clear_busy(dev);
} }
break; break;
...@@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int event, void *arg) ...@@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int event, void *arg)
fsm_newstate(fi, DEV_STATE_RUNNING); fsm_newstate(fi, DEV_STATE_RUNNING);
ctc_pr_info("%s: connected with remote side\n", ctc_pr_info("%s: connected with remote side\n",
dev->name); dev->name);
if (privptr->protocol == CTC_PROTO_LINUX_TTY)
ctc_tty_setcarrier(dev, 1);
ctc_clear_busy(dev); ctc_clear_busy(dev);
} }
break; break;
...@@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int event, void *arg) ...@@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int event, void *arg)
static void static void
dev_action_chdown(fsm_instance * fi, int event, void *arg) dev_action_chdown(fsm_instance * fi, int event, void *arg)
{ {
struct net_device *dev = (struct net_device *) arg;
struct ctc_priv *privptr = dev->priv;
DBF_TEXT(trace, 3, __FUNCTION__); DBF_TEXT(trace, 3, __FUNCTION__);
switch (fsm_getstate(fi)) { switch (fsm_getstate(fi)) {
case DEV_STATE_RUNNING: case DEV_STATE_RUNNING:
if (privptr->protocol == CTC_PROTO_LINUX_TTY)
ctc_tty_setcarrier(dev, 0);
if (event == DEV_EVENT_TXDOWN) if (event == DEV_EVENT_TXDOWN)
fsm_newstate(fi, DEV_STATE_STARTWAIT_TX); fsm_newstate(fi, DEV_STATE_STARTWAIT_TX);
else else
...@@ -2397,8 +2383,6 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev) ...@@ -2397,8 +2383,6 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev)
*/ */
if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
fsm_event(privptr->fsm, DEV_EVENT_START, dev); fsm_event(privptr->fsm, DEV_EVENT_START, dev);
if (privptr->protocol == CTC_PROTO_LINUX_TTY)
return -EBUSY;
dev_kfree_skb(skb); dev_kfree_skb(skb);
privptr->stats.tx_dropped++; privptr->stats.tx_dropped++;
privptr->stats.tx_errors++; privptr->stats.tx_errors++;
...@@ -2608,20 +2592,13 @@ ctc_netdev_unregister(struct net_device * dev) ...@@ -2608,20 +2592,13 @@ ctc_netdev_unregister(struct net_device * dev)
if (!dev) if (!dev)
return; return;
privptr = (struct ctc_priv *) dev->priv; privptr = (struct ctc_priv *) dev->priv;
if (privptr->protocol != CTC_PROTO_LINUX_TTY) unregister_netdev(dev);
unregister_netdev(dev);
else
ctc_tty_unregister_netdev(dev);
} }
static int static int
ctc_netdev_register(struct net_device * dev) ctc_netdev_register(struct net_device * dev)
{ {
struct ctc_priv *privptr = (struct ctc_priv *) dev->priv; return register_netdev(dev);
if (privptr->protocol != CTC_PROTO_LINUX_TTY)
return register_netdev(dev);
else
return ctc_tty_register_netdev(dev);
} }
static void static void
...@@ -2667,7 +2644,9 @@ ctc_proto_store(struct device *dev, struct device_attribute *attr, const char *b ...@@ -2667,7 +2644,9 @@ ctc_proto_store(struct device *dev, struct device_attribute *attr, const char *b
if (!priv) if (!priv)
return -ENODEV; return -ENODEV;
sscanf(buf, "%u", &value); sscanf(buf, "%u", &value);
if ((value < 0) || (value > CTC_PROTO_MAX)) if (!((value == CTC_PROTO_S390) ||
(value == CTC_PROTO_LINUX) ||
(value == CTC_PROTO_OS390)))
return -EINVAL; return -EINVAL;
priv->protocol = value; priv->protocol = value;
...@@ -2897,10 +2876,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) ...@@ -2897,10 +2876,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
goto out; goto out;
} }
if (privptr->protocol == CTC_PROTO_LINUX_TTY) strlcpy(dev->name, "ctc%d", IFNAMSIZ);
strlcpy(dev->name, "ctctty%d", IFNAMSIZ);
else
strlcpy(dev->name, "ctc%d", IFNAMSIZ);
for (direction = READ; direction <= WRITE; direction++) { for (direction = READ; direction <= WRITE; direction++) {
privptr->channel[direction] = privptr->channel[direction] =
...@@ -3046,7 +3022,6 @@ ctc_exit(void) ...@@ -3046,7 +3022,6 @@ ctc_exit(void)
{ {
DBF_TEXT(setup, 3, __FUNCTION__); DBF_TEXT(setup, 3, __FUNCTION__);
unregister_cu3088_discipline(&ctc_group_driver); unregister_cu3088_discipline(&ctc_group_driver);
ctc_tty_cleanup();
ctc_unregister_dbf_views(); ctc_unregister_dbf_views();
ctc_pr_info("CTC driver unloaded\n"); ctc_pr_info("CTC driver unloaded\n");
} }
...@@ -3073,10 +3048,8 @@ ctc_init(void) ...@@ -3073,10 +3048,8 @@ ctc_init(void)
ctc_pr_crit("ctc_init failed with ctc_register_dbf_views rc = %d\n", ret); ctc_pr_crit("ctc_init failed with ctc_register_dbf_views rc = %d\n", ret);
return ret; return ret;
} }
ctc_tty_init();
ret = register_cu3088_discipline(&ctc_group_driver); ret = register_cu3088_discipline(&ctc_group_driver);
if (ret) { if (ret) {
ctc_tty_cleanup();
ctc_unregister_dbf_views(); ctc_unregister_dbf_views();
} }
return ret; return ret;
......
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
#include <asm/ccwdev.h> #include <asm/ccwdev.h>
#include <asm/ccwgroup.h> #include <asm/ccwgroup.h>
#include "ctctty.h" #include <linux/skbuff.h>
#include <linux/netdevice.h>
#include "fsm.h" #include "fsm.h"
#include "cu3088.h" #include "cu3088.h"
...@@ -50,9 +52,7 @@ ...@@ -50,9 +52,7 @@
#define CTC_PROTO_S390 0 #define CTC_PROTO_S390 0
#define CTC_PROTO_LINUX 1 #define CTC_PROTO_LINUX 1
#define CTC_PROTO_LINUX_TTY 2
#define CTC_PROTO_OS390 3 #define CTC_PROTO_OS390 3
#define CTC_PROTO_MAX 3
#define CTC_BUFSIZE_LIMIT 65535 #define CTC_BUFSIZE_LIMIT 65535
#define CTC_BUFSIZE_DEFAULT 32768 #define CTC_BUFSIZE_DEFAULT 32768
...@@ -257,15 +257,13 @@ static __inline__ void ...@@ -257,15 +257,13 @@ static __inline__ void
ctc_clear_busy(struct net_device * dev) ctc_clear_busy(struct net_device * dev)
{ {
clear_bit(0, &(((struct ctc_priv *) dev->priv)->tbusy)); clear_bit(0, &(((struct ctc_priv *) dev->priv)->tbusy));
if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY) netif_wake_queue(dev);
netif_wake_queue(dev);
} }
static __inline__ int static __inline__ int
ctc_test_and_set_busy(struct net_device * dev) ctc_test_and_set_busy(struct net_device * dev)
{ {
if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY) netif_stop_queue(dev);
netif_stop_queue(dev);
return test_and_set_bit(0, &((struct ctc_priv *) dev->priv)->tbusy); return test_and_set_bit(0, &((struct ctc_priv *) dev->priv)->tbusy);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment