-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);
/* 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_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);
static uint dgap_config_get_useintr(struct board_t *bd);
static uint dgap_config_get_altpin(struct board_t *bd);
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);
-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 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;
-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 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 char *dgap_driver_state_text[] = {
"Driver Initialized",
"Driver needs configuration load.",
static char *dgap_driver_state_text[] = {
"Driver Initialized",
"Driver needs configuration load.",
/* returns count (>= 0), or negative on error */
static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
/* returns count (>= 0), or negative on error */
static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
static int dgap_probe1(struct pci_dev *pdev, int card_type)
{
return dgap_found_board(pdev, card_type);
}
static int dgap_probe1(struct pci_dev *pdev, int card_type)
{
return dgap_found_board(pdev, card_type);
}
DGAP_UNLOCK(dgap_poll_lock, lock_flags);
/* Turn off poller right away. */
DGAP_UNLOCK(dgap_poll_lock, lock_flags);
/* Turn off poller right away. */
/* make a temporary message buffer for the boot messages */
brd->msgbuf = brd->msgbuf_head =
(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
/* make a temporary message buffer for the boot messages */
brd->msgbuf = brd->msgbuf_head =
(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
/*
* Do not start the board state machine until
* driver tells us its up and running, and has
/*
* 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.
*/
* Otherwise, use our new tasklet based poller, which should
* speed things up for multiple boards.
*/
dgap_poll_timer.function = dgap_poll_handler;
dgap_poll_timer.data = 0;
dgap_poll_timer.expires = dgap_poll_time;
dgap_poll_timer.function = dgap_poll_handler;
dgap_poll_timer.data = 0;
dgap_poll_timer.expires = dgap_poll_time;
/************************************************************************
*
* TTY Initialization/Cleanup Functions
/************************************************************************
*
* TTY Initialization/Cleanup Functions
/*=======================================================================
*
* dgap_input - Process received data.
/*=======================================================================
*
* dgap_input - Process received data.
/************************************************************************
* Determines when CARRIER changes state and takes appropriate
* action.
/************************************************************************
* Determines when CARRIER changes state and takes appropriate
* action.
/************************************************************************
*
* TTY Entry points and helper functions
/************************************************************************
*
* TTY Entry points and helper functions
- dgap_cmdb( ch, SMODEM, 0, D_DTR(ch)|D_RTS(ch), 0 );
+ dgap_cmdb(ch, SMODEM, 0, D_DTR(ch)|D_RTS(ch), 0);
dgap_wmove(ch, ch->ch_digi.digi_offstr,
(int) ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
dgap_wmove(ch, ch->ch_digi.digi_offstr,
(int) ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
static inline void dgap_set_firmware_event(struct un_t *un, unsigned int event)
{
struct channel_t *ch = NULL;
static inline void dgap_set_firmware_event(struct un_t *un, unsigned int event)
{
struct channel_t *ch = NULL;
static int dgap_tty_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
static int dgap_tty_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
/*****************************************************************************
*
* The IOCTL function and all of its helpers
/*****************************************************************************
*
* The IOCTL function and all of its helpers
if ((arg == TCOFLUSH) || (arg == TCIOFLUSH)) {
ch->ch_flags &= ~CH_STOP;
head = readw(&(ch->ch_bs->tx_head));
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);
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);
/*
* Copies the BIOS code from the user to the board,
* and starts the BIOS running.
/*
* Copies the BIOS code from the user to the board,
* and starts the BIOS running.
/*
* Copies the FEP code from the user to the board,
* and starts the FEP running.
/*
* Copies the FEP code from the user to the board,
* and starts the FEP running.
/*=======================================================================
*
* dgap_cmdb - Sends a 2 byte command to the FEP.
/*=======================================================================
*
* dgap_cmdb - Sends a 2 byte command to the FEP.
/*=======================================================================
*
* dgap_cmdw - Sends a 1 word 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_cmdw_ext - Sends a extended word command to the FEP.
/*=======================================================================
*
* dgap_wmove - Write data to FEP buffer.
/*=======================================================================
*
* dgap_wmove - Write data to FEP buffer.
/*=======================================================================
*
* dgap_param - Set Digi parameters.
/*=======================================================================
*
* dgap_param - Set Digi parameters.
if ((ch->ch_c_cflag & CBAUDEX) && !(ch->ch_digi.digi_flags & DIGI_FAST)) {
/*
* The below code is trying to guarantee that only baud rates
if ((ch->ch_c_cflag & CBAUDEX) && !(ch->ch_digi.digi_flags & DIGI_FAST)) {
/*
* The below code is trying to guarantee that only baud rates
/*=======================================================================
*
* dgap_event - FEP to host event processing routine.
/*=======================================================================
*
* 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 DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, dgap_driver_pollrate_store);
static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
{
struct device_driver *driverfs = &dgap_driver->driver;
static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
{
struct device_driver *driverfs = &dgap_driver->driver;
}
static DEVICE_ATTR(ports_state, S_IRUSR, dgap_ports_state_show, NULL);
}
static DEVICE_ATTR(ports_state, S_IRUSR, dgap_ports_state_show, NULL);
}
static DEVICE_ATTR(ports_baud, S_IRUSR, dgap_ports_baud_show, NULL);
}
static DEVICE_ATTR(ports_baud, S_IRUSR, dgap_ports_baud_show, NULL);
}
static DEVICE_ATTR(ports_msignals, S_IRUSR, dgap_ports_msignals_show, NULL);
}
static DEVICE_ATTR(ports_msignals, S_IRUSR, dgap_ports_msignals_show, NULL);
}
static DEVICE_ATTR(ports_iflag, S_IRUSR, dgap_ports_iflag_show, NULL);
}
static DEVICE_ATTR(ports_iflag, S_IRUSR, dgap_ports_iflag_show, NULL);
}
static DEVICE_ATTR(ports_cflag, S_IRUSR, dgap_ports_cflag_show, NULL);
}
static DEVICE_ATTR(ports_cflag, S_IRUSR, dgap_ports_cflag_show, NULL);
}
static DEVICE_ATTR(ports_oflag, S_IRUSR, dgap_ports_oflag_show, NULL);
}
static DEVICE_ATTR(ports_oflag, S_IRUSR, dgap_ports_oflag_show, NULL);
}
static DEVICE_ATTR(ports_lflag, S_IRUSR, dgap_ports_lflag_show, NULL);
}
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 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 DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgap_ports_digi_flag_show, NULL);
}
static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgap_ports_rxcount_show, NULL);
}
static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgap_ports_rxcount_show, NULL);
}
static DEVICE_ATTR(ports_txcount, S_IRUSR, dgap_ports_txcount_show, NULL);
}
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
*/
/* this function creates the sys files that will export each signal status
* to sysfs each value will be put in a separate filename
*/
/* removes all the sys files created for that port */
static void dgap_remove_ports_sysfiles(struct board_t *bd)
{
/* removes all the sys files created for that port */
static void dgap_remove_ports_sysfiles(struct board_t *bd)
{
}
static DEVICE_ATTR(state, S_IRUSR, dgap_tty_state_show, NULL);
}
static DEVICE_ATTR(state, S_IRUSR, dgap_tty_state_show, NULL);
}
static DEVICE_ATTR(baud, S_IRUSR, dgap_tty_baud_show, NULL);
}
static DEVICE_ATTR(baud, S_IRUSR, dgap_tty_baud_show, NULL);
}
static DEVICE_ATTR(msignals, S_IRUSR, dgap_tty_msignals_show, NULL);
}
static DEVICE_ATTR(msignals, S_IRUSR, dgap_tty_msignals_show, NULL);
}
static DEVICE_ATTR(iflag, S_IRUSR, dgap_tty_iflag_show, NULL);
}
static DEVICE_ATTR(iflag, S_IRUSR, dgap_tty_iflag_show, NULL);
}
static DEVICE_ATTR(cflag, S_IRUSR, dgap_tty_cflag_show, NULL);
}
static DEVICE_ATTR(cflag, S_IRUSR, dgap_tty_cflag_show, NULL);
}
static DEVICE_ATTR(oflag, S_IRUSR, dgap_tty_oflag_show, NULL);
}
static DEVICE_ATTR(oflag, S_IRUSR, dgap_tty_oflag_show, NULL);
}
static DEVICE_ATTR(lflag, S_IRUSR, dgap_tty_lflag_show, NULL);
}
static DEVICE_ATTR(lflag, S_IRUSR, dgap_tty_lflag_show, NULL);
}
static DEVICE_ATTR(digi_flag, S_IRUSR, dgap_tty_digi_flag_show, NULL);
}
static DEVICE_ATTR(digi_flag, S_IRUSR, dgap_tty_digi_flag_show, NULL);
}
static DEVICE_ATTR(rxcount, S_IRUSR, dgap_tty_rxcount_show, NULL);
}
static DEVICE_ATTR(rxcount, S_IRUSR, dgap_tty_rxcount_show, NULL);
}
static DEVICE_ATTR(txcount, S_IRUSR, dgap_tty_txcount_show, NULL);
}
static DEVICE_ATTR(txcount, S_IRUSR, dgap_tty_txcount_show, NULL);
}
static DEVICE_ATTR(custom_name, S_IRUSR, dgap_tty_name_show, NULL);
}
static DEVICE_ATTR(custom_name, S_IRUSR, dgap_tty_name_show, NULL);
static struct attribute_group dgap_tty_attribute_group = {
.name = NULL,
.attrs = dgap_sysfs_tty_entries,
};
static struct attribute_group dgap_tty_attribute_group = {
.name = NULL,
.attrs = dgap_sysfs_tty_entries,
};
static void dgap_remove_tty_sysfs(struct device *c)
{
sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
static void dgap_remove_tty_sysfs(struct device *c)
{
sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
/*
* 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
/*
* 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
w = dgap_getword(in);
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
w = dgap_getword(in);
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
while ( (w = dgap_getword(in)) != NULL ) {
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
while ( (w = dgap_getword(in)) != NULL ) {
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
/*
* get a word from the input stream, also keep track of current line number.
* words are separated by whitespace.
/*
* get a word from the input stream, also keep track of current line number.
* words are separated by whitespace.
/*
* dgap_checknode: see if all the necessary info has been supplied for a node
* before creating the next node.
/*
* dgap_checknode: see if all the necessary info has been supplied for a node
* before creating the next node.
/*
* Given a specific type of board, if found, detached link and
* returns the first occurrence in the list.
/*
* Given a specific type of board, if found, detached link and
* returns the first occurrence in the list.