static int __init hysdn_init(void) { char tmp[50]; strcpy(tmp, hysdn_init_revision); printk(KERN_NOTICE "HYSDN: module Rev: %s loaded\n", hysdn_getrev(tmp)); strcpy(tmp, hysdn_net_revision); printk(KERN_NOTICE "HYSDN: network interface Rev: %s \n", hysdn_getrev(tmp)); search_cards(); printk(KERN_INFO "HYSDN: %d card(s) found.\n", cardmax); if (hysdn_procconf_init()) { free_resources(); /* proc file_sys not created */ return (-1); } #ifdef CONFIG_HYSDN_CAPI if(cardmax > 0) { if(hycapi_init()) { printk(KERN_ERR "HYCAPI: init failed\n"); return(-1); } } #endif /* CONFIG_HYSDN_CAPI */ return (0); /* no error */ } /* init_module */
int hysdn_procconf_init(void) { hysdn_card *card; unsigned char conf_name[20]; hysdn_proc_entry = proc_mkdir(PROC_SUBDIR_NAME, init_net.proc_net); if (!hysdn_proc_entry) { printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n"); return (-1); } card = card_root; /* point to first card */ while (card) { sprintf(conf_name, "%s%d", PROC_CONF_BASENAME, card->myid); if ((card->procconf = (void *) proc_create(conf_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry, &conf_fops)) != NULL) { hysdn_proclog_init(card); /* init the log file entry */ } card = card->next; /* next entry */ } printk(KERN_NOTICE "HYSDN: procfs Rev. %s initialised\n", hysdn_getrev(hysdn_procconf_revision)); return (0); } /* hysdn_procconf_init */
int hysdn_procconf_init(void) { hysdn_card *card; uchar conf_name[20]; hysdn_proc_entry = create_proc_entry(PROC_SUBDIR_NAME, S_IFDIR | S_IRUGO | S_IXUGO, proc_net); if (!hysdn_proc_entry) { printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n"); return (-1); } card = card_root; /* point to first card */ while (card) { sprintf(conf_name, "%s%d", PROC_CONF_BASENAME, card->myid); if ((card->procconf = (void *) create_proc_entry(conf_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops; ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE; hysdn_proclog_init(card); /* init the log file entry */ } card = card->next; /* next entry */ } printk(KERN_NOTICE "HYSDN: procfs Rev. %s initialised\n", hysdn_getrev(hysdn_procconf_revision)); return (0); } /* hysdn_procconf_init */
static int __init hysdn_init(void) { char tmp[50]; int rc; strcpy(tmp, hysdn_init_revision); printk(KERN_NOTICE "HYSDN: module Rev: %s loaded\n", hysdn_getrev(tmp)); strcpy(tmp, hysdn_net_revision); printk(KERN_NOTICE "HYSDN: network interface Rev: %s \n", hysdn_getrev(tmp)); rc = pci_register_driver(&hysdn_pci_driver); if (rc) return rc; printk(KERN_INFO "HYSDN: %d card(s) found.\n", cardmax); if (!hysdn_procconf_init()) hysdn_have_procfs = 1; #ifdef CONFIG_HYSDN_CAPI if(cardmax > 0) { if(hycapi_init()) { printk(KERN_ERR "HYCAPI: init failed\n"); if (hysdn_have_procfs) hysdn_procconf_release(); pci_unregister_driver(&hysdn_pci_driver); return -ESPIPE; } } #endif /* CONFIG_HYSDN_CAPI */ return 0; /* no error */ } /* init_module */
int hysdn_procconf_init(void) { hysdn_card *card; uchar conf_name[20]; hysdn_proc_entry = create_proc_entry(PROC_SUBDIR_NAME, S_IFDIR | S_IRUGO | S_IXUGO, proc_net); if (!hysdn_proc_entry) { printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n"); return (-1); } card = card_root; /* point to first card */ while (card) { sprintf(conf_name, "%s%d", PROC_CONF_BASENAME, card->myid); if ((card->procconf = (void *) create_proc_entry(conf_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { #ifdef COMPAT_NO_SOFTNET memset(&conf_inode_operations, 0, sizeof(struct inode_operations)); conf_inode_operations.default_file_ops = &conf_fops; ((struct proc_dir_entry *) card->procconf)->ops = &conf_inode_operations; #else ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops; #ifdef COMPAT_HAS_FILEOP_OWNER ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE; #endif #endif hysdn_proclog_init(card); /* init the log file entry */ } card = card->next; /* next entry */ } printk(KERN_NOTICE "HYSDN: procfs Rev. %s initialised\n", hysdn_getrev(hysdn_procconf_revision)); return (0); } /* hysdn_procconf_init */