<commit_before>/*
 *  linux/drivers/s390/net/lcs.c
 *
 *  Linux for S/390 Lan Channel Station Network Driver
 *
 *  Copyright (C)  1999-2001 IBM Deutschland Entwicklung GmbH,
 *			     IBM Corporation
 *    Author(s): Original Code written by
 *			  <NAME> (<EMAIL>,<EMAIL>)
 *		 Rewritten by
 *			  <NAME> (<EMAIL>) and
 *		 	  <NAME> <<EMAIL>>
 *
 * 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, 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.
 */

#include <linux/module.h>
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/trdevice.h>
#include <linux/fddidevice.h>
#include <linux/inetdevice.h>
#include <linux/in.h>
#include <linux/igmp.h>
#include <linux/delay.h>
#include <net/arp.h>
#include <net/ip.h>

#include <asm/debug.h>
#include <asm/idals.h>
#include <asm/timex.h>
#include <linux/device.h>
#include <asm/ccwgroup.h>

#include "lcs.h"
#include "cu3088.h"


#if !defined(CONFIG_NET_ETHERNET) && \
    !defined(CONFIG_TR) && !defined(CONFIG_FDDI)
#error Cannot compile lcs.c without some net devices switched on.
#endif

#define PRINTK_HEADER		" lcs: "

/**
 * initialization string for output
 */

static char version[] __initdata = "LCS driver";
static char debug_buffer[255];

/**
 * Some prototypes.
 */
static void lcs_tasklet(unsigned long);
static void lcs_start_kernel_thread(struct work_struct *);
static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *);
static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *);
static int lcs_recovery(void *ptr);

/**
 * Debug Facility Stuff
 */
static debug_info_t *lcs_dbf_setup;
static debug_info_t *lcs_dbf_trace;

/**
 *  LCS Debug Facility functions
 */
static void
lcs_unregister_debug_facility(void)
{
	if (lcs_dbf_setup)
		debug_unregister(lcs_dbf_setup);
	if (lcs_dbf_trace)
		debug_unregister(lcs_dbf_trace);
}

static int
lcs_register_debug_facility(void)
{
	lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8);
	lcs_dbf_trace = debug_register("lcs_trace", 2, 2, 8);
	if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) {
		PRINT_ERR("Not enough memory for debug facility.\n");
		lcs_unregister_debug_facility();
		return -ENOMEM;
	}
	debug_register_view(lcs_dbf_setup, &debug_hex_ascii_view);
	debug_set_level(lcs_dbf_setup, 2);
	debug_register_view(lcs_dbf_trace, &debug_hex_ascii_view);
	debug_set_level(lcs_dbf_trace, 2);
	return 0;
}

/**
 * Allocate io buffers.
 */
static int<commit_msg>lcs: avoid/reduce unused s390dbf debug areas.<commit_after>/*
 *  linux/drivers/s390/net/lcs.c
 *
 *  Linux for S/390 Lan Channel Station Network Driver
 *
 *  Copyright (C)  1999-2001 IBM Deutschland Entwicklung GmbH,
 *			     IBM Corporation
 *    Author(s): Original Code written by
 *			  <NAME> (<EMAIL>,<EMAIL>)
 *		 Rewritten by
 *			  <NAME> (<EMAIL>) and
 *		 	  <NAME> <<EMAIL>>
 *
 * 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, 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.
 */

#include <linux/module.h>
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/trdevice.h>
#include <linux/fddidevice.h>
#include <linux/inetdevice.h>
#include <linux/in.h>
#include <linux/igmp.h>
#include <linux/delay.h>
#include <net/arp.h>
#include <net/ip.h>

#include <asm/debug.h>
#include <asm/idals.h>
#include <asm/timex.h>
#include <linux/device.h>
#include <asm/ccwgroup.h>

#include "lcs.h"
#include "cu3088.h"


#if !defined(CONFIG_NET_ETHERNET) && \
    !defined(CONFIG_TR) && !defined(CONFIG_FDDI)
#error Cannot compile lcs.c without some net devices switched on.
#endif

#define PRINTK_HEADER		" lcs: "

/**
 * initialization string for output
 */

static char version[] __initdata = "LCS driver";
static char debug_buffer[255];

/**
 * Some prototypes.
 */
static void lcs_tasklet(unsigned long);
static void lcs_start_kernel_thread(struct work_struct *);
static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *);
static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *);
static int lcs_recovery(void *ptr);

/**
 * Debug Facility Stuff
 */
static debug_info_t *lcs_dbf_setup;
static debug_info_t *lcs_dbf_trace;

/**
 *  LCS Debug Facility functions
 */
static void
lcs_unregister_debug_facility(void)
{
	if (lcs_dbf_setup)
		debug_unregister(lcs_dbf_setup);
	if (lcs_dbf_trace)
		debug_unregister(lcs_dbf_trace);
}

static int
lcs_register_debug_facility(void)
{
	lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8);
	lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8);
	if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) {
		PRINT_ERR("Not enough memory for debug facility.\n");
		lcs_unregister_debug_facility();
		return -ENOMEM;
	}
	debug_register_view(lcs_dbf_setup, &debug_hex_ascii_view);
	debug_set_level(lcs_dbf_setup, 2);
	debug_register_view(lcs_dbf_trace, &debug_hex_ascii_view);
	debug_set_level(lcs_dbf_trace, 2);
	return 0;
}

/**
 * Allocate io buffers.
 */
static int
{'fraction_non_alphanumeric': 0.11448751642575558, 'fraction_numerical': 0.013304862023653089, 'mean_word_length': 4.627541589648798, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, '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': '7449350', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2150, 'n_words': 606}