checkpatch warns us about multiple blank lines which are not needed.
Remove them.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* PURPOSE. See the GNU General Public License for more details.
*/
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
.release = dgnc_mgmt_close
};
-
/*
* Globals
*/
static uint dgnc_poll_stop; /* Used to tell poller to stop */
static struct timer_list dgnc_poll_timer;
-
static const struct pci_device_id dgnc_pci_tbl[] = {
{PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_DID), .driver_data = 0},
{PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID), .driver_data = 1},
}
}
-
dgnc_Board[brd->boardnum] = NULL;
kfree(brd);
}
-
/*
* dgnc_found_board()
*
pci_irq = pdev->irq;
brd->irq = pci_irq;
-
switch (brd->device) {
case PCI_DEVICE_CLASSIC_4_DID:
* 4 Memory Mapped UARTs and Status
*/
-
/* get the PCI Base Address Registers */
brd->membase = pci_resource_start(pdev, 4);
break;
-
case PCI_DEVICE_NEO_4_DID:
case PCI_DEVICE_NEO_8_DID:
case PCI_DEVICE_NEO_2DB9_DID:
}
-
static int dgnc_finalize_board_init(struct dgnc_board *brd)
{
int rc = 0;
brd->re_map_membase = ioremap(brd->membase, 0x1000);
}
-
/*****************************************************************************
*
* Function:
#include "dgnc_pci.h"
#include "dgnc_mgmt.h"
-
/* Our "in use" variables, to enforce 1 open only */
static int dgnc_mgmt_in_use[MAXMGMTDEVICES];
-
/*
* dgnc_mgmt_open()
*
return 0;
}
-
/*
* dgnc_mgmt_close()
*
return 0;
}
-
/*
* dgnc_mgmt_ioctl()
*
break;
}
-
}
return 0;
* PURPOSE. See the GNU General Public License for more details.
*/
-
#include <linux/kernel.h>
#include <linux/sched.h> /* For jiffies, task states */
#include <linux/interrupt.h> /* For tasklet and interrupt structs/defines */
static void neo_send_immediate_char(struct channel_t *ch, unsigned char c);
static irqreturn_t neo_intr(int irq, void *voidbrd);
-
struct board_ops dgnc_neo_ops = {
.tasklet = neo_tasklet,
.intr = neo_intr,
static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
-
/*
* This function allows calls to ensure that all outstanding
* PCI writes have been completed, by doing a PCI read against
unsigned char ier = readb(&ch->ch_neo_uart->ier);
unsigned char efr = readb(&ch->ch_neo_uart->efr);
-
/* Turn on auto CTS flow control */
#if 1
ier |= UART_17158_IER_CTSDSR;
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_rts_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_ixon_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_ixoff_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_no_input_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
else
efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXOFF);
-
/* Why? Becuz Exar's spec says we have to zero it out before setting it */
writeb(0, &ch->ch_neo_uart->efr);
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_no_output_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
neo_pci_posting_flush(ch->ch_bd);
}
-
/* change UARTs start/stop chars */
static inline void neo_set_new_start_stop_chars(struct channel_t *ch)
{
neo_pci_posting_flush(ch->ch_bd);
}
-
/*
* No locks are assumed to be held when calling this function.
*/
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* Parse the ISR register.
*/
}
}
-
static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
{
struct channel_t *ch;
}
}
-
/*
* neo_param()
* Send any/all changes to the line to the UART.
neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr));
}
-
/*
* Our board poller function.
*/
}
-
/*
* dgnc_neo_intr()
*
return IRQ_HANDLED;
}
-
/*
* Neo specific way of turning off the receiver.
* Used as a way to enforce queue flow control when in
neo_pci_posting_flush(ch->ch_bd);
}
-
/*
* Neo specific way of turning on the receiver.
* Used as a way to un-enforce queue flow control when in
neo_pci_posting_flush(ch->ch_bd);
}
-
static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
{
int qleft = 0;
total -= 3;
}
-
/*
* Finally, bound the copy to make sure we don't overflow
* our own queue...
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* This function basically goes to sleep for secs, or until
* it gets signalled that the port has fully drained.
return rc;
}
-
/*
* Flush the WRITE FIFO on the Neo.
*
ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
}
-
/*
* Flush the READ FIFO on the Neo.
*
}
}
-
static void neo_copy_data_from_queue_to_uart(struct channel_t *ch)
{
ushort head;
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void neo_parse_modem(struct channel_t *ch, unsigned char signals)
{
unsigned char msignals = signals;
ch->ch_mistat &= ~UART_MSR_CTS;
}
-
/* Make the UART raise any of the output signals we want up */
static void neo_assert_modem_signals(struct channel_t *ch)
{
udelay(10);
}
-
static void neo_send_start_character(struct channel_t *ch)
{
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
}
}
-
static void neo_send_stop_character(struct channel_t *ch)
{
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
}
}
-
/*
* neo_uart_init
*/
writeb(0, &ch->ch_neo_uart->efr);
writeb(UART_EFR_ECB, &ch->ch_neo_uart->efr);
-
/* Clear out UART and FIFO */
readb(&ch->ch_neo_uart->txrx);
writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT), &ch->ch_neo_uart->isr_fcr);
neo_pci_posting_flush(ch->ch_bd);
}
-
/*
* Make the UART completely turn off.
*/
neo_pci_posting_flush(ch->ch_bd);
}
-
static uint neo_get_uart_bytes_left(struct channel_t *ch)
{
unsigned char left = 0;
return left;
}
-
/* Channel lock MUST be held by the calling function! */
static void neo_send_break(struct channel_t *ch, int msecs)
{
}
}
-
/*
* neo_send_immediate_char.
*
neo_pci_posting_flush(ch->ch_bd);
}
-
static unsigned int neo_read_eeprom(unsigned char __iomem *base, unsigned int address)
{
unsigned int enable;
return val;
}
-
static void neo_vpd(struct dgnc_board *brd)
{
unsigned int i = 0;
* PURPOSE. See the GNU General Public License for more details.
*/
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ctype.h>
#include "dgnc_driver.h"
#include "dgnc_mgmt.h"
-
static ssize_t dgnc_driver_version_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n", DG_PART);
}
static DRIVER_ATTR(version, S_IRUSR, dgnc_driver_version_show, NULL);
-
static ssize_t dgnc_driver_boards_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", dgnc_NumBoards);
}
static DRIVER_ATTR(boards, S_IRUSR, dgnc_driver_boards_show, NULL);
-
static ssize_t dgnc_driver_maxboards_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", MAXBOARDS);
}
static DRIVER_ATTR(maxboards, S_IRUSR, dgnc_driver_maxboards_show, NULL);
-
static ssize_t dgnc_driver_pollrate_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%dms\n", dgnc_poll_tick);
static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgnc_driver_pollrate_show,
dgnc_driver_pollrate_store);
-
void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
{
int rc = 0;
pr_err("DGNC: sysfs driver_create_file failed!\n");
}
-
void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
{
struct device_driver *driverfs = &dgnc_driver->driver;
driver_remove_file(driverfs, &driver_attr_pollrate);
}
-
#define DGNC_VERIFY_BOARD(p, bd) \
do { \
if (!p) \
return 0; \
} while (0)
-
-
static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
char *buf)
{
}
static DEVICE_ATTR(serial_number, S_IRUSR, dgnc_serial_number_show, NULL);
-
static ssize_t dgnc_ports_state_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_state, S_IRUSR, dgnc_ports_state_show, NULL);
-
static ssize_t dgnc_ports_baud_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_baud, S_IRUSR, dgnc_ports_baud_show, NULL);
-
static ssize_t dgnc_ports_msignals_show(struct device *p,
struct device_attribute *attr,
char *buf)
}
static DEVICE_ATTR(ports_msignals, S_IRUSR, dgnc_ports_msignals_show, NULL);
-
static ssize_t dgnc_ports_iflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_iflag, S_IRUSR, dgnc_ports_iflag_show, NULL);
-
static ssize_t dgnc_ports_cflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_cflag, S_IRUSR, dgnc_ports_cflag_show, NULL);
-
static ssize_t dgnc_ports_oflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_oflag, S_IRUSR, dgnc_ports_oflag_show, NULL);
-
static ssize_t dgnc_ports_lflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_lflag, S_IRUSR, dgnc_ports_lflag_show, NULL);
-
static ssize_t dgnc_ports_digi_flag_show(struct device *p,
struct device_attribute *attr,
char *buf)
}
static DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgnc_ports_digi_flag_show, NULL);
-
static ssize_t dgnc_ports_rxcount_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgnc_ports_rxcount_show, NULL);
-
static ssize_t dgnc_ports_txcount_show(struct device *p,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(ports_txcount, S_IRUSR, dgnc_ports_txcount_show, NULL);
-
/* this function creates the sys files that will export each signal status
* to sysfs each value will be put in a separate filename
*/
dev_err(&bd->pdev->dev, "dgnc: sysfs device_create_file failed!\n");
}
-
/* removes all the sys files created for that port */
void dgnc_remove_ports_sysfiles(struct dgnc_board *bd)
{
device_remove_file(&(bd->pdev->dev), &dev_attr_serial_number);
}
-
static ssize_t dgnc_tty_state_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(state, S_IRUSR, dgnc_tty_state_show, NULL);
-
static ssize_t dgnc_tty_baud_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(baud, S_IRUSR, dgnc_tty_baud_show, NULL);
-
static ssize_t dgnc_tty_msignals_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(msignals, S_IRUSR, dgnc_tty_msignals_show, NULL);
-
static ssize_t dgnc_tty_iflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(iflag, S_IRUSR, dgnc_tty_iflag_show, NULL);
-
static ssize_t dgnc_tty_cflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(cflag, S_IRUSR, dgnc_tty_cflag_show, NULL);
-
static ssize_t dgnc_tty_oflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(oflag, S_IRUSR, dgnc_tty_oflag_show, NULL);
-
static ssize_t dgnc_tty_lflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(lflag, S_IRUSR, dgnc_tty_lflag_show, NULL);
-
static ssize_t dgnc_tty_digi_flag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(digi_flag, S_IRUSR, dgnc_tty_digi_flag_show, NULL);
-
static ssize_t dgnc_tty_rxcount_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(rxcount, S_IRUSR, dgnc_tty_rxcount_show, NULL);
-
static ssize_t dgnc_tty_txcount_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(txcount, S_IRUSR, dgnc_tty_txcount_show, NULL);
-
static ssize_t dgnc_tty_name_show(struct device *d,
struct device_attribute *attr, char *buf)
{
}
static DEVICE_ATTR(custom_name, S_IRUSR, dgnc_tty_name_show, NULL);
-
static struct attribute *dgnc_sysfs_tty_entries[] = {
&dev_attr_state.attr,
&dev_attr_baud.attr,
NULL
};
-
static struct attribute_group dgnc_tty_attribute_group = {
.name = NULL,
.attrs = dgnc_sysfs_tty_entries,
};
-
void dgnc_create_tty_sysfs(struct un_t *un, struct device *c)
{
int ret;
}
-
void dgnc_remove_tty_sysfs(struct device *c)
{
sysfs_remove_group(&c->kobj, &dgnc_tty_attribute_group);
.digi_term = "ansi" /* default terminal type */
};
-
/*
* Define a local default termios struct. All ports will be created
* with this termios initially.
.c_line = 0,
};
-
/* Our function prototypes */
static int dgnc_tty_open(struct tty_struct *tty, struct file *file);
static void dgnc_tty_close(struct tty_struct *tty, struct file *file);
struct ktermios *old_termios);
static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch);
-
static const struct tty_operations dgnc_tty_ops = {
.open = dgnc_tty_open,
.close = dgnc_tty_close,
return 0;
}
-
/*
* dgnc_tty_register()
*
return rc;
}
-
/*
* dgnc_tty_init()
*
return -ENOMEM;
}
-
/*
* dgnc_tty_post_uninit()
*
dgnc_TmpWriteBuf = NULL;
}
-
/*
* dgnc_tty_uninit()
*
ch->ch_w_head = head;
}
-
-
-
/*=======================================================================
*
* dgnc_input - Process received data.
tty_ldisc_deref(ld);
}
-
/************************************************************************
* Determines when CARRIER changes state and takes appropriate
* action.
ch->ch_custom_speed = newrate;
}
-
void dgnc_check_queue_flow_control(struct channel_t *ch)
{
int qleft = 0;
}
}
-
void dgnc_wakeup_writes(struct channel_t *ch)
{
int qlen = 0;
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
-
/************************************************************************
*
* TTY Entry points and helper functions
spin_lock_irqsave(&ch->ch_lock, flags);
-
/* Store our unit into driver_data, so we always have it available. */
tty->driver_data = un;
-
/*
* Initialize tty's
*/
/* Maybe do something here to the TTY struct as well? */
}
-
/*
* Allocate channel buffers for read/write/error.
* Set flag, so we don't get trounced on.
return rc;
}
-
/*
* dgnc_block_til_ready()
*
return 0;
}
-
/*
* dgnc_tty_hangup()
*
}
-
/*
* dgnc_tty_close()
*
tty->closing = 1;
-
/*
* Only officially close channel if count is 0 and
* DIGI_PRINTER bit is not set.
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* dgnc_tty_chars_in_buffer()
*
return chars;
}
-
/*
* dgnc_maxcps_room
*
return bytes_available;
}
-
/*
* dgnc_tty_write_room()
*
return ret;
}
-
/*
* dgnc_tty_put_char()
*
return 1;
}
-
/*
* dgnc_tty_write()
*
return 0;
}
-
/*
* Return modem signals to ld.
*/
return result;
}
-
/*
* dgnc_tty_tiocmset()
*
return 0;
}
-
/*
* dgnc_tty_send_break()
*
}
-
/*
* dgnc_tty_wait_until_sent()
*
bd->bd_ops->drain(tty, 0);
}
-
/*
* dgnc_send_xchar()
*
dev_dbg(tty->dev, "dgnc_tty_send_xchar finish\n");
}
-
-
-
/*
* Return modem signals to ld.
*/
return result;
}
-
-
/*
* Return modem signals to ld.
*/
return put_user(result, value);
}
-
/*
* dgnc_set_modem_info()
*
return 0;
}
-
/*
* dgnc_tty_digigeta()
*
return 0;
}
-
/*
* dgnc_tty_digiseta()
*
return 0;
}
-
/*
* dgnc_set_termios()
*/
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_throttle(struct tty_struct *tty)
{
struct channel_t *ch;
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_unthrottle(struct tty_struct *tty)
{
struct channel_t *ch;
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_start(struct tty_struct *tty)
{
struct dgnc_board *bd;
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_stop(struct tty_struct *tty)
{
struct dgnc_board *bd;
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* dgnc_tty_flush_chars()
*
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
-
/*
* dgnc_tty_flush_buffer()
*
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
-
/*****************************************************************************
*
* The IOCTL function and all of its helpers
return 0;
-
case TCSBRKP:
/* support for POSIX tcsendbreak()
* According to POSIX.1 spec (7.2.2.1.2) breaks should be