All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] staging: dgnc: removes Makefile.inc
@ 2013-08-13 19:49 Lidza Louina
  2013-08-13 19:49 ` [PATCH 2/8] staging: dgnc: removes proc code Lidza Louina
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

The Makefile contains the variables needed for the driver to build.
The Makefile.inc isn't needed.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/Makefile.inc | 133 --------------------------------------
 1 file changed, 133 deletions(-)
 delete mode 100644 drivers/staging/dgnc/Makefile.inc

diff --git a/drivers/staging/dgnc/Makefile.inc b/drivers/staging/dgnc/Makefile.inc
deleted file mode 100644
index 6ca38c7..0000000
--- a/drivers/staging/dgnc/Makefile.inc
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-# From Makefile.inc
-#
-
-#
-# Common definitions go here.
-#
-
-#
-# TRUE_VERSION is the version string used in the driver build,
-# it is intended to be in the form:
-#
-#   2.0-0
-#
-# A string noting a particular special modification could be
-# used as well.  This string will be reported when the driver
-# is loaded, and will be exposed by its /proc/dgnc/info
-# interface.
-#
-TRUE_VERSION="1.3-16"
-
-#
-# DGNC_PART_NUM is the part number string for the driver package.
-# It should be in the form:
-#
-#   40002369_A
-#
-DGNC_PART_NUM=40002369_F
-
-#
-# DGNC_REL_NOTE is the part number string for the driver release
-# notes.  It should be in the form:
-#
-#   93000517_A
-#
-DGNC_REL_NOTE=93000517_F
-
-#
-# DGNC_PKG_VER is the "version" number string included in the
-# various documentation and packaging files.  It should be
-# in the form:
-#
-#   1.0
-#
-DGNC_PKG_VER=1.3
-
-#
-# DGNC_PKG_REV is the "revision" of this version.  Together,
-# a linux module revision is built with:
-#
-#   ${DGNC_PKG_VER}-${DGNC_PKG_REV}
-#
-DGNC_PKG_REV=16
-
-#
-# DRP_PKG_DATE is the "date" string included in (for now) the
-# release notes.  It should be in the form:
-#
-#   11/04/2003
-#
-DGNC_PKG_DATE=10/17/2008
-
-INIT_DIR= $(shell \
-	if [ -d /etc/rc.d/init.d ]; \
-	then echo "$(RPM_BUILD_ROOT)/etc/rc.d/init.d"; \
-	else echo "$(RPM_BUILD_ROOT)/etc/init.d"; fi)
-
-#
-#	Miscelaneous path macro's
-#
-
-PACKAGE=	dgnc
-DEVDIR=		/dev/dg/$(PACKAGE)
-SRCDIR=		/usr/src/dg/$(PACKAGE)
-BINDIR=		/usr/bin
-DRVLIBDIR=	/etc/$(PACKAGE)
-MANDIR=		/usr/man
-USRLIBDIR=	/usr/lib
-DGNCDIR=	/etc/dgnc
-
-
-INIT_DIR= $(shell \
-	if [ -d /etc/rc.d/init.d ]; \
-	then echo "/etc/rc.d/init.d"; \
-	else echo "/etc/init.d"; fi)
-
-
-#
-# From Makefile
-#
-ifndef MYPWD
-MYPWD = $(shell pwd)
-endif
-
-ifeq ($(KERNDIR),)
-  KERNVERS       := $(shell uname -r)
-  KERNDIR         :=/lib/modules/${KERNVERS}/
-endif
-
-# Grab version and other important stuff
-
-RPMNAME := $(PACKAGE)-$(TRUE_VERSION)
-
-PARTNUM := $(DGNC_PART_NUM)
-
-RELNOTES := $(DGNC_REL_NOTE)
-
-MODDIR = $(shell echo $(BUILDROOT)/lib/modules/3.4.36-lcrs/misc)
-LSMOD = /sbin/lsmod
-RMMOD = /sbin/rmmod
-INSMOD = /sbin/insmod
-NEW_TTY_LOCKING = No
-NEW_TTY_BUFFERING = No
-REGISTER_TTYS_WITH_SYSFS = No
-
-# Send in some extra things...
-EXTRA_CFLAGS += -I${MYPWD} -I${MYPWD}/include -I${MYPWD}/../../commoninc\
-	-I${MYPWD}/../../dpa -DLINUX -DDG_NAME=\"$(RPMNAME)\"\
-	-DDG_PART=\"$(PARTNUM)\" -DDGNC_TRACER
-
-ifeq ($(NEW_TTY_LOCKING),Yes)
-	EXTRA_CFLAGS += -DNEW_TTY_LOCKING
-endif
-
-ifeq ($(NEW_TTY_BUFFERING),Yes)
-	EXTRA_CFLAGS += -DNEW_TTY_BUFFERING
-endif
-
-ifeq ($(REGISTER_TTYS_WITH_SYSFS),Yes)
-	EXTRA_CFLAGS += -DREGISTER_TTYS_WITH_SYSFS
-endif
-
-# Conform to correct kbuild conventions...
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/8] staging: dgnc: removes proc code
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 23:20   ` Dan Carpenter
  2013-08-14 21:04   ` Greg KH
  2013-08-13 19:49 ` [PATCH 3/8] staging: dgnc: fixes termios error Lidza Louina
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

This patch removes the dgnc_proc.c file, all references to proc functions in dgnc_driver.c and from the Makefile's build.

There were a lot of issues with the proc code so I removed it to make sure it builds. I'll work on the proc code and add it to the build once it fits the new proc API.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/Makefile      |    2 +-
 drivers/staging/dgnc/dgnc_driver.c |    6 +-
 drivers/staging/dgnc/dgnc_proc.c   | 1551 ------------------------------------
 3 files changed, 4 insertions(+), 1555 deletions(-)
 delete mode 100644 drivers/staging/dgnc/dgnc_proc.c

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index c4c96dc..888c433 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -4,4 +4,4 @@ obj-$(CONFIG_DGNC) += dgnc.o
 
 dgnc-objs :=   dgnc_cls.o dgnc_driver.o\
                dgnc_mgmt.o dgnc_neo.o\
-               dgnc_proc.o dgnc_trace.o dgnc_tty.o dgnc_sysfs.o
+               dgnc_trace.o dgnc_tty.o dgnc_sysfs.o
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 7c88de7..b09c20c 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -315,7 +315,7 @@ static int dgnc_start(void)
 		/*
 		 * Register our basic stuff in /proc/dgnc
 		 */
-		dgnc_proc_register_basic_prescan();
+		/*dgnc_proc_register_basic_prescan();*/
 
 		/*
 		 * Init any global tty stuff.
@@ -401,7 +401,7 @@ void dgnc_cleanup_module(void)
 	/* Turn off poller right away. */
 	del_timer_sync(&dgnc_poll_timer);
 
-	dgnc_proc_unregister_all();
+	/*dgnc_proc_unregister_all();*/
 
 	dgnc_remove_driver_sysfiles(&dgnc_driver);
 
@@ -742,7 +742,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	 */
 	brd->flipbuf = dgnc_driver_kzmalloc(MYFLIPLEN, GFP_KERNEL);
 
-	dgnc_proc_register_basic_postscan(dgnc_NumBoards);
+	/*dgnc_proc_register_basic_postscan(dgnc_NumBoards);*/
 
 	wake_up_interruptible(&brd->state_wait);
 
diff --git a/drivers/staging/dgnc/dgnc_proc.c b/drivers/staging/dgnc/dgnc_proc.c
deleted file mode 100644
index 8fbaf3b..0000000
--- a/drivers/staging/dgnc/dgnc_proc.c
+++ /dev/null
@@ -1,1551 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- *	Scott H Kilau <Scott_Kilau at digi dot com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the 
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *	NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *	This is shared code between Digi's CVS archive and the
- *	Linux Kernel sources.
- *	Changing the source just for reformatting needlessly breaks
- *	our CVS diff history.
- *
- *	Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *	Thank you.
- *
- *
- * $Id: dgnc_proc.c,v 1.3 2011/06/22 12:16:35 markh Exp $
- */
-
-#include <linux/kernel.h>
-#include <linux/version.h>
-#include <linux/sched.h>	/* For jiffies, task states */
-#include <linux/interrupt.h>	/* For tasklet and interrupt structs/defines */
-#include <linux/module.h>
-#include <linux/ctype.h>
-#include <linux/proc_fs.h>
-#include <linux/serial_reg.h>
-#include <linux/sched.h>		/* For in_egroup_p() */
-#include <linux/string.h>
-#include <asm/uaccess.h>		/* For copy_from_user/copy_to_user */
-
-#include "dgnc_driver.h"
-#include "dgnc_proc.h"
-#include "dgnc_mgmt.h"
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
-#define init_MUTEX(sem)         sema_init(sem, 1)
-#define DECLARE_MUTEX(name)     \
-        struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
-#endif
-
-
-/* The /proc/dgnc directory */
-static struct proc_dir_entry *ProcDGNC;
-
-
-/* File operation declarations */
-static int	dgnc_gen_proc_open(struct inode *, struct file *);
-static int	dgnc_gen_proc_close(struct inode *, struct file *);
-static ssize_t	dgnc_gen_proc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos);
-static ssize_t	dgnc_gen_proc_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos);
-
-static int dgnc_proc_chk_perm(struct inode *, int);
-
-static const struct file_operations dgnc_proc_file_ops =
-{
-	.owner =	THIS_MODULE,
-	.read =		dgnc_gen_proc_read,	/* read		*/
-	.write =	dgnc_gen_proc_write,	/* write	*/
-	.open =		dgnc_gen_proc_open,	/* open		*/
-	.release =	dgnc_gen_proc_close,	/* release	*/
-};
-
-
-static struct inode_operations dgnc_proc_inode_ops =
-{
-	.permission =	dgnc_proc_chk_perm
-};
-
-
-static void dgnc_register_proc_table(struct dgnc_proc_entry *, struct proc_dir_entry *);
-static void dgnc_unregister_proc_table(struct dgnc_proc_entry *, struct proc_dir_entry *);
-static void dgnc_remove_proc_entry(struct proc_dir_entry *pde);
-
-
-/* Stuff in /proc/ */
-static int dgnc_read_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_write_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				const char __user *buffer, ssize_t *lenp, loff_t *ppos);
-
-static int dgnc_read_mknod(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-
-static struct dgnc_proc_entry dgnc_table[] = {
-	{DGNC_INFO,	"info", 0600, NULL, NULL, NULL, &dgnc_read_info, &dgnc_write_info,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_table[0].excl_sem, 1), 0, NULL },
-	{DGNC_MKNOD, "mknod", 0600, NULL, NULL, NULL, &dgnc_read_mknod, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_table[1].excl_sem, 1), 0, NULL },
-	{0}
-};
-
-
-/* Stuff in /proc/<board>/ */
-static int dgnc_read_board_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_board_vpd(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_board_mknod(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_board_ttystats(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_board_ttyintr(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_board_ttyflags(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-
-static struct dgnc_proc_entry dgnc_board_table[] = {
-	{DGNC_BOARD_INFO, "info", 0600, NULL, NULL, NULL, &dgnc_read_board_info, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_board_table[0].excl_sem, 1), 0, NULL },
-	{DGNC_BOARD_VPD, "vpd", 0600, NULL, NULL, NULL, &dgnc_read_board_vpd, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_board_table[1].excl_sem, 1), 0, NULL },
-	{DGNC_BOARD_TTYSTATS, "stats", 0600, NULL, NULL, NULL, &dgnc_read_board_ttystats, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_board_table[2].excl_sem, 1), 0, NULL },
-	{DGNC_BOARD_TTYINTR, "intr", 0600, NULL, NULL, NULL, &dgnc_read_board_ttyintr, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_board_table[3].excl_sem, 1), 0, NULL },
-	{DGNC_BOARD_TTYFLAGS, "flags", 0600, NULL, NULL, NULL, &dgnc_read_board_ttyflags, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_board_table[4].excl_sem, 1), 0, NULL },
-	{DGNC_BOARD_MKNOD, "mknod", 0600, NULL, NULL, NULL, &dgnc_read_board_mknod, NULL,
-			NULL, __SEMAPHORE_INITIALIZER(dgnc_board_table[5].excl_sem, 1), 0, NULL },
-	{0}
-};
-
-
-/* Stuff in /proc/<board>/<channel> */
-static int dgnc_read_channel_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_open_channel_sniff(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				void *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_close_channel_sniff(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				void *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_channel_sniff(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user  *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_channel_custom_ttyname(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-static int dgnc_read_channel_custom_prname(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos);
-
-static struct dgnc_proc_entry dgnc_channel_table[] = {
-	{DGNC_PORT_INFO, "info", 0600, NULL, NULL, NULL, &dgnc_read_channel_info, NULL,
-		NULL, __SEMAPHORE_INITIALIZER(dgnc_channel_table[0].excl_sem, 1), 0, NULL },
-	{DGNC_PORT_SNIFF, "sniff", 0600, NULL, &dgnc_open_channel_sniff, &dgnc_close_channel_sniff, &dgnc_read_channel_sniff, NULL,
-		NULL, __SEMAPHORE_INITIALIZER(dgnc_channel_table[1].excl_sem, 1), 0, NULL},
-        {DGNC_PORT_CUSTOM_TTYNAME, "ttyname", 0600, NULL, NULL, NULL, &dgnc_read_channel_custom_ttyname, NULL,
-		NULL, __SEMAPHORE_INITIALIZER(dgnc_channel_table[2].excl_sem, 1), 0, NULL },
-        {DGNC_PORT_CUSTOM_PRNAME, "prname", 0600, NULL, NULL, NULL, &dgnc_read_channel_custom_prname, NULL,
-		NULL, __SEMAPHORE_INITIALIZER(dgnc_channel_table[3].excl_sem, 1), 0, NULL },
-	{0}
-};
-
-
-/*
- * dgnc_test_perm does NOT grant the superuser all rights automatically, because
- * some entries are readonly even to root.
- */
-static inline int dgnc_test_perm(int mode, int op)
-{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-	if (!current->euid)
-#else
-	if (!current_euid())
-#endif
-		mode >>= 6;
-	else if (in_egroup_p(0))
-		mode >>= 3;
-	if ((mode & op & 0007) == op)
-		return 0;
-	if (capable(CAP_SYS_ADMIN))
-		return 0;
-	return -EACCES;
-}
-
-
-/*
- * /proc/sys support
- */
-static inline int dgnc_proc_match(int len, const char *name, struct proc_dir_entry *de)
-{
-	if (!de || !de->low_ino)
-		return 0;
-	if (de->namelen != len)  
-		return 0;
-	return !memcmp(name, de->name, len);
-}
-
-
-/*
- *  Scan the entries in table and add them all to /proc at the position
- *  referred to by "root"
- */
-static void dgnc_register_proc_table(struct dgnc_proc_entry *table, struct proc_dir_entry *root)
-{
-	struct proc_dir_entry *de;
-	int len;
-	mode_t mode;
-
-	for (; table->magic; table++) {
-		/* Can't do anything without a proc name. */
-		if (!table->name) {
-			DPR_PROC(("dgnc_register_proc_table, no name...\n"));
-			continue;
-		}
-
-		/* Maybe we can't do anything with it... */
-		if (!table->read_handler && !table->write_handler && !table->child) {
-			DPR_PROC((KERN_WARNING "DGNC PROC: Can't register %s\n", table->name));
-			continue;
-		}
-
-		len = strlen(table->name);
-		mode = table->mode;
-		de = NULL;
-
-		if (!table->child) {
-			mode |= S_IFREG;
-		} else {
-			mode |= S_IFDIR;
-			for (de = root->subdir; de; de = de->next) {
-				if (dgnc_proc_match(len, table->name, de))
-					break;
-			}
-
-			/* If the subdir exists already, de is non-NULL */
-		}
-
-		if (!de) {
-			de = create_proc_entry(table->name, mode, root);
-			if (!de)
-				continue;
-			de->data = (void *) table;
-			if (!table->child) {
-				de->proc_iops = &dgnc_proc_inode_ops;
-				de->proc_fops = &dgnc_proc_file_ops;		
-			}
-		}
-
-		table->de = de;
-
-		if (de->mode & S_IFDIR)
-			dgnc_register_proc_table(table->child, de);
-
-	}
-}
-
-
-
-/*
- * Unregister a /proc sysctl table and any subdirectories.
- */
-static void dgnc_unregister_proc_table(struct dgnc_proc_entry *table, struct proc_dir_entry *root)
-{
-	struct proc_dir_entry *de;
-
-	for (; table->magic; table++) {
-		if (!(de = table->de))
-			continue;
-
-		if (de->mode & S_IFDIR) {
-			if (!table->child) {
-				DPR_PROC((KERN_ALERT "Help - malformed sysctl tree on free\n"));
-				continue;
-			}
-
-			/* recurse down into subdirectory... */
-			DPR_PROC(("Recursing down a directory...\n"));
-			dgnc_unregister_proc_table(table->child, de);
-
-			/* Don't unregister directories which still have entries.. */
-			if (de->subdir)
-				continue;
-		}   
-
-		/* Don't unregister proc entries that are still being used.. */
-		if ((atomic_read(&de->count)) != 1) {
-			DPR_PROC(("proc entry in use... Not removing...\n"));
-			continue;
-		}
-
-		dgnc_remove_proc_entry(de);
-		table->de = NULL;
-	}
-}
-
-
-
-static int dgnc_gen_proc_open(struct inode *inode, struct file *file)
-{
-	struct proc_dir_entry *de;
-	struct dgnc_proc_entry *entry;
-	int (*handler) (struct dgnc_proc_entry *table, int dir, struct file *filp,
-		void *buffer, ssize_t *lenp, loff_t *ppos);
-	int ret = 0, error = 0;
-
-	de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode);
-	if (!de || !de->data) {
-		ret = -ENXIO;
-		goto done;
-	}
-
-	entry = (struct dgnc_proc_entry *) de->data;
-	if (!entry) {
-		ret = -ENXIO;
-		goto done;
-	}
-
-	down(&entry->excl_sem);
-
-	if (entry->excl_cnt) {
-		ret = -EBUSY;
-	} else {
-		entry->excl_cnt++;
-
-		handler = entry->open_handler;
-		if (handler) {
-			error = (*handler) (entry, OUTBOUND, file, NULL, NULL, NULL);
-			if (error) {
-				entry->excl_cnt--;
-				ret = error;
-			}
-		}
-	}
-
-	up(&entry->excl_sem);
-
-done:
-
-	return ret;
-}
-
-
-static int dgnc_gen_proc_close(struct inode *inode, struct file *file)
-{
-	struct proc_dir_entry *de;
-	int (*handler) (struct dgnc_proc_entry *table, int dir, struct file *filp,
-		void *buffer, ssize_t *lenp, loff_t *ppos);
-	struct dgnc_proc_entry *entry;
-	int error = 0;
-
-	de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode);
-	if (!de || !de->data)
-		goto done;
-
-	entry = (struct dgnc_proc_entry *) de->data;
-	if (!entry)
-		goto done;
-
-	down(&entry->excl_sem);
-
-	if (entry->excl_cnt)
-		entry->excl_cnt = 0;
-
-
-	handler = entry->close_handler;
-	if (handler) {
-		error = (*handler) (entry, OUTBOUND, file, NULL, NULL, NULL);
-	}
-
-	up(&entry->excl_sem);
-
-done:
-	return 0;
-}
-
-
-static ssize_t dgnc_gen_proc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
-{
-	struct proc_dir_entry *de;
-	struct dgnc_proc_entry *entry;
-	int (*handler) (struct dgnc_proc_entry *table, int dir, struct file *filp,
-		char __user *buffer, ssize_t *lenp, loff_t *ppos2);
-	ssize_t res;
-	ssize_t error;
-
-	de = (struct proc_dir_entry*) PDE(file->f_dentry->d_inode);
-	if (!de || !de->data)
-		return -ENXIO; 
-
-	entry = (struct dgnc_proc_entry *) de->data;
-	if (!entry)
-		return -ENXIO;
-
-	/* Test for read permission */
-	if (dgnc_test_perm(entry->mode, 4))
-		return -EPERM;
-
-	res = count;
-
-	handler = entry->read_handler;
-	if (!handler)
-		return -ENXIO;
-
-	error = (*handler) (entry, OUTBOUND, file, buf, &res, ppos);
-	if (error)
-		return error;
-
-	return res;
-}
-
-
-static ssize_t	dgnc_gen_proc_write(struct file *file, const char __user *buf,
-				    size_t count, loff_t *ppos)
-{
-	struct proc_dir_entry *de;
-	struct dgnc_proc_entry *entry;
-	int (*handler) (struct dgnc_proc_entry *table, int dir, struct file *filp,
-		const char __user *buffer, ssize_t *lenp, loff_t *ppos2);
-	ssize_t res;   
-	ssize_t error;
-
-	de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode);
-	if (!de || !de->data)
-		return -ENXIO;
-
-	entry = (struct dgnc_proc_entry *) de->data;
-	if (!entry)
-		return -ENXIO;
-
-	/* Test for write permission */
-	if (dgnc_test_perm(entry->mode, 2))
-		return -EPERM;
-
-	res = count;
-
-	handler = entry->write_handler;
-	if (!handler)
-		return -ENXIO;
-
-	error = (*handler) (entry, INBOUND, file, buf, &res, ppos);
-	if (error)
-		return error; 
-
-	return res;
-}
-
-
-static int dgnc_proc_chk_perm(struct inode *inode, int op)
-{               
-	return dgnc_test_perm(inode->i_mode, op);
-}
-
-
-/*               
- *  Return what is (hopefully) useful information about the
- *  driver. 
- */
-static int dgnc_read_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-
-	DPR_PROC(("dgnc_proc_info\n"));
-
-	if (done) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	p += sprintf(p, "Driver:\t\t%s\n", DG_NAME);
-	p += sprintf(p, "\n");
-	p += sprintf(p, "Debug:\t\t0x%x\n", dgnc_debug);
-	p += sprintf(p, "Sysfs Support:\t0x1\n");
-	p += sprintf(p, "Rawreadok:\t0x%x\n", dgnc_rawreadok);
-	p += sprintf(p, "Max Boards:\t%d\n", MAXBOARDS);
-	p += sprintf(p, "Total Boards:\t%d\n", dgnc_NumBoards);
-	p += sprintf(p, "Poll rate:\t%dms\n", dgnc_poll_tick);
-	p += sprintf(p, "Poll counter:\t%ld\n", dgnc_poll_counter);
-	p += sprintf(p, "State:\t\t%s\n", dgnc_driver_state_text[dgnc_driver_state]);
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  When writing to the "info" entry point, I actually allow one
- *  to modify certain variables.  This may be a sleazy overload
- *  of this /proc entry, but I don't want:
- *
- *     a. to clutter /proc more than I have to
- *     b. to overload the "config" entry, which would be somewhat
- *        more natural
- *     c. necessarily advertise the fact this ability exists
- *
- *  The continued support of this feature has not yet been
- *  guaranteed.
- *
- *  Writing operates on a "state machine" principle.
- *
- *  State 0: waiting for a symbol to start.  Waiting for anything
- *           which isn't " ' = or whitespace.
- *  State 1: reading a symbol.  If the character is a space, move
- *           to state 2.  If =, move to state 3.  If " or ', move
- *           to state 0.
- *  State 2: Waiting for =... suck whitespace.  If anything other
- *           than whitespace, drop to state 0.
- *  State 3: Got =.  Suck whitespace waiting for value to start.
- *           If " or ', go to state 4 (and remember which quote it
- *           was).  Otherwise, go to state 5.
- *  State 4: Reading value, within quotes.  Everything is added to
- *           value up until the matching quote.  When you hit the
- *           matching quote, try to set the variable, then state 0.
- *  State 5: Reading value, outside quotes.  Everything not " ' =
- *           or whitespace goes in value.  Hitting one of the
- *           terminators tosses us back to state 0 after trying to
- *           set the variable.
- */
-typedef enum {
-	INFO_NONE, INFO_INT, INFO_CHAR, INFO_SHORT,
-	INFO_LONG, INFO_PTR, INFO_STRING, INFO_END
-} info_proc_var_val;
-
-static struct {
-	char              *name;
-	info_proc_var_val  type;
-	int                rw;       /* 0=readonly */
-	void              *val_ptr;
-} dgnc_info_vars[] = {
-	{ "rawreadok",   INFO_INT,    1, (void *) &dgnc_rawreadok },
-        { "pollrate",    INFO_INT,    1, (void *) &dgnc_poll_tick },
-	{ NULL, INFO_NONE, 0, NULL },
-	{ "debug",   INFO_LONG,   1, (void *) &dgnc_debug },
-	{ NULL, INFO_END, 0, NULL }
-};
-
-static void dgnc_set_info_var(char *name, char *val)
-{
-	int i;
-	unsigned long newval;
-	unsigned char charval;
-	unsigned short shortval;
-	unsigned int intval;
-
-	for (i = 0; dgnc_info_vars[i].type != INFO_END; i++) {
-		if (dgnc_info_vars[i].name)
-			if (!strcmp(name, dgnc_info_vars[i].name))
-				break;
-	}
-
-	if (dgnc_info_vars[i].type == INFO_END)
-		return;
-	if (dgnc_info_vars[i].rw == 0)
-		return;
-	if (dgnc_info_vars[i].val_ptr == NULL)
-		return;
-
-	newval = simple_strtoul(val, NULL, 0 ); 
-
-	switch (dgnc_info_vars[i].type) {
-	case INFO_CHAR:
-		charval = newval & 0xff;
-		APR(("Modifying %s (%lx) <= 0x%02x  (%d)\n",
-		           name, (long)(dgnc_info_vars[i].val_ptr ),
-		           charval, charval));
-		*(uchar *)(dgnc_info_vars[i].val_ptr) = charval;
-		break;
-	case INFO_SHORT:
-		shortval = newval & 0xffff;
-		APR(("Modifying %s (%lx) <= 0x%04x  (%d)\n",
-		           name, (long)(dgnc_info_vars[i].val_ptr),
-		           shortval, shortval));
-		*(ushort *)(dgnc_info_vars[i].val_ptr) = shortval;
-		break;
-	case INFO_INT:
-		intval = newval & 0xffffffff;
-		APR(("Modifying %s (%lx) <= 0x%08x  (%d)\n",
-		           name, (long)(dgnc_info_vars[i].val_ptr),
-		           intval, intval));
-		*(uint *)(dgnc_info_vars[i].val_ptr) = intval;
-		break;
-	case INFO_LONG:
-		APR(("Modifying %s (%lx) <= 0x%lx  (%ld)\n",
-		           name, (long)(dgnc_info_vars[i].val_ptr),
-		           newval, newval));
-		*(ulong *)(dgnc_info_vars[i].val_ptr) = newval;
-		break;
-	case INFO_PTR:
-	case INFO_STRING:
-	case INFO_END:
-	case INFO_NONE:
-	default:
-		break;
-	}
-}
-
-static int dgnc_write_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				const char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	static int state = 0;
-	#define MAXSYM 255
-	static int sympos, valpos;
-	static char sym[MAXSYM + 1];
-	static char val[MAXSYM + 1];
-	static int quotchar = 0;
-
-	int i;
-
-	long len;
-	#define INBUFLEN 256
-	char inbuf[INBUFLEN];
-
-	if (*ppos == 0) {
-		state = 0;
-		sympos = 0; sym[0] = 0;
-		valpos = 0; val[0] = 0;
-		quotchar = 0;
-	}
-
-	if ((!*lenp) || (dir != INBOUND)) {
-		*lenp = 0;
-		return 0;
-	}
-
-	len = *lenp;
-
-	if (len > INBUFLEN - 1)
-		len = INBUFLEN - 1;
-
-	if (copy_from_user(inbuf, buffer, len))
-		return -EFAULT;
-
-	inbuf[len] = 0;
-
-	for (i = 0; i < len; i++) {
-		unsigned char c = inbuf[i];
-
-		switch (state) {
-		case 0:
-			quotchar = sympos = valpos = sym[0] = val[0] = 0;
-			if (!isspace(c) && (c != '\"') &&
-			    (c != '\'') && (c != '=')) {
-				sym[sympos++] = c;
-				state = 1;
-				break;
-			}
-			break;
-		case 1:
-			if (isspace(c)) {
-				sym[sympos] = 0;
-				state = 2;
-				break;
-			}
-			if (c == '=') {
-				sym[sympos] = 0;
-				state = 3;
-				break;
-			}
-			if ((c == '\"' ) || ( c == '\'' )) {
-				state = 0;
-				break;
-			}
-			if (sympos < MAXSYM) sym[sympos++] = c;
-			break;
-		case 2:
-			if (isspace(c)) break;
-			if (c == '=') {
-				state = 3;
-				break;
-			}
-			if ((c != '\"') && (c != '\'')) {
-				quotchar = sympos = valpos = sym[0] = val[0] = 0;
-				sym[sympos++] = c;
-				state = 1;
-				break;
-			}
-			state = 0;
-			break;
-		case 3:
-			if (isspace(c)) break;
-			if (c == '=') {
-				state = 0;
-				break;
-			}
-			if ((c == '\"') || (c == '\'')) {
-				state = 4;
-				quotchar = c;
-				break;
-			}
-			val[valpos++] = c;
-			state = 5;
-			break;
-		case 4:
-			if (c == quotchar) {
-				val[valpos] = 0;
-				dgnc_set_info_var(sym, val);
-				state = 0;
-				break;
-			}
-			if (valpos < MAXSYM) val[valpos++] = c;
-			break;
-		case 5:
-			if (isspace(c) || (c == '\"') ||
-			    (c == '\'') || (c == '=')) {
-				val[valpos] = 0;
-				dgnc_set_info_var(sym, val);
-				state = 0;
-				break;
-			}
-			if (valpos < MAXSYM) val[valpos++] = c;
-			break;
-		default:
-			break;
-		}
-	}
-
-	*lenp = len;
-	*ppos += len;
-		
-	return len;
-}
-
-
-/*
- *  Return mknod information for the driver's devices.
- */                                             
-static int dgnc_read_mknod(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	int i = 0;
-
-	DPR_PROC(("dgnc_proc_info\n"));
-
-	if (done) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	DPR_PROC(("dgnc_proc_mknod\n"));
-
-	p += sprintf(p, "#\tCreate the management devices.\n");
-
-	for (i = 0; i < MAXMGMTDEVICES; i++) {
-		char tmp[100];
-		sprintf(tmp, "/dev/dg/dgnc/mgmt%d", i);
-		p += sprintf(p, "%s\t%d\t%d\t%d\n",
-			tmp, dgnc_Major, i, 1);
-	}
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*               
- *  Return what is (hopefully) useful information about the specific board.
- */
-static int dgnc_read_board_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct board_t	*brd;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	char *name;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	brd = (struct board_t *) table->data;
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	name = brd->name;
-
-	p += sprintf(p, "Board Name = %s\n", name);
-	if (brd->serial_num[0] == '\0')
-		p += sprintf(p, "Serial number = <UNKNOWN>\n");
-	else
-		p += sprintf(p, "Serial number = %s\n", brd->serial_num);
-
-	p += sprintf(p, "Board Type = %d\n", brd->type);
-	p += sprintf(p, "Number of Ports = %d\n", brd->nasync);
-
-	/*
-	 * report some things about the PCI bus that are important
-	 * to some applications
-	 */
-        p += sprintf(p, "Vendor ID = 0x%x\n", brd->vendor);
-        p += sprintf(p, "Device ID = 0x%x\n", brd->device);
-        p += sprintf(p, "Subvendor ID = 0x%x\n", brd->subvendor);
-        p += sprintf(p, "Subdevice ID = 0x%x\n", brd->subdevice);
-        p += sprintf(p, "Bus = %d\n", brd->pci_bus);
-        p += sprintf(p, "Slot = %d\n", brd->pci_slot);
-
-	/*
-	 * report the physical addresses assigned to us when we got
-	 * registered
-	 */	
-        p += sprintf(p, "Memory Base Address = 0x%lx\n", brd->membase);
-        p += sprintf(p, "Remapped Memory Base Address = 0x%p\n", brd->re_map_membase);
-
-        p += sprintf(p, "Current state of board = %s\n", dgnc_state_text[brd->state]);
-        p += sprintf(p, "Interrupt #: %d. Times interrupted: %ld\n",
-		brd->irq, brd->intr_count);
-
-        p += sprintf(p, "TX interrupts: %ld  RX interrupts: %ld\n",
-		brd->intr_tx, brd->intr_rx);
-        p += sprintf(p, "Modem interrupts: %ld\n", brd->intr_modem);
-
-        p += sprintf(p, "Majors allocated to board = TTY: %d PR: %d\n",
-		brd->SerialDriver.major, brd->PrintDriver.major);
-
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-
-static int dgnc_read_board_vpd(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct board_t	*brd;
-	static int done = 0;
-	static char buf[4096];
-	int i = 0, j = 0;
-	char *p = buf;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	brd = (struct board_t *) table->data;
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	p += sprintf(p, "\n      0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F          ASCII\n");
-
-	for (i = 0; i < 0x40 * 2; i++) {
-		j = i;
-		if (!(i % 16)) {
-			if (j > 0) {
-				p += sprintf(p, "    ");
-				for (j = i - 16; j < i; j++) {
-					if (0x20 <= brd->vpd[j] && brd->vpd[j] <= 0x7e)
-						p += sprintf(p, "%c", brd->vpd[j]);
-					else
-						p += sprintf(p, ".");
-				}
-				p += sprintf(p, "\n");
-			}
-			p += sprintf(p, "%04X ", i);
-		}
-		p += sprintf(p, "%02X ", brd->vpd[i]);
-	}
-	if (!(i % 16)) {
-		p += sprintf(p, "    ");
-		for (j = i - 16; j < i; j++) {
-			if (0x20 <= brd->vpd[j] && brd->vpd[j] <= 0x7e)
-				p += sprintf(p, "%c", brd->vpd[j]);
-			else
-				p += sprintf(p, ".");
-		}
-		p += sprintf(p, "\n");
-	}
-
-	p += sprintf(p, "\n");
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  Return what is (hopefully) useful stats about the specific board's ttys
- */
-static int dgnc_read_board_ttystats(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct board_t	*brd;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	int i = 0;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	brd = (struct board_t *) table->data;
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	/* Prepare the Header Labels */
-	p += sprintf(p, "%2s %10s %23s %10s %9s\n",
-		"Ch", "Chars Rx", "  Rx Par--Brk--Frm--Ovr", 
-		"Chars Tx", "XON XOFF");
-
-        for (i = 0; i < brd->nasync; i++) {
-
-		struct channel_t *ch = brd->channels[i];
-
-		p += sprintf(p, "%2d ", i);
-		p += sprintf(p, "%10ld ", ch->ch_rxcount);
-		p += sprintf(p, "    %4ld %4ld %4ld %4ld ", ch->ch_err_parity,
-			ch->ch_err_break, ch->ch_err_frame, ch->ch_err_overrun);
-		p += sprintf(p, "%10ld ", ch->ch_txcount);
-		p += sprintf(p, "%4ld %4ld ", ch->ch_xon_sends, ch->ch_xoff_sends);
-
-		p += sprintf(p, "\n");
-	}
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  Return what is (hopefully) useful stats about the specific board's tty intrs
- */
-static int dgnc_read_board_ttyintr(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct board_t	*brd;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	int i = 0;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	brd = (struct board_t *) table->data;
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	/* Prepare the Header Labels */
-	p += sprintf(p, "%2s     %14s  %14s  %14s\n",
-		"Ch", "TX interrupts", "RX interrupts", "Modem interrupts");
-
-        for (i = 0; i < brd->nasync; i++) {
-
-		struct channel_t *ch = brd->channels[i];
-
-		p += sprintf(p, "%2d ", i);
-
-	        p += sprintf(p, "    %14ld  %14ld    %14ld",
-			ch->ch_intr_tx, ch->ch_intr_rx, ch->ch_intr_modem);
-
-		p += sprintf(p, "\n");
-	}
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  Return what is (hopefully) useful flags about the specific board's ttys
- */
-static int dgnc_read_board_ttyflags(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct board_t	*brd;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	int i = 0;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	brd = (struct board_t *) table->data;
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	/* Prepare the Header Labels */
-	p += sprintf(p, "%2s %5s %5s %5s %5s %5s %10s  Line Status Flags\n",
-		"Ch", "CFlag", "IFlag", "OFlag", "LFlag", "DFlag", "Baud");
-
-        for (i = 0; i < brd->nasync; i++) {
-
-		struct channel_t *ch = brd->channels[i];
-
-		p += sprintf(p, "%2d ", i);
-		p += sprintf(p, "%5x ", ch->ch_c_cflag);
-		p += sprintf(p, "%5x ", ch->ch_c_iflag);
-		p += sprintf(p, "%5x ", ch->ch_c_oflag);
-		p += sprintf(p, "%5x ", ch->ch_c_lflag);
-		p += sprintf(p, "%5x ", ch->ch_digi.digi_flags);
-		p += sprintf(p, "%10d ", ch->ch_old_baud);
-
-		if (!ch->ch_open_count) {
-			p += sprintf(p, " -- -- -- -- -- -- --") ;
-		} else {
-			p += sprintf(p, " op %s %s %s %s %s %s",
-				(ch->ch_mostat & UART_MCR_RTS) ? "rs" : "--",
-				(ch->ch_mistat & UART_MSR_CTS) ? "cs" : "--",
-				(ch->ch_mostat & UART_MCR_DTR) ? "tr" : "--",
-				(ch->ch_mistat & UART_MSR_DSR) ? "mr" : "--",
-				(ch->ch_mistat & UART_MSR_DCD) ? "cd" : "--",
-				(ch->ch_mistat & UART_MSR_RI)  ? "ri" : "--");
-		}
-
-		p += sprintf(p, "\n");
-	}
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  Return mknod information for the board's devices.
- */                                             
-static int dgnc_read_board_mknod(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct board_t	*brd;
-	static int done = 0;
-	static char buf[4096];
-	char str[MAXTTYNAMELEN];
-	char *p = buf;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	brd = (struct board_t *) table->data;
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	/*
-	 * For each board, output the device information in
-	 * a handy table format...
-	 */
-	p += sprintf(p,	"# Create the TTY and PR devices\n");
-
-	/* TTY devices */
-	sprintf(str, "ttyn%d%%p", brd->boardnum + 1);
-	p += sprintf(p, "%s\t\t\t%d\t%d\t%d\n", str,
-		brd->dgnc_Serial_Major, 0, brd->maxports);
-
-	/* PR devices */
-	sprintf(str, "prn%d%%p", brd->boardnum + 1);
-	p += sprintf(p, "%s\t\t\t%d\t%d\t%d\n", str,
-		brd->dgnc_TransparentPrint_Major, 128, brd->maxports);
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  Return what is (hopefully) useful information about the specific channel.
- */
-static int dgnc_read_channel_info(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct channel_t *ch;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-
-	DPR_PROC(("dgnc_proc_info\n"));
-
-	ch = (struct channel_t *) table->data;
-
-	if (done || !ch || (ch->magic != DGNC_CHANNEL_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	p += sprintf(p, "Port number:\t\t%d\n", ch->ch_portnum);
-	p += sprintf(p, "\n");
-
-	/* Prepare the Header Labels */
-	p += sprintf(p, "%10s %23s %10s %9s\n",
-		"Chars Rx", "  Rx Par--Brk--Frm--Ovr",
-		"Chars Tx", "XON XOFF");
-	p += sprintf(p, "%10ld ", ch->ch_rxcount);
-	p += sprintf(p, "    %4ld %4ld %4ld %4ld ", ch->ch_err_parity,
-		ch->ch_err_break, ch->ch_err_frame, ch->ch_err_overrun);
-	p += sprintf(p, "%10ld ", ch->ch_txcount);  
-	p += sprintf(p, "%4ld %4ld ", ch->ch_xon_sends, ch->ch_xoff_sends);
-	p += sprintf(p, "\n\n");
-
-	/* Prepare the Header Labels */
-	p += sprintf(p, "%5s %5s %5s %5s %5s %10s  Line Status Flags\n",
-		"CFlag", "IFlag", "OFlag", "LFlag", "DFlag", "Baud");
-
-	p += sprintf(p, "%5x ", ch->ch_c_cflag);
-	p += sprintf(p, "%5x ", ch->ch_c_iflag);
-	p += sprintf(p, "%5x ", ch->ch_c_oflag);
-	p += sprintf(p, "%5x ", ch->ch_c_lflag);
-	p += sprintf(p, "%5x ", ch->ch_digi.digi_flags);
-	p += sprintf(p, "%10d ", ch->ch_old_baud);
-	if (!ch->ch_open_count) {
-		p += sprintf(p, " -- -- -- -- -- -- --") ;
-	} else {
-		p += sprintf(p, " op %s %s %s %s %s %s",
-			(ch->ch_mostat & UART_MCR_RTS) ? "rs" : "--",
-			(ch->ch_mistat & UART_MSR_CTS) ? "cs" : "--",
-			(ch->ch_mostat & UART_MCR_DTR) ? "tr" : "--",
-			(ch->ch_mistat & UART_MSR_DSR) ? "mr" : "--",
-			(ch->ch_mistat & UART_MSR_DCD) ? "cd" : "--",
-			(ch->ch_mistat & UART_MSR_RI)  ? "ri" : "--");
-	}
-	p += sprintf(p, "\n\n");
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf; 
-	done = 1;
-	return 0;
-}
-
-
-/*
- *  Return mknod information for the board's devices.
- */
-static int dgnc_read_channel_custom_ttyname(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct channel_t *ch;
-	struct board_t  *brd;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	int     cn;
-	int     bn;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	ch = (struct channel_t *) table->data;
-
-	if (done || !ch || (ch->magic != DGNC_CHANNEL_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	brd = ch->ch_bd;        
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	bn = brd->boardnum;
-	cn = ch->ch_portnum;
-
-	p += sprintf(p, "ttyn%d%c\n", bn + 1, 'a' + cn);
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf;
-	done = 1;
-	return 0;
-}
-
-
-
-
-/*
- *  Return mknod information for the board's devices.
- */
-static int dgnc_read_channel_custom_prname(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct channel_t *ch;
-	struct board_t  *brd;
-	static int done = 0;
-	static char buf[4096];
-	char *p = buf;
-	int     cn;
-	int     bn;
-
-	DPR_PROC(("dgnc_proc_brd_info\n"));
-
-	ch = (struct channel_t *) table->data;
-
-	if (done || !ch || (ch->magic != DGNC_CHANNEL_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	brd = ch->ch_bd;        
-
-	if (done || !brd || (brd->magic != DGNC_BOARD_MAGIC)) {
-		done = 0;
-		*lenp = 0;
-		return 0;
-	}
-
-	bn = brd->boardnum;
-	cn = ch->ch_portnum;
-
-	p += sprintf(p, "prn%d%c\n", bn + 1, 'a' + cn);
-
-	if (copy_to_user(buffer, buf, (p - (char *) buf)))
-		return -EFAULT;
-
-	*lenp = p - (char *) buf;
-	*ppos += p - (char *) buf;
-	done = 1;
-	return 0;
-}
-
-
-static int dgnc_open_channel_sniff(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				void *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct channel_t *ch;
-	ulong  lock_flags;
-
-	ch = (struct channel_t *) table->data;
-
-	if (!ch || (ch->magic != DGNC_CHANNEL_MAGIC))
-		return 0;
-
-	ch->ch_sniff_buf = dgnc_driver_kzmalloc(SNIFF_MAX, GFP_KERNEL);
-
-	DGNC_LOCK(ch->ch_lock, lock_flags);
-	ch->ch_sniff_flags |= SNIFF_OPEN;
-	DGNC_UNLOCK(ch->ch_lock, lock_flags);
-
-	return 0;
-}
-
-static int dgnc_close_channel_sniff(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				void *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct channel_t *ch;
-	ulong  lock_flags;
-
-	ch = (struct channel_t *) table->data;
-
-	if (!ch || (ch->magic != DGNC_CHANNEL_MAGIC))
-		return 0;
-
-	DGNC_LOCK(ch->ch_lock, lock_flags);
-	ch->ch_sniff_flags &= ~(SNIFF_OPEN);
-	kfree(ch->ch_sniff_buf);
-	DGNC_UNLOCK(ch->ch_lock, lock_flags);
-
-	return 0;
-}
-
-
-/*
- *    Copy data from the monitoring buffer to the user, freeing space
- *    in the monitoring buffer for more messages
- *
- */
-static int dgnc_read_channel_sniff(struct dgnc_proc_entry *table, int dir, struct file *filp,
-				char __user *buffer, ssize_t *lenp, loff_t *ppos)
-{
-	struct channel_t *ch;
-	int n;
-	int r;
-	int offset = 0;
-	int res = 0;
-	ssize_t rtn = 0;
-	ulong  lock_flags;
-
-	ch = (struct channel_t *) table->data;
-
-	if (!ch || (ch->magic != DGNC_CHANNEL_MAGIC)) {
-		rtn = -ENXIO;
-		goto done;
-	}
-
-	/*
-	 *  Wait for some data to appear in the buffer.
-	 */
-	DGNC_LOCK(ch->ch_lock, lock_flags);
-
-	for (;;) {
-		n = (ch->ch_sniff_in - ch->ch_sniff_out) & SNIFF_MASK;
-
-		if (n != 0)
-			break;
-
-		ch->ch_sniff_flags |= SNIFF_WAIT_DATA;
-
-		DGNC_UNLOCK(ch->ch_lock, lock_flags);
-
-		/*
-		 * Go to sleep waiting until the condition becomes true.
-		 */
-		rtn = wait_event_interruptible(ch->ch_sniff_wait,
-			((ch->ch_sniff_flags & SNIFF_WAIT_DATA) == 0));
-
-		if (rtn)
-			goto done;
-
-		DGNC_LOCK(ch->ch_lock, lock_flags);
-	}
-
-	/*
-	 *  Read whatever is there.
-	 */
-
-	if (n > *lenp)
-		n = *lenp;
-
-	res = n;
-
-	r = SNIFF_MAX - ch->ch_sniff_out;
-
-	if (r <= n) {
-		DGNC_UNLOCK(ch->ch_lock, lock_flags);
-		rtn = copy_to_user(buffer, ch->ch_sniff_buf + ch->ch_sniff_out, r);
-		if (rtn) {
-			rtn = -EFAULT;
-			goto done;
-		}
-
-		DGNC_LOCK(ch->ch_lock, lock_flags);
-
-		ch->ch_sniff_out = 0;
-		n -= r;
-		offset = r;
-	}
-
-	DGNC_UNLOCK(ch->ch_lock, lock_flags);
-	rtn = copy_to_user(buffer + offset, ch->ch_sniff_buf + ch->ch_sniff_out, n);
-	if (rtn) {
-		rtn = -EFAULT;
-		goto done;
-	}
-	DGNC_LOCK(ch->ch_lock, lock_flags);
-
-	ch->ch_sniff_out += n;
-	*ppos += res;
-	rtn = res;
-//	rtn = 0;
-
-	/*
-	 *  Wakeup any thread waiting for buffer space.
-	 */
-
-	if (ch->ch_sniff_flags & SNIFF_WAIT_SPACE) {
-		ch->ch_sniff_flags &= ~SNIFF_WAIT_SPACE;
-		wake_up_interruptible(&ch->ch_sniff_wait);
-	}
-
-	DGNC_UNLOCK(ch->ch_lock, lock_flags);
-
-done:
-	return rtn;
-}
-
-
-/*
- * Register the basic /proc/dgnc files that appear whenever
- * the driver is loaded.
- */
-void dgnc_proc_register_basic_prescan(void)
-{
-	/*
-	 *      Register /proc/dgnc
-	 */
-	ProcDGNC = proc_create("dgnc", (0700 | S_IFDIR), NULL, &dgnc_proc_file_ops);
-	dgnc_register_proc_table(dgnc_table, ProcDGNC);
-}
-
-
-/*
- * Register the basic /proc/dgnc files that appear whenever
- * the driver is loaded.
- */
-void dgnc_proc_register_basic_postscan(int board_num)
-{
-	int i, j;
-	char board[10];
-	sprintf(board, "%d", board_num);
-
-	/* Set proc board entry pointer */
-	dgnc_Board[board_num]->proc_entry_pointer = create_proc_entry(board, (0700 | S_IFDIR), ProcDGNC);
-
-	/* Create a new copy of the board_table... */
-	dgnc_Board[board_num]->dgnc_board_table = dgnc_driver_kzmalloc(sizeof(dgnc_board_table), 
-		GFP_KERNEL);
-
-	/* Now copy the default table into that memory */
-	memcpy(dgnc_Board[board_num]->dgnc_board_table, dgnc_board_table, sizeof(dgnc_board_table));
-
-	/* Initialize semaphores in each table slot */
-	for (i = 0; i < 999; i++) {
-		if (!dgnc_Board[board_num]->dgnc_board_table[i].magic) {
-			break;
-		}
-
-		init_MUTEX(&(dgnc_Board[board_num]->dgnc_board_table[i].excl_sem));
-		dgnc_Board[board_num]->dgnc_board_table[i].data = dgnc_Board[board_num];
-
-	}
-
-	/* Register board table into proc */
-	dgnc_register_proc_table(dgnc_Board[board_num]->dgnc_board_table, 
-		dgnc_Board[board_num]->proc_entry_pointer);
-
-	/*
-	 * Add new entries for each port.
-	 */
-	for (i = 0; i < dgnc_Board[board_num]->nasync; i++) {
-
-		char channel[10];
-		sprintf(channel, "%d", i);
-
-		/* Set proc channel entry pointer */
-		dgnc_Board[board_num]->channels[i]->proc_entry_pointer =
-			create_proc_entry(channel, (0700 | S_IFDIR), 
-			dgnc_Board[board_num]->proc_entry_pointer);
-
-		/* Create a new copy of the channel_table... */
-		dgnc_Board[board_num]->channels[i]->dgnc_channel_table =
-			dgnc_driver_kzmalloc(sizeof(dgnc_channel_table), GFP_KERNEL);
-
-		/* Now copy the default table into that memory */
-		memcpy(dgnc_Board[board_num]->channels[i]->dgnc_channel_table,
-			dgnc_channel_table, sizeof(dgnc_channel_table));
-
-		/* Initialize semaphores in each table slot */
-		for (j = 0; j < 999; j++) {
-			if (!dgnc_Board[board_num]->channels[i]->dgnc_channel_table[j].magic) {
-				break;
-			}
-
-			init_MUTEX(&(dgnc_Board[board_num]->channels[i]->dgnc_channel_table[j].excl_sem));
-			dgnc_Board[board_num]->channels[i]->dgnc_channel_table[j].data = 
-				dgnc_Board[board_num]->channels[i];
-		}
-
-		/* Register channel table into proc */
-		dgnc_register_proc_table(dgnc_Board[board_num]->channels[i]->dgnc_channel_table, 
-			dgnc_Board[board_num]->channels[i]->proc_entry_pointer);
-	}
-}
-
-
-static void dgnc_remove_proc_entry(struct proc_dir_entry *pde)
-{ 
-	if (!pde) {
-		DPR_PROC(("dgnc_remove_proc_entry... NULL entry... not removing...\n"));
-		return;
-	}
-
-	remove_proc_entry(pde->name, pde->parent);
-}
-
-
-void dgnc_proc_unregister_all(void)
-{
-	int i = 0, j = 0;
-
-	/* Walk each board, blowing away their proc entries... */
-	for (i = 0; i < dgnc_NumBoards; i++) {
-
-		/* Walk each channel, blowing away their proc entries... */
-		for (j = 0; j < dgnc_Board[i]->nasync; j++) {
-
-			dgnc_unregister_proc_table(dgnc_Board[i]->channels[j]->dgnc_channel_table, 
-				dgnc_Board[i]->channels[j]->proc_entry_pointer);
-			dgnc_remove_proc_entry(dgnc_Board[i]->channels[j]->proc_entry_pointer);
-			kfree(dgnc_Board[i]->channels[j]->dgnc_channel_table);
-		}
-
-		dgnc_unregister_proc_table(dgnc_Board[i]->dgnc_board_table, 
-			dgnc_Board[i]->proc_entry_pointer);
-		dgnc_remove_proc_entry(dgnc_Board[i]->proc_entry_pointer);
-		kfree(dgnc_Board[i]->dgnc_board_table);
-	}
-
-	/* Blow away the top proc entry */
-	dgnc_unregister_proc_table(dgnc_table, ProcDGNC);
-	dgnc_remove_proc_entry(ProcDGNC);
-}
-- 
1.8.1.2


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/8] staging: dgnc: fixes termios error
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
  2013-08-13 19:49 ` [PATCH 2/8] staging: dgnc: removes proc code Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 19:49 ` [PATCH 4/8] staging: dgnc: fixes tty_port and tty_struct params Lidza Louina
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

This patch fixes this error: invalid type argument of ‘->’ (have ‘struct ktermios’).

There were changes in the tty layer's API. Access to the termios flags changed from tty->termios->*flag* to tty->termios.*flag*.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 461e881..63b80e2 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -719,7 +719,7 @@ void dgnc_input(struct channel_t *ch)
          * flush input data and return immediately.
 	 */
 	if (!tp || (tp->magic != TTY_MAGIC) || !(ch->ch_tun.un_flags & UN_ISOPEN) || 
-	    !(tp->termios->c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING)) {
+	    !(tp->termios.c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING)) {
 
 		DPR_READ(("input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum));
 		DPR_READ(("input. tp: %p tp->magic: %x MAGIC:%x ch flags: %x\n",
@@ -1495,12 +1495,12 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
 		ch->ch_stop_sending_break = 0;
 		ch->ch_stops_sent = 0;
 
-		ch->ch_c_cflag   = tty->termios->c_cflag;
-		ch->ch_c_iflag   = tty->termios->c_iflag;
-		ch->ch_c_oflag   = tty->termios->c_oflag;
-		ch->ch_c_lflag   = tty->termios->c_lflag;
-		ch->ch_startc = tty->termios->c_cc[VSTART];
-		ch->ch_stopc  = tty->termios->c_cc[VSTOP];
+		ch->ch_c_cflag   = tty->termios.c_cflag;
+		ch->ch_c_iflag   = tty->termios.c_iflag;
+		ch->ch_c_oflag   = tty->termios.c_oflag;
+		ch->ch_c_lflag   = tty->termios.c_lflag;
+		ch->ch_startc = tty->termios.c_cc[VSTART];
+		ch->ch_stopc  = tty->termios.c_cc[VSTOP];
 
 		/*
 		 * Bring up RTS and DTR...
@@ -2874,12 +2874,12 @@ static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_te
 
 	DGNC_LOCK(ch->ch_lock, lock_flags);
 
-	ch->ch_c_cflag   = tty->termios->c_cflag;
-	ch->ch_c_iflag   = tty->termios->c_iflag;
-	ch->ch_c_oflag   = tty->termios->c_oflag;
-	ch->ch_c_lflag   = tty->termios->c_lflag;
-	ch->ch_startc = tty->termios->c_cc[VSTART];
-	ch->ch_stopc  = tty->termios->c_cc[VSTOP];
+	ch->ch_c_cflag   = tty->termios.c_cflag;
+	ch->ch_c_iflag   = tty->termios.c_iflag;
+	ch->ch_c_oflag   = tty->termios.c_oflag;
+	ch->ch_c_lflag   = tty->termios.c_lflag;
+	ch->ch_startc = tty->termios.c_cc[VSTART];
+	ch->ch_stopc  = tty->termios.c_cc[VSTOP];
 
 	ch->ch_bd->bd_ops->param(tty);
 	dgnc_carrier(ch);
@@ -3272,7 +3272,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned in
 			return(rc);
 
 		DGNC_LOCK(ch->ch_lock, lock_flags);
-		tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
+		tty->termios.c_cflag = ((tty->termios.c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
 		ch->ch_bd->bd_ops->param(tty);
 		DGNC_UNLOCK(ch->ch_lock, lock_flags);
 
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/8] staging: dgnc: fixes tty_port and tty_struct params
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
  2013-08-13 19:49 ` [PATCH 2/8] staging: dgnc: removes proc code Lidza Louina
  2013-08-13 19:49 ` [PATCH 3/8] staging: dgnc: fixes termios error Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 19:49 ` [PATCH 5/8] staging: dgnc: dereferences ts var in dgnc_tty_close() Lidza Louina
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

The functions tty_flip_buffer_push, tty_insert_flip_string,
tty_insert_flip_char and tty_buffer_request_room now require a struct of
type tty_port instead of struct tty_struct. This patch makes those
changes.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 63b80e2..a00fe2b 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -870,7 +870,7 @@ void dgnc_input(struct channel_t *ch)
 
 	}
 	else {
-		len = tty_buffer_request_room(tp, len);
+		len = tty_buffer_request_room(tp->port, len);
 		n = len;
 
 		/*
@@ -894,17 +894,17 @@ void dgnc_input(struct channel_t *ch)
 			if (I_PARMRK(tp) || I_BRKINT(tp) || I_INPCK(tp)) {
 				for (i = 0; i < s; i++) {
 					if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
-						tty_insert_flip_char(tp, *(ch->ch_rqueue + tail + i), TTY_BREAK);
+						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_BREAK);
 					else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
-						tty_insert_flip_char(tp, *(ch->ch_rqueue + tail + i), TTY_PARITY);
+						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_PARITY);
 					else if (*(ch->ch_equeue + tail + i) & UART_LSR_FE)
-						tty_insert_flip_char(tp, *(ch->ch_rqueue + tail + i), TTY_FRAME);
+						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_FRAME);
 					else
-						tty_insert_flip_char(tp, *(ch->ch_rqueue + tail + i), TTY_NORMAL);
+						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_NORMAL);
 				}
 			}
 			else {
-				tty_insert_flip_string(tp, ch->ch_rqueue + tail, s);
+				tty_insert_flip_string(tp->port, ch->ch_rqueue + tail, s);
 			}
 
 			dgnc_sniff_nowait_nolock(ch, "USER READ", ch->ch_rqueue + tail, s);
@@ -921,7 +921,7 @@ void dgnc_input(struct channel_t *ch)
 		DGNC_UNLOCK(ch->ch_lock, lock_flags);
 
 		/* Tell the tty layer its okay to "eat" the data now */
-		tty_flip_buffer_push(tp);
+		tty_flip_buffer_push(tp->port);
 	}
 
 	if (ld)
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/8] staging: dgnc: dereferences ts var in dgnc_tty_close()
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
                   ` (2 preceding siblings ...)
  2013-08-13 19:49 ` [PATCH 4/8] staging: dgnc: fixes tty_port and tty_struct params Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 19:49 ` [PATCH 6/8] staging: dgcn: removes unnecessary commands in ioctl Lidza Louina
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

The value tty->termios needed to be dereferenced to be assigned to the
variable ts.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index a00fe2b..c174bf8 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1758,7 +1758,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
 	if (!bd || bd->magic != DGNC_BOARD_MAGIC)
 		return;
 
-	ts = tty->termios;
+	ts = &tty->termios;
 
 	DPR_CLOSE(("Close called\n"));
 
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/8] staging: dgcn: removes unnecessary commands in ioctl
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
                   ` (3 preceding siblings ...)
  2013-08-13 19:49 ` [PATCH 5/8] staging: dgnc: dereferences ts var in dgnc_tty_close() Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 19:49 ` [PATCH 7/8] staging: dgnc: fixes ioctl param list Lidza Louina
  2013-08-13 19:49 ` [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf Lidza Louina
  6 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

The commands TIOCGETP, TCGETS, and TCGETA are not supposed to be seen by
the ioctl. This patch removes the switch cases for these commands.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index c174bf8..9dbe7bd 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -3336,40 +3336,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned in
 		/* pretend we didn't recognize this IOCTL */  
 		DGNC_UNLOCK(ch->ch_lock, lock_flags);
 		return(-ENOIOCTLCMD);
-
-#ifdef TIOCGETP
-	case TIOCGETP:
-#endif
-	case TCGETS:
-	case TCGETA:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
-		if (tty->ldisc->ops->ioctl) {
-#else
-		if (tty->ldisc.ops->ioctl) {
-#endif
-			int retval = (-ENXIO);
-
-			DGNC_UNLOCK(ch->ch_lock, lock_flags);
-
-			if (tty->termios) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
-				retval = ((tty->ldisc->ops->ioctl) (tty, file, cmd, arg));
-#else
-				retval = ((tty->ldisc.ops->ioctl) (tty, file, cmd, arg));
-#endif
-			}
-
-			DPR_IOCTL(("dgnc_tty_ioctl (LINE:%d) finish on port %d - cmd %s (%x), arg %lx\n", 
-				__LINE__, ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
-			return(retval);
-		}
-
-		DGNC_UNLOCK(ch->ch_lock, lock_flags);
-		DPR_IOCTL(("dgnc_tty_ioctl (LINE:%d) finish on port %d - cmd %s (%x), arg %lx\n", 
-			__LINE__, ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
-
-		return(-ENOIOCTLCMD);
-
 	case TCSETSF:
 	case TCSETSW:
 		/*
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 7/8] staging: dgnc: fixes ioctl param list
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
                   ` (4 preceding siblings ...)
  2013-08-13 19:49 ` [PATCH 6/8] staging: dgcn: removes unnecessary commands in ioctl Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 19:49 ` [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf Lidza Louina
  6 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

The declaration for the ioctl function has changed. The previous version
of this declaration took struct file *file as a parameter and the new
one does not. This patch removes that parameter.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 9dbe7bd..6f2ddb3 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -112,7 +112,7 @@ static struct ktermios DgncDefaultTermios =
 static int dgnc_tty_open(struct tty_struct *tty, struct file *file);
 static void dgnc_tty_close(struct tty_struct *tty, struct file *file);
 static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struct channel_t *ch);
-static int dgnc_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg);
+static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
 static int dgnc_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retinfo);
 static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_info);
 static int dgnc_tty_write_room(struct tty_struct* tty);
@@ -3123,7 +3123,7 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty)
  *
  * The usual assortment of ioctl's
  */
-static int dgnc_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd,
+static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
 		unsigned long arg)
 {
 	struct board_t *bd;
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf
  2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
                   ` (5 preceding siblings ...)
  2013-08-13 19:49 ` [PATCH 7/8] staging: dgnc: fixes ioctl param list Lidza Louina
@ 2013-08-13 19:49 ` Lidza Louina
  2013-08-13 23:27   ` Dan Carpenter
  6 siblings, 1 reply; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 19:49 UTC (permalink / raw)
  To: driverdev-devel, Greg KH, Mark Hounschell; +Cc: Lidza Louina

This patch removes the use of read_cnt, real_raw, buf and rawreadok. The
variable buf is never used in the code. The variables rawreadok read_cnt
and real_raw don't exist in the new API. Reading the data raw is no
longer supported by the tty layer.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 155 +++++++++++-----------------------------
 1 file changed, 43 insertions(+), 112 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 6f2ddb3..2acf934 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -683,7 +683,6 @@ void dgnc_input(struct channel_t *ch)
 	int flip_len;
 	int len = 0;
 	int n = 0;
-	char *buf = NULL;
 	int s = 0;
 	int i = 0;
 
@@ -746,15 +745,11 @@ void dgnc_input(struct channel_t *ch)
 
 	DPR_READ(("dgnc_input start 2\n"));
 
-	/* Decide how much data we can send into the tty layer */
-	if (dgnc_rawreadok && tp->real_raw)
-		flip_len = MYFLIPLEN;
-	else
-		flip_len = TTY_FLIPBUF_SIZE;
+	flip_len = TTY_FLIPBUF_SIZE;
 
 	/* Chop down the length, if needed */
 	len = min(data_len, flip_len);
-	len = min(len, (N_TTY_BUF_SIZE - 1) - tp->read_cnt);
+	len = min(len, (N_TTY_BUF_SIZE - 1));
 
 	ld = tty_ldisc_ref(tp);
 
@@ -807,122 +802,58 @@ void dgnc_input(struct channel_t *ch)
 	 * On the other hand, if we are not raw, we need to go through
 	 * the new 2.6.16+ tty layer, which has its API more well defined.
 	 */
-	if (dgnc_rawreadok && tp->real_raw) {
-
-		if (ch->ch_flags & CH_FLIPBUF_IN_USE) {
-			DPR_READ(("DGNC - FLIPBUF in use. delaying input\n"));
-			DGNC_UNLOCK(ch->ch_lock, lock_flags);
-			if (ld)
-				tty_ldisc_deref(ld);
-			return;
-		}
+	len = tty_buffer_request_room(tp->port, len);
+	n = len;
 
-		ch->ch_flags |= CH_FLIPBUF_IN_USE;
-		buf = ch->ch_bd->flipbuf;
+	/*
+	 * n now contains the most amount of data we can copy,
+	 * bounded either by how much the Linux tty layer can handle,
+	 * or the amount of data the card actually has pending...
+	 */
+	while (n) {
+		s = ((head >= tail) ? head : RQUEUESIZE) - tail;
+		s = min(s, n);
 
-		n = len;
+		if (s <= 0)
+			break;
 
 		/*
-		 * n now contains the most amount of data we can copy,
-		 * bounded either by the flip buffer size or the amount
-		 * of data the card actually has pending...
+		 * If conditions are such that ld needs to see all 
+		 * UART errors, we will have to walk each character
+		 * and error byte and send them to the buffer one at
+		 * a time.
 		 */
-		while (n) {
-			s = ((head >= tail) ? head : RQUEUESIZE) - tail;
-			s = min(s, n);
-
-			if (s <= 0)
-				break;
-
-			memcpy(buf, ch->ch_rqueue + tail, s);
-			dgnc_sniff_nowait_nolock(ch, "USER READ", ch->ch_rqueue + tail, s);
-
-			tail += s;
-			buf += s;
-
-			n -= s;
-			/* Flip queue if needed */
-			tail &= rmask;
+		if (I_PARMRK(tp) || I_BRKINT(tp) || I_INPCK(tp)) {
+			for (i = 0; i < s; i++) {
+				if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
+					tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_BREAK);
+				else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
+					tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_PARITY);
+				else if (*(ch->ch_equeue + tail + i) & UART_LSR_FE)
+					tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_FRAME);
+				else
+					tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_NORMAL);
+			}
+		}
+		else {
+			tty_insert_flip_string(tp->port, ch->ch_rqueue + tail, s);
 		}
 
-		ch->ch_r_tail = tail & rmask;
-		ch->ch_e_tail = tail & rmask;
-
-		dgnc_check_queue_flow_control(ch);
-
-		/* !!! WE *MUST* LET GO OF ALL LOCKS BEFORE CALLING RECEIVE BUF !!! */
-
-		DGNC_UNLOCK(ch->ch_lock, lock_flags);
-
-		DPR_READ(("dgnc_input. %d real_raw len:%d calling receive_buf for buffer for board %d\n", 
-			 __LINE__, len, ch->ch_bd->boardnum));
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
-		tp->ldisc->ops->receive_buf(tp, ch->ch_bd->flipbuf, NULL, len);
-#else
-		tp->ldisc.ops->receive_buf(tp, ch->ch_bd->flipbuf, NULL, len);
-#endif
-
-		/* Allow use of channel flip buffer again */
-		DGNC_LOCK(ch->ch_lock, lock_flags);
-		ch->ch_flags &= ~CH_FLIPBUF_IN_USE;
-		DGNC_UNLOCK(ch->ch_lock, lock_flags);
+		dgnc_sniff_nowait_nolock(ch, "USER READ", ch->ch_rqueue + tail, s);
 
+		tail += s;
+		n -= s;
+		/* Flip queue if needed */
+		tail &= rmask;
 	}
-	else {
-		len = tty_buffer_request_room(tp->port, len);
-		n = len;
-
-		/*
-		 * n now contains the most amount of data we can copy,
-		 * bounded either by how much the Linux tty layer can handle,
-		 * or the amount of data the card actually has pending...
-		 */
-		while (n) {
-			s = ((head >= tail) ? head : RQUEUESIZE) - tail;
-			s = min(s, n);
-
-			if (s <= 0)
-				break;
 
-			/*
-			 * If conditions are such that ld needs to see all 
-			 * UART errors, we will have to walk each character
-			 * and error byte and send them to the buffer one at
-			 * a time.
-			 */
-			if (I_PARMRK(tp) || I_BRKINT(tp) || I_INPCK(tp)) {
-				for (i = 0; i < s; i++) {
-					if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
-						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_BREAK);
-					else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
-						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_PARITY);
-					else if (*(ch->ch_equeue + tail + i) & UART_LSR_FE)
-						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_FRAME);
-					else
-						tty_insert_flip_char(tp->port, *(ch->ch_rqueue + tail + i), TTY_NORMAL);
-				}
-			}
-			else {
-				tty_insert_flip_string(tp->port, ch->ch_rqueue + tail, s);
-			}
-
-			dgnc_sniff_nowait_nolock(ch, "USER READ", ch->ch_rqueue + tail, s);
-
-			tail += s;
-			n -= s;
-			/* Flip queue if needed */
-			tail &= rmask;
-		}
-
-		ch->ch_r_tail = tail & rmask;
-		ch->ch_e_tail = tail & rmask;
-		dgnc_check_queue_flow_control(ch);
-		DGNC_UNLOCK(ch->ch_lock, lock_flags);
+	ch->ch_r_tail = tail & rmask;
+	ch->ch_e_tail = tail & rmask;
+	dgnc_check_queue_flow_control(ch);
+	DGNC_UNLOCK(ch->ch_lock, lock_flags);
 
-		/* Tell the tty layer its okay to "eat" the data now */
-		tty_flip_buffer_push(tp->port);
-	}
+	/* Tell the tty layer its okay to "eat" the data now */
+	tty_flip_buffer_push(tp->port);
 
 	if (ld)
 		tty_ldisc_deref(ld);
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/8] staging: dgnc: removes proc code
  2013-08-13 19:49 ` [PATCH 2/8] staging: dgnc: removes proc code Lidza Louina
@ 2013-08-13 23:20   ` Dan Carpenter
  2013-08-14  2:25     ` Lidza Louina
  2013-08-14  2:29     ` Lidza Louina
  2013-08-14 21:04   ` Greg KH
  1 sibling, 2 replies; 18+ messages in thread
From: Dan Carpenter @ 2013-08-13 23:20 UTC (permalink / raw)
  To: Lidza Louina; +Cc: Mark Hounschell, Greg KH, driverdev-devel

On Tue, Aug 13, 2013 at 03:49:52PM -0400, Lidza Louina wrote:
> This patch removes the dgnc_proc.c file, all references to proc functions in dgnc_driver.c and from the Makefile's build.
> 
> There were a lot of issues with the proc code so I removed it to make sure it builds. I'll work on the proc code and add it to the build once it fits the new proc API.

Don't add new proc files.  These days we use sysfs for that pretty
much.  The format will have to change a lot if we decide to go that
route.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf
  2013-08-13 19:49 ` [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf Lidza Louina
@ 2013-08-13 23:27   ` Dan Carpenter
  2013-08-13 23:35     ` Lidza Louina
                       ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Dan Carpenter @ 2013-08-13 23:27 UTC (permalink / raw)
  To: Lidza Louina; +Cc: Mark Hounschell, Greg KH, driverdev-devel

On Tue, Aug 13, 2013 at 03:49:58PM -0400, Lidza Louina wrote:
> This patch removes the use of read_cnt, real_raw, buf and rawreadok. The variable buf is never used in the code. The variables rawreadok read_cnt and real_raw don't exist in the new API. Reading the data raw is no longer supported by the tty layer.
> 

These patches are much better, but the changelog text should be
line wrapped at around 72 characters.  I hate to ask you to redo
these over and over, but the alternative is for Greg to fix them up
and he's a shared resource and very very busy.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf
  2013-08-13 23:27   ` Dan Carpenter
@ 2013-08-13 23:35     ` Lidza Louina
  2013-08-14  2:28     ` Lidza Louina
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-13 23:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mark Hounschell, Greg KH, driverdev-devel

[-- Attachment #1: Type: text/plain, Size: 788 bytes --]

Ahh, I
On Aug 13, 2013 7:28 PM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
>
> On Tue, Aug 13, 2013 at 03:49:58PM -0400, Lidza Louina wrote:
> > This patch removes the use of read_cnt, real_raw, buf and rawreadok.
The variable buf is never used in the code. The variables rawreadok
read_cnt and real_raw don't exist in the new API. Reading the data raw is
no longer supported by the tty layer.
> >
>
> These patches are much better, but the changelog text should be
> line wrapped at around 72 characters.  I hate to ask you to redo
> these over and over, but the alternative is for Greg to fix them up
> and he's a shared resource and very very busy.

Ooo, I understand. I'll send out another version after I get more feedback
about this one.

Thanks.

> regards,
> dan carpenter

[-- Attachment #2: Type: text/html, Size: 994 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/8] staging: dgnc: removes proc code
  2013-08-13 23:20   ` Dan Carpenter
@ 2013-08-14  2:25     ` Lidza Louina
  2013-08-14  2:29     ` Lidza Louina
  1 sibling, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-14  2:25 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: driverdev-devel, Greg KH, Mark Hounschell

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

On Tue, Aug 13, 2013 at 7:20 PM, Dan Carpenter <dan.carpenter@oracle.com>wrote:

> On Tue, Aug 13, 2013 at 03:49:52PM -0400, Lidza Louina wrote:
> > This patch removes the dgnc_proc.c file, all references to proc
> functions in dgnc_driver.c and from the Makefile's build.
> >
> > There were a lot of issues with the proc code so I removed it to make
> sure it builds. I'll work on the proc code and add it to the build once it
> fits the new proc API.
>
> Don't add new proc files.  These days we use sysfs for that pretty
> much.  The format will have to change a lot if we decide to go that
> route.
>

Ok, then I'd have to make a new set of patches removing the references
to the proc code instead of commenting it out in driver.c.

[-- Attachment #2: Type: text/html, Size: 1131 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf
  2013-08-13 23:27   ` Dan Carpenter
  2013-08-13 23:35     ` Lidza Louina
@ 2013-08-14  2:28     ` Lidza Louina
  2013-08-14  2:31     ` Lidza Louina
  2013-08-14 21:08     ` Greg KH
  3 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-14  2:28 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: driverdev-devel, Greg KH, Mark Hounschell

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

On Tue, Aug 13, 2013 at 7:27 PM, Dan Carpenter <dan.carpenter@oracle.com>wrote:

> On Tue, Aug 13, 2013 at 03:49:58PM -0400, Lidza Louina wrote:
> > This patch removes the use of read_cnt, real_raw, buf and rawreadok. The
> variable buf is never used in the code. The variables rawreadok read_cnt
> and real_raw don't exist in the new API. Reading the data raw is no longer
> supported by the tty layer.
> >
>
> These patches are much better, but the changelog text should be
> line wrapped at around 72 characters.  I hate to ask you to redo
> these over and over, but the alternative is for Greg to fix them up
> and he's a shared resource and very very busy.
>

I'll wait until I get more feedback from this set of patches then
I'll make the appropriate changes. I want to make sure I do
this right. =]

[-- Attachment #2: Type: text/html, Size: 1214 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/8] staging: dgnc: removes proc code
  2013-08-13 23:20   ` Dan Carpenter
  2013-08-14  2:25     ` Lidza Louina
@ 2013-08-14  2:29     ` Lidza Louina
  1 sibling, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-14  2:29 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mark Hounschell, Greg KH, driverdev-devel

Eek, for some reason, gmail has been
sending html, sorry I'm spamming. =[

On Tue, Aug 13, 2013 at 7:20 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Tue, Aug 13, 2013 at 03:49:52PM -0400, Lidza Louina wrote:
>> This patch removes the dgnc_proc.c file, all references to proc functions in dgnc_driver.c and from the Makefile's build.
>>
>> There were a lot of issues with the proc code so I removed it to make sure it builds. I'll work on the proc code and add it to the build once it fits the new proc API.
>
> Don't add new proc files.  These days we use sysfs for that pretty
> much.  The format will have to change a lot if we decide to go that
> route.

Ok, then I'd have to make a new set of patches removing the references
to the proc code instead of commenting it out in driver.c.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf
  2013-08-13 23:27   ` Dan Carpenter
  2013-08-13 23:35     ` Lidza Louina
  2013-08-14  2:28     ` Lidza Louina
@ 2013-08-14  2:31     ` Lidza Louina
  2013-08-14 21:08     ` Greg KH
  3 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-14  2:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mark Hounschell, Greg KH, driverdev-devel

For some reason, gmail has been sending out
html. Sorry for spamming. =[


On Tue, Aug 13, 2013 at 7:27 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Tue, Aug 13, 2013 at 03:49:58PM -0400, Lidza Louina wrote:
>> This patch removes the use of read_cnt, real_raw, buf and rawreadok. The variable buf is never used in the code. The variables rawreadok read_cnt and real_raw don't exist in the new API. Reading the data raw is no longer supported by the tty layer.
>>
>
> These patches are much better, but the changelog text should be
> line wrapped at around 72 characters.  I hate to ask you to redo
> these over and over, but the alternative is for Greg to fix them up
> and he's a shared resource and very very busy.


I'll wait until I get more feedback from this set of patches then
I'll make the appropriate changes. I want to make sure I do
this right. =]
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/8] staging: dgnc: removes proc code
  2013-08-13 19:49 ` [PATCH 2/8] staging: dgnc: removes proc code Lidza Louina
  2013-08-13 23:20   ` Dan Carpenter
@ 2013-08-14 21:04   ` Greg KH
  2013-08-14 22:10     ` Lidza Louina
  1 sibling, 1 reply; 18+ messages in thread
From: Greg KH @ 2013-08-14 21:04 UTC (permalink / raw)
  To: Lidza Louina; +Cc: Mark Hounschell, driverdev-devel

On Tue, Aug 13, 2013 at 03:49:52PM -0400, Lidza Louina wrote:
> This patch removes the dgnc_proc.c file, all references to proc functions in dgnc_driver.c and from the Makefile's build.
> 
> There were a lot of issues with the proc code so I removed it to make sure it builds. I'll work on the proc code and add it to the build once it fits the new proc API.
> 
> Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
> ---
>  drivers/staging/dgnc/Makefile      |    2 +-
>  drivers/staging/dgnc/dgnc_driver.c |    6 +-
>  drivers/staging/dgnc/dgnc_proc.c   | 1551 ------------------------------------
>  3 files changed, 4 insertions(+), 1555 deletions(-)
>  delete mode 100644 drivers/staging/dgnc/dgnc_proc.c

For some strange reason, this patch doesn't apply with patch, or with
git:

$ p1 < ../s2
checking file drivers/staging/dgnc/Makefile
checking file drivers/staging/dgnc/dgnc_driver.c
checking file drivers/staging/dgnc/dgnc_proc.c
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored

$ git am -s ../s2
Applying: staging: dgnc: removes proc code
error: patch failed: drivers/staging/dgnc/dgnc_proc.c:1
error: drivers/staging/dgnc/dgnc_proc.c: patch does not apply
Patch failed at 0001 staging: dgnc: removes proc code
The copy of the patch that failed is found in:
    /home/gregkh/linux/work/staging/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


How did you create this patch?  Very strange...

Anyway, I applied the first one, but can't apply this one, can you
please resend it after verifying that you can apply it to the tree
yourself?

Oh and yeah, line-wrap those changelog comments please :)

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf
  2013-08-13 23:27   ` Dan Carpenter
                       ` (2 preceding siblings ...)
  2013-08-14  2:31     ` Lidza Louina
@ 2013-08-14 21:08     ` Greg KH
  3 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2013-08-14 21:08 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mark Hounschell, Lidza Louina, driverdev-devel

On Wed, Aug 14, 2013 at 02:27:58AM +0300, Dan Carpenter wrote:
> On Tue, Aug 13, 2013 at 03:49:58PM -0400, Lidza Louina wrote:
> > This patch removes the use of read_cnt, real_raw, buf and rawreadok. The variable buf is never used in the code. The variables rawreadok read_cnt and real_raw don't exist in the new API. Reading the data raw is no longer supported by the tty layer.
> > 
> 
> These patches are much better, but the changelog text should be
> line wrapped at around 72 characters.  I hate to ask you to redo
> these over and over, but the alternative is for Greg to fix them up
> and he's a shared resource and very very busy.

I am Lidza's "mentor" for the OPW program, so the least I can do is
line-wrap the patches when applying them if that's all that is wrong
with them :)

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/8] staging: dgnc: removes proc code
  2013-08-14 21:04   ` Greg KH
@ 2013-08-14 22:10     ` Lidza Louina
  0 siblings, 0 replies; 18+ messages in thread
From: Lidza Louina @ 2013-08-14 22:10 UTC (permalink / raw)
  To: Greg KH; +Cc: Mark Hounschell, driverdev-devel

On Wed, Aug 14, 2013 at 5:04 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Aug 13, 2013 at 03:49:52PM -0400, Lidza Louina wrote:
>> This patch removes the dgnc_proc.c file, all references to proc functions in dgnc_driver.c and from the Makefile's build.
>>
>> There were a lot of issues with the proc code so I removed it to make sure it builds. I'll work on the proc code and add it to the build once it fits the new proc API.
>>
>> Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
>> ---
>>  drivers/staging/dgnc/Makefile      |    2 +-
>>  drivers/staging/dgnc/dgnc_driver.c |    6 +-
>>  drivers/staging/dgnc/dgnc_proc.c   | 1551 ------------------------------------
>>  3 files changed, 4 insertions(+), 1555 deletions(-)
>>  delete mode 100644 drivers/staging/dgnc/dgnc_proc.c
>
> For some strange reason, this patch doesn't apply with patch, or with
> git:
>
> $ p1 < ../s2
> checking file drivers/staging/dgnc/Makefile
> checking file drivers/staging/dgnc/dgnc_driver.c
> checking file drivers/staging/dgnc/dgnc_proc.c
> Reversed (or previously applied) patch detected!  Assume -R? [n]
> Apply anyway? [n]
> Skipping patch.
> 1 out of 1 hunk ignored
>
> $ git am -s ../s2
> Applying: staging: dgnc: removes proc code
> error: patch failed: drivers/staging/dgnc/dgnc_proc.c:1
> error: drivers/staging/dgnc/dgnc_proc.c: patch does not apply
> Patch failed at 0001 staging: dgnc: removes proc code
> The copy of the patch that failed is found in:
>     /home/gregkh/linux/work/staging/.git/rebase-apply/patch
> When you have resolved this problem, run "git am --resolved".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>
>
> How did you create this patch?  Very strange...

I had reset my directory, applied the patch that (I thought) I had sent out
last week, added the code to make sure it builds into the kernel,
committed that, then started fixing up the code. All the patches I sent
out stemmed from it.

> Anyway, I applied the first one, but can't apply this one, can you
> please resend it after verifying that you can apply it to the tree
> yourself?

I just applied the exact patch from last week to my directory and
got errors. =[

I'll resend this patch...

> Oh and yeah, line-wrap those changelog comments please :)

...with the lines wrapped. =]
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-08-14 22:10 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 19:49 [PATCH 1/8] staging: dgnc: removes Makefile.inc Lidza Louina
2013-08-13 19:49 ` [PATCH 2/8] staging: dgnc: removes proc code Lidza Louina
2013-08-13 23:20   ` Dan Carpenter
2013-08-14  2:25     ` Lidza Louina
2013-08-14  2:29     ` Lidza Louina
2013-08-14 21:04   ` Greg KH
2013-08-14 22:10     ` Lidza Louina
2013-08-13 19:49 ` [PATCH 3/8] staging: dgnc: fixes termios error Lidza Louina
2013-08-13 19:49 ` [PATCH 4/8] staging: dgnc: fixes tty_port and tty_struct params Lidza Louina
2013-08-13 19:49 ` [PATCH 5/8] staging: dgnc: dereferences ts var in dgnc_tty_close() Lidza Louina
2013-08-13 19:49 ` [PATCH 6/8] staging: dgcn: removes unnecessary commands in ioctl Lidza Louina
2013-08-13 19:49 ` [PATCH 7/8] staging: dgnc: fixes ioctl param list Lidza Louina
2013-08-13 19:49 ` [PATCH 8/8] staging: dgnc: removes read_cnt, real_raw, rawreadok and buf Lidza Louina
2013-08-13 23:27   ` Dan Carpenter
2013-08-13 23:35     ` Lidza Louina
2013-08-14  2:28     ` Lidza Louina
2013-08-14  2:31     ` Lidza Louina
2013-08-14 21:08     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.