#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 <asm/unaligned.h>
#include "ipac.h"
#define AVMFRITZ_REV …
static int AVM_cnt;
static int debug;
enum { … };
#define HDLC_FIFO …
#define HDLC_STATUS …
#define CHIP_WINDOW …
#define CHIP_INDEX …
#define AVM_HDLC_1 …
#define AVM_HDLC_2 …
#define AVM_ISAC_FIFO …
#define AVM_ISAC_REG_LOW …
#define AVM_ISAC_REG_HIGH …
#define AVM_STATUS0_IRQ_ISAC …
#define AVM_STATUS0_IRQ_HDLC …
#define AVM_STATUS0_IRQ_TIMER …
#define AVM_STATUS0_IRQ_MASK …
#define AVM_STATUS0_RESET …
#define AVM_STATUS0_DIS_TIMER …
#define AVM_STATUS0_RES_TIMER …
#define AVM_STATUS0_ENA_IRQ …
#define AVM_STATUS0_TESTBIT …
#define AVM_STATUS1_INT_SEL …
#define AVM_STATUS1_ENA_IOM …
#define HDLC_MODE_ITF_FLG …
#define HDLC_MODE_TRANS …
#define HDLC_MODE_CCR_7 …
#define HDLC_MODE_CCR_16 …
#define HDLC_FIFO_SIZE_128 …
#define HDLC_MODE_TESTLOOP …
#define HDLC_INT_XPR …
#define HDLC_INT_XDU …
#define HDLC_INT_RPR …
#define HDLC_INT_MASK …
#define HDLC_STAT_RME …
#define HDLC_STAT_RDO …
#define HDLC_STAT_CRCVFRRAB …
#define HDLC_STAT_CRCVFR …
#define HDLC_STAT_RML_MASK_V1 …
#define HDLC_STAT_RML_MASK_V2 …
#define HDLC_CMD_XRS …
#define HDLC_CMD_XME …
#define HDLC_CMD_RRS …
#define HDLC_CMD_XML_MASK …
#define HDLC_FIFO_SIZE_V1 …
#define HDLC_FIFO_SIZE_V2 …
#define AVM_HDLC_FIFO_1 …
#define AVM_HDLC_FIFO_2 …
#define AVM_HDLC_STATUS_1 …
#define AVM_HDLC_STATUS_2 …
#define AVM_ISACX_INDEX …
#define AVM_ISACX_DATA …
#define LOG_SIZE …
struct hdlc_stat_reg { … } __attribute__((packed));
struct hdlc_hw { … };
struct fritzcard { … };
static LIST_HEAD(Cards);
static DEFINE_RWLOCK(card_lock);
static void
_set_debug(struct fritzcard *card)
{ … }
static int
set_debug(const char *val, const struct kernel_param *kp)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
module_param_call(…);
MODULE_PARM_DESC(…) …;
static u8
ReadISAC_V1(void *p, u8 offset)
{ … }
static void
WriteISAC_V1(void *p, u8 offset, u8 value)
{ … }
static void
ReadFiFoISAC_V1(void *p, u8 off, u8 *data, int size)
{ … }
static void
WriteFiFoISAC_V1(void *p, u8 off, u8 *data, int size)
{ … }
static u8
ReadISAC_V2(void *p, u8 offset)
{ … }
static void
WriteISAC_V2(void *p, u8 offset, u8 value)
{ … }
static void
ReadFiFoISAC_V2(void *p, u8 off, u8 *data, int size)
{ … }
static void
WriteFiFoISAC_V2(void *p, u8 off, u8 *data, int size)
{ … }
static struct bchannel *
Sel_BCS(struct fritzcard *fc, u32 channel)
{ … }
static inline void
__write_ctrl_pci(struct fritzcard *fc, struct hdlc_hw *hdlc, u32 channel) { … }
static inline void
__write_ctrl_pciv2(struct fritzcard *fc, struct hdlc_hw *hdlc, u32 channel) { … }
static void
write_ctrl(struct bchannel *bch, int which) { … }
static inline u32
__read_status_pci(u_long addr, u32 channel)
{ … }
static inline u32
__read_status_pciv2(u_long addr, u32 channel)
{ … }
static u32
read_status(struct fritzcard *fc, u32 channel)
{ … }
static void
enable_hwirq(struct fritzcard *fc)
{ … }
static void
disable_hwirq(struct fritzcard *fc)
{ … }
static int
modehdlc(struct bchannel *bch, int protocol)
{ … }
static void
hdlc_empty_fifo(struct bchannel *bch, int count)
{ … }
static void
hdlc_fill_fifo(struct bchannel *bch)
{ … }
static void
HDLC_irq_xpr(struct bchannel *bch)
{ … }
static void
HDLC_irq(struct bchannel *bch, u32 stat)
{ … }
static inline void
HDLC_irq_main(struct fritzcard *fc)
{ … }
static irqreturn_t
avm_fritz_interrupt(int intno, void *dev_id)
{ … }
static irqreturn_t
avm_fritzv2_interrupt(int intno, void *dev_id)
{ … }
static int
avm_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)
{ … }
static void
inithdlc(struct fritzcard *fc)
{ … }
static void
clear_pending_hdlc_ints(struct fritzcard *fc)
{ … }
static void
reset_avm(struct fritzcard *fc)
{ … }
static int
init_card(struct fritzcard *fc)
{ … }
static int
channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq)
{ … }
static int
avm_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)
{ … }
static int
channel_ctrl(struct fritzcard *fc, struct mISDN_ctrl_req *cq)
{ … }
static int
open_bchannel(struct fritzcard *fc, struct channel_req *rq)
{ … }
static int
avm_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg)
{ … }
static int
setup_fritz(struct fritzcard *fc)
{ … }
static void
release_card(struct fritzcard *card)
{ … }
static int
setup_instance(struct fritzcard *card)
{ … }
static int
fritzpci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void
fritz_remove_pci(struct pci_dev *pdev)
{ … }
static const struct pci_device_id fcpci_ids[] = …;
MODULE_DEVICE_TABLE(pci, fcpci_ids);
static struct pci_driver fcpci_driver = …;
static int __init AVM_init(void)
{ … }
static void __exit AVM_cleanup(void)
{ … }
module_init(…) …;
module_exit(AVM_cleanup);