Commit e14047e4 authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: dgnc: clean up header comments

TODO file has task: remove unnecessary comments. Driver uses some
custom comment format. Driver would be better if it used kernel doc
format.

Audit header file comments. Replace struct comments with kernel doc
format comments. Remove unnecessary comments.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd801a07
...@@ -16,24 +16,21 @@ ...@@ -16,24 +16,21 @@
#ifndef __DGNC_CLS_H #ifndef __DGNC_CLS_H
#define __DGNC_CLS_H #define __DGNC_CLS_H
/************************************************************************ /**
* Per channel/port Classic UART structure * * struct cls_uart_struct - Per channel/port Classic UART.
************************************************************************ *
* Base Structure Entries Usage Meanings to Host * * key - W = read write
* * * - R = read only
* W = read write R = read only * * - U = unused
* U = Unused. * *
************************************************************************/ * @txrx: (WR) Holding Register.
* @ier: (WR) Interrupt Enable Register.
/* * @isr_fcr: (WR) Interrupt Status Register/Fifo Control Register.
* txrx : WR RHR/THR - Holding reg * @lcr: (WR) Line Control Register.
* ier : WR IER - Interrupt Enable Reg * @mcr: (WR) Modem Control Register.
* isr_fcr : WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg * @lsr: (WR) Line Status Register.
* lcr : WR LCR - Line Control Reg * @msr: (WR) Modem Status Register.
* mcr : WR MCR - Modem Control Reg * @spr: (WR) Scratch Pad Register.
* lsr : WR LSR - Line Status Reg
* msr : WR MSG - Modem Status Reg
* spr : WR SPR - Scratch pad Reg
*/ */
struct cls_uart_struct { struct cls_uart_struct {
u8 txrx; u8 txrx;
...@@ -74,9 +71,6 @@ struct cls_uart_struct { ...@@ -74,9 +71,6 @@ struct cls_uart_struct {
#define UART_EXAR654_IER_RTSDTR 0x40 /* Output Interrupt Enable */ #define UART_EXAR654_IER_RTSDTR 0x40 /* Output Interrupt Enable */
#define UART_EXAR654_IER_CTSDSR 0x80 /* Input Interrupt Enable */ #define UART_EXAR654_IER_CTSDSR 0x80 /* Input Interrupt Enable */
/*
* Our Global Variables
*/
extern struct board_ops dgnc_cls_ops; extern struct board_ops dgnc_cls_ops;
#endif #endif
This diff is collapsed.
...@@ -18,38 +18,57 @@ ...@@ -18,38 +18,57 @@
#include "dgnc_driver.h" #include "dgnc_driver.h"
/* /**
* Per channel/port NEO UART structure * struct neo_uart_struct - Per channel/port NEO UART structure
* Base Structure Entries Usage Meanings to Host *
* key - W = read write
* - R = read only
* - U = unused
* *
* W = read write R = read only * @txrx: (RW) Holding Register.
* U = Unused. * @ier: (RW) Interrupt Enable Register.
* @isr_fcr: (RW) Interrupt Status Reg/Fifo Control Register.
* @lcr: (RW) Line Control Register.
* @mcr: (RW) Modem Control Register.
* @lsr: (RW) Line Status Register.
* @msr: (RW) Modem Status Register.
* @spr: (RW) Scratch Pad Register.
* @fctr: (RW) Feature Control Register.
* @efr: (RW) Enhanced Function Register.
* @tfifo: (RW) Transmit FIFO Register.
* @rfifo: (RW) Receive FIFO Register.
* @xoffchar1: (RW) XOff Character 1 Register.
* @xoffchar2: (RW) XOff Character 2 Register.
* @xonchar1: (RW) Xon Character 1 Register.
* @xonchar2: (RW) XOn Character 2 Register.
* @reserved1: (U) Reserved by Exar.
* @txrxburst: (RW) 64 bytes of RX/TX FIFO Data.
* @reserved2: (U) Reserved by Exar.
* @rxburst_with_errors: (R) bytes of RX FIFO Data + LSR.
*/ */
struct neo_uart_struct { struct neo_uart_struct {
u8 txrx; /* WR RHR/THR - Holding Reg */ u8 txrx;
u8 ier; /* WR IER - Interrupt Enable Reg */ u8 ier;
u8 isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo u8 isr_fcr;
* Control Reg
*/ u8 lcr;
u8 lcr; /* WR LCR - Line Control Reg */ u8 mcr;
u8 mcr; /* WR MCR - Modem Control Reg */ u8 lsr;
u8 lsr; /* WR LSR - Line Status Reg */ u8 msr;
u8 msr; /* WR MSR - Modem Status Reg */ u8 spr;
u8 spr; /* WR SPR - Scratch Pad Reg */ u8 fctr;
u8 fctr; /* WR FCTR - Feature Control Reg */ u8 efr;
u8 efr; /* WR EFR - Enhanced Function Reg */ u8 tfifo;
u8 tfifo; /* WR TXCNT/TXTRG - Transmit FIFO Reg */ u8 rfifo;
u8 rfifo; /* WR RXCNT/RXTRG - Receive FIFO Reg */ u8 xoffchar1;
u8 xoffchar1; /* WR XOFF 1 - XOff Character 1 Reg */ u8 xoffchar2;
u8 xoffchar2; /* WR XOFF 2 - XOff Character 2 Reg */ u8 xonchar1;
u8 xonchar1; /* WR XON 1 - Xon Character 1 Reg */ u8 xonchar2;
u8 xonchar2; /* WR XON 2 - XOn Character 2 Reg */
u8 reserved1[0x2ff - 0x200];
u8 reserved1[0x2ff - 0x200]; /* U Reserved by Exar */ u8 txrxburst[64];
u8 txrxburst[64]; /* RW 64 bytes of RX/TX FIFO Data */ u8 reserved2[0x37f - 0x340];
u8 reserved2[0x37f - 0x340]; /* U Reserved by Exar */ u8 rxburst_with_errors[64];
u8 rxburst_with_errors[64]; /* R 64 bytes of RX FIFO Data + LSR */
}; };
/* Where to read the extended interrupt register (32bits instead of 8bits) */ /* Where to read the extended interrupt register (32bits instead of 8bits) */
...@@ -151,8 +170,6 @@ struct neo_uart_struct { ...@@ -151,8 +170,6 @@ struct neo_uart_struct {
#define UART_17158_IER_RTSDTR 0x40 /* Output Interrupt Enable */ #define UART_17158_IER_RTSDTR 0x40 /* Output Interrupt Enable */
#define UART_17158_IER_CTSDSR 0x80 /* Input Interrupt Enable */ #define UART_17158_IER_CTSDSR 0x80 /* Input Interrupt Enable */
/* Our Global Variables */
extern struct board_ops dgnc_neo_ops; extern struct board_ops dgnc_neo_ops;
#endif #endif
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
#ifndef __DGNC_PCI_H #ifndef __DGNC_PCI_H
#define __DGNC_PCI_H #define __DGNC_PCI_H
#define PCIMAX 32 /* maximum number of PCI boards */ /* Maximum number of PCI boards */
#define PCIMAX 32
#define DIGI_VID 0x114F #define DIGI_VID 0x114F
...@@ -59,10 +60,10 @@ ...@@ -59,10 +60,10 @@
#define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME "Neo 8 PCI Express RJ45" #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME "Neo 8 PCI Express RJ45"
#define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME "Neo 4 PCI Express IBM" #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME "Neo 4 PCI Express IBM"
/* Size of Memory and I/O for PCI (4 K) */ /* Size of memory and I/O for PCI (4 K) */
#define PCI_RAM_SIZE 0x1000 #define PCI_RAM_SIZE 0x1000
/* Size of Memory (2MB) */ /* Size of memory (2MB) */
#define PCI_MEM_SIZE 0x1000 #define PCI_MEM_SIZE 0x1000
#endif #endif
...@@ -45,8 +45,7 @@ ...@@ -45,8 +45,7 @@
#define DIGI_SETAW (('e' << 8) | 96) /* Drain & set params */ #define DIGI_SETAW (('e' << 8) | 96) /* Drain & set params */
#define DIGI_SETAF (('e' << 8) | 97) /* Drain, flush & set params */ #define DIGI_SETAF (('e' << 8) | 97) /* Drain, flush & set params */
#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */ #define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
#define DIGI_LOOPBACK (('d' << 8) | 252) /* #define DIGI_LOOPBACK (('d' << 8) | 252) /* Enable/disable UART
* Enable/disable UART
* internal loopback * internal loopback
*/ */
#define DIGI_FAST 0x0002 /* Fast baud rates */ #define DIGI_FAST 0x0002 /* Fast baud rates */
...@@ -64,50 +63,77 @@ ...@@ -64,50 +63,77 @@
/* /*
* Structure used with ioctl commands for DIGI parameters. * Structure used with ioctl commands for DIGI parameters.
*/ */
/**
* struct digi_t - Ioctl commands for DIGI parameters.
* @digi_flags: Flags.
* @digi_maxcps: Maximum printer CPS.
* @digi_maxchar: Maximum characters in the print queue.
* @digi_bufsize: Buffer size.
* @digi_onlen: Length of ON string.
* @digi_offlen: Length of OFF string.
* @digi_onstr: Printer ON string.
* @digi_offstr: Printer OFF string.
* @digi_term: Terminal string.
*/
struct digi_t { struct digi_t {
unsigned short digi_flags; /* Flags (see above) */ unsigned short digi_flags;
unsigned short digi_maxcps; /* Max printer CPS */ unsigned short digi_maxcps;
unsigned short digi_maxchar; /* Max chars in print queue */ unsigned short digi_maxchar;
unsigned short digi_bufsize; /* Buffer size */ unsigned short digi_bufsize;
unsigned char digi_onlen; /* Length of ON string */ unsigned char digi_onlen;
unsigned char digi_offlen; /* Length of OFF string */ unsigned char digi_offlen;
char digi_onstr[DIGI_PLEN]; /* Printer on string */ char digi_onstr[DIGI_PLEN];
char digi_offstr[DIGI_PLEN]; /* Printer off string */ char digi_offstr[DIGI_PLEN];
char digi_term[DIGI_TSIZ]; /* terminal string */ char digi_term[DIGI_TSIZ];
}; };
/* Structure to get driver status information */ /**
* struct digi_dinfo - Driver status information.
* @dinfo_nboards: Number of boards configured.
* @dinfo_reserved: Not used, for future expansion.
* @dinfio_version: Driver version.
*/
struct digi_dinfo { struct digi_dinfo {
unsigned int dinfo_nboards; /* # boards configured */ unsigned int dinfo_nboards;
char dinfo_reserved[12]; /* for future expansion */ char dinfo_reserved[12];
char dinfo_version[16]; /* driver version */ char dinfo_version[16];
}; };
#define DIGI_GETDD (('d' << 8) | 248) /* get driver info */ #define DIGI_GETDD (('d' << 8) | 248) /* get driver info */
/* /**
* Structure used with ioctl commands for per-board information * struct digi_info - Ioctl commands for per board information.
* *
* physsize and memsize differ when board has "windowed" memory * Physsize and memsize differ when board has "windowed" memory.
*
* @info_bdnum: Board number (0 based).
* @info_ioport: IO port address.
* @indo_physaddr: Memory address.
* @info_physize: Size of host memory window.
* @info_memsize: Amount of dual-port memory on board.
* @info_bdtype: Board type.
* @info_nports: Number of ports.
* @info_bdstate: Board state.
* @info_reserved: Not used, for future expansion.
*/ */
struct digi_info { struct digi_info {
unsigned int info_bdnum; /* Board number (0 based) */ unsigned int info_bdnum;
unsigned int info_ioport; /* io port address */ unsigned int info_ioport;
unsigned int info_physaddr; /* memory address */ unsigned int info_physaddr;
unsigned int info_physsize; /* Size of host mem window */ unsigned int info_physsize;
unsigned int info_memsize; /* Amount of dual-port mem */ unsigned int info_memsize;
/* on board */ unsigned short info_bdtype;
unsigned short info_bdtype; /* Board type */ unsigned short info_nports;
unsigned short info_nports; /* number of ports */ char info_bdstate;
char info_bdstate; /* board state */ char info_reserved[7];
char info_reserved[7]; /* for future expansion */
}; };
#define DIGI_GETBD (('d' << 8) | 249) /* get board info */ #define DIGI_GETBD (('d' << 8) | 249) /* get board info */
struct digi_getbuffer /* Struct for holding buffer use counts */ /**
{ * struct digi_getbuffer - Holds buffer use counts.
*/
struct digi_getbuffer {
unsigned long tx_in; unsigned long tx_in;
unsigned long tx_out; unsigned long tx_out;
unsigned long rxbuf; unsigned long rxbuf;
...@@ -115,14 +141,24 @@ struct digi_getbuffer /* Struct for holding buffer use counts */ ...@@ -115,14 +141,24 @@ struct digi_getbuffer /* Struct for holding buffer use counts */
unsigned long txdone; unsigned long txdone;
}; };
/**
* struct digi_getcounter
* @norun: Number of UART overrun errors.
* @noflow: Number of buffer overflow errors.
* @nframe: Number of framing errors.
* @nparity: Number of parity errors.
* @nbreak: Number of breaks received.
* @rbytes: Number of received bytes.
* @tbytes: Number of transmitted bytes.
*/
struct digi_getcounter { struct digi_getcounter {
unsigned long norun; /* number of UART overrun errors */ unsigned long norun;
unsigned long noflow; /* number of buffer overflow errors */ unsigned long noflow;
unsigned long nframe; /* number of framing errors */ unsigned long nframe;
unsigned long nparity; /* number of parity errors */ unsigned long nparity;
unsigned long nbreak; /* number of breaks received */ unsigned long nbreak;
unsigned long rbytes; /* number of received bytes */ unsigned long rbytes;
unsigned long tbytes; /* number of bytes transmitted fully */ unsigned long tbytes;
}; };
/* Board State Definitions */ /* Board State Definitions */
...@@ -137,15 +173,14 @@ struct digi_getcounter { ...@@ -137,15 +173,14 @@ struct digi_getcounter {
#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110) #define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110)
#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111) #define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)
#define EV_OPU 0x0001 /* !<Output paused by client */ #define EV_OPU 0x0001 /* Output paused by client */
#define EV_OPS 0x0002 /* !<Output paused by regular sw flowctrl */ #define EV_OPS 0x0002 /* Output paused by regular sw flowctrl */
#define EV_IPU 0x0010 /* !<Input paused unconditionally by user */ #define EV_IPU 0x0010 /* Input paused unconditionally by user */
#define EV_IPS 0x0020 /* !<Input paused by high/low water marks */ #define EV_IPS 0x0020 /* Input paused by high/low water marks */
#define EV_TXB 0x0040 /* !<Transmit break pending */ #define EV_TXB 0x0040 /* Transmit break pending */
/* /**
* This structure holds data needed for the intelligent <--> nonintelligent * struct ni_info - intelligent <--> non-intelligent DPA translation.
* DPA translation
*/ */
struct ni_info { struct ni_info {
int board; int board;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment