linux/drivers/isdn/hardware/mISDN/hfcpci.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 * hfcpci.c     low level driver for CCD's hfc-pci based cards
 *
 * Author     Werner Cornelius ([email protected])
 *            based on existing driver for CCD hfc ISA cards
 *            type approval valid for HFC-S PCI A based card
 *
 * Copyright 1999  by Werner Cornelius ([email protected])
 * Copyright 2008  by Karsten Keil <[email protected]>
 *
 * Module options:
 *
 * debug:
 *	NOTE: only one poll value must be given for all cards
 *	See hfc_pci.h for debug flags.
 *
 * poll:
 *	NOTE: only one poll value must be given for all cards
 *	Give the number of samples for each fifo process.
 *	By default 128 is used. Decrease to reduce delay, increase to
 *	reduce cpu load. If unsure, don't mess with it!
 *	A value of 128 will use controller's interrupt. Other values will
 *	use kernel timer, because the controller will not allow lower values
 *	than 128.
 *	Also note that the value depends on the kernel timer frequency.
 *	If kernel uses a frequency of 1000 Hz, steps of 8 samples are possible.
 *	If the kernel uses 100 Hz, steps of 80 samples are possible.
 *	If the kernel uses 300 Hz, steps of about 26 samples are possible.
 */

#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/mISDNhw.h>
#include <linux/slab.h>

#include "hfc_pci.h"

static const char *hfcpci_revision =;

static int HFC_cnt;
static uint debug;
static uint poll, tics;
static struct timer_list hfc_tl;
static unsigned long hfc_jiffies;

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
module_param(debug, uint, S_IRUGO | S_IWUSR);
module_param(poll, uint, S_IRUGO | S_IWUSR);

enum {};

struct hfcPCI_hw {};

#define HFC_CFG_MASTER
#define HFC_CFG_SLAVE
#define HFC_CFG_PCM
#define HFC_CFG_2HFC
#define HFC_CFG_SLAVEHFC
#define HFC_CFG_NEG_F0
#define HFC_CFG_SW_DD_DU

#define FLG_HFC_TIMER_T1
#define FLG_HFC_TIMER_T3

#define NT_T1_COUNT
#define NT_T3_COUNT
#define CLKDEL_TE
#define CLKDEL_NT


struct hfc_pci {};

/* Interface functions */
static void
enable_hwirq(struct hfc_pci *hc)
{}

static void
disable_hwirq(struct hfc_pci *hc)
{}

/*
 * free hardware resources used by driver
 */
static void
release_io_hfcpci(struct hfc_pci *hc)
{}

/*
 * set mode (NT or TE)
 */
static void
hfcpci_setmode(struct hfc_pci *hc)
{}

/*
 * function called to reset the HFC PCI chip. A complete software reset of chip
 * and fifos is done.
 */
static void
reset_hfcpci(struct hfc_pci *hc)
{}

/*
 * Timer function called when kernel timer expires
 */
static void
hfcpci_Timer(struct timer_list *t)
{}


/*
 * select a b-channel entry matching and active
 */
static struct bchannel *
Sel_BCS(struct hfc_pci *hc, int channel)
{}

/*
 * clear the desired B-channel rx fifo
 */
static void
hfcpci_clear_fifo_rx(struct hfc_pci *hc, int fifo)
{}

/*
 * clear the desired B-channel tx fifo
 */
static void hfcpci_clear_fifo_tx(struct hfc_pci *hc, int fifo)
{}

/*
 * read a complete B-frame out of the buffer
 */
static void
hfcpci_empty_bfifo(struct bchannel *bch, struct bzfifo *bz,
		   u_char *bdata, int count)
{}

/*
 * D-channel receive procedure
 */
static int
receive_dmsg(struct hfc_pci *hc)
{}

/*
 * check for transparent receive data and read max one 'poll' size if avail
 */
static void
hfcpci_empty_fifo_trans(struct bchannel *bch, struct bzfifo *rxbz,
			struct bzfifo *txbz, u_char *bdata)
{}

/*
 * B-channel main receive routine
 */
static void
main_rec_hfcpci(struct bchannel *bch)
{}

/*
 * D-channel send routine
 */
static void
hfcpci_fill_dfifo(struct hfc_pci *hc)
{}

/*
 * B-channel send routine
 */
static void
hfcpci_fill_fifo(struct bchannel *bch)
{}



/*
 * handle L1 state changes TE
 */

static void
ph_state_te(struct dchannel *dch)
{}

/*
 * handle L1 state changes NT
 */

static void
handle_nt_timer3(struct dchannel *dch) {}

static void
ph_state_nt(struct dchannel *dch)
{}

static void
ph_state(struct dchannel *dch)
{}

/*
 * Layer 1 callback function
 */
static int
hfc_l1callback(struct dchannel *dch, u_int cmd)
{}

/*
 * Interrupt handler
 */
static inline void
tx_birq(struct bchannel *bch)
{}

static inline void
tx_dirq(struct dchannel *dch)
{}

static irqreturn_t
hfcpci_int(int intno, void *dev_id)
{}

/*
 * timer callback for D-chan busy resolution. Currently no function
 */
static void
hfcpci_dbusy_timer(struct timer_list *t)
{}

/*
 * activate/deactivate hardware for selected channels and mode
 */
static int
mode_hfcpci(struct bchannel *bch, int bc, int protocol)
{}

static int
set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)
{}

static void
deactivate_bchannel(struct bchannel *bch)
{}

/*
 * Layer 1 B-channel hardware access
 */
static int
channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq)
{}
static int
hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
{}

/*
 * Layer2 -> Layer 1 Dchannel data
 */
static int
hfcpci_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb)
{}

/*
 * Layer2 -> Layer 1 Bchannel data
 */
static int
hfcpci_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)
{}

/*
 * called for card init message
 */

static void
inithfcpci(struct hfc_pci *hc)
{}


static int
init_card(struct hfc_pci *hc)
{}

static int
channel_ctrl(struct hfc_pci *hc, struct mISDN_ctrl_req *cq)
{}

static int
open_dchannel(struct hfc_pci *hc, struct mISDNchannel *ch,
	      struct channel_req *rq)
{}

static int
open_bchannel(struct hfc_pci *hc, struct channel_req *rq)
{}

/*
 * device control function
 */
static int
hfc_dctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
{}

static int
setup_hw(struct hfc_pci *hc)
{}

static void
release_card(struct hfc_pci *hc) {}

static int
setup_card(struct hfc_pci *card)
{}

/* private data in the PCI devices list */
struct _hfc_map {};

static const struct _hfc_map hfc_map[] =;

static const struct pci_device_id hfc_ids[] =;

static int
hfc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static void
hfc_remove_pci(struct pci_dev *pdev)
{}


static struct pci_driver hfc_driver =;

static int
_hfcpci_softirq(struct device *dev, void *unused)
{}

static void
hfcpci_softirq(struct timer_list *unused)
{}

static int __init
HFC_init(void)
{}

static void __exit
HFC_cleanup(void)
{}

module_init();
module_exit(HFC_cleanup);

MODULE_DEVICE_TABLE(pci, hfc_ids);