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);
-int dgap_tty_register(struct board_t *brd);
-int dgap_tty_preinit(void);
-int dgap_tty_init(struct board_t *);
-void dgap_tty_post_uninit(void);
-void dgap_tty_uninit(struct board_t *);
-void dgap_carrier(struct channel_t *ch);
-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 void dgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, uint ncmds);
static int dgap_event(struct board_t *bd);
+static void dgap_poll_tasklet(unsigned long data);
+static void dgap_cmdb(struct channel_t *ch, uchar cmd, uchar byte1, uchar byte2, uint ncmds);
+static void dgap_cmdw(struct channel_t *ch, uchar cmd, u16 word, uint ncmds);
+static void dgap_wmove(struct channel_t *ch, char *buf, uint cnt);
+static int dgap_param(struct tty_struct *tty);
+static void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned char *fbuf, int *len);
+static uint dgap_get_custom_baud(struct channel_t *ch);
+static void dgap_firmware_reset_port(struct channel_t *ch);
+
/*
* Function prototypes from dgap_parse.c.
*/
struct pci_driver;
struct class_device;
-void dgap_create_ports_sysfiles(struct board_t *bd);
-void dgap_remove_ports_sysfiles(struct board_t *bd);
+static void dgap_create_ports_sysfiles(struct board_t *bd);
+static void dgap_remove_ports_sysfiles(struct board_t *bd);
-void dgap_create_driver_sysfiles(struct pci_driver *);
-void dgap_remove_driver_sysfiles(struct pci_driver *);
+static void dgap_create_driver_sysfiles(struct pci_driver *);
+static void dgap_remove_driver_sysfiles(struct pci_driver *);
-int dgap_tty_class_init(void);
-int dgap_tty_class_destroy(void);
+static int dgap_tty_class_init(void);
+static int dgap_tty_class_destroy(void);
-void dgap_create_tty_sysfs(struct un_t *un, struct device *c);
-void dgap_remove_tty_sysfs(struct device *c);
+static void dgap_create_tty_sysfs(struct un_t *un, struct device *c);
+static void dgap_remove_tty_sysfs(struct device *c);
/*
* Function prototypes from dgap_parse.h
*/
-int dgap_parsefile(char **in, int Remove);
-struct cnode *dgap_find_config(int type, int bus, int slot);
-uint dgap_config_get_number_of_ports(struct board_t *bd);
-char *dgap_create_config_string(struct board_t *bd, char *string);
-char *dgap_get_config_letters(struct board_t *bd, char *string);
-uint dgap_config_get_useintr(struct board_t *bd);
-uint dgap_config_get_altpin(struct board_t *bd);
+static int dgap_parsefile(char **in, int Remove);
+static struct cnode *dgap_find_config(int type, int bus, int slot);
+static uint dgap_config_get_number_of_ports(struct board_t *bd);
+static char *dgap_create_config_string(struct board_t *bd, char *string);
+static char *dgap_get_config_letters(struct board_t *bd, char *string);
+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 char *dgap_ioctl_name(int cmd);
+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 void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, int len);
+static void dgap_do_config_load(uchar __user *uaddr, int len);
+static int dgap_after_config_loaded(void);
+static int dgap_finalize_board_init(struct board_t *brd);
+
/* Driver load/unload functions */
int dgap_init_module(void);
/*
* Globals
*/
-uint dgap_NumBoards;
-struct board_t *dgap_Board[MAXBOARDS];
+static uint dgap_NumBoards;
+static struct board_t *dgap_Board[MAXBOARDS];
DEFINE_SPINLOCK(dgap_global_lock);
-ulong dgap_poll_counter;
-char *dgap_config_buf;
-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);
-wait_queue_head_t dgap_dl_wait;
-int dgap_dl_action;
-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 struct board_t *dgap_BoardsByMajor[256];
static uchar *dgap_TmpWriteBuf = NULL;
-static DECLARE_MUTEX(dgap_TmpWriteSem);
+DECLARE_MUTEX(dgap_TmpWriteSem);
static uint dgap_count = 500;
/*
* Poller stuff
*/
-static DEFINE_SPINLOCK(dgap_poll_lock); /* Poll scheduling lock */
+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 struct timer_list dgap_poll_timer;
};
-char *dgap_state_text[] = {
+static char *dgap_state_text[] = {
"Board Failed",
"Configuration for board not found.\n\t\t\tRun mpi to configure board.",
"Board Found",
"Board READY",
};
-char *dgap_driver_state_text[] = {
+static char *dgap_driver_state_text[] = {
"Driver Initialized",
"Driver needs configuration load.",
"Driver requested configuration from download daemon.",
}
-int dgap_finalize_board_init(struct board_t *brd) {
+static int dgap_finalize_board_init(struct board_t *brd) {
int rc;
*
* Returns 0 if timed out, !0 (showing signal) if interrupted by a signal.
*/
-int dgap_ms_sleep(ulong ms)
+static int dgap_ms_sleep(ulong ms)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout((ms * HZ) / 1000);
/*
* dgap_ioctl_name() : Returns a text version of each ioctl value.
*/
-char *dgap_ioctl_name(int cmd)
+static char *dgap_ioctl_name(int cmd)
{
switch(cmd) {
*
* Initialize any global tty related data before we download any boards.
*/
-int dgap_tty_preinit(void)
+static int dgap_tty_preinit(void)
{
unsigned long flags;
*
* Init the tty subsystem for this board.
*/
-int dgap_tty_register(struct board_t *brd)
+static int dgap_tty_register(struct board_t *brd)
{
int rc = 0;
* Init the tty subsystem. Called once per board after board has been
* downloaded and init'ed.
*/
-int dgap_tty_init(struct board_t *brd)
+static int dgap_tty_init(struct board_t *brd)
{
int i;
int tlw;
*
* UnInitialize any global tty related data.
*/
-void dgap_tty_post_uninit(void)
+static void dgap_tty_post_uninit(void)
{
kfree(dgap_TmpWriteBuf);
dgap_TmpWriteBuf = NULL;
* Uninitialize the TTY portion of this driver. Free all memory and
* resources.
*/
-void dgap_tty_uninit(struct board_t *brd)
+static void dgap_tty_uninit(struct board_t *brd)
{
int i = 0;
*
*=======================================================================*/
-void dgap_input(struct channel_t *ch)
+static void dgap_input(struct channel_t *ch)
{
struct board_t *bd;
struct bs_t *bs;
* Determines when CARRIER changes state and takes appropriate
* action.
************************************************************************/
-void dgap_carrier(struct channel_t *ch)
+static void dgap_carrier(struct channel_t *ch)
{
struct board_t *bd;
/*
* Loads the dgap.conf config file from the user.
*/
-void dgap_do_config_load(uchar __user *uaddr, int len)
+static void dgap_do_config_load(uchar __user *uaddr, int len)
{
int orig_len = len;
char *to_addr;
}
-int dgap_after_config_loaded(void)
+static int dgap_after_config_loaded(void)
{
int i = 0;
int rc = 0;
* Copies the BIOS code from the user to the board,
* and starts the BIOS running.
*/
-void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len)
+static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len)
{
uchar *addr;
uint offset;
* Copies the FEP code from the user to the board,
* and starts the FEP running.
*/
-void dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len)
+static void dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len)
{
uchar *addr;
uint offset;
/*
* Sends a concentrator image into the FEP5 board.
*/
-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)
{
char *vaddr;
u16 offset = 0;
/*
* Our board poller function.
*/
-void dgap_poll_tasklet(unsigned long data)
+static void dgap_poll_tasklet(unsigned long data)
{
struct board_t *bd = (struct board_t *) data;
ulong lock_flags;
* in the cmd buffer before returning.
*
*=======================================================================*/
-void dgap_cmdb(struct channel_t *ch, uchar cmd, uchar byte1, uchar byte2, uint ncmds)
+static void dgap_cmdb(struct channel_t *ch, uchar cmd, uchar byte1, uchar byte2, uint ncmds)
{
char *vaddr = NULL;
struct cm_t *cm_addr = NULL;
* in the cmd buffer before returning.
*
*=======================================================================*/
-void dgap_cmdw(struct channel_t *ch, uchar cmd, u16 word, uint ncmds)
+static void dgap_cmdw(struct channel_t *ch, uchar cmd, u16 word, uint ncmds)
{
char *vaddr = NULL;
struct cm_t *cm_addr = NULL;
* cnt - Number of characters to move.
*
*=======================================================================*/
-void dgap_wmove(struct channel_t *ch, char *buf, uint cnt)
+static void dgap_wmove(struct channel_t *ch, char *buf, uint cnt)
{
int n;
char *taddr;
* and returns it back to the user.
* Returns 0 on error.
*/
-uint dgap_get_custom_baud(struct channel_t *ch)
+static uint dgap_get_custom_baud(struct channel_t *ch)
{
uchar *vaddr;
ulong offset = 0;
/*
* Calls the firmware to reset this channel.
*/
-void dgap_firmware_reset_port(struct channel_t *ch)
+static void dgap_firmware_reset_port(struct channel_t *ch)
{
dgap_cmdb(ch, CHRESET, 0, 0, 0);
* struct tty_struct * - TTY for port.
*
*=======================================================================*/
-int dgap_param(struct tty_struct *tty)
+static int dgap_param(struct tty_struct *tty)
{
struct ktermios *ts;
struct board_t *bd;
* Convert the FEP5 way of reporting parity errors and breaks into
* the Linux line discipline way.
*/
-void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned char *fbuf, int *len)
+static void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned char *fbuf, int *len)
{
int l = *len;
int count = 0;
static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, dgap_driver_pollrate_store);
-void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
+static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
{
int rc = 0;
struct device_driver *driverfs = &dgap_driver->driver;
}
-void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
+static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
{
struct device_driver *driverfs = &dgap_driver->driver;
driver_remove_file(driverfs, &driver_attr_version);
/* this function creates the sys files that will export each signal status
* to sysfs each value will be put in a separate filename
*/
-void dgap_create_ports_sysfiles(struct board_t *bd)
+static void dgap_create_ports_sysfiles(struct board_t *bd)
{
int rc = 0;
/* removes all the sys files created for that port */
-void dgap_remove_ports_sysfiles(struct board_t *bd)
+static void dgap_remove_ports_sysfiles(struct board_t *bd)
{
device_remove_file(&(bd->pdev->dev), &dev_attr_ports_state);
device_remove_file(&(bd->pdev->dev), &dev_attr_ports_baud);
-void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
+static void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
{
int ret;
}
-void dgap_remove_tty_sysfs(struct device *c)
+static void dgap_remove_tty_sysfs(struct device *c)
{
sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
}
/*
* Parse a configuration file read into memory as a string.
*/
-int dgap_parsefile(char **in, int Remove)
+static int dgap_parsefile(char **in, int Remove)
{
struct cnode *p, *brd, *line, *conc;
int rc;
/*
* Given a board pointer, returns whether we should use interrupts or not.
*/
-uint dgap_config_get_useintr(struct board_t *bd)
+static uint dgap_config_get_useintr(struct board_t *bd)
{
struct cnode *p = NULL;
/*
* Given a board pointer, returns whether we turn on altpin or not.
*/
-uint dgap_config_get_altpin(struct board_t *bd)
+static uint dgap_config_get_altpin(struct board_t *bd)
{
struct cnode *p = NULL;
* Given a specific type of board, if found, detached link and
* returns the first occurrence in the list.
*/
-struct cnode *dgap_find_config(int type, int bus, int slot)
+static struct cnode *dgap_find_config(int type, int bus, int slot)
{
struct cnode *p, *prev = NULL, *prev2 = NULL, *found = NULL;
* all ports user specified should be on the board.
* (This does NOT mean they are all actually present right now tho)
*/
-uint dgap_config_get_number_of_ports(struct board_t *bd)
+static uint dgap_config_get_number_of_ports(struct board_t *bd)
{
int count = 0;
struct cnode *p = NULL;
return (count);
}
-char *dgap_create_config_string(struct board_t *bd, char *string)
+static char *dgap_create_config_string(struct board_t *bd, char *string)
{
char *ptr = string;
struct cnode *p = NULL;
-char *dgap_get_config_letters(struct board_t *bd, char *string)
+static char *dgap_get_config_letters(struct board_t *bd, char *string)
{
int found = FALSE;
char *ptr = string;