*
*/
-static int dgap_start(void);
-static void dgap_init_globals(void);
-static int dgap_found_board(struct pci_dev *pdev, int id);
-static void dgap_cleanup_board(struct board_t *brd);
-static void dgap_poll_handler(ulong dummy);
-static int dgap_init_pci(void);
-static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
-static void dgap_remove_one(struct pci_dev *dev);
-static int dgap_probe1(struct pci_dev *pdev, int card_type);
-static int dgap_do_remap(struct board_t *brd);
-static irqreturn_t dgap_intr(int irq, void *voidbrd);
+static int dgap_start(void);
+static void dgap_init_globals(void);
+static int dgap_found_board(struct pci_dev *pdev, int id);
+static void dgap_cleanup_board(struct board_t *brd);
+static void dgap_poll_handler(ulong dummy);
+static int dgap_init_pci(void);
+static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
+static void dgap_remove_one(struct pci_dev *dev);
+static int dgap_probe1(struct pci_dev *pdev, int card_type);
+static int dgap_do_remap(struct board_t *brd);
+static irqreturn_t dgap_intr(int irq, void *voidbrd);
/* Our function prototypes */
static int dgap_tty_open(struct tty_struct *tty, struct file *file);
static int dgap_tty_put_char(struct tty_struct *tty, unsigned char c);
static void dgap_tty_send_xchar(struct tty_struct *tty, char ch);
-static int dgap_tty_register(struct board_t *brd);
-static int dgap_tty_preinit(void);
-static int dgap_tty_init(struct board_t *);
-static void dgap_tty_post_uninit(void);
-static void dgap_tty_uninit(struct board_t *);
-static void dgap_carrier(struct channel_t *ch);
-static void dgap_input(struct channel_t *ch);
+static int dgap_tty_register(struct board_t *brd);
+static int dgap_tty_preinit(void);
+static int dgap_tty_init(struct board_t *);
+static void dgap_tty_post_uninit(void);
+static void dgap_tty_uninit(struct board_t *);
+static void dgap_carrier(struct channel_t *ch);
+static void dgap_input(struct channel_t *ch);
/*
* Our function prototypes from dgap_fep5
static uint dgap_config_get_useintr(struct board_t *bd);
static uint dgap_config_get_altpin(struct board_t *bd);
-static int dgap_ms_sleep(ulong ms);
-static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len);
-static void dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len);
+static int dgap_ms_sleep(ulong ms);
+static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len);
+static void dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len);
#ifdef DIGI_CONCENTRATORS_SUPPORTED
-static void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, int len);
+static void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, int len);
#endif
-static int dgap_after_config_loaded(int board);
-static int dgap_finalize_board_init(struct board_t *brd);
+static int dgap_after_config_loaded(int board);
+static int dgap_finalize_board_init(struct board_t *brd);
static void dgap_get_vpd(struct board_t *brd);
static void dgap_do_reset_board(struct board_t *brd);
module_init(dgap_init_module);
module_exit(dgap_cleanup_module);
-
/*
* File operations permitted on Control/Management major.
*/
.owner = THIS_MODULE,
};
-
/*
* Globals
*/
-static uint dgap_NumBoards;
-static struct board_t *dgap_Board[MAXBOARDS];
+static uint dgap_NumBoards;
+static struct board_t *dgap_Board[MAXBOARDS];
DEFINE_SPINLOCK(dgap_global_lock);
-static ulong dgap_poll_counter;
-static char *dgap_config_buf;
-static int dgap_driver_state = DRIVER_INITIALIZED;
+static ulong dgap_poll_counter;
+static char *dgap_config_buf;
+static int dgap_driver_state = DRIVER_INITIALIZED;
DEFINE_SPINLOCK(dgap_dl_lock);
-static wait_queue_head_t dgap_dl_wait;
-static int dgap_dl_action;
-static int dgap_poll_tick = 20; /* Poll interval - 20 ms */
+static wait_queue_head_t dgap_dl_wait;
+static int dgap_dl_action;
+static int dgap_poll_tick = 20; /* Poll interval - 20 ms */
/*
* Static vars.
*/
-static int dgap_Major_Control_Registered = FALSE;
-static uint dgap_driver_start = FALSE;
+static int dgap_Major_Control_Registered = FALSE;
+static uint dgap_driver_start = FALSE;
-static struct class * dgap_class;
+static struct class *dgap_class;
-static struct board_t *dgap_BoardsByMajor[256];
-static uchar *dgap_TmpWriteBuf = NULL;
+static struct board_t *dgap_BoardsByMajor[256];
+static uchar *dgap_TmpWriteBuf = NULL;
DECLARE_MUTEX(dgap_TmpWriteSem);
static uint dgap_count = 500;
* Poller stuff
*/
DEFINE_SPINLOCK(dgap_poll_lock); /* Poll scheduling lock */
-static ulong dgap_poll_time; /* Time of next poll */
-static uint dgap_poll_stop; /* Used to tell poller to stop */
+static ulong dgap_poll_time; /* Time of next poll */
+static uint dgap_poll_stop; /* Used to tell poller to stop */
static struct timer_list dgap_poll_timer;
/*
};
MODULE_DEVICE_TABLE(pci, dgap_pci_tbl);
-
/*
* A generic list of Product names, PCI Vendor ID, and PCI Device ID.
*/
{0,}
};
-
static char *dgap_driver_state_text[] = {
"Driver Initialized",
"Driver needs configuration load.",
.digi_term = "ansi" /* default terminal type */
};
-
/*
* Define a local default termios struct. All ports will be created
* with this termios initially.
return rc;
}
-
/*
* Start of driver.
*/
return rc;
}
-
/*
* Register pci driver, and return how many boards we have.
*/
return pci_register_driver(&dgap_driver);
}
-
/* returns count (>= 0), or negative on error */
static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
return rc;
}
-
static int dgap_probe1(struct pci_dev *pdev, int card_type)
{
return dgap_found_board(pdev, card_type);
}
-
static void dgap_remove_one(struct pci_dev *dev)
{
/* Do Nothing */
}
-
/*
* dgap_cleanup_module()
*
DGAP_UNLOCK(dgap_poll_lock, lock_flags);
/* Turn off poller right away. */
- del_timer_sync( &dgap_poll_timer);
+ del_timer_sync(&dgap_poll_timer);
dgap_remove_driver_sysfiles(&dgap_driver);
pci_unregister_driver(&dgap_driver);
}
-
/*
* dgap_cleanup_board()
*
kfree(brd);
}
-
/*
* dgap_found_board()
*
/* make a temporary message buffer for the boot messages */
brd->msgbuf = brd->msgbuf_head =
(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
- if(!brd->msgbuf) {
+ if (!brd->msgbuf) {
kfree(brd);
return -ENOMEM;
}
brd->port = brd->membase + PCI_IO_OFFSET;
brd->port_end = brd->port + PCI_IO_SIZE;
-
/*
* Special initialization for non-PLX boards
*/
static int dgap_finalize_board_init(struct board_t *brd)
{
-
int rc;
if (!brd || brd->magic != DGAP_BOARD_MAGIC)
return 0;
}
-
/*****************************************************************************
*
* Function:
dgap_poll_counter++;
-
/*
* Do not start the board state machine until
* driver tells us its up and running, and has
* Otherwise, use our new tasklet based poller, which should
* speed things up for multiple boards.
*/
- if ( (dgap_NumBoards == 1) || (num_online_cpus() <= 1) ) {
+ if ((dgap_NumBoards == 1) || (num_online_cpus() <= 1)) {
for (i = 0; i < dgap_NumBoards; i++) {
brd = dgap_Board[i];
/*
* Schedule ourself back at the nominal wakeup interval.
*/
- DGAP_LOCK(dgap_poll_lock, lock_flags );
+ DGAP_LOCK(dgap_poll_lock, lock_flags);
dgap_poll_time += dgap_jiffies_from_ms(dgap_poll_tick);
new_time = dgap_poll_time - jiffies;
dgap_poll_timer.function = dgap_poll_handler;
dgap_poll_timer.data = 0;
dgap_poll_timer.expires = dgap_poll_time;
- DGAP_UNLOCK(dgap_poll_lock, lock_flags );
+ DGAP_UNLOCK(dgap_poll_lock, lock_flags);
if (!dgap_poll_stop)
add_timer(&dgap_poll_timer);
}
-
-
-
/*
* dgap_intr()
*
return IRQ_HANDLED;
}
-
/*
* dgap_init_globals()
*
for (i = 0; i < MAXBOARDS; i++)
dgap_Board[i] = NULL;
- init_timer( &dgap_poll_timer );
+ init_timer(&dgap_poll_timer);
init_waitqueue_head(&dgap_dl_wait);
dgap_dl_action = 0;
}
-
/************************************************************************
*
* Utility functions
return signal_pending(current);
}
-
-
-
/************************************************************************
*
* TTY Initialization/Cleanup Functions
return 0;
}
-
/*
* dgap_tty_register()
*
return rc;
}
-
/*
* dgap_tty_init()
*
return 0;
}
-
/*
* dgap_tty_post_uninit()
*
dgap_TmpWriteBuf = NULL;
}
-
/*
* dgap_tty_uninit()
*
}
}
-
#define TMPBUFLEN (1024)
-
/*
* dgap_sniff - Dump data out to the "sniff" buffer if the
* proc sniff file is opened...
} while (too_much_data);
}
-
/*=======================================================================
*
* dgap_input - Process received data.
return;
bd = ch->ch_bd;
- if(!bd || bd->magic != DGAP_BOARD_MAGIC)
+ if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
DGAP_LOCK(bd->bd_lock, lock_flags);
}
-
/************************************************************************
* Determines when CARRIER changes state and takes appropriate
* action.
ch->ch_flags &= ~CH_CD;
}
-
/************************************************************************
*
* TTY Entry points and helper functions
return rc;
}
-
/*
* dgap_block_til_ready()
*
return 0;
}
-
/*
* dgap_tty_hangup()
*
}
-
-
/*
* dgap_tty_close()
*
/*
* If we have HUPCL set, lower DTR and RTS
*/
- if (ch->ch_c_cflag & HUPCL ) {
+ if (ch->ch_c_cflag & HUPCL) {
ch->ch_mostat &= ~(D_RTS(ch)|D_DTR(ch));
- dgap_cmdb( ch, SMODEM, 0, D_DTR(ch)|D_RTS(ch), 0 );
+ dgap_cmdb(ch, SMODEM, 0, D_DTR(ch)|D_RTS(ch), 0);
/*
* Go to sleep to ensure RTS/DTR
/*
* turn off print device when closing print device.
*/
- if ((un->un_type == DGAP_PRINT) && (ch->ch_flags & CH_PRON) ) {
+ if ((un->un_type == DGAP_PRINT) && (ch->ch_flags & CH_PRON)) {
dgap_wmove(ch, ch->ch_digi.digi_offstr,
(int) ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
DGAP_UNLOCK(ch->ch_lock, lock_flags);
}
-
/*
* dgap_tty_chars_in_buffer()
*
return chars;
}
-
static int dgap_wait_for_drain(struct tty_struct *tty)
{
struct channel_t *ch;
return ret;
}
-
/*
* dgap_maxcps_room
*
if (un->un_type != DGAP_PRINT)
return bytes_available;
- if (ch->ch_digi.digi_maxcps > 0 && ch->ch_digi.digi_bufsize > 0 ) {
+ if (ch->ch_digi.digi_maxcps > 0 && ch->ch_digi.digi_bufsize > 0) {
int cps_limit = 0;
unsigned long current_time = jiffies;
unsigned long buffer_time = current_time +
return bytes_available;
}
-
static inline void dgap_set_firmware_event(struct un_t *un, unsigned int event)
{
struct channel_t *ch = NULL;
}
}
-
/*
* dgap_tty_write_room()
*
return ret;
}
-
/*
* dgap_tty_put_char()
*
return 1;
}
-
/*
* dgap_tty_write()
*
writew(head, &(bs->tx_head));
}
-
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
/*
return count;
}
-
-
/*
* Return modem signals to ld.
*/
return result;
}
-
/*
* dgap_tty_tiocmset()
*
* Set modem signals, called by ld.
*/
-
static int dgap_tty_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
return 0;
}
-
-
/*
* dgap_tty_send_break()
*
return 0;
}
-
-
-
/*
* dgap_tty_wait_until_sent()
*
dgap_wait_for_drain(tty);
}
-
-
/*
* dgap_send_xchar()
*
return;
}
-
-
-
/*
* Return modem signals to ld.
*/
return rc;
}
-
/*
* dgap_set_modem_info()
*
return 0;
}
-
/*
* dgap_tty_digigeta()
*
return 0;
}
-
/*
* dgap_tty_digiseta()
*
return 0;
}
-
/*
* dgap_tty_digigetedelay()
*
return 0;
}
-
/*
* dgap_tty_digisetedelay()
*
return 0;
}
-
/*
* dgap_tty_digigetcustombaud()
*
return 0;
}
-
/*
* dgap_tty_digisetcustombaud()
*
return 0;
}
-
/*
* dgap_set_termios()
*/
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
-
static void dgap_tty_throttle(struct tty_struct *tty)
{
struct board_t *bd;
}
-
static void dgap_tty_unthrottle(struct tty_struct *tty)
{
struct board_t *bd;
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
-
static void dgap_tty_start(struct tty_struct *tty)
{
struct board_t *bd;
}
-
static void dgap_tty_stop(struct tty_struct *tty)
{
struct board_t *bd;
}
-
/*
* dgap_tty_flush_chars()
*
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
-
-
/*
* dgap_tty_flush_buffer()
*
tty_wakeup(tty);
}
-
-
/*****************************************************************************
*
* The IOCTL function and all of its helpers
return 0;
-
case TCSBRKP:
/* support for POSIX tcsendbreak()
if ((arg == TCOFLUSH) || (arg == TCIOFLUSH)) {
ch->ch_flags &= ~CH_STOP;
head = readw(&(ch->ch_bs->tx_head));
- dgap_cmdw(ch, FLUSHTX, (u16) head, 0 );
+ dgap_cmdw(ch, FLUSHTX, (u16) head, 0);
dgap_cmdw(ch, RESUMETX, 0, 0);
if (ch->ch_tun.un_flags & (UN_LOW|UN_EMPTY)) {
ch->ch_tun.un_flags &= ~(UN_LOW|UN_EMPTY);
return 0;
}
-
-
/*
* Create pr and tty device entries
*/
return 0;
}
-
/*
* Copies the BIOS code from the user to the board,
* and starts the BIOS running.
writeb(FEPCLR, brd->re_map_port);
}
-
/*
* Checks to see if the BIOS completed running on the card.
*/
brd->dpastatus = BD_NOBIOS;
}
-
/*
* Copies the FEP code from the user to the board,
* and starts the FEP running.
}
-
/*
* Waits for the FEP to report thats its ready for us to use.
*/
brd->dpastatus = BD_NOFEP;
}
-
/*
* Physically forces the FEP5 card to reset itself.
*/
brd->state = FINISHED_RESET;
}
-
#ifdef DIGI_CONCENTRATORS_SUPPORTED
/*
* Sends a concentrator image into the FEP5 board.
pci_write_config_dword(brd->pdev, PCI_ROM_ADDRESS, magic);
}
-
/*
* Our board poller function.
*/
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
-
/*=======================================================================
*
* dgap_cmdb - Sends a 2 byte command to the FEP.
}
}
-
/*=======================================================================
*
* dgap_cmdw - Sends a 1 word command to the FEP.
}
}
-
-
/*=======================================================================
*
* dgap_cmdw_ext - Sends a extended word command to the FEP.
}
}
-
/*=======================================================================
*
* dgap_wmove - Write data to FEP buffer.
return value;
}
-
/*
* Calls the firmware to reset this channel.
*/
ch->ch_hflow = 0;
}
-
/*=======================================================================
*
* dgap_param - Set Digi parameters.
ch->ch_baud_info = baud;
-
/*
* CBAUD has bit position 0x1000 set these days to indicate Linux
* baud rate remap.
if ((ch->ch_digi.digi_flags & DIGI_FAST) || (ch->ch_c_cflag & CBAUDEX))
cflag |= HUPCL;
-
if ((ch->ch_c_cflag & CBAUDEX) && !(ch->ch_digi.digi_flags & DIGI_FAST)) {
/*
* The below code is trying to guarantee that only baud rates
/* Map high speed requests to index into FEP's baud table */
switch (tcflag) {
- case B57600 :
+ case B57600:
baudpart = 1;
break;
#ifdef B76800
- case B76800 :
+ case B76800:
baudpart = 2;
break;
#endif
- case B115200 :
+ case B115200:
baudpart = 3;
break;
- case B230400 :
+ case B230400:
baudpart = 9;
break;
- case B460800 :
+ case B460800:
baudpart = 11;
break;
#ifdef B921600
- case B921600 :
+ case B921600:
baudpart = 12;
break;
#endif
}
if (ch->ch_digi.digi_flags & DIGI_ALTPIN)
- iflag |= IALTPIN ;
+ iflag |= IALTPIN;
if (iflag != ch->ch_fepiflag) {
ch->ch_fepiflag = iflag;
return 0;
}
-
/*
* dgap_parity_scan()
*
*len = count;
}
-
-
-
/*=======================================================================
*
* dgap_event - FEP to host event processing routine.
}
static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, dgap_driver_pollrate_store);
-
static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
{
int rc = 0;
printk(KERN_ERR "DGAP: sysfs driver_create_file failed!\n");
}
-
static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
{
struct device_driver *driverfs = &dgap_driver->driver;
driver_remove_file(driverfs, &driver_attr_state);
}
-
#define DGAP_VERIFY_BOARD(p, bd) \
if (!p) \
return 0; \
if (bd->state != BOARD_READY) \
return 0; \
-
static ssize_t dgap_ports_state_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_state, S_IRUSR, dgap_ports_state_show, NULL);
-
static ssize_t dgap_ports_baud_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_baud, S_IRUSR, dgap_ports_baud_show, NULL);
-
static ssize_t dgap_ports_msignals_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_msignals, S_IRUSR, dgap_ports_msignals_show, NULL);
-
static ssize_t dgap_ports_iflag_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_iflag, S_IRUSR, dgap_ports_iflag_show, NULL);
-
static ssize_t dgap_ports_cflag_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_cflag, S_IRUSR, dgap_ports_cflag_show, NULL);
-
static ssize_t dgap_ports_oflag_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_oflag, S_IRUSR, dgap_ports_oflag_show, NULL);
-
static ssize_t dgap_ports_lflag_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_lflag, S_IRUSR, dgap_ports_lflag_show, NULL);
-
static ssize_t dgap_ports_digi_flag_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgap_ports_digi_flag_show, NULL);
-
static ssize_t dgap_ports_rxcount_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgap_ports_rxcount_show, NULL);
-
static ssize_t dgap_ports_txcount_show(struct device *p, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(ports_txcount, S_IRUSR, dgap_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
*/
printk(KERN_ERR "DGAP: sysfs device_create_file failed!\n");
}
-
/* removes all the sys files created for that port */
static void dgap_remove_ports_sysfiles(struct board_t *bd)
{
device_remove_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
}
-
static ssize_t dgap_tty_state_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(state, S_IRUSR, dgap_tty_state_show, NULL);
-
static ssize_t dgap_tty_baud_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(baud, S_IRUSR, dgap_tty_baud_show, NULL);
-
static ssize_t dgap_tty_msignals_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(msignals, S_IRUSR, dgap_tty_msignals_show, NULL);
-
static ssize_t dgap_tty_iflag_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(iflag, S_IRUSR, dgap_tty_iflag_show, NULL);
-
static ssize_t dgap_tty_cflag_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(cflag, S_IRUSR, dgap_tty_cflag_show, NULL);
-
static ssize_t dgap_tty_oflag_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(oflag, S_IRUSR, dgap_tty_oflag_show, NULL);
-
static ssize_t dgap_tty_lflag_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(lflag, S_IRUSR, dgap_tty_lflag_show, NULL);
-
static ssize_t dgap_tty_digi_flag_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(digi_flag, S_IRUSR, dgap_tty_digi_flag_show, NULL);
-
static ssize_t dgap_tty_rxcount_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(rxcount, S_IRUSR, dgap_tty_rxcount_show, NULL);
-
static ssize_t dgap_tty_txcount_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(txcount, S_IRUSR, dgap_tty_txcount_show, NULL);
-
static ssize_t dgap_tty_name_show(struct device *d, struct device_attribute *attr, char *buf)
{
struct board_t *bd;
}
static DEVICE_ATTR(custom_name, S_IRUSR, dgap_tty_name_show, NULL);
-
static struct attribute *dgap_sysfs_tty_entries[] = {
&dev_attr_state.attr,
&dev_attr_baud.attr,
NULL
};
-
static struct attribute_group dgap_tty_attribute_group = {
.name = NULL,
.attrs = dgap_sysfs_tty_entries,
};
-
-
-
static void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
{
int ret;
}
-
static void dgap_remove_tty_sysfs(struct device *c)
{
sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
p = p->next;
/* file must start with a BEGIN */
- while ( (rc = dgap_gettok(in,p)) != BEGIN ) {
+ while ((rc = dgap_gettok(in, p)) != BEGIN) {
if (rc == 0) {
dgap_err("unexpected EOF");
return -1;
}
}
- for (; ; ) {
- rc = dgap_gettok(in,p);
+ for (; ;) {
+ rc = dgap_gettok(in, p);
if (rc == 0) {
dgap_err("unexpected EOF");
return -1;
case BOARD: /* board info */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(BNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(BNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case TTYN: /* tty name prefix */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(TNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(TNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
p = p->next;
- if ( (s = dgap_getword(in)) == NULL ) {
+ if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpeced end of file");
return -1;
}
- if ( (p->u.ttyname = dgap_savestring(s)) == NULL ) {
+ if ((p->u.ttyname = dgap_savestring(s)) == NULL) {
dgap_err("out of memory");
return -1;
}
case CU: /* cu name prefix */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(CUNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(CUNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
p = p->next;
- if ( (s = dgap_getword(in)) == NULL ) {
+ if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpeced end of file");
return -1;
}
- if ( (p->u.cuname = dgap_savestring(s)) == NULL ) {
+ if ((p->u.cuname = dgap_savestring(s)) == NULL) {
dgap_err("out of memory");
return -1;
}
dgap_err("line not vaild for PC/em");
return -1;
}
- if ( (p->next = dgap_newnode(LNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(LNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
dgap_err("must specify line info before concentrator");
return -1;
}
- if ( (p->next = dgap_newnode(CNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(CNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
return -1;
}
}
- if ( (p->next = dgap_newnode(MNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(MNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case PRINT: /* transparent print name prefix */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(PNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(PNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
p = p->next;
- if ( (s = dgap_getword(in)) == NULL ) {
+ if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpeced end of file");
return -1;
}
- if ( (p->u.printname = dgap_savestring(s)) == NULL ) {
+ if ((p->u.printname = dgap_savestring(s)) == NULL) {
dgap_err("out of memory");
return -1;
}
case CMAJOR: /* major number */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(JNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(JNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case ALTPIN: /* altpin setting */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(ANODE)) == NULL ) {
+ if ((p->next = dgap_newnode(ANODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case USEINTR: /* enable interrupt setting */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(INTRNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(INTRNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case TTSIZ: /* size of tty structure */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(TSNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(TSNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case CHSIZ: /* channel structure size */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(CSNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(CSNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case BSSIZ: /* board structure size */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(BSNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(BSNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case UNTSIZ: /* sched structure size */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(USNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(USNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case F2SIZ: /* f2200 structure size */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(FSNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(FSNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
case VPSIZ: /* vpix structure size */
if (dgap_checknode(p))
return -1;
- if ( (p->next = dgap_newnode(VSNODE)) == NULL ) {
+ if ((p->next = dgap_newnode(VSNODE)) == NULL) {
dgap_err("out of memory");
return -1;
}
}
}
-
/*
* dgap_sindex: much like index(), but it looks for a match of any character in
* the group, and returns that position. If the first character is a ^, then
return (char *) NULL;
}
-
/*
* Get a token from the input file; return 0 if end of file is reached
*/
w = dgap_getword(in);
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
- if ( !strcmp(w, t->string))
+ if (!strcmp(w, t->string))
return t->token;
}
dgap_err("board !!type not specified");
while ( (w = dgap_getword(in)) != NULL ) {
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
- if ( !strcmp(w, t->string) )
+ if (!strcmp(w, t->string))
return t->token;
}
}
}
}
-
/*
* get a word from the input stream, also keep track of current line number.
* words are separated by whitespace.
return ret_ptr;
}
-
/*
* print an error message, giving the line number in the file where
* the error occurred.
printk("DGAP: parse: %s\n", s);
}
-
/*
* allocate a new configuration node of type t
*/
return n;
}
-
/*
* dgap_checknode: see if all the necessary info has been supplied for a node
* before creating the next node.
return p;
}
-
/*
* Given a board pointer, returns whether we should use interrupts or not.
*/
return 0;
}
-
/*
* Given a board pointer, returns whether we turn on altpin or not.
*/
return 0;
}
-
-
/*
* Given a specific type of board, if found, detached link and
* returns the first occurrence in the list.
*/
speed = p->u.conc.speed;
q = p->next;
- if ((q != NULL) && (q->type == MNODE) ) {
+ if ((q != NULL) && (q->type == MNODE)) {
*ptr = (p->u.conc.nport + 0x80);
ptr++;
p = q;