Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b99d589 authored by Lidza Louina's avatar Lidza Louina Committed by Greg Kroah-Hartman
Browse files

staging: dgnc: add dgnc digi driver

This patch adds the DGNC driver. This is a TTY Serial Port
Driver for the Digi International Neo and Classic PCI based product
line by Digi International <http://www.digi.com

>.

This driver isn't hooked up to the build system because it doesn't
build, it merely adds the driver written by Digi to the kernel tree so
that it can be cleaned up and fixed up properly over time.

Cc: Mark Hounschell <markh@compro.net>
Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9cc16c0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
config DGNC
       tristate "Digi Neo and Classic PCI Products"
       default n
       depends on TTY
       ---help---
       Driver for the Digi International Neo and Classic PCI based product line.
+7 −0
Original line number Diff line number Diff line
EXTRA_CFLAGS += -DDG_NAME=\"dgnc-1.3-16\" -DDG_PART=\"40002369_F\"

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
+133 −0
Original line number Diff line number Diff line
#
# 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...
+1412 −0

File added.

Preview size limit exceeded, changes collapsed.

+90 −0
Original line number Diff line number Diff line
/*
 * 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: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
 *
 */

#ifndef __DGNC_CLS_H
#define __DGNC_CLS_H

#include "dgnc_types.h"


/************************************************************************ 
 * Per channel/port Classic UART structure				*
 ************************************************************************
 *		Base Structure Entries Usage Meanings to Host		*
 *									*
 *	W = read write		R = read only				* 
 *			U = Unused.					*
 ************************************************************************/

struct cls_uart_struct {
	volatile uchar txrx;		/* WR  RHR/THR - Holding Reg */
	volatile uchar ier;		/* WR  IER - Interrupt Enable Reg */
	volatile uchar isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
	volatile uchar lcr;		/* WR  LCR - Line Control Reg */
	volatile uchar mcr;		/* WR  MCR - Modem Control Reg */
	volatile uchar lsr;		/* WR  LSR - Line Status Reg */
	volatile uchar msr;		/* WR  MSR - Modem Status Reg */
	volatile uchar spr;		/* WR  SPR - Scratch Pad Reg */
};

/* Where to read the interrupt register (8bits) */
#define	UART_CLASSIC_POLL_ADDR_OFFSET	0x40

#define UART_EXAR654_ENHANCED_REGISTER_SET 0xBF

#define UART_16654_FCR_TXTRIGGER_8	0x0
#define UART_16654_FCR_TXTRIGGER_16	0x10
#define UART_16654_FCR_TXTRIGGER_32	0x20
#define UART_16654_FCR_TXTRIGGER_56	0x30

#define UART_16654_FCR_RXTRIGGER_8	0x0
#define UART_16654_FCR_RXTRIGGER_16	0x40
#define UART_16654_FCR_RXTRIGGER_56	0x80
#define UART_16654_FCR_RXTRIGGER_60     0xC0

#define UART_IIR_XOFF			0x10	/* Received Xoff signal/Special character */
#define UART_IIR_CTSRTS			0x20	/* Received CTS/RTS change of state */
#define UART_IIR_RDI_TIMEOUT		0x0C    /* Receiver data TIMEOUT */

/*
 * These are the EXTENDED definitions for the Exar 654's Interrupt
 * Enable Register.
 */
#define UART_EXAR654_EFR_ECB      0x10    /* Enhanced control bit */
#define UART_EXAR654_EFR_IXON     0x2     /* Receiver compares Xon1/Xoff1 */
#define UART_EXAR654_EFR_IXOFF    0x8     /* Transmit Xon1/Xoff1 */
#define UART_EXAR654_EFR_RTSDTR   0x40    /* Auto RTS/DTR Flow Control Enable */
#define UART_EXAR654_EFR_CTSDSR   0x80    /* Auto CTS/DSR Flow COntrol Enable */

#define UART_EXAR654_XOFF_DETECT  0x1     /* Indicates whether chip saw an incoming XOFF char  */
#define UART_EXAR654_XON_DETECT   0x2     /* Indicates whether chip saw an incoming XON char */

#define UART_EXAR654_IER_XOFF     0x20    /* Xoff Interrupt Enable */
#define UART_EXAR654_IER_RTSDTR   0x40    /* Output Interrupt Enable */
#define UART_EXAR654_IER_CTSDSR   0x80    /* Input Interrupt Enable */

/* 
 * Our Global Variables
 */
extern struct board_ops dgnc_cls_ops;

#endif
Loading