<commit_before>/************************************************************************************************
 * This file is part of SerialPundit.
 * 
 * Copyright (C) 2014-2016, <NAME>. All rights reserved.
 *
 * The SerialPundit is DUAL LICENSED. It is made available under the terms of the GNU Affero 
 * General Public License (AGPL) v3.0 for non-commercial use and under the terms of a commercial 
 * license for commercial use of this software. 
 * 
 * The SerialPundit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 ************************************************************************************************/

/* 
 * Virtual multi-port serial card :
 *
 * This driver implements a virtual multiport serial card in such a way that the virtual card 
 * can have from 0 to N number of virtual serial ports (tty devices). The virtual tty devices created 
 * by this card are used in exactly the same way using termios and Linux/Posix APIs as the real tty 
 * devices.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/sched.h>
#include <linux/version.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
#include <linux/device.h>

/* Module information */
#define DRIVER_VERSION "v1.0"
#define DRIVER_AUTHOR "<NAME>"
#define DRIVER_DESC "Serial port null modem emulation driver !"

/* 
 * Default number of virtual tty ports this driver is going to support. TTY devices are created 
 * on demand. Users can override this value at module load time for example to support 5000 tty 
 * virtual devices :
 * $ insmod ./tty2comKm.ko max_num_vtty_dev=5000
 *
 * Major number is assigned dynamically by kernel for device nodes served by this driver.
 */
#define DEFAULT_VTTY_DEV_MAX  128

/* Pin out configurations definitions */
#define SP_CON_CTS    0x0001
#define SP_CON_DCD    0x0002
#define SP_CON_DSR    0x0004
#define SP_CON_RI     0x0008

/* Modem control register definitions */
#define SP_MCR_DTR    0x0001
#define SP_MCR_RTS    0x0002
#define SP_MCR_LOOP   0x0004

/* Modem status register definitions */
#define SP_MSR_CTS    0x0008
#define SP_MSR_DCD    0x0010
#define SP_MSR_RI     0x0020
#define SP_MSR_DSR    0x0040

/* UART frame structure definitions */
#define SP_CRTSCTS       0x0001
#define SP_XON           0x0002<commit_msg>make null modem kernel log more appropriate<commit_after>/************************************************************************************************
 * This file is part of SerialPundit.
 * 
 * Copyright (C) 2014-2016, <NAME>. All rights reserved.
 *
 * The SerialPundit is DUAL LICENSED. It is made available under the terms of the GNU Affero 
 * General Public License (AGPL) v3.0 for non-commercial use and under the terms of a commercial 
 * license for commercial use of this software. 
 * 
 * The SerialPundit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 ************************************************************************************************/

/* 
 * Virtual multi-port serial card :
 *
 * This driver implements a virtual multiport serial card in such a way that the virtual card 
 * can have from 0 to N number of virtual serial ports (tty devices). The virtual tty devices created 
 * by this card are used in exactly the same way using termios and Linux/Posix APIs as the real tty 
 * devices.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/sched.h>
#include <linux/version.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
#include <linux/device.h>

/* Module information */
#define DRIVER_VERSION "v1.0"
#define DRIVER_AUTHOR "<NAME>"
#define DRIVER_DESC "Serial port null modem emulation driver "

/* 
 * Default number of virtual tty ports this driver is going to support. TTY devices are created 
 * on demand. Users can override this value at module load time for example to support 5000 tty 
 * virtual devices :
 * $ insmod ./tty2comKm.ko max_num_vtty_dev=5000
 *
 * Major number is assigned dynamically by kernel for device nodes served by this driver.
 */
#define DEFAULT_VTTY_DEV_MAX  128

/* Pin out configurations definitions */
#define SP_CON_CTS    0x0001
#define SP_CON_DCD    0x0002
#define SP_CON_DSR    0x0004
#define SP_CON_RI     0x0008

/* Modem control register definitions */
#define SP_MCR_DTR    0x0001
#define SP_MCR_RTS    0x0002
#define SP_MCR_LOOP   0x0004

/* Modem status register definitions */
#define SP_MSR_CTS    0x0008
#define SP_MSR_DCD    0x0010
#define SP_MSR_RI     0x0020
#define SP_MSR_DSR    0x0040

/* UART frame structure definitions */
#define SP_CRTSCTS       0x0001
#define SP_XON           0x0002
{'fraction_non_alphanumeric': 0.14675395526459356, 'fraction_numerical': 0.03273322422258593, 'mean_word_length': 4.283381364073007, 'pattern_counts': {'":': 2, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6326411', 'n_tokens_mistral': 1791, 'n_tokens_neox': 1618, 'n_words': 615}