cregit-Linux how code gets into the kernel

Release 4.14 drivers/isdn/hardware/eicon/capimain.c

/* $Id: capimain.c,v 1.24 2003/09/09 06:51:05 schindler Exp $
 *
 * ISDN interface module for Eicon active cards DIVA.
 * CAPI Interface
 *
 * Copyright 2000-2003 by Armin Schindler (mac@melware.de)
 * Copyright 2000-2003 Cytronics & Melware (info@melware.de)
 *
 * This software may be used and distributed according to the terms
 * of the GNU General Public License, incorporated herein by reference.
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/seq_file.h>
#include <linux/skbuff.h>

#include "os_capi.h"

#include "platform.h"
#include "di_defs.h"
#include "capi20.h"
#include "divacapi.h"
#include "cp_vers.h"
#include "capifunc.h"


static char *main_revision = "$Revision: 1.24 $";

static char *DRIVERNAME =
	"Eicon DIVA - CAPI Interface driver (http://www.melware.net)";

static char *DRIVERLNAME = "divacapi";

MODULE_DESCRIPTION("CAPI driver for Eicon DIVA cards");
MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
MODULE_SUPPORTED_DEVICE("CAPI and DIVA card drivers");
MODULE_LICENSE("GPL");

/*
 * get revision number from revision string
 */

static char *getrev(const char *revision) { char *rev; char *p; if ((p = strchr(revision, ':'))) { rev = p + 2; p = strchr(rev, '$'); *--p = 0; } else rev = "1.0"; return rev; }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler64100.00%1100.00%
Total64100.00%1100.00%

/* * alloc a message buffer */
diva_os_message_buffer_s *diva_os_alloc_message_buffer(unsigned long size, void **data_buf) { diva_os_message_buffer_s *dmb = alloc_skb(size, GFP_ATOMIC); if (dmb) { *data_buf = skb_put(dmb, size); } return (dmb); }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler47100.00%1100.00%
Total47100.00%1100.00%

/* * free a message buffer */
void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb) { kfree_skb(dmb); }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler14100.00%1100.00%
Total14100.00%1100.00%

/* * proc function for controller info */
static int diva_ctl_proc_show(struct seq_file *m, void *v) { struct capi_ctr *ctrl = m->private; diva_card *card = (diva_card *) ctrl->driverdata; seq_printf(m, "%s\n", ctrl->name); seq_printf(m, "Serial No. : %s\n", ctrl->serial); seq_printf(m, "Id : %d\n", card->Id); seq_printf(m, "Channels : %d\n", card->d.channels); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler6374.12%150.00%
Alexey Dobriyan2225.88%150.00%
Total85100.00%2100.00%


static int diva_ctl_proc_open(struct inode *inode, struct file *file) { return single_open(file, diva_ctl_proc_show, NULL); }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan2388.46%150.00%
Armin Schindler311.54%150.00%
Total26100.00%2100.00%

static const struct file_operations diva_ctl_proc_fops = { .owner = THIS_MODULE, .open = diva_ctl_proc_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; /* * set additional os settings in capi_ctr struct */
void diva_os_set_controller_struct(struct capi_ctr *ctrl) { ctrl->driver_name = DRIVERLNAME; ctrl->load_firmware = NULL; ctrl->reset_ctr = NULL; ctrl->proc_fops = &diva_ctl_proc_fops; ctrl->owner = THIS_MODULE; }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler3278.05%125.00%
David S. Miller49.76%125.00%
Alexey Dobriyan37.32%125.00%
Al Viro24.88%125.00%
Total41100.00%4100.00%

/* * module init */
static int __init divacapi_init(void) { char tmprev[32]; int ret = 0; sprintf(DRIVERRELEASE_CAPI, "%d.%d%s", DRRELMAJOR, DRRELMINOR, DRRELEXTRA); printk(KERN_INFO "%s\n", DRIVERNAME); printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE_CAPI); strcpy(tmprev, main_revision); printk("%s Build: %s(%s)\n", getrev(tmprev), diva_capi_common_code_build, DIVA_BUILD); if (!(init_capifunc())) { printk(KERN_ERR "%s: failed init capi_driver.\n", DRIVERLNAME); ret = -EIO; } return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler9798.98%266.67%
H Hartley Sweeten11.02%133.33%
Total98100.00%3100.00%

/* * module exit */
static void __exit divacapi_exit(void) { finit_capifunc(); printk(KERN_INFO "%s: module unloaded.\n", DRIVERLNAME); }

Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler1995.00%150.00%
H Hartley Sweeten15.00%150.00%
Total20100.00%2100.00%

module_init(divacapi_init); module_exit(divacapi_exit);

Overall Contributors

PersonTokensPropCommitsCommitProp
Armin Schindler42981.56%222.22%
Alexey Dobriyan8415.97%111.11%
David S. Miller40.76%111.11%
Tejun Heo30.57%111.11%
H Hartley Sweeten20.38%111.11%
Al Viro20.38%111.11%
Linus Torvalds10.19%111.11%
Joe Perches10.19%111.11%
Kai Germaschewski0.00%00.00%
Total526100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.