<commit_before>/* drivers/char/ser_a2232.c */

/* $Id: ser_a2232.c,v 0.4 2000/01/25 12:00:00 ehaase Exp $ */

/* Linux serial driver for the Amiga A2232 board */

/* This driver is MAINTAINED. Before applying any changes, please contact
 * the author.
 */

/* Copyright (c) 2000-2001 <NAME>    <<EMAIL>>
 *                   alias The A2232 driver project <<EMAIL>>
 * All rights reserved.
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
/***************************** Documentation ************************/
/*
 * This driver is in EXPERIMENTAL state. That means I could not find
 * someone with five A2232 boards with 35 ports running at 19200 bps
 * at the same time and test the machine's behaviour.
 * However, I know that you can performance-tweak this driver (see
 * the source code).
 * One thing to consider is the time this driver consumes during the
 * Amiga's vertical blank interrupt. Everything that is to be done
 * _IS DONE_ when entering the vertical blank interrupt handler of
 * this driver.
 * However, it would be more sane to only do the job for only ONE card
 * instead of ALL cards at a time; or, more generally, to handle only
 * SOME ports instead of ALL ports at a time.
 * However, as long as no-one runs into problems I guess I shouldn't
 * change the driver as it runs fine for me :) .
 *
 * Version history of this file:
 * 0.4	Resolved licensing issues.
 * 0.3	Inclusion in the Linux/m68k tree, small fixes.
 * 0.2	Added documentation, minor typo fixes.
 * 0.1	Initial release.
 *
 * TO DO:
 * -	Handle incoming BREAK events. I guess "Stevens: Advanced
 *	Programming in the UNIX(R) Environment" is a good reference
 *	on what is to be done.
 * -	When installing as a module, don't simply 'printk' text, but
 *	send it to the TTY used by the user.
 *
 * THANKS TO:
 * -	<NAME> (65EC02 code).
 * -	The other NetBSD developers on whose A2232 driver I had a
 *	pretty close look. However, I didn't copy any code so it
 *	is okay to put my code under the GPL and include it into
 *	Linux.
 */
/***************************** End of Documentation *****************/

/***************************** Defines ******************************/
/*
 * Enables experimental 115200 (normal) 230400 (turbo) baud rate.
 * The A2232 specification states it can only operate at speeds up to
 * 19200 bits per second, and I was not able to send a file via
 * "sz"/"rz" and a null-modem cable from one A2232 port to another
 * at 115200 bits per second.
 * However, this might work for you.
 */
#undef A2232_SPEEDHACK
/*
 * Default is not to use RTS/CTS so you could be talked to death.
 */
#define A2232_SUPPRESS_RTSCTS_WARNING
/************************* End of Defines ***************************/

/***************************** Includes *****************************/
#include <linux/module.h>

#include <linux/types.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/tty.h>

#include <asm/setup.h>
#include <asm/amigaints.h>
#include <asm/amigahw.h>
#include <linux/zorro.h>
#include <asm/irq.h>
#include <asm/semaphore.h>

#include <linux/delay.h>

#include <linux/serial.h>
#include <linux/generic_serial.h>

#include "ser_a2232.h"
#include "ser_a2232fw.h"
/************************* End of Includes **************************/

/***************************** Prototypes ***************************/
/* The interrupt service routine */
static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp);
/* Initialize the port structures */
static void a2232_init_portstructs(void);
/* Initialize and register TTY drivers. */
/* returns 0 IFF successful */
static int a2232_init_drivers(void); 

/* BEGIN GENERIC_SERIAL PROTOTYPES */
static void a2232_disable_tx_interrupts(void *ptr);<commit_msg>[PATCH] missing include in ser_a2232<commit_after>/* drivers/char/ser_a2232.c */

/* $Id: ser_a2232.c,v 0.4 2000/01/25 12:00:00 ehaase Exp $ */

/* Linux serial driver for the Amiga A2232 board */

/* This driver is MAINTAINED. Before applying any changes, please contact
 * the author.
 */

/* Copyright (c) 2000-2001 <NAME>    <<EMAIL>>
 *                   alias The A2232 driver project <<EMAIL>>
 * All rights reserved.
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
/***************************** Documentation ************************/
/*
 * This driver is in EXPERIMENTAL state. That means I could not find
 * someone with five A2232 boards with 35 ports running at 19200 bps
 * at the same time and test the machine's behaviour.
 * However, I know that you can performance-tweak this driver (see
 * the source code).
 * One thing to consider is the time this driver consumes during the
 * Amiga's vertical blank interrupt. Everything that is to be done
 * _IS DONE_ when entering the vertical blank interrupt handler of
 * this driver.
 * However, it would be more sane to only do the job for only ONE card
 * instead of ALL cards at a time; or, more generally, to handle only
 * SOME ports instead of ALL ports at a time.
 * However, as long as no-one runs into problems I guess I shouldn't
 * change the driver as it runs fine for me :) .
 *
 * Version history of this file:
 * 0.4	Resolved licensing issues.
 * 0.3	Inclusion in the Linux/m68k tree, small fixes.
 * 0.2	Added documentation, minor typo fixes.
 * 0.1	Initial release.
 *
 * TO DO:
 * -	Handle incoming BREAK events. I guess "Stevens: Advanced
 *	Programming in the UNIX(R) Environment" is a good reference
 *	on what is to be done.
 * -	When installing as a module, don't simply 'printk' text, but
 *	send it to the TTY used by the user.
 *
 * THANKS TO:
 * -	<NAME> (65EC02 code).
 * -	The other NetBSD developers on whose A2232 driver I had a
 *	pretty close look. However, I didn't copy any code so it
 *	is okay to put my code under the GPL and include it into
 *	Linux.
 */
/***************************** End of Documentation *****************/

/***************************** Defines ******************************/
/*
 * Enables experimental 115200 (normal) 230400 (turbo) baud rate.
 * The A2232 specification states it can only operate at speeds up to
 * 19200 bits per second, and I was not able to send a file via
 * "sz"/"rz" and a null-modem cable from one A2232 port to another
 * at 115200 bits per second.
 * However, this might work for you.
 */
#undef A2232_SPEEDHACK
/*
 * Default is not to use RTS/CTS so you could be talked to death.
 */
#define A2232_SUPPRESS_RTSCTS_WARNING
/************************* End of Defines ***************************/

/***************************** Includes *****************************/
#include <linux/module.h>

#include <linux/types.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/tty.h>

#include <asm/setup.h>
#include <asm/amigaints.h>
#include <asm/amigahw.h>
#include <linux/zorro.h>
#include <asm/irq.h>
#include <asm/semaphore.h>

#include <linux/delay.h>

#include <linux/serial.h>
#include <linux/generic_serial.h>
#include <linux/tty_flip.h>

#include "ser_a2232.h"
#include "ser_a2232fw.h"
/************************* End of Includes **************************/

/***************************** Prototypes ***************************/
/* The interrupt service routine */
static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp);
/* Initialize the port structures */
static void a2232_init_portstructs(void);
/* Initialize and register TTY drivers. */
/* returns 0 IFF successful */
static int a2232_init_drivers(void); 

/* BEGIN GENERIC_SERIAL PROTOTYPES */
static void a2232_disable_tx_interrupts(void *ptr);
{'fraction_non_alphanumeric': 0.16513048306496392, 'fraction_numerical': 0.03198223209328151, 'mean_word_length': 3.88659793814433, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 48, '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': '3360898', 'n_tokens_mistral': 2867, 'n_tokens_neox': 2618, 'n_words': 1133}