diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-02 14:39:09 +0200 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-02 14:39:09 +0200 |
commit | d2f6409584e2c62ffad81690562330ff3bf4a458 (patch) | |
tree | 3bdfb97d0b51be2f7f414f2107e97603c1206abb /drivers/isdn | |
parent | AUDIT: Use KERN_NOTICE for printk of audit records (diff) | |
parent | [PATCH] alpha smp fix (part #2) (diff) | |
download | linux-d2f6409584e2c62ffad81690562330ff3bf4a458.tar.xz linux-d2f6409584e2c62ffad81690562330ff3bf4a458.zip |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/isdn')
102 files changed, 414 insertions, 1363 deletions
diff --git a/drivers/isdn/act2000/capi.c b/drivers/isdn/act2000/capi.c index 40395f567231..afa46681f983 100644 --- a/drivers/isdn/act2000/capi.c +++ b/drivers/isdn/act2000/capi.c @@ -224,6 +224,7 @@ actcapi_manufacturer_req_net(act2000_card *card) /* * Switch V.42 on or off */ +#if 0 int actcapi_manufacturer_req_v42(act2000_card *card, ulong arg) { @@ -242,6 +243,7 @@ actcapi_manufacturer_req_v42(act2000_card *card, ulong arg) ACTCAPI_QUEUE_TX; return 0; } +#endif /* 0 */ /* * Set error-handler diff --git a/drivers/isdn/act2000/capi.h b/drivers/isdn/act2000/capi.h index 04d2bcdd37a7..f6d5f530b86b 100644 --- a/drivers/isdn/act2000/capi.h +++ b/drivers/isdn/act2000/capi.h @@ -350,7 +350,6 @@ actcapi_nextsmsg(act2000_card *card) extern int actcapi_chkhdr(act2000_card *, actcapi_msghdr *); extern int actcapi_listen_req(act2000_card *); extern int actcapi_manufacturer_req_net(act2000_card *); -extern int actcapi_manufacturer_req_v42(act2000_card *, ulong); extern int actcapi_manufacturer_req_errh(act2000_card *); extern int actcapi_manufacturer_req_msn(act2000_card *); extern int actcapi_connect_req(act2000_card *, act2000_chan *, char *, char, int, int); diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 12dee8e9fbbe..04fb606b5ddd 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -58,7 +58,7 @@ MODULE_LICENSE("GPL"); /* -------- driver information -------------------------------------- */ -static struct class_simple *capi_class; +static struct class *capi_class; static int capi_major = 68; /* allocated */ #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE @@ -1499,20 +1499,20 @@ static int __init capi_init(void) return -EIO; } - capi_class = class_simple_create(THIS_MODULE, "capi"); + capi_class = class_create(THIS_MODULE, "capi"); if (IS_ERR(capi_class)) { unregister_chrdev(capi_major, "capi20"); return PTR_ERR(capi_class); } - class_simple_device_add(capi_class, MKDEV(capi_major, 0), NULL, "capi"); + class_device_create(capi_class, MKDEV(capi_major, 0), NULL, "capi"); devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR, "isdn/capi20"); #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE if (capinc_tty_init() < 0) { - class_simple_device_remove(MKDEV(capi_major, 0)); - class_simple_destroy(capi_class); + class_device_destroy(capi_class, MKDEV(capi_major, 0)); + class_destroy(capi_class); unregister_chrdev(capi_major, "capi20"); return -ENOMEM; } @@ -1539,8 +1539,8 @@ static void __exit capi_exit(void) { proc_exit(); - class_simple_device_remove(MKDEV(capi_major, 0)); - class_simple_destroy(capi_class); + class_device_destroy(capi_class, MKDEV(capi_major, 0)); + class_destroy(capi_class); unregister_chrdev(capi_major, "capi20"); devfs_remove("isdn/capi20"); diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index dc00c85e3e35..ee750e9456dd 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c @@ -486,6 +486,14 @@ static int avmcs_event(event_t event, int priority, return 0; } /* avmcs_event */ +static struct pcmcia_device_id avmcs_ids[] = { + PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN-Controller B1", 0x95d42008, 0x845dc335), + PCMCIA_DEVICE_PROD_ID12("AVM", "Mobile ISDN-Controller M1", 0x95d42008, 0x81e10430), + PCMCIA_DEVICE_PROD_ID12("AVM", "Mobile ISDN-Controller M2", 0x95d42008, 0x18e8558a), + PCMCIA_DEVICE_NULL +}; +MODULE_DEVICE_TABLE(pcmcia, avmcs_ids); + static struct pcmcia_driver avmcs_driver = { .owner = THIS_MODULE, .drv = { @@ -493,6 +501,7 @@ static struct pcmcia_driver avmcs_driver = { }, .attach = avmcs_attach, .detach = avmcs_detach, + .id_table = avmcs_ids, }; static int __init avmcs_init(void) diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 55bed00ca865..91dd0551fc7c 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -955,7 +955,7 @@ EXPORT_SYMBOL(b1dma_release_appl); EXPORT_SYMBOL(b1dma_send_message); EXPORT_SYMBOL(b1dmactl_read_proc); -int b1dma_init(void) +static int __init b1dma_init(void) { char *p; char rev[32]; @@ -972,7 +972,7 @@ int b1dma_init(void) return 0; } -void b1dma_exit(void) +static void __exit b1dma_exit(void) { } diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index fa6b93b1a42d..724aac2c1cca 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -885,7 +885,7 @@ static int c4_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) } -void c4_reset_ctr(struct capi_ctr *ctrl) +static void c4_reset_ctr(struct capi_ctr *ctrl) { avmcard *card = ((avmctrl_info *)(ctrl->driverdata))->card; avmctrl_info *cinfo; @@ -933,7 +933,7 @@ static void c4_remove(struct pci_dev *pdev) /* ------------------------------------------------------------- */ -void c4_register_appl(struct capi_ctr *ctrl, +static void c4_register_appl(struct capi_ctr *ctrl, u16 appl, capi_register_params *rp) { @@ -978,7 +978,7 @@ void c4_register_appl(struct capi_ctr *ctrl, /* ------------------------------------------------------------- */ -void c4_release_appl(struct capi_ctr *ctrl, u16 appl) +static void c4_release_appl(struct capi_ctr *ctrl, u16 appl) { avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmcard *card = cinfo->card; diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c index cb9d9cee2a64..3b701d97bdf1 100644 --- a/drivers/isdn/hardware/avm/t1isa.c +++ b/drivers/isdn/hardware/avm/t1isa.c @@ -328,7 +328,7 @@ static int t1isa_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) return 0; } -void t1isa_reset_ctr(struct capi_ctr *ctrl) +static void t1isa_reset_ctr(struct capi_ctr *ctrl) { avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmcard *card = cinfo->card; diff --git a/drivers/isdn/hardware/eicon/dadapter.c b/drivers/isdn/hardware/eicon/dadapter.c index 6e548a222ef1..89497890158d 100644 --- a/drivers/isdn/hardware/eicon/dadapter.c +++ b/drivers/isdn/hardware/eicon/dadapter.c @@ -44,7 +44,7 @@ static didd_adapter_change_notification_t\ Array to held adapter information -------------------------------------------------------------------------- */ static DESCRIPTOR HandleTable[NEW_MAX_DESCRIPTORS]; -dword Adapters = 0; /* Number of adapters */ +static dword Adapters = 0; /* Number of adapters */ /* -------------------------------------------------------------------------- Shadow IDI_DIMAINT and 'shadow' debug stuff diff --git a/drivers/isdn/hisax/Makefile b/drivers/isdn/hisax/Makefile index 8d6bb56754b8..293e27789d54 100644 --- a/drivers/isdn/hisax/Makefile +++ b/drivers/isdn/hisax/Makefile @@ -23,7 +23,7 @@ endif # Multipart objects. hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \ - st5481_b.o st5481_hdlc.o + st5481_b.o hisax-y := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \ lmgr.o q931.o callc.o fsm.o diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c index c4f861a5db25..8ae08c41c853 100644 --- a/drivers/isdn/hisax/amd7930_fn.c +++ b/drivers/isdn/hisax/amd7930_fn.c @@ -97,7 +97,7 @@ static WORD initAMD[] = { }; -void /* macro wWordAMD */ +static void /* macro wWordAMD */ WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) { wByteAMD(cs, 0x00, reg); @@ -105,7 +105,7 @@ WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) wByteAMD(cs, 0x01, HIBYTE(val)); } -WORD /* macro rWordAMD */ +static WORD /* macro rWordAMD */ ReadWordAmd7930(struct IsdnCardState *cs, BYTE reg) { WORD res; @@ -665,7 +665,7 @@ Amd7930_l1hw(struct PStack *st, int pr, void *arg) } } -void +static void setstack_Amd7930(struct PStack *st, struct IsdnCardState *cs) { @@ -676,7 +676,7 @@ setstack_Amd7930(struct PStack *st, struct IsdnCardState *cs) } -void +static void DC_Close_Amd7930(struct IsdnCardState *cs) { if (cs->debug & L1_DEB_ISAC) debugl1(cs, "Amd7930: DC_Close called"); diff --git a/drivers/isdn/hisax/asuscom.c b/drivers/isdn/hisax/asuscom.c index 7546e2e4a94e..a98c5e38bbbc 100644 --- a/drivers/isdn/hisax/asuscom.c +++ b/drivers/isdn/hisax/asuscom.c @@ -22,7 +22,7 @@ extern const char *CardType[]; -const char *Asuscom_revision = "$Revision: 1.14.2.4 $"; +static const char *Asuscom_revision = "$Revision: 1.14.2.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -239,7 +239,7 @@ Start_IPAC: return IRQ_HANDLED; } -void +static void release_io_asuscom(struct IsdnCardState *cs) { int bytecnt = 8; diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index 6fcb2cf7b0b6..625799ab0d14 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -172,7 +172,7 @@ struct BCState *Sel_BCS(struct IsdnCardState *cs, int channel) return(NULL); } -void +static void write_ctrl(struct BCState *bcs, int which) { if (bcs->cs->debug & L1_DEB_HSCX) @@ -193,7 +193,7 @@ write_ctrl(struct BCState *bcs, int which) { } } -void +static void modehdlc(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -451,7 +451,7 @@ HDLC_irq(struct BCState *bcs, u_int stat) { } } -inline void +static inline void HDLC_irq_main(struct IsdnCardState *cs) { u_int stat; @@ -487,7 +487,7 @@ HDLC_irq_main(struct IsdnCardState *cs) } } -void +static void hdlc_l2l1(struct PStack *st, int pr, void *arg) { struct BCState *bcs = st->l1.bcs; @@ -547,7 +547,7 @@ hdlc_l2l1(struct PStack *st, int pr, void *arg) } } -void +static void close_hdlcstate(struct BCState *bcs) { modehdlc(bcs, 0, 0); @@ -570,7 +570,7 @@ close_hdlcstate(struct BCState *bcs) } } -int +static int open_hdlcstate(struct IsdnCardState *cs, struct BCState *bcs) { if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { @@ -598,7 +598,7 @@ open_hdlcstate(struct IsdnCardState *cs, struct BCState *bcs) return (0); } -int +static int setstack_hdlc(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; @@ -612,6 +612,7 @@ setstack_hdlc(struct PStack *st, struct BCState *bcs) return (0); } +#if 0 void __init clear_pending_hdlc_ints(struct IsdnCardState *cs) { @@ -641,8 +642,9 @@ clear_pending_hdlc_ints(struct IsdnCardState *cs) debugl1(cs, "HDLC 2 VIN %x", val); } } +#endif /* 0 */ -void __init +static void __init inithdlc(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_hdlc; diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index 663a0bf703b7..67c60e04a37b 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c @@ -501,6 +501,13 @@ static int avma1cs_event(event_t event, int priority, return 0; } /* avma1cs_event */ +static struct pcmcia_device_id avma1cs_ids[] = { + PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN A", 0x95d42008, 0xadc9d4bb), + PCMCIA_DEVICE_PROD_ID12("ISDN", "CARD", 0x8d9761c8, 0x01c5aa7b), + PCMCIA_DEVICE_NULL +}; +MODULE_DEVICE_TABLE(pcmcia, avma1cs_ids); + static struct pcmcia_driver avma1cs_driver = { .owner = THIS_MODULE, .drv = { @@ -508,6 +515,7 @@ static struct pcmcia_driver avma1cs_driver = { }, .attach = avma1cs_attach, .detach = avma1cs_detach, + .id_table = avma1cs_ids, }; /*====================================================================*/ diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c index f410f628a3e2..dcb308aeb50c 100644 --- a/drivers/isdn/hisax/bkm_a4t.c +++ b/drivers/isdn/hisax/bkm_a4t.c @@ -23,7 +23,7 @@ extern const char *CardType[]; -const char *bkm_a4t_revision = "$Revision: 1.22.2.4 $"; +static const char *bkm_a4t_revision = "$Revision: 1.22.2.4 $"; static inline u_char @@ -167,7 +167,7 @@ bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs) } } -void +static void release_io_bkm(struct IsdnCardState *cs) { if (cs->hw.ax.base) { diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c index 94bb83ce7fd8..5f21b82c8c8d 100644 --- a/drivers/isdn/hisax/bkm_a8.c +++ b/drivers/isdn/hisax/bkm_a8.c @@ -27,7 +27,7 @@ extern const char *CardType[]; -const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $"; +static const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $"; static const char *sct_quadro_subtypes[] = { @@ -193,7 +193,7 @@ bkm_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_sct_quadro(struct IsdnCardState *cs) { release_region(cs->hw.ax.base & 0xffffffc0, 128); @@ -261,7 +261,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return (0); } -int __init +static int __init sct_alloc_io(u_int adr, u_int len) { if (!request_region(adr, len, "scitel")) { diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index 04065ab2610f..7c56c44f0fd1 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -874,7 +874,7 @@ release_b_st(struct Channel *chanp) } } -struct Channel +static struct Channel *selectfreechannel(struct PStack *st, int bch) { struct IsdnCardState *cs = st->l1.hardware; @@ -1429,7 +1429,7 @@ capi_debug(struct Channel *chanp, capi_msg *cm) HiSax_putstatus(chanp->cs, "Ch", "%d CAPIMSG %s", chanp->chan, tmpbuf); } -void +static void lli_got_fac_req(struct Channel *chanp, capi_msg *cm) { if ((cm->para[0] != 3) || (cm->para[1] != 0)) return; @@ -1454,7 +1454,7 @@ lli_got_fac_req(struct Channel *chanp, capi_msg *cm) { } } -void +static void lli_got_manufacturer(struct Channel *chanp, struct IsdnCardState *cs, capi_msg *cm) { if ((cs->typ == ISDN_CTYPE_ELSA) || (cs->typ == ISDN_CTYPE_ELSA_PNP) || (cs->typ == ISDN_CTYPE_ELSA_PCI)) { diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 1663ee69d41d..c542e6fb2bde 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -332,7 +332,7 @@ struct IsdnCard cards[HISAX_MAX_CARDS] = { #define HISAX_IDSIZE (HISAX_MAX_CARDS*8) static char HiSaxID[HISAX_IDSIZE] = { 0, }; -char *HiSax_id = HiSaxID; +static char *HiSax_id = HiSaxID; #ifdef MODULE /* Variables for insmod */ static int type[HISAX_MAX_CARDS] = { 0, }; @@ -391,7 +391,7 @@ char *HiSax_getrev(const char *revision) return rev; } -void __init HiSaxVersion(void) +static void __init HiSaxVersion(void) { char tmp[64]; @@ -608,6 +608,7 @@ static inline struct IsdnCardState *hisax_findcard(int driverid) /* * Find card with given card number */ +#if 0 struct IsdnCardState *hisax_get_card(int cardnr) { if ((cardnr <= nrcards) && (cardnr > 0)) @@ -615,8 +616,9 @@ struct IsdnCardState *hisax_get_card(int cardnr) return cards[cardnr - 1].cs; return NULL; } +#endif /* 0 */ -int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) +static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) { int count, cnt; u_char __user *p = buf; @@ -768,7 +770,7 @@ int ll_run(struct IsdnCardState *cs, int addfeatures) return 0; } -void ll_stop(struct IsdnCardState *cs) +static void ll_stop(struct IsdnCardState *cs) { isdn_ctrl ic; @@ -1184,7 +1186,7 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow return ret; } -void HiSax_shiftcards(int idx) +static void HiSax_shiftcards(int idx) { int i; @@ -1192,7 +1194,7 @@ void HiSax_shiftcards(int idx) memcpy(&cards[i], &cards[i + 1], sizeof(cards[i])); } -int HiSax_inithardware(int *busy_flag) +static int HiSax_inithardware(int *busy_flag) { int foundcards = 0; int i = 0; diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 394d481e093f..b62d6b30b72b 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -28,7 +28,7 @@ extern const char *CardType[]; -const char *Diva_revision = "$Revision: 1.33.2.6 $"; +static const char *Diva_revision = "$Revision: 1.33.2.6 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -706,7 +706,7 @@ diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_diva(struct IsdnCardState *cs) { int bytecnt; diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index 4d7a0250d7e2..110e9fd669c5 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -33,13 +33,13 @@ extern const char *CardType[]; -const char *Elsa_revision = "$Revision: 2.32.2.4 $"; -const char *Elsa_Types[] = +static const char *Elsa_revision = "$Revision: 2.32.2.4 $"; +static const char *Elsa_Types[] = {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", "PCMCIA-IPAC" }; -const char *ITACVer[] = +static const char *ITACVer[] = {"?0?", "?1?", "?2?", "?3?", "?4?", "V2.2", "B1", "A1"}; @@ -425,7 +425,7 @@ Start_IPAC: return IRQ_HANDLED; } -void +static void release_io_elsa(struct IsdnCardState *cs) { int bytecnt = 8; diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index bfc013225f46..9146be547044 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c @@ -508,6 +508,13 @@ static int elsa_cs_event(event_t event, int priority, return 0; } /* elsa_cs_event */ +static struct pcmcia_device_id elsa_ids[] = { + PCMCIA_DEVICE_PROD_ID12("ELSA AG (Aachen, Germany)", "MicroLink ISDN/MC ", 0x983de2c4, 0x333ba257), + PCMCIA_DEVICE_PROD_ID12("ELSA GmbH, Aachen", "MicroLink ISDN/MC ", 0x639e5718, 0x333ba257), + PCMCIA_DEVICE_NULL +}; +MODULE_DEVICE_TABLE(pcmcia, elsa_ids); + static struct pcmcia_driver elsa_cs_driver = { .owner = THIS_MODULE, .drv = { @@ -515,6 +522,7 @@ static struct pcmcia_driver elsa_cs_driver = { }, .attach = elsa_cs_attach, .detach = elsa_cs_detach, + .id_table = elsa_ids, }; static int __init init_elsa_cs(void) diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index 689c83395693..898ec0916195 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c @@ -237,7 +237,7 @@ static void mshutdown(struct IsdnCardState *cs) #endif } -inline int +static inline int write_modem(struct BCState *bcs) { int ret=0; struct IsdnCardState *cs = bcs->cs; @@ -275,7 +275,7 @@ write_modem(struct BCState *bcs) { return(ret); } -inline void +static inline void modem_fill(struct BCState *bcs) { if (bcs->tx_skb) { @@ -422,7 +422,7 @@ extern int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs); extern void modehscx(struct BCState *bcs, int mode, int bc); extern void hscx_l2l1(struct PStack *st, int pr, void *arg); -void +static void close_elsastate(struct BCState *bcs) { modehscx(bcs, 0, bcs->channel); @@ -442,7 +442,7 @@ close_elsastate(struct BCState *bcs) } } -void +static void modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) { int count, fp; u_char *msg = buf; @@ -472,7 +472,7 @@ modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) { } } -void +static void modem_set_init(struct IsdnCardState *cs) { int timeout; @@ -521,7 +521,7 @@ modem_set_init(struct IsdnCardState *cs) { udelay(RCV_DELAY); } -void +static void modem_set_dial(struct IsdnCardState *cs, int outgoing) { int timeout; #define RCV_DELAY 20000 @@ -543,7 +543,7 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) { udelay(RCV_DELAY); } -void +static void modem_l2l1(struct PStack *st, int pr, void *arg) { struct BCState *bcs = st->l1.bcs; @@ -579,7 +579,7 @@ modem_l2l1(struct PStack *st, int pr, void *arg) } } -int +static int setstack_elsa(struct PStack *st, struct BCState *bcs) { @@ -614,7 +614,7 @@ setstack_elsa(struct PStack *st, struct BCState *bcs) return (0); } -void +static void init_modem(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_elsa; @@ -641,7 +641,7 @@ init_modem(struct IsdnCardState *cs) { modem_set_init(cs); } -void +static void release_modem(struct IsdnCardState *cs) { cs->hw.elsa.MFlag = 0; diff --git a/drivers/isdn/hisax/enternow.h b/drivers/isdn/hisax/enternow.h deleted file mode 100644 index ed2eec5874c5..000000000000 --- a/drivers/isdn/hisax/enternow.h +++ /dev/null @@ -1,51 +0,0 @@ -/* 2001/10/02 - * - * enternow.h Header-file included by - * enternow_pci.c - * - * Author Christoph Ersfeld <info@formula-n.de> - * Formula-n Europe AG (www.formula-n.com) - * previously Gerdes AG - * - * - * This file is (c) under GNU PUBLIC LICENSE - */ - - -/* ***************************************************************************************** * - * ****************************** datatypes and macros ************************************* * - * ***************************************************************************************** */ - -#define BYTE unsigned char -#define WORD unsigned int -#define HIBYTE(w) ((unsigned char)((w & 0xff00) / 256)) -#define LOBYTE(w) ((unsigned char)(w & 0x00ff)) -#define InByte(addr) inb(addr) -#define OutByte(addr,val) outb(val,addr) - - - -/* ***************************************************************************************** * - * *********************************** card-specific *************************************** * - * ***************************************************************************************** */ - -/* für PowerISDN PCI */ -#define TJ_AMD_IRQ 0x20 -#define TJ_LED1 0x40 -#define TJ_LED2 0x80 - - -/* Das Fenster zum AMD... - * Ab Adresse hw.njet.base + TJ_AMD_PORT werden vom AMD jeweils 8 Bit in - * den TigerJet i/o-Raum gemappt - * -> 0x01 des AMD bei hw.njet.base + 0C4 */ -#define TJ_AMD_PORT 0xC0 - - - -/* ***************************************************************************************** * - * *************************************** Prototypen ************************************** * - * ***************************************************************************************** */ - -BYTE ReadByteAmd7930(struct IsdnCardState *cs, BYTE offset); -void WriteByteAmd7930(struct IsdnCardState *cs, BYTE offset, BYTE value); diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c index 1cc4d11e007a..3341cf155531 100644 --- a/drivers/isdn/hisax/enternow_pci.c +++ b/drivers/isdn/hisax/enternow_pci.c @@ -65,7 +65,6 @@ #include "isac.h" #include "isdnl1.h" #include "amd7930_fn.h" -#include "enternow.h" #include <linux/interrupt.h> #include <linux/ppp_defs.h> #include <linux/pci.h> @@ -74,58 +73,72 @@ -const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; +static const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; + + +/* für PowerISDN PCI */ +#define TJ_AMD_IRQ 0x20 +#define TJ_LED1 0x40 +#define TJ_LED2 0x80 + + +/* Das Fenster zum AMD... + * Ab Adresse hw.njet.base + TJ_AMD_PORT werden vom AMD jeweils 8 Bit in + * den TigerJet i/o-Raum gemappt + * -> 0x01 des AMD bei hw.njet.base + 0C4 */ +#define TJ_AMD_PORT 0xC0 + /* *************************** I/O-Interface functions ************************************* */ /* cs->readisac, macro rByteAMD */ -BYTE -ReadByteAmd7930(struct IsdnCardState *cs, BYTE offset) +static unsigned char +ReadByteAmd7930(struct IsdnCardState *cs, unsigned char offset) { /* direktes Register */ if(offset < 8) - return (InByte(cs->hw.njet.isac + 4*offset)); + return (inb(cs->hw.njet.isac + 4*offset)); /* indirektes Register */ else { - OutByte(cs->hw.njet.isac + 4*AMD_CR, offset); - return(InByte(cs->hw.njet.isac + 4*AMD_DR)); + outb(offset, cs->hw.njet.isac + 4*AMD_CR); + return(inb(cs->hw.njet.isac + 4*AMD_DR)); } } /* cs->writeisac, macro wByteAMD */ -void -WriteByteAmd7930(struct IsdnCardState *cs, BYTE offset, BYTE value) +static void +WriteByteAmd7930(struct IsdnCardState *cs, unsigned char offset, unsigned char value) { /* direktes Register */ if(offset < 8) - OutByte(cs->hw.njet.isac + 4*offset, value); + outb(value, cs->hw.njet.isac + 4*offset); /* indirektes Register */ else { - OutByte(cs->hw.njet.isac + 4*AMD_CR, offset); - OutByte(cs->hw.njet.isac + 4*AMD_DR, value); + outb(offset, cs->hw.njet.isac + 4*AMD_CR); + outb(value, cs->hw.njet.isac + 4*AMD_DR); } } -void -enpci_setIrqMask(struct IsdnCardState *cs, BYTE val) { +static void +enpci_setIrqMask(struct IsdnCardState *cs, unsigned char val) { if (!val) - OutByte(cs->hw.njet.base+NETJET_IRQMASK1, 0x00); + outb(0x00, cs->hw.njet.base+NETJET_IRQMASK1); else - OutByte(cs->hw.njet.base+NETJET_IRQMASK1, TJ_AMD_IRQ); + outb(TJ_AMD_IRQ, cs->hw.njet.base+NETJET_IRQMASK1); } -static BYTE dummyrr(struct IsdnCardState *cs, int chan, BYTE off) +static unsigned char dummyrr(struct IsdnCardState *cs, int chan, unsigned char off) { return(5); } -static void dummywr(struct IsdnCardState *cs, int chan, BYTE off, BYTE value) +static void dummywr(struct IsdnCardState *cs, int chan, unsigned char off, unsigned char value) { } @@ -142,18 +155,18 @@ reset_enpci(struct IsdnCardState *cs) /* Reset on, (also for AMD) */ cs->hw.njet.ctrl_reg = 0x07; - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); mdelay(20); /* Reset off */ cs->hw.njet.ctrl_reg = 0x30; - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); /* 20ms delay */ mdelay(20); cs->hw.njet.auxd = 0; // LED-status cs->hw.njet.dmactrl = 0; - OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); - OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); - OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); // LED off + outb(~TJ_AMD_IRQ, cs->hw.njet.base + NETJET_AUXCTRL); + outb(TJ_AMD_IRQ, cs->hw.njet.base + NETJET_IRQMASK1); + outb(cs->hw.njet.auxd, cs->hw.njet.auxa); // LED off } @@ -161,7 +174,7 @@ static int enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) { u_long flags; - BYTE *chan; + unsigned char *chan; if (cs->debug & L1_DEB_ISAC) debugl1(cs, "enter:now PCI: card_msg: 0x%04X", mt); @@ -187,16 +200,16 @@ enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) case MDL_ASSIGN: /* TEI assigned, LED1 on */ cs->hw.njet.auxd = TJ_AMD_IRQ << 1; - OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); + outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); break; case MDL_REMOVE: /* TEI removed, LEDs off */ cs->hw.njet.auxd = 0; - OutByte(cs->hw.njet.base + NETJET_AUXDATA, 0x00); + outb(0x00, cs->hw.njet.base + NETJET_AUXDATA); break; case MDL_BC_ASSIGN: /* activate B-channel */ - chan = (BYTE *)arg; + chan = (unsigned char *)arg; if (cs->debug & L1_DEB_ISAC) debugl1(cs, "enter:now PCI: assign phys. BC %d in AMD LMR1", *chan); @@ -204,11 +217,11 @@ enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) cs->dc.amd7930.ph_command(cs, (cs->dc.amd7930.lmr1 | (*chan + 1)), "MDL_BC_ASSIGN"); /* at least one b-channel in use, LED 2 on */ cs->hw.njet.auxd |= TJ_AMD_IRQ << 2; - OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); + outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); break; case MDL_BC_RELEASE: /* deactivate B-channel */ - chan = (BYTE *)arg; + chan = (unsigned char *)arg; if (cs->debug & L1_DEB_ISAC) debugl1(cs, "enter:now PCI: release phys. BC %d in Amd LMR1", *chan); @@ -217,7 +230,7 @@ enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) /* no b-channel active -> LED2 off */ if (!(cs->dc.amd7930.lmr1 & 3)) { cs->hw.njet.auxd &= ~(TJ_AMD_IRQ << 2); - OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); + outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); } break; default: @@ -231,11 +244,11 @@ static irqreturn_t enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; - BYTE s0val, s1val, ir; + unsigned char s0val, s1val, ir; u_long flags; spin_lock_irqsave(&cs->lock, flags); - s1val = InByte(cs->hw.njet.base + NETJET_IRQSTAT1); + s1val = inb(cs->hw.njet.base + NETJET_IRQSTAT1); /* AMD threw an interrupt */ if (!(s1val & TJ_AMD_IRQ)) { @@ -245,13 +258,13 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) s1val = 1; } else s1val = 0; - s0val = InByte(cs->hw.njet.base + NETJET_IRQSTAT0); + s0val = inb(cs->hw.njet.base + NETJET_IRQSTAT0); if ((s0val | s1val)==0) { // shared IRQ spin_unlock_irqrestore(&cs->lock, flags); return IRQ_NONE; } if (s0val) - OutByte(cs->hw.njet.base + NETJET_IRQSTAT0, s0val); + outb(s0val, cs->hw.njet.base + NETJET_IRQSTAT0); /* DMA-Interrupt: B-channel-stuff */ /* set bits in sval to indicate which page is free */ @@ -342,20 +355,20 @@ setup_enternow_pci(struct IsdnCard *card) /* Reset an */ cs->hw.njet.ctrl_reg = 0x07; // geändert von 0xff - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); /* 20 ms Pause */ mdelay(20); cs->hw.njet.ctrl_reg = 0x30; /* Reset Off and status read clear */ - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); mdelay(10); cs->hw.njet.auxd = 0x00; // war 0xc0 cs->hw.njet.dmactrl = 0; - OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); - OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); - OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); + outb(~TJ_AMD_IRQ, cs->hw.njet.base + NETJET_AUXCTRL); + outb(TJ_AMD_IRQ, cs->hw.njet.base + NETJET_IRQMASK1); + outb(cs->hw.njet.auxd, cs->hw.njet.auxa); break; } diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c index 24a05a43f33e..352b45ac5347 100644 --- a/drivers/isdn/hisax/gazel.c +++ b/drivers/isdn/hisax/gazel.c @@ -21,7 +21,7 @@ #include <linux/pci.h> extern const char *CardType[]; -const char *gazel_revision = "$Revision: 2.19.2.4 $"; +static const char *gazel_revision = "$Revision: 2.19.2.4 $"; #define R647 1 #define R685 2 @@ -317,7 +317,8 @@ gazel_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) spin_unlock_irqrestore(&cs->lock, flags); return IRQ_HANDLED; } -void + +static void release_io_gazel(struct IsdnCardState *cs) { unsigned int i; diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index ba1d028343ec..7333377ab31d 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c @@ -312,7 +312,7 @@ wait_busy(hfc4s8s_hw * a) /* function to read critical counter registers that */ /* may be udpated by the chip during read */ /******************************************************/ -static volatile u_char +static u_char Read_hfc8_stable(hfc4s8s_hw * hw, int reg) { u_char ref8; @@ -324,7 +324,7 @@ Read_hfc8_stable(hfc4s8s_hw * hw, int reg) return in8; } -static volatile int +static int Read_hfc16_stable(hfc4s8s_hw * hw, int reg) { int ref16; @@ -1358,7 +1358,7 @@ chipreset(hfc4s8s_hw * hw) /********************************************/ /* disable/enable hardware in nt or te mode */ /********************************************/ -void +static void hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode) { u_long flags; @@ -1465,7 +1465,7 @@ hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode) /******************************************/ /* disable memory mapped ports / io ports */ /******************************************/ -void +static void release_pci_ports(hfc4s8s_hw * hw) { pci_write_config_word(hw->pdev, PCI_COMMAND, 0); @@ -1481,7 +1481,7 @@ release_pci_ports(hfc4s8s_hw * hw) /*****************************************/ /* enable memory mapped ports / io ports */ /*****************************************/ -void +static void enable_pci_ports(hfc4s8s_hw * hw) { #ifdef CONFIG_HISAX_HFC4S8S_PCIMEM diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c index ebea3feef003..7cf87793e790 100644 --- a/drivers/isdn/hisax/hfc_2bds0.c +++ b/drivers/isdn/hisax/hfc_2bds0.c @@ -345,7 +345,7 @@ hfc_send_data(struct BCState *bcs) debugl1(cs,"send_data %d blocked", bcs->channel); } -void +static void main_rec_2bds0(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; @@ -399,7 +399,7 @@ main_rec_2bds0(struct BCState *bcs) return; } -void +static void mode_2bs0(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -505,7 +505,7 @@ hfc_l2l1(struct PStack *st, int pr, void *arg) } } -void +static void close_2bs0(struct BCState *bcs) { mode_2bs0(bcs, 0, bcs->channel); @@ -534,7 +534,7 @@ open_hfcstate(struct IsdnCardState *cs, struct BCState *bcs) return (0); } -int +static int setstack_2b(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; @@ -1004,7 +1004,7 @@ HFCD_l1hw(struct PStack *st, int pr, void *arg) } } -void +static void setstack_hfcd(struct PStack *st, struct IsdnCardState *cs) { st->l1.l1hw = HFCD_l1hw; @@ -1015,7 +1015,7 @@ hfc_dbusy_timer(struct IsdnCardState *cs) { } -unsigned int __init +static unsigned int __init *init_send_hfcd(int cnt) { int i, *send; diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c index bb376f39ac89..f978a5af8662 100644 --- a/drivers/isdn/hisax/hfc_2bs0.c +++ b/drivers/isdn/hisax/hfc_2bs0.c @@ -52,7 +52,7 @@ WaitNoBusy(struct IsdnCardState *cs) return (to); } -int +static int GetFreeFifoBytes(struct BCState *bcs) { int s; @@ -66,7 +66,7 @@ GetFreeFifoBytes(struct BCState *bcs) return (s); } -int +static int ReadZReg(struct BCState *bcs, u_char reg) { int val; @@ -394,7 +394,7 @@ main_irq_hfc(struct BCState *bcs) return; } -void +static void mode_hfc(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -507,7 +507,7 @@ hfc_l2l1(struct PStack *st, int pr, void *arg) } -void +static void close_hfcstate(struct BCState *bcs) { mode_hfc(bcs, 0, bcs->channel); @@ -537,7 +537,7 @@ open_hfcstate(struct IsdnCardState *cs, struct BCState *bcs) return (0); } -int +static int setstack_hfc(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; @@ -551,7 +551,7 @@ setstack_hfc(struct PStack *st, struct BCState *bcs) return (0); } -void __init +static void __init init_send(struct BCState *bcs) { int i; diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index c2db52696a86..8337b0f26cc4 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -70,7 +70,7 @@ static const PCI_ENTRY id_list[] = /******************************************/ /* free hardware resources used by driver */ /******************************************/ -void +static void release_io_hfcpci(struct IsdnCardState *cs) { printk(KERN_INFO "HiSax: release hfcpci at %p\n", @@ -394,7 +394,7 @@ receive_dmsg(struct IsdnCardState *cs) /*******************************************************************************/ /* check for transparent receive data and read max one threshold size if avail */ /*******************************************************************************/ -int +static int hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata) { unsigned short *z1r, *z2r; @@ -446,7 +446,7 @@ hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata) /**********************************/ /* B-channel main receive routine */ /**********************************/ -void +static void main_rec_hfcpci(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; @@ -1244,7 +1244,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg) /***********************************************/ /* called during init setting l1 stack pointer */ /***********************************************/ -void +static void setstack_hfcpci(struct PStack *st, struct IsdnCardState *cs) { st->l1.l1hw = HFCPCI_l1hw; @@ -1268,7 +1268,7 @@ hfcpci_send_data(struct BCState *bcs) /***************************************************************/ /* activate/deactivate hardware for selected channels and mode */ /***************************************************************/ -void +static void mode_hfcpci(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -1579,7 +1579,7 @@ hfcpci_bh(struct IsdnCardState *cs) /********************************/ /* called for card init message */ /********************************/ -void __init +static void __init inithfcpci(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_2b; diff --git a/drivers/isdn/hisax/hfc_pci.h b/drivers/isdn/hisax/hfc_pci.h index 4df036ed1af0..9ef2981e404e 100644 --- a/drivers/isdn/hisax/hfc_pci.h +++ b/drivers/isdn/hisax/hfc_pci.h @@ -232,5 +232,4 @@ typedef union { #define Read_hfc(a,b) (*(((u_char *)a->hw.hfcpci.pci_io)+b)) extern void main_irq_hcpci(struct BCState *bcs); -extern void inithfcpci(struct IsdnCardState *cs); extern void releasehfcpci(struct IsdnCardState *cs); diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c index a307fcb6c634..f27c1608a3a7 100644 --- a/drivers/isdn/hisax/hfc_sx.c +++ b/drivers/isdn/hisax/hfc_sx.c @@ -308,7 +308,7 @@ read_fifo(struct IsdnCardState *cs, u_char fifo, int trans_max) /******************************************/ /* free hardware resources used by driver */ /******************************************/ -void +static void release_io_hfcsx(struct IsdnCardState *cs) { cs->hw.hfcsx.int_m2 = 0; /* interrupt output off ! */ @@ -472,7 +472,7 @@ receive_dmsg(struct IsdnCardState *cs) /**********************************/ /* B-channel main receive routine */ /**********************************/ -void +static void main_rec_hfcsx(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; @@ -1003,7 +1003,7 @@ HFCSX_l1hw(struct PStack *st, int pr, void *arg) /***********************************************/ /* called during init setting l1 stack pointer */ /***********************************************/ -void +static void setstack_hfcsx(struct PStack *st, struct IsdnCardState *cs) { st->l1.l1hw = HFCSX_l1hw; @@ -1027,7 +1027,7 @@ hfcsx_send_data(struct BCState *bcs) /***************************************************************/ /* activate/deactivate hardware for selected channels and mode */ /***************************************************************/ -void +static void mode_hfcsx(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -1328,7 +1328,7 @@ hfcsx_bh(struct IsdnCardState *cs) /********************************/ /* called for card init message */ /********************************/ -void __devinit +static void __devinit inithfcsx(struct IsdnCardState *cs) { cs->setstack_d = setstack_hfcsx; diff --git a/drivers/isdn/hisax/hfc_sx.h b/drivers/isdn/hisax/hfc_sx.h index 12f54159344a..6792f13dc220 100644 --- a/drivers/isdn/hisax/hfc_sx.h +++ b/drivers/isdn/hisax/hfc_sx.h @@ -193,5 +193,4 @@ struct hfcsx_extra { }; extern void main_irq_hfcsx(struct BCState *bcs); -extern void inithfcsx(struct IsdnCardState *cs); extern void releasehfcsx(struct IsdnCardState *cs); diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index ffd74b84f502..e2c3af49d72b 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c @@ -60,7 +60,7 @@ static const char *hfcusb_revision = #include "hisax_debug.h" static u_int debug; module_param(debug, uint, 0); -int hfc_debug; +static int hfc_debug; #endif @@ -85,7 +85,7 @@ static struct usb_device_id hfc_usb_idtab[] = { * VendorID, ProductID, Devicename, LED_SCHEME, * LED's BitMask in HFCUSB_P_DATA Register : LED_USB, LED_S0, LED_B1, LED_B2 */ -vendor_data vdata[] = { +static vendor_data vdata[] = { /* CologneChip Eval TA */ {0x0959, 0x2bd0, "ISDN USB TA (Cologne Chip HFC-S USB based)", LED_OFF, {4, 0, 2, 1} @@ -1137,7 +1137,7 @@ set_hfcmode(hfcusb_data * hfc, int channel, int mode) } } -void +static void hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) { usb_fifo *fifo = my_hisax_if->priv; diff --git a/drivers/isdn/hisax/hfc_usb.h b/drivers/isdn/hisax/hfc_usb.h index b171600cf641..280dd29b30d6 100644 --- a/drivers/isdn/hisax/hfc_usb.h +++ b/drivers/isdn/hisax/hfc_usb.h @@ -168,7 +168,7 @@ static struct hfcusb_symbolic_list urb_errlist[] = { * 3 entries are the configuration number, the minimum interval for * Interrupt endpoints & boolean if E-channel logging possible */ -int validconf[][19] = { +static int validconf[][19] = { // INT in, ISO out config {EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NOP, EP_INT, EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_NUL, EP_NUL, @@ -187,7 +187,7 @@ int validconf[][19] = { }; // string description of chosen config -char *conf_str[] = { +static char *conf_str[] = { "4 Interrupt IN + 3 Isochron OUT", "3 Interrupt IN + 3 Isochron OUT", "4 Isochron IN + 3 Isochron OUT", diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c index 6fc55fea1702..86ab1c13f6b1 100644 --- a/drivers/isdn/hisax/hfcscard.c +++ b/drivers/isdn/hisax/hfcscard.c @@ -52,7 +52,7 @@ hfcs_Timer(struct IsdnCardState *cs) */ } -void +static void release_io_hfcs(struct IsdnCardState *cs) { release2bds0(cs); diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index dc5791728d53..17cf7663c582 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1271,7 +1271,6 @@ extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, void init_bcstate(struct IsdnCardState *cs, int bc); void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs); -unsigned int random_ri(void); void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st); void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st); @@ -1315,15 +1314,11 @@ int QuickHex(char *txt, u_char * p, int cnt); void LogFrame(struct IsdnCardState *cs, u_char * p, int size); void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir); void iecpy(u_char * dest, u_char * iestart, int ieoffset); -#ifdef ISDN_CHIP_ISAC -void setstack_isac(struct PStack *st, struct IsdnCardState *cs); -#endif /* ISDN_CHIP_ISAC */ #endif /* __KERNEL__ */ #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);} int ll_run(struct IsdnCardState *cs, int addfeatures); -void ll_stop(struct IsdnCardState *cs); int CallcNew(void); void CallcFree(void); int CallcNewChan(struct IsdnCardState *cs); diff --git a/drivers/isdn/hisax/hscx.c b/drivers/isdn/hisax/hscx.c index 5bbbe3e95125..66dbaee77bfb 100644 --- a/drivers/isdn/hisax/hscx.c +++ b/drivers/isdn/hisax/hscx.c @@ -151,7 +151,7 @@ hscx_l2l1(struct PStack *st, int pr, void *arg) } } -void +static void close_hscxstate(struct BCState *bcs) { modehscx(bcs, 0, bcs->channel); @@ -203,7 +203,7 @@ open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs) return (0); } -int +static int setstack_hscx(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c index dcf31f83c600..b4ca5859b177 100644 --- a/drivers/isdn/hisax/icc.c +++ b/drivers/isdn/hisax/icc.c @@ -108,7 +108,7 @@ icc_bh(struct IsdnCardState *cs) #endif } -void +static void icc_empty_fifo(struct IsdnCardState *cs, int count) { u_char *ptr; @@ -563,13 +563,13 @@ ICC_l1hw(struct PStack *st, int pr, void *arg) } } -void +static void setstack_icc(struct PStack *st, struct IsdnCardState *cs) { st->l1.l1hw = ICC_l1hw; } -void +static void DC_Close_icc(struct IsdnCardState *cs) { if (cs->dc.icc.mon_rx) { kfree(cs->dc.icc.mon_rx); diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c index 6485e232d869..efba2f448017 100644 --- a/drivers/isdn/hisax/ipacx.c +++ b/drivers/isdn/hisax/ipacx.c @@ -36,8 +36,6 @@ static void ph_command(struct IsdnCardState *cs, unsigned int command); static inline void cic_int(struct IsdnCardState *cs); static void dch_l2l1(struct PStack *st, int pr, void *arg); static void dbusy_timer_handler(struct IsdnCardState *cs); -static void ipacx_new_ph(struct IsdnCardState *cs); -static void dch_bh(struct IsdnCardState *cs); static void dch_empty_fifo(struct IsdnCardState *cs, int count); static void dch_fill_fifo(struct IsdnCardState *cs); static inline void dch_int(struct IsdnCardState *cs); @@ -232,81 +230,6 @@ dbusy_timer_handler(struct IsdnCardState *cs) } //---------------------------------------------------------- -// L1 state machine intermediate layer to isdnl1 module -//---------------------------------------------------------- -static void -ipacx_new_ph(struct IsdnCardState *cs) -{ - switch (cs->dc.isac.ph_state) { - case (IPACX_IND_RES): - ph_command(cs, IPACX_CMD_DI); - l1_msg(cs, HW_RESET | INDICATION, NULL); - break; - - case (IPACX_IND_DC): - l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL); - break; - - case (IPACX_IND_DR): - l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL); - break; - - case (IPACX_IND_PU): - l1_msg(cs, HW_POWERUP | CONFIRM, NULL); - break; - - case (IPACX_IND_RSY): - l1_msg(cs, HW_RSYNC | INDICATION, NULL); - break; - - case (IPACX_IND_AR): - l1_msg(cs, HW_INFO2 | INDICATION, NULL); - break; - - case (IPACX_IND_AI8): - l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); - break; - - case (IPACX_IND_AI10): - l1_msg(cs, HW_INFO4_P10 | INDICATION, NULL); - break; - - default: - break; - } -} - -//---------------------------------------------------------- -// bottom half handler for D channel -//---------------------------------------------------------- -static void -dch_bh(struct IsdnCardState *cs) -{ - struct PStack *st; - - if (!cs) return; - - if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { - if (cs->debug) debugl1(cs, "D-Channel Busy cleared"); - for (st = cs->stlist; st; st = st->next) { - st->l1.l1l2(st, PH_PAUSE | CONFIRM, NULL); - } - } - - if (test_and_clear_bit(D_RCVBUFREADY, &cs->event)) { - DChannel_proc_rcv(cs); - } - - if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) { - DChannel_proc_xmt(cs); - } - - if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { - ipacx_new_ph(cs); - } -} - -//---------------------------------------------------------- // Fill buffer from receive FIFO //---------------------------------------------------------- static void @@ -991,14 +914,5 @@ init_ipacx(struct IsdnCardState *cs, int part) } } - -void __devinit -setup_ipacx(struct IsdnCardState *cs) -{ - INIT_WORK(&cs->tqueue, (void *)(void *) dch_bh, cs); - cs->dbusytimer.function = (void *) dbusy_timer_handler; - cs->dbusytimer.data = (long) cs; - init_timer(&cs->dbusytimer); -} //----------------- end of file ----------------------- diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c index 20b949952952..85e063a08d23 100644 --- a/drivers/isdn/hisax/isac.c +++ b/drivers/isdn/hisax/isac.c @@ -112,7 +112,7 @@ isac_bh(struct IsdnCardState *cs) #endif } -void +static void isac_empty_fifo(struct IsdnCardState *cs, int count) { u_char *ptr; @@ -563,13 +563,13 @@ ISAC_l1hw(struct PStack *st, int pr, void *arg) } } -void +static void setstack_isac(struct PStack *st, struct IsdnCardState *cs) { st->l1.l1hw = ISAC_l1hw; } -void +static void DC_Close_isac(struct IsdnCardState *cs) { if (cs->dc.isac.mon_rx) { kfree(cs->dc.isac.mon_rx); diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index ee081321efb2..642a87c51295 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -21,13 +21,13 @@ #define ETX 0x03 #define FAXMODCNT 13 -const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146}; +static const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146}; static u_int modmask = 0x1fff; static int frm_extra_delay = 2; static int para_TOA = 6; -const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" }; +static const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" }; -void isar_setup(struct IsdnCardState *cs); +static void isar_setup(struct IsdnCardState *cs); static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para); static void ll_deliver_faxstat(struct BCState *bcs, u_char status); @@ -45,7 +45,7 @@ waitforHIA(struct IsdnCardState *cs, int timeout) } -int +static int sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, u_char *msg) { @@ -85,7 +85,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, } /* Call only with IRQ disabled !!! */ -inline void +static inline void rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) { int i; @@ -114,7 +114,7 @@ rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) } /* Call only with IRQ disabled !!! */ -inline void +static inline void get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg) { ireg->iis = cs->BC_Read_Reg(cs, 1, ISAR_IIS); @@ -127,7 +127,7 @@ get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg) #endif } -int +static int waitrecmsg(struct IsdnCardState *cs, u_char *len, u_char *msg, int maxdelay) { @@ -185,7 +185,7 @@ ISARVersion(struct IsdnCardState *cs, char *s) return(ver); } -int +static int isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) { int ret, size, cnt, debug; @@ -739,7 +739,7 @@ isar_fill_fifo(struct BCState *bcs) } } -inline +static inline struct BCState *sel_bcs_isar(struct IsdnCardState *cs, u_char dpath) { if ((!dpath) || (dpath == 3)) @@ -751,7 +751,7 @@ struct BCState *sel_bcs_isar(struct IsdnCardState *cs, u_char dpath) return(NULL); } -void +static void send_frames(struct BCState *bcs) { if (bcs->tx_skb) { @@ -806,7 +806,7 @@ send_frames(struct BCState *bcs) } } -inline void +static inline void check_send(struct IsdnCardState *cs, u_char rdm) { struct BCState *bcs; @@ -828,11 +828,13 @@ check_send(struct IsdnCardState *cs, u_char rdm) } -const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4", - "300", "600", "1200", "2400", "4800", "7200", - "9600nt", "9600t", "12000", "14400", "WRONG"}; -const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", - "Bell103", "V23", "Bell202", "V17", "V29", "V27ter"}; +static const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", + "NODEF4", "300", "600", "1200", "2400", + "4800", "7200", "9600nt", "9600t", "12000", + "14400", "WRONG"}; +static const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", + "Bell103", "V23", "Bell202", "V17", "V29", + "V27ter"}; static void isar_pump_status_rsp(struct BCState *bcs, struct isar_reg *ireg) { @@ -1388,7 +1390,7 @@ setup_iom2(struct BCState *bcs) { udelay(1000); } -int +static int modeisar(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -1562,7 +1564,7 @@ isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para) sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1); } -void +static void isar_setup(struct IsdnCardState *cs) { u_char msg; @@ -1582,7 +1584,7 @@ isar_setup(struct IsdnCardState *cs) } } -void +static void isar_l2l1(struct PStack *st, int pr, void *arg) { struct BCState *bcs = st->l1.bcs; @@ -1681,7 +1683,7 @@ isar_l2l1(struct PStack *st, int pr, void *arg) } } -void +static void close_isarstate(struct BCState *bcs) { modeisar(bcs, 0, bcs->channel); @@ -1703,7 +1705,7 @@ close_isarstate(struct BCState *bcs) del_timer(&bcs->hw.isar.ftimer); } -int +static int open_isarstate(struct IsdnCardState *cs, struct BCState *bcs) { if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { @@ -1725,7 +1727,7 @@ open_isarstate(struct IsdnCardState *cs, struct BCState *bcs) return (0); } -int +static int setstack_isar(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index 4d08d27f1499..ac899503a74f 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -151,7 +151,7 @@ l1m_debug(struct FsmInst *fi, char *fmt, ...) va_end(args); } -void +static void L1activated(struct IsdnCardState *cs) { struct PStack *st; @@ -166,7 +166,7 @@ L1activated(struct IsdnCardState *cs) } } -void +static void L1deactivated(struct IsdnCardState *cs) { struct PStack *st; @@ -370,7 +370,7 @@ init_bcstate(struct IsdnCardState *cs, int bc) #ifdef L2FRAME_DEBUG /* psa */ -char * +static char * l2cmd(u_char cmd) { switch (cmd & ~0x10) { @@ -404,7 +404,7 @@ l2cmd(u_char cmd) static char tmpdeb[32]; -char * +static char * l2frames(u_char * ptr) { switch (ptr[2] & ~0x10) { diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index d311b5fbf895..9022583fd6a0 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c @@ -142,7 +142,7 @@ freewin1(struct Layer2 *l2) return cnt; } -inline void +static inline void freewin(struct PStack *st) { freewin1(&st->l2); @@ -157,7 +157,7 @@ ReleaseWin(struct Layer2 *l2) printk(KERN_WARNING "isdl2 freed %d skbuffs in release\n", cnt); } -inline unsigned int +static inline unsigned int cansend(struct PStack *st) { unsigned int p1; @@ -169,7 +169,7 @@ cansend(struct PStack *st) return ((p1 < st->l2.window) && !test_bit(FLG_PEER_BUSY, &st->l2.flag)); } -inline void +static inline void clear_exception(struct Layer2 *l2) { test_and_clear_bit(FLG_ACK_PEND, &l2->flag); @@ -178,7 +178,7 @@ clear_exception(struct Layer2 *l2) clear_peer_busy(l2); } -inline int +static inline int l2headersize(struct Layer2 *l2, int ui) { return (((test_bit(FLG_MOD128, &l2->flag) && (!ui)) ? 2 : 1) + @@ -223,40 +223,31 @@ enqueue_super(struct PStack *st, #define enqueue_ui(a, b) enqueue_super(a, b) -inline int +static inline int IsUI(u_char * data) { return ((data[0] & 0xef) == UI); } -inline int +static inline int IsUA(u_char * data) { return ((data[0] & 0xef) == UA); } -inline int +static inline int IsDM(u_char * data) { return ((data[0] & 0xef) == DM); } -inline int +static inline int IsDISC(u_char * data) { return ((data[0] & 0xef) == DISC); } -inline int -IsRR(u_char * data, struct PStack *st) -{ - if (test_bit(FLG_MOD128, &st->l2.flag)) - return (data[0] == RR); - else - return ((data[0] & 0xf) == 1); -} - -inline int +static inline int IsSFrame(u_char * data, struct PStack *st) { register u_char d = *data; @@ -266,7 +257,7 @@ IsSFrame(u_char * data, struct PStack *st) return(((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c)); } -inline int +static inline int IsSABME(u_char * data, struct PStack *st) { u_char d = data[0] & ~0x10; @@ -274,25 +265,25 @@ IsSABME(u_char * data, struct PStack *st) return (test_bit(FLG_MOD128, &st->l2.flag) ? d == SABME : d == SABM); } -inline int +static inline int IsREJ(u_char * data, struct PStack *st) { return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == REJ : (data[0] & 0xf) == REJ); } -inline int +static inline int IsFRMR(u_char * data) { return ((data[0] & 0xef) == FRMR); } -inline int +static inline int IsRNR(u_char * data, struct PStack *st) { return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == RNR : (data[0] & 0xf) == RNR); } -int +static int iframe_error(struct PStack *st, struct sk_buff *skb) { int i = l2addrsize(&st->l2) + (test_bit(FLG_MOD128, &st->l2.flag) ? 2 : 1); @@ -315,7 +306,7 @@ iframe_error(struct PStack *st, struct sk_buff *skb) return 0; } -int +static int super_error(struct PStack *st, struct sk_buff *skb) { if (skb->len != l2addrsize(&st->l2) + @@ -325,7 +316,7 @@ super_error(struct PStack *st, struct sk_buff *skb) return 0; } -int +static int unnum_error(struct PStack *st, struct sk_buff *skb, int wantrsp) { int rsp = (*skb->data & 0x2) >> 1; @@ -341,7 +332,7 @@ unnum_error(struct PStack *st, struct sk_buff *skb, int wantrsp) return 0; } -int +static int UI_error(struct PStack *st, struct sk_buff *skb) { int rsp = *skb->data & 0x2; @@ -357,7 +348,7 @@ UI_error(struct PStack *st, struct sk_buff *skb) return 0; } -int +static int FRMR_error(struct PStack *st, struct sk_buff *skb) { int headers = l2addrsize(&st->l2) + 1; @@ -444,51 +435,44 @@ send_uframe(struct PStack *st, u_char cmd, u_char cr) enqueue_super(st, skb); } -inline u_char +static inline u_char get_PollFlag(struct PStack * st, struct sk_buff * skb) { return (skb->data[l2addrsize(&(st->l2))] & 0x10); } -inline void -FreeSkb(struct sk_buff *skb) -{ - dev_kfree_skb(skb); -} - - -inline u_char +static inline u_char get_PollFlagFree(struct PStack *st, struct sk_buff *skb) { u_char PF; PF = get_PollFlag(st, skb); - FreeSkb(skb); + dev_kfree_skb(skb); return (PF); } -inline void +static inline void start_t200(struct PStack *st, int i) { FsmAddTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); test_and_set_bit(FLG_T200_RUN, &st->l2.flag); } -inline void +static inline void restart_t200(struct PStack *st, int i) { FsmRestartTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); test_and_set_bit(FLG_T200_RUN, &st->l2.flag); } -inline void +static inline void stop_t200(struct PStack *st, int i) { if(test_and_clear_bit(FLG_T200_RUN, &st->l2.flag)) FsmDelTimer(&st->l2.t200, i); } -inline void +static inline void st5_dl_release_l2l3(struct PStack *st) { int pr; @@ -501,7 +485,7 @@ st5_dl_release_l2l3(struct PStack *st) st->l2.l2l3(st, pr, NULL); } -inline void +static inline void lapb_dl_release_l2l3(struct PStack *st, int f) { if (test_bit(FLG_LAPB, &st->l2.flag)) @@ -802,7 +786,7 @@ l2_connected(struct FsmInst *fi, int event, void *arg) l2_mdl_error_ua(fi, event, arg); return; } - FreeSkb(skb); + dev_kfree_skb(skb); if (test_and_clear_bit(FLG_PEND_REL, &st->l2.flag)) l2_disconnect(fi, event, arg); @@ -840,7 +824,7 @@ l2_released(struct FsmInst *fi, int event, void *arg) l2_mdl_error_ua(fi, event, arg); return; } - FreeSkb(skb); + dev_kfree_skb(skb); stop_t200(st, 6); lapb_dl_release_l2l3(st, CONFIRM); @@ -889,7 +873,7 @@ l2_st6_dm_release(struct FsmInst *fi, int event, void *arg) } } -inline void +static inline void enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) { struct sk_buff *skb; @@ -912,7 +896,7 @@ enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) enqueue_super(st, skb); } -inline void +static inline void enquiry_response(struct PStack *st) { if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) @@ -922,7 +906,7 @@ enquiry_response(struct PStack *st) test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); } -inline void +static inline void transmit_enquiry(struct PStack *st) { if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) @@ -1004,7 +988,7 @@ l2_st7_got_super(struct FsmInst *fi, int event, void *arg) PollFlag = (skb->data[0] & 0x10); nr = (skb->data[0] >> 5) & 0x7; } - FreeSkb(skb); + dev_kfree_skb(skb); if (PollFlag) { if (rsp) @@ -1047,7 +1031,7 @@ l2_feed_i_if_reest(struct FsmInst *fi, int event, void *arg) if (!test_bit(FLG_L3_INIT, &st->l2.flag)) skb_queue_tail(&st->l2.i_queue, skb); else - FreeSkb(skb); + dev_kfree_skb(skb); } static void @@ -1093,7 +1077,7 @@ l2_got_iframe(struct FsmInst *fi, int event, void *arg) nr = (skb->data[i] >> 5) & 0x7; } if (test_bit(FLG_OWN_BUSY, &l2->flag)) { - FreeSkb(skb); + dev_kfree_skb(skb); if(PollFlag) enquiry_response(st); } else if (l2->vr == ns) { (l2->vr)++; @@ -1111,7 +1095,7 @@ l2_got_iframe(struct FsmInst *fi, int event, void *arg) st->l2.l2l3(st, DL_DATA | INDICATION, skb); } else { /* n(s)!=v(r) */ - FreeSkb(skb); + dev_kfree_skb(skb); if (test_and_set_bit(FLG_REJEXC, &l2->flag)) { if (PollFlag) enquiry_response(st); @@ -1309,7 +1293,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) skb = alloc_skb(oskb->len + i, GFP_ATOMIC); memcpy(skb_put(skb, i), header, i); memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len); - FreeSkb(oskb); + dev_kfree_skb(oskb); } st->l2.l2l1(st, PH_PULL | INDICATION, skb); test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); @@ -1349,7 +1333,7 @@ l2_st8_got_super(struct FsmInst *fi, int event, void *arg) PollFlag = (skb->data[0] & 0x10); nr = (skb->data[0] >> 5) & 0x7; } - FreeSkb(skb); + dev_kfree_skb(skb); if (rsp && PollFlag) { if (legalnr(st, nr)) { @@ -1391,7 +1375,7 @@ l2_got_FRMR(struct FsmInst *fi, int event, void *arg) establishlink(fi); test_and_clear_bit(FLG_L3_INIT, &st->l2.flag); } - FreeSkb(skb); + dev_kfree_skb(skb); } static void @@ -1655,7 +1639,7 @@ isdnl2_l1l2(struct PStack *st, int pr, void *arg) datap += len; else { FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'N'); - FreeSkb(skb); + dev_kfree_skb(skb); return; } if (!(*datap & 1)) { /* I-Frame */ @@ -1684,16 +1668,16 @@ isdnl2_l1l2(struct PStack *st, int pr, void *arg) ret = FsmEvent(&st->l2.l2m, EV_L2_FRMR, skb); } else { FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'L'); - FreeSkb(skb); + dev_kfree_skb(skb); ret = 0; } if(c) { - FreeSkb(skb); + dev_kfree_skb(skb); FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *)(long)c); ret = 0; } if (ret) - FreeSkb(skb); + dev_kfree_skb(skb); break; case (PH_PULL | CONFIRM): FsmEvent(&st->l2.l2m, EV_L2_ACK_PULL, arg); diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c index f571b5d18e91..abcc9530eb34 100644 --- a/drivers/isdn/hisax/isdnl3.c +++ b/drivers/isdn/hisax/isdnl3.c @@ -390,7 +390,7 @@ setstack_l3dc(struct PStack *st, struct Channel *chanp) } } -void +static void isdnl3_trans(struct PStack *st, int pr, void *arg) { st->l3.l3l2(st, pr, arg); } diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c index af5171da7345..33747afc984d 100644 --- a/drivers/isdn/hisax/isurf.c +++ b/drivers/isdn/hisax/isurf.c @@ -122,7 +122,7 @@ isurf_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_isurf(struct IsdnCardState *cs) { release_region(cs->hw.isurf.reset, 1); diff --git a/drivers/isdn/hisax/ix1_micro.c b/drivers/isdn/hisax/ix1_micro.c index b843b7509ae2..908a7e144421 100644 --- a/drivers/isdn/hisax/ix1_micro.c +++ b/drivers/isdn/hisax/ix1_micro.c @@ -25,7 +25,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *ix1_revision = "$Revision: 2.12.2.4 $"; +static const char *ix1_revision = "$Revision: 2.12.2.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -162,7 +162,7 @@ ix1micro_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_ix1micro(struct IsdnCardState *cs) { if (cs->hw.ix1.cfg_reg) diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c index f05d52757557..363ae3179bbd 100644 --- a/drivers/isdn/hisax/jade.c +++ b/drivers/isdn/hisax/jade.c @@ -74,7 +74,7 @@ jade_write_indirect(struct IsdnCardState *cs, u_char reg, u_char value) -void +static void modejade(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -190,7 +190,7 @@ jade_l2l1(struct PStack *st, int pr, void *arg) } } -void +static void close_jadestate(struct BCState *bcs) { modejade(bcs, 0, bcs->channel); @@ -243,7 +243,7 @@ open_jadestate(struct IsdnCardState *cs, struct BCState *bcs) } -int +static int setstack_jade(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; diff --git a/drivers/isdn/hisax/jade.h b/drivers/isdn/hisax/jade.h index fa2944485994..29055e1ee381 100644 --- a/drivers/isdn/hisax/jade.h +++ b/drivers/isdn/hisax/jade.h @@ -128,7 +128,6 @@ #define jade_TXAUDIOCH2CFG 0x1A extern int JadeVersion(struct IsdnCardState *cs, char *s); -extern void modejade(struct BCState *bcs, int mode, int bc); extern void clear_pending_jade_ints(struct IsdnCardState *cs); extern void initjade(struct IsdnCardState *cs); diff --git a/drivers/isdn/hisax/l3_1tr6.c b/drivers/isdn/hisax/l3_1tr6.c index d6c1c8f8329d..c5c36eeff261 100644 --- a/drivers/isdn/hisax/l3_1tr6.c +++ b/drivers/isdn/hisax/l3_1tr6.c @@ -19,7 +19,7 @@ #include <linux/ctype.h> extern char *HiSax_getrev(const char *revision); -const char *l3_1tr6_revision = "$Revision: 2.15.2.3 $"; +static const char *l3_1tr6_revision = "$Revision: 2.15.2.3 $"; #define MsgHead(ptr, cref, mty, dis) \ *ptr++ = dis; \ diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c index ec92308c1efc..a6d2abdb478a 100644 --- a/drivers/isdn/hisax/l3dss1.c +++ b/drivers/isdn/hisax/l3dss1.c @@ -26,7 +26,7 @@ #include <linux/config.h> extern char *HiSax_getrev(const char *revision); -const char *dss1_revision = "$Revision: 2.32.2.3 $"; +static const char *dss1_revision = "$Revision: 2.32.2.3 $"; #define EXT_BEARER_CAPS 1 diff --git a/drivers/isdn/hisax/l3ni1.c b/drivers/isdn/hisax/l3ni1.c index 3ab3a54daac1..f7041d5ba64e 100644 --- a/drivers/isdn/hisax/l3ni1.c +++ b/drivers/isdn/hisax/l3ni1.c @@ -24,7 +24,7 @@ #include <linux/ctype.h> extern char *HiSax_getrev(const char *revision); -const char *ni1_revision = "$Revision: 2.8.2.3 $"; +static const char *ni1_revision = "$Revision: 2.8.2.3 $"; #define EXT_BEARER_CAPS 1 @@ -2665,7 +2665,7 @@ static void l3ni1_spid_send( struct l3_process *pc, u_char pr, void *arg ) l3ni1_SendSpid( pc, pr, arg, 20 ); } -void l3ni1_spid_epid( struct l3_process *pc, u_char pr, void *arg ) +static void l3ni1_spid_epid( struct l3_process *pc, u_char pr, void *arg ) { struct sk_buff *skb = arg; diff --git a/drivers/isdn/hisax/mic.c b/drivers/isdn/hisax/mic.c index 3ac4484a4886..fe11f226b285 100644 --- a/drivers/isdn/hisax/mic.c +++ b/drivers/isdn/hisax/mic.c @@ -18,7 +18,7 @@ extern const char *CardType[]; -const char *mic_revision = "$Revision: 1.12.2.4 $"; +static const char *mic_revision = "$Revision: 1.12.2.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -157,7 +157,7 @@ mic_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_mic(struct IsdnCardState *cs) { int bytecnt = 8; diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c index fe61d26365d3..94da03c30c51 100644 --- a/drivers/isdn/hisax/netjet.c +++ b/drivers/isdn/hisax/netjet.c @@ -25,8 +25,6 @@ #include <asm/io.h> #include "netjet.h" -const char *NETjet_revision = "$Revision: 1.29.2.4 $"; - /* Interface functions */ u_char @@ -66,7 +64,7 @@ NETjet_WriteICfifo(struct IsdnCardState *cs, u_char *data, int size) outsb(cs->hw.njet.isac, data, size); } -void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) +static void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) { u_int mask=0x000000ff, val = 0, *p=pos; u_int i; @@ -85,7 +83,7 @@ void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) } } -void +static void mode_tiger(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; @@ -852,7 +850,7 @@ tiger_l2l1(struct PStack *st, int pr, void *arg) } -void +static void close_tigerstate(struct BCState *bcs) { mode_tiger(bcs, 0, bcs->channel); @@ -900,7 +898,7 @@ open_tigerstate(struct IsdnCardState *cs, struct BCState *bcs) return (0); } -int +static int setstack_tiger(struct PStack *st, struct BCState *bcs) { bcs->channel = st->l1.bc; @@ -966,7 +964,7 @@ inittiger(struct IsdnCardState *cs) cs->bcs[1].BC_Close = close_tigerstate; } -void +static void releasetiger(struct IsdnCardState *cs) { if (cs->bcs[0].hw.tiger.send) { diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c index cf77d8360975..68a2159cbd11 100644 --- a/drivers/isdn/hisax/niccy.c +++ b/drivers/isdn/hisax/niccy.c @@ -24,7 +24,7 @@ #include <linux/isapnp.h> extern const char *CardType[]; -const char *niccy_revision = "$Revision: 1.21.2.4 $"; +static const char *niccy_revision = "$Revision: 1.21.2.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -178,7 +178,7 @@ niccy_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_niccy(struct IsdnCardState *cs) { if (cs->subtyp == NICCY_PCI) { diff --git a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c index fd664697f821..a7d3cd3f36fd 100644 --- a/drivers/isdn/hisax/nj_s.c +++ b/drivers/isdn/hisax/nj_s.c @@ -15,7 +15,7 @@ #include <linux/ppp_defs.h> #include "netjet.h" -const char *NETjet_S_revision = "$Revision: 2.13.2.4 $"; +static const char *NETjet_S_revision = "$Revision: 2.13.2.4 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { diff --git a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c index 3d6441e9633c..1ae7cac98a87 100644 --- a/drivers/isdn/hisax/nj_u.c +++ b/drivers/isdn/hisax/nj_u.c @@ -15,7 +15,7 @@ #include <linux/ppp_defs.h> #include "netjet.h" -const char *NETjet_U_revision = "$Revision: 2.14.2.3 $"; +static const char *NETjet_U_revision = "$Revision: 2.14.2.3 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { diff --git a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c index 170fcd4a3984..abecabf8c271 100644 --- a/drivers/isdn/hisax/q931.c +++ b/drivers/isdn/hisax/q931.c @@ -516,7 +516,7 @@ struct MessageType cause_1tr6[] = {CAUSE_UserInfoDiscarded, "User Info Discarded"} }; -int cause_1tr6_len = (sizeof(cause_1tr6) / sizeof(struct MessageType)); +static int cause_1tr6_len = (sizeof(cause_1tr6) / sizeof(struct MessageType)); static int prcause_1tr6(char *dest, u_char * p) @@ -935,7 +935,7 @@ display(char *dest, u_char * p) return (dp - dest); } -int +static int prfacility(char *dest, u_char * p) { char *dp = dest; diff --git a/drivers/isdn/hisax/s0box.c b/drivers/isdn/hisax/s0box.c index f3c481384a4e..7b63085ea6e5 100644 --- a/drivers/isdn/hisax/s0box.c +++ b/drivers/isdn/hisax/s0box.c @@ -17,7 +17,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *s0box_revision = "$Revision: 2.6.2.4 $"; +static const char *s0box_revision = "$Revision: 2.6.2.4 $"; static inline void writereg(unsigned int padr, signed int addr, u_char off, u_char val) { @@ -183,7 +183,7 @@ s0box_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_s0box(struct IsdnCardState *cs) { release_region(cs->hw.teles3.cfg_reg, 8); diff --git a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c index 9e6d3d686cce..821776e1561a 100644 --- a/drivers/isdn/hisax/saphir.c +++ b/drivers/isdn/hisax/saphir.c @@ -171,7 +171,7 @@ SaphirWatchDog(struct IsdnCardState *cs) mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); } -void +static void release_io_saphir(struct IsdnCardState *cs) { byteout(cs->hw.saphir.cfg_reg + IRQ_REG, 0xff); diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index 8390f1606853..8c044a6a7fe3 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -51,9 +51,9 @@ extern const char *CardType[]; -const char *Sedlbauer_revision = "$Revision: 1.34.2.6 $"; +static const char *Sedlbauer_revision = "$Revision: 1.34.2.6 $"; -const char *Sedlbauer_Types[] = +static const char *Sedlbauer_Types[] = {"None", "speed card/win", "speed star", "speed fax+", "speed win II / ISDN PC/104", "speed star II", "speed pci", "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"}; @@ -394,7 +394,7 @@ sedlbauer_interrupt_isar(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_sedlbauer(struct IsdnCardState *cs) { int bytecnt = 8; diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 449651241477..058147a69576 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c @@ -616,6 +616,18 @@ static int sedlbauer_event(event_t event, int priority, return 0; } /* sedlbauer_event */ +static struct pcmcia_device_id sedlbauer_ids[] = { + PCMCIA_DEVICE_PROD_ID1234("SEDLBAUER", "speed star II", "V 3.1", "(c) 93 - 98 cb ", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a, 0x50d4149c), + PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D67", 0x81fb79f5, 0xe4e9bc12, 0x397b7e90), + PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D98", 0x81fb79f5, 0xe4e9bc12, 0x2e5c7fce), + PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", " (C) 93-94 VK", 0x81fb79f5, 0xe4e9bc12, 0x8db143fe), + PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", " (c) 93-95 VK", 0x81fb79f5, 0xe4e9bc12, 0xb391ab4c), + PCMCIA_DEVICE_PROD_ID12("HST High Soft Tech GmbH", "Saphir II B", 0xd79e0b84, 0x21d083ae), +/* PCMCIA_DEVICE_PROD_ID1234("SEDLBAUER", 0x81fb79f5), */ /* too generic*/ + PCMCIA_DEVICE_NULL +}; +MODULE_DEVICE_TABLE(pcmcia, sedlbauer_ids); + static struct pcmcia_driver sedlbauer_driver = { .owner = THIS_MODULE, .drv = { @@ -623,6 +635,7 @@ static struct pcmcia_driver sedlbauer_driver = { }, .attach = sedlbauer_attach, .detach = sedlbauer_detach, + .id_table = sedlbauer_ids, }; static int __init init_sedlbauer_cs(void) diff --git a/drivers/isdn/hisax/sportster.c b/drivers/isdn/hisax/sportster.c index 132840b750ce..cdf35dc564c4 100644 --- a/drivers/isdn/hisax/sportster.c +++ b/drivers/isdn/hisax/sportster.c @@ -19,7 +19,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *sportster_revision = "$Revision: 1.16.2.4 $"; +static const char *sportster_revision = "$Revision: 1.16.2.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -132,7 +132,7 @@ sportster_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_sportster(struct IsdnCardState *cs) { int i, adr; @@ -144,7 +144,7 @@ release_io_sportster(struct IsdnCardState *cs) } } -void +static void reset_sportster(struct IsdnCardState *cs) { cs->hw.spt.res_irq |= SPORTSTER_RESET; /* Reset On */ diff --git a/drivers/isdn/hisax/st5481.h b/drivers/isdn/hisax/st5481.h index e8177b017b1d..0fda5c89429b 100644 --- a/drivers/isdn/hisax/st5481.h +++ b/drivers/isdn/hisax/st5481.h @@ -450,12 +450,8 @@ int st5481_setup_isocpipes(struct urb* urb[2], struct usb_device *dev, usb_complete_t complete, void *context); void st5481_release_isocpipes(struct urb* urb[2]); -int st5481_isoc_flatten(struct urb *urb); void st5481_usb_pipe_reset(struct st5481_adapter *adapter, u_char pipe, ctrl_complete_t complete, void *context); -void st5481_usb_ctrl_msg(struct st5481_adapter *adapter, - u8 request, u8 requesttype, u16 value, u16 index, - ctrl_complete_t complete, void *context); void st5481_usb_device_ctrl_msg(struct st5481_adapter *adapter, u8 request, u16 value, ctrl_complete_t complete, void *context); diff --git a/drivers/isdn/hisax/st5481_hdlc.c b/drivers/isdn/hisax/st5481_hdlc.c deleted file mode 100644 index 680f42e9a993..000000000000 --- a/drivers/isdn/hisax/st5481_hdlc.c +++ /dev/null @@ -1,580 +0,0 @@ -/* - * Driver for ST5481 USB ISDN modem - * - * Author Frode Isaksen - * Copyright 2001 by Frode Isaksen <fisaksen@bewan.com> - * 2001 by Kai Germaschewski <kai.germaschewski@gmx.de> - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - * - */ - -#include <linux/crc-ccitt.h> -#include "st5481_hdlc.h" - - -enum { - HDLC_FAST_IDLE,HDLC_GET_FLAG_B0,HDLC_GETFLAG_B1A6,HDLC_GETFLAG_B7, - HDLC_GET_DATA,HDLC_FAST_FLAG -}; - -enum { - HDLC_SEND_DATA,HDLC_SEND_CRC1,HDLC_SEND_FAST_FLAG, - HDLC_SEND_FIRST_FLAG,HDLC_SEND_CRC2,HDLC_SEND_CLOSING_FLAG, - HDLC_SEND_IDLE1,HDLC_SEND_FAST_IDLE,HDLC_SENDFLAG_B0, - HDLC_SENDFLAG_B1A6,HDLC_SENDFLAG_B7,STOPPED -}; - -void -hdlc_rcv_init(struct hdlc_vars *hdlc, int do_adapt56) -{ - hdlc->bit_shift = 0; - hdlc->hdlc_bits1 = 0; - hdlc->data_bits = 0; - hdlc->ffbit_shift = 0; - hdlc->data_received = 0; - hdlc->state = HDLC_GET_DATA; - hdlc->do_adapt56 = do_adapt56; - hdlc->dchannel = 0; - hdlc->crc = 0; - hdlc->cbin = 0; - hdlc->shift_reg = 0; - hdlc->ffvalue = 0; - hdlc->dstpos = 0; -} - -void -hdlc_out_init(struct hdlc_vars *hdlc, int is_d_channel, int do_adapt56) -{ - hdlc->bit_shift = 0; - hdlc->hdlc_bits1 = 0; - hdlc->data_bits = 0; - hdlc->ffbit_shift = 0; - hdlc->data_received = 0; - hdlc->do_closing = 0; - hdlc->ffvalue = 0; - if (is_d_channel) { - hdlc->dchannel = 1; - hdlc->state = HDLC_SEND_FIRST_FLAG; - } else { - hdlc->dchannel = 0; - hdlc->state = HDLC_SEND_FAST_FLAG; - hdlc->ffvalue = 0x7e; - } - hdlc->cbin = 0x7e; - hdlc->bit_shift = 0; - if(do_adapt56){ - hdlc->do_adapt56 = 1; - hdlc->data_bits = 0; - hdlc->state = HDLC_SENDFLAG_B0; - } else { - hdlc->do_adapt56 = 0; - hdlc->data_bits = 8; - } - hdlc->shift_reg = 0; -} - -/* - hdlc_decode - decodes HDLC frames from a transparent bit stream. - - The source buffer is scanned for valid HDLC frames looking for - flags (01111110) to indicate the start of a frame. If the start of - the frame is found, the bit stuffing is removed (0 after 5 1's). - When a new flag is found, the complete frame has been received - and the CRC is checked. - If a valid frame is found, the function returns the frame length - excluding the CRC with the bit HDLC_END_OF_FRAME set. - If the beginning of a valid frame is found, the function returns - the length. - If a framing error is found (too many 1s and not a flag) the function - returns the length with the bit HDLC_FRAMING_ERROR set. - If a CRC error is found the function returns the length with the - bit HDLC_CRC_ERROR set. - If the frame length exceeds the destination buffer size, the function - returns the length with the bit HDLC_LENGTH_ERROR set. - - src - source buffer - slen - source buffer length - count - number of bytes removed (decoded) from the source buffer - dst _ destination buffer - dsize - destination buffer size - returns - number of decoded bytes in the destination buffer and status - flag. - */ -int hdlc_decode(struct hdlc_vars *hdlc, const unsigned char *src, - int slen, int *count, unsigned char *dst, int dsize) -{ - int status=0; - - static const unsigned char fast_flag[]={ - 0x00,0x00,0x00,0x20,0x30,0x38,0x3c,0x3e,0x3f - }; - - static const unsigned char fast_flag_value[]={ - 0x00,0x7e,0xfc,0xf9,0xf3,0xe7,0xcf,0x9f,0x3f - }; - - static const unsigned char fast_abort[]={ - 0x00,0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff - }; - - *count = slen; - - while(slen > 0){ - if(hdlc->bit_shift==0){ - hdlc->cbin = *src++; - slen--; - hdlc->bit_shift = 8; - if(hdlc->do_adapt56){ - hdlc->bit_shift --; - } - } - - switch(hdlc->state){ - case STOPPED: - return 0; - case HDLC_FAST_IDLE: - if(hdlc->cbin == 0xff){ - hdlc->bit_shift = 0; - break; - } - hdlc->state = HDLC_GET_FLAG_B0; - hdlc->hdlc_bits1 = 0; - hdlc->bit_shift = 8; - break; - case HDLC_GET_FLAG_B0: - if(!(hdlc->cbin & 0x80)) { - hdlc->state = HDLC_GETFLAG_B1A6; - hdlc->hdlc_bits1 = 0; - } else { - if(!hdlc->do_adapt56){ - if(++hdlc->hdlc_bits1 >=8 ) if(hdlc->bit_shift==1) - hdlc->state = HDLC_FAST_IDLE; - } - } - hdlc->cbin<<=1; - hdlc->bit_shift --; - break; - case HDLC_GETFLAG_B1A6: - if(hdlc->cbin & 0x80){ - hdlc->hdlc_bits1++; - if(hdlc->hdlc_bits1==6){ - hdlc->state = HDLC_GETFLAG_B7; - } - } else { - hdlc->hdlc_bits1 = 0; - } - hdlc->cbin<<=1; - hdlc->bit_shift --; - break; - case HDLC_GETFLAG_B7: - if(hdlc->cbin & 0x80) { - hdlc->state = HDLC_GET_FLAG_B0; - } else { - hdlc->state = HDLC_GET_DATA; - hdlc->crc = 0xffff; - hdlc->shift_reg = 0; - hdlc->hdlc_bits1 = 0; - hdlc->data_bits = 0; - hdlc->data_received = 0; - } - hdlc->cbin<<=1; - hdlc->bit_shift --; - break; - case HDLC_GET_DATA: - if(hdlc->cbin & 0x80){ - hdlc->hdlc_bits1++; - switch(hdlc->hdlc_bits1){ - case 6: - break; - case 7: - if(hdlc->data_received) { - // bad frame - status = -HDLC_FRAMING_ERROR; - } - if(!hdlc->do_adapt56){ - if(hdlc->cbin==fast_abort[hdlc->bit_shift+1]){ - hdlc->state = HDLC_FAST_IDLE; - hdlc->bit_shift=1; - break; - } - } else { - hdlc->state = HDLC_GET_FLAG_B0; - } - break; - default: - hdlc->shift_reg>>=1; - hdlc->shift_reg |= 0x80; - hdlc->data_bits++; - break; - } - } else { - switch(hdlc->hdlc_bits1){ - case 5: - break; - case 6: - if(hdlc->data_received){ - if (hdlc->dstpos < 2) { - status = -HDLC_FRAMING_ERROR; - } else if (hdlc->crc != 0xf0b8){ - // crc error - status = -HDLC_CRC_ERROR; - } else { - // remove CRC - hdlc->dstpos -= 2; - // good frame - status = hdlc->dstpos; - } - } - hdlc->crc = 0xffff; - hdlc->shift_reg = 0; - hdlc->data_bits = 0; - if(!hdlc->do_adapt56){ - if(hdlc->cbin==fast_flag[hdlc->bit_shift]){ - hdlc->ffvalue = fast_flag_value[hdlc->bit_shift]; - hdlc->state = HDLC_FAST_FLAG; - hdlc->ffbit_shift = hdlc->bit_shift; - hdlc->bit_shift = 1; - } else { - hdlc->state = HDLC_GET_DATA; - hdlc->data_received = 0; - } - } else { - hdlc->state = HDLC_GET_DATA; - hdlc->data_received = 0; - } - break; - default: - hdlc->shift_reg>>=1; - hdlc->data_bits++; - break; - } - hdlc->hdlc_bits1 = 0; - } - if (status) { - hdlc->dstpos = 0; - *count -= slen; - hdlc->cbin <<= 1; - hdlc->bit_shift--; - return status; - } - if(hdlc->data_bits==8){ - hdlc->data_bits = 0; - hdlc->data_received = 1; - hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg); - - // good byte received - if (dsize--) { - dst[hdlc->dstpos++] = hdlc->shift_reg; - } else { - // frame too long - status = -HDLC_LENGTH_ERROR; - hdlc->dstpos = 0; - } - } - hdlc->cbin <<= 1; - hdlc->bit_shift--; - break; - case HDLC_FAST_FLAG: - if(hdlc->cbin==hdlc->ffvalue){ - hdlc->bit_shift = 0; - break; - } else { - if(hdlc->cbin == 0xff){ - hdlc->state = HDLC_FAST_IDLE; - hdlc->bit_shift=0; - } else if(hdlc->ffbit_shift==8){ - hdlc->state = HDLC_GETFLAG_B7; - break; - } else { - hdlc->shift_reg = fast_abort[hdlc->ffbit_shift-1]; - hdlc->hdlc_bits1 = hdlc->ffbit_shift-2; - if(hdlc->hdlc_bits1<0)hdlc->hdlc_bits1 = 0; - hdlc->data_bits = hdlc->ffbit_shift-1; - hdlc->state = HDLC_GET_DATA; - hdlc->data_received = 0; - } - } - break; - default: - break; - } - } - *count -= slen; - return 0; -} - -/* - hdlc_encode - encodes HDLC frames to a transparent bit stream. - - The bit stream starts with a beginning flag (01111110). After - that each byte is added to the bit stream with bit stuffing added - (0 after 5 1's). - When the last byte has been removed from the source buffer, the - CRC (2 bytes is added) and the frame terminates with the ending flag. - For the dchannel, the idle character (all 1's) is also added at the end. - If this function is called with empty source buffer (slen=0), flags or - idle character will be generated. - - src - source buffer - slen - source buffer length - count - number of bytes removed (encoded) from source buffer - dst _ destination buffer - dsize - destination buffer size - returns - number of encoded bytes in the destination buffer -*/ -int hdlc_encode(struct hdlc_vars *hdlc, const unsigned char *src, - unsigned short slen, int *count, - unsigned char *dst, int dsize) -{ - static const unsigned char xfast_flag_value[] = { - 0x7e,0x3f,0x9f,0xcf,0xe7,0xf3,0xf9,0xfc,0x7e - }; - - int len = 0; - - *count = slen; - - while (dsize > 0) { - if(hdlc->bit_shift==0){ - if(slen && !hdlc->do_closing){ - hdlc->shift_reg = *src++; - slen--; - if (slen == 0) - hdlc->do_closing = 1; /* closing sequence, CRC + flag(s) */ - hdlc->bit_shift = 8; - } else { - if(hdlc->state == HDLC_SEND_DATA){ - if(hdlc->data_received){ - hdlc->state = HDLC_SEND_CRC1; - hdlc->crc ^= 0xffff; - hdlc->bit_shift = 8; - hdlc->shift_reg = hdlc->crc & 0xff; - } else if(!hdlc->do_adapt56){ - hdlc->state = HDLC_SEND_FAST_FLAG; - } else { - hdlc->state = HDLC_SENDFLAG_B0; - } - } - - } - } - - switch(hdlc->state){ - case STOPPED: - while (dsize--) - *dst++ = 0xff; - - return dsize; - case HDLC_SEND_FAST_FLAG: - hdlc->do_closing = 0; - if(slen == 0){ - *dst++ = hdlc->ffvalue; - len++; - dsize--; - break; - } - if(hdlc->bit_shift==8){ - hdlc->cbin = hdlc->ffvalue>>(8-hdlc->data_bits); - hdlc->state = HDLC_SEND_DATA; - hdlc->crc = 0xffff; - hdlc->hdlc_bits1 = 0; - hdlc->data_received = 1; - } - break; - case HDLC_SENDFLAG_B0: - hdlc->do_closing = 0; - hdlc->cbin <<= 1; - hdlc->data_bits++; - hdlc->hdlc_bits1 = 0; - hdlc->state = HDLC_SENDFLAG_B1A6; - break; - case HDLC_SENDFLAG_B1A6: - hdlc->cbin <<= 1; - hdlc->data_bits++; - hdlc->cbin++; - if(++hdlc->hdlc_bits1 == 6) - hdlc->state = HDLC_SENDFLAG_B7; - break; - case HDLC_SENDFLAG_B7: - hdlc->cbin <<= 1; - hdlc->data_bits++; - if(slen == 0){ - hdlc->state = HDLC_SENDFLAG_B0; - break; - } - if(hdlc->bit_shift==8){ - hdlc->state = HDLC_SEND_DATA; - hdlc->crc = 0xffff; - hdlc->hdlc_bits1 = 0; - hdlc->data_received = 1; - } - break; - case HDLC_SEND_FIRST_FLAG: - hdlc->data_received = 1; - if(hdlc->data_bits==8){ - hdlc->state = HDLC_SEND_DATA; - hdlc->crc = 0xffff; - hdlc->hdlc_bits1 = 0; - break; - } - hdlc->cbin <<= 1; - hdlc->data_bits++; - if(hdlc->shift_reg & 0x01) - hdlc->cbin++; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - if(hdlc->bit_shift==0){ - hdlc->state = HDLC_SEND_DATA; - hdlc->crc = 0xffff; - hdlc->hdlc_bits1 = 0; - } - break; - case HDLC_SEND_DATA: - hdlc->cbin <<= 1; - hdlc->data_bits++; - if(hdlc->hdlc_bits1 == 5){ - hdlc->hdlc_bits1 = 0; - break; - } - if(hdlc->bit_shift==8){ - hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg); - } - if(hdlc->shift_reg & 0x01){ - hdlc->hdlc_bits1++; - hdlc->cbin++; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - } else { - hdlc->hdlc_bits1 = 0; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - } - break; - case HDLC_SEND_CRC1: - hdlc->cbin <<= 1; - hdlc->data_bits++; - if(hdlc->hdlc_bits1 == 5){ - hdlc->hdlc_bits1 = 0; - break; - } - if(hdlc->shift_reg & 0x01){ - hdlc->hdlc_bits1++; - hdlc->cbin++; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - } else { - hdlc->hdlc_bits1 = 0; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - } - if(hdlc->bit_shift==0){ - hdlc->shift_reg = (hdlc->crc >> 8); - hdlc->state = HDLC_SEND_CRC2; - hdlc->bit_shift = 8; - } - break; - case HDLC_SEND_CRC2: - hdlc->cbin <<= 1; - hdlc->data_bits++; - if(hdlc->hdlc_bits1 == 5){ - hdlc->hdlc_bits1 = 0; - break; - } - if(hdlc->shift_reg & 0x01){ - hdlc->hdlc_bits1++; - hdlc->cbin++; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - } else { - hdlc->hdlc_bits1 = 0; - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - } - if(hdlc->bit_shift==0){ - hdlc->shift_reg = 0x7e; - hdlc->state = HDLC_SEND_CLOSING_FLAG; - hdlc->bit_shift = 8; - } - break; - case HDLC_SEND_CLOSING_FLAG: - hdlc->cbin <<= 1; - hdlc->data_bits++; - if(hdlc->hdlc_bits1 == 5){ - hdlc->hdlc_bits1 = 0; - break; - } - if(hdlc->shift_reg & 0x01){ - hdlc->cbin++; - } - hdlc->shift_reg >>= 1; - hdlc->bit_shift--; - if(hdlc->bit_shift==0){ - hdlc->ffvalue = xfast_flag_value[hdlc->data_bits]; - if(hdlc->dchannel){ - hdlc->ffvalue = 0x7e; - hdlc->state = HDLC_SEND_IDLE1; - hdlc->bit_shift = 8-hdlc->data_bits; - if(hdlc->bit_shift==0) - hdlc->state = HDLC_SEND_FAST_IDLE; - } else { - if(!hdlc->do_adapt56){ - hdlc->state = HDLC_SEND_FAST_FLAG; - hdlc->data_received = 0; - } else { - hdlc->state = HDLC_SENDFLAG_B0; - hdlc->data_received = 0; - } - // Finished with this frame, send flags - if (dsize > 1) dsize = 1; - } - } - break; - case HDLC_SEND_IDLE1: - hdlc->do_closing = 0; - hdlc->cbin <<= 1; - hdlc->cbin++; - hdlc->data_bits++; - hdlc->bit_shift--; - if(hdlc->bit_shift==0){ - hdlc->state = HDLC_SEND_FAST_IDLE; - hdlc->bit_shift = 0; - } - break; - case HDLC_SEND_FAST_IDLE: - hdlc->do_closing = 0; - hdlc->cbin = 0xff; - hdlc->data_bits = 8; - if(hdlc->bit_shift == 8){ - hdlc->cbin = 0x7e; - hdlc->state = HDLC_SEND_FIRST_FLAG; - } else { - *dst++ = hdlc->cbin; - hdlc->bit_shift = hdlc->data_bits = 0; - len++; - dsize = 0; - } - break; - default: - break; - } - if(hdlc->do_adapt56){ - if(hdlc->data_bits==7){ - hdlc->cbin <<= 1; - hdlc->cbin++; - hdlc->data_bits++; - } - } - if(hdlc->data_bits==8){ - *dst++ = hdlc->cbin; - hdlc->data_bits = 0; - len++; - dsize--; - } - } - *count -= slen; - - return len; -} - diff --git a/drivers/isdn/hisax/st5481_hdlc.h b/drivers/isdn/hisax/st5481_hdlc.h deleted file mode 100644 index 495432f0f6ba..000000000000 --- a/drivers/isdn/hisax/st5481_hdlc.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Driver for ST5481 USB ISDN modem - * - * Author Frode Isaksen - * Copyright 2001 by Frode Isaksen <fisaksen@bewan.com> - * 2001 by Kai Germaschewski <kai.germaschewski@gmx.de> - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - * - */ - -#ifndef __ST5481_HDLC_H__ -#define __ST5481_HDLC_H__ - -struct hdlc_vars { - int bit_shift; - int hdlc_bits1; - int data_bits; - int ffbit_shift; // encoding only - int state; - int dstpos; - - int data_received:1; // set if transferring data - int dchannel:1; // set if D channel (send idle instead of flags) - int do_adapt56:1; // set if 56K adaptation - int do_closing:1; // set if in closing phase (need to send CRC + flag - - unsigned short crc; - - unsigned char cbin; - unsigned char shift_reg; - unsigned char ffvalue; - -}; - - -/* - The return value from hdlc_decode is - the frame length, 0 if no complete frame was decoded, - or a negative error number -*/ - -#define HDLC_FRAMING_ERROR 1 -#define HDLC_CRC_ERROR 2 -#define HDLC_LENGTH_ERROR 3 - -void -hdlc_rcv_init(struct hdlc_vars *hdlc, int do_adapt56); - -int -hdlc_decode(struct hdlc_vars *hdlc, const unsigned char *src, int slen,int *count, - unsigned char *dst, int dsize); - -void -hdlc_out_init(struct hdlc_vars *hdlc,int is_d_channel,int do_adapt56); - -int -hdlc_encode(struct hdlc_vars *hdlc,const unsigned char *src,unsigned short slen,int *count, - unsigned char *dst,int dsize); - -#endif diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c index 2369180b1cb1..ab62223297a5 100644 --- a/drivers/isdn/hisax/st5481_usb.c +++ b/drivers/isdn/hisax/st5481_usb.c @@ -15,6 +15,8 @@ #include <linux/slab.h> #include "st5481.h" +static int st5481_isoc_flatten(struct urb *urb); + /* ====================================================================== * control pipe */ @@ -55,9 +57,9 @@ static void usb_next_ctrl_msg(struct urb *urb, * Asynchronous endpoint 0 request (async version of usb_control_msg). * The request will be queued up in a FIFO if the endpoint is busy. */ -void usb_ctrl_msg(struct st5481_adapter *adapter, - u8 request, u8 requesttype, u16 value, u16 index, - ctrl_complete_t complete, void *context) +static void usb_ctrl_msg(struct st5481_adapter *adapter, + u8 request, u8 requesttype, u16 value, u16 index, + ctrl_complete_t complete, void *context) { struct st5481_ctrl *ctrl = &adapter->ctrl; int w_index; @@ -571,7 +573,7 @@ void st5481_release_in(struct st5481_in *in) * Make the transfer_buffer contiguous by * copying from the iso descriptors if necessary. */ -int st5481_isoc_flatten(struct urb *urb) +static int st5481_isoc_flatten(struct urb *urb) { struct usb_iso_packet_descriptor *pipd,*pend; unsigned char *src,*dst; diff --git a/drivers/isdn/hisax/tei.c b/drivers/isdn/hisax/tei.c index 082726db3985..ceb0df92fd3e 100644 --- a/drivers/isdn/hisax/tei.c +++ b/drivers/isdn/hisax/tei.c @@ -74,7 +74,7 @@ static char *strTeiEvent[] = "EV_T202", }; -unsigned int +static unsigned int random_ri(void) { unsigned int x; diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c index ef8984c5f1f7..a2b1816af37a 100644 --- a/drivers/isdn/hisax/teleint.c +++ b/drivers/isdn/hisax/teleint.c @@ -18,7 +18,7 @@ extern const char *CardType[]; -const char *TeleInt_revision = "$Revision: 1.16.2.5 $"; +static const char *TeleInt_revision = "$Revision: 1.16.2.5 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -203,7 +203,7 @@ TeleInt_Timer(struct IsdnCardState *cs) add_timer(&cs->hw.hfc.timer); } -void +static void release_io_TeleInt(struct IsdnCardState *cs) { del_timer(&cs->hw.hfc.timer); diff --git a/drivers/isdn/hisax/teles0.c b/drivers/isdn/hisax/teles0.c index 5ec5ec3e1eab..2b7df8f98233 100644 --- a/drivers/isdn/hisax/teles0.c +++ b/drivers/isdn/hisax/teles0.c @@ -23,7 +23,7 @@ extern const char *CardType[]; -const char *teles0_revision = "$Revision: 2.15.2.4 $"; +static const char *teles0_revision = "$Revision: 2.15.2.4 $"; #define TELES_IOMEM_SIZE 0x400 #define byteout(addr,val) outb(val,addr) @@ -183,7 +183,7 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_teles0(struct IsdnCardState *cs) { if (cs->hw.teles0.cfg_reg) diff --git a/drivers/isdn/hisax/teles3.c b/drivers/isdn/hisax/teles3.c index c5b1f65f7275..adeaad62d35c 100644 --- a/drivers/isdn/hisax/teles3.c +++ b/drivers/isdn/hisax/teles3.c @@ -21,7 +21,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *teles3_revision = "$Revision: 2.19.2.4 $"; +static const char *teles3_revision = "$Revision: 2.19.2.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -154,7 +154,7 @@ release_ioregs(struct IsdnCardState *cs, int mask) release_region(cs->hw.teles3.hscx[1] + 32, 32); } -void +static void release_io_teles3(struct IsdnCardState *cs) { if (cs->typ == ISDN_CTYPE_TELESPCMCIA) { diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 63e8e20c17a8..107376ff5b9b 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c @@ -489,6 +489,12 @@ static int teles_cs_event(event_t event, int priority, return 0; } /* teles_cs_event */ +static struct pcmcia_device_id teles_ids[] = { + PCMCIA_DEVICE_PROD_ID12("TELES", "S0/PC", 0x67b50eae, 0xe9e70119), + PCMCIA_DEVICE_NULL, +}; +MODULE_DEVICE_TABLE(pcmcia, teles_ids); + static struct pcmcia_driver teles_cs_driver = { .owner = THIS_MODULE, .drv = { @@ -496,6 +502,7 @@ static struct pcmcia_driver teles_cs_driver = { }, .attach = teles_attach, .detach = teles_detach, + .id_table = teles_ids, }; static int __init init_teles_cs(void) diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c index 0661c6c31ad0..e2bb4fd8e25e 100644 --- a/drivers/isdn/hisax/telespci.c +++ b/drivers/isdn/hisax/telespci.c @@ -21,7 +21,7 @@ #include <linux/pci.h> extern const char *CardType[]; -const char *telespci_revision = "$Revision: 2.23.2.3 $"; +static const char *telespci_revision = "$Revision: 2.23.2.3 $"; #define ZORAN_PO_RQ_PEN 0x02000000 #define ZORAN_PO_WR 0x00800000 @@ -257,7 +257,7 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -void +static void release_io_telespci(struct IsdnCardState *cs) { iounmap(cs->hw.teles0.membase); diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index d2b6b8e72980..7baf8e488471 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c @@ -41,7 +41,7 @@ static const PCI_ENTRY id_list[] = extern const char *CardType[]; -const char *w6692_revision = "$Revision: 1.18.2.4 $"; +static const char *w6692_revision = "$Revision: 1.18.2.4 $"; #define DBUSY_TIMER_VALUE 80 @@ -880,7 +880,7 @@ setstack_w6692(struct PStack *st, struct BCState *bcs) return (0); } -void resetW6692(struct IsdnCardState *cs) +static void resetW6692(struct IsdnCardState *cs) { cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST); mdelay(10); @@ -902,7 +902,7 @@ void resetW6692(struct IsdnCardState *cs) } } -void __init initW6692(struct IsdnCardState *cs, int part) +static void __init initW6692(struct IsdnCardState *cs, int part) { if (part & 1) { cs->setstack_d = setstack_W6692; diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index 8ee25b2ccce1..1fd3d4e5f284 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c @@ -42,6 +42,8 @@ typedef struct _hycapi_appl { static hycapi_appl hycapi_applications[CAPI_MAXAPPL]; +static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); + static inline int _hycapi_appCheck(int app_id, int ctrl_no) { if((ctrl_no <= 0) || (ctrl_no > CAPI_MAXCONTR) || (app_id <= 0) || @@ -57,7 +59,7 @@ static inline int _hycapi_appCheck(int app_id, int ctrl_no) Kernel-Capi callback reset_ctr ******************************/ -void +static void hycapi_reset_ctr(struct capi_ctr *ctrl) { hycapictrl_info *cinfo = ctrl->driverdata; @@ -73,7 +75,7 @@ hycapi_reset_ctr(struct capi_ctr *ctrl) Kernel-Capi callback remove_ctr ******************************/ -void +static void hycapi_remove_ctr(struct capi_ctr *ctrl) { int i; @@ -215,7 +217,7 @@ Error-checking is done for CAPI-compliance. The application is recorded in the internal list. *************************************************************/ -void +static void hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp) { @@ -291,7 +293,7 @@ Release the application from the internal list an remove it's registration at controller-level ******************************************************************/ -void +static void hycapi_release_appl(struct capi_ctr *ctrl, __u16 appl) { int chk; @@ -364,7 +366,7 @@ firmware-releases that do not check the MsgLen-Indication! ***************************************************************/ -u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) +static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) { __u16 appl_id; int _len, _len2; @@ -437,8 +439,8 @@ Informations provided in the /proc/capi-entries. *********************************************************************/ -int hycapi_read_proc(char *page, char **start, off_t off, - int count, int *eof, struct capi_ctr *ctrl) +static int hycapi_read_proc(char *page, char **start, off_t off, + int count, int *eof, struct capi_ctr *ctrl) { hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata); hysdn_card *card = cinfo->card; @@ -485,7 +487,7 @@ on capi-interface registration. **************************************************************/ -int hycapi_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) +static int hycapi_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) { #ifdef HYCAPI_PRINTFNAMES printk(KERN_NOTICE "hycapi_load_firmware\n"); @@ -494,7 +496,7 @@ int hycapi_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) } -char *hycapi_procinfo(struct capi_ctr *ctrl) +static char *hycapi_procinfo(struct capi_ctr *ctrl) { hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata); #ifdef HYCAPI_PRINTFNAMES diff --git a/drivers/isdn/hysdn/hysdn_boot.c b/drivers/isdn/hysdn/hysdn_boot.c index 6c04281e57b8..7bfba196f315 100644 --- a/drivers/isdn/hysdn/hysdn_boot.c +++ b/drivers/isdn/hysdn/hysdn_boot.c @@ -53,7 +53,7 @@ struct boot_data { /* to be called at start of POF file reading, */ /* before starting any decryption on any POF record. */ /*****************************************************/ -void +static void StartDecryption(struct boot_data *boot) { boot->Cryptor = CRYPT_STARTTERM; @@ -66,7 +66,7 @@ StartDecryption(struct boot_data *boot) /* to HI and LO boot loader and (all) seq tags, because */ /* global Cryptor is started for whole POF. */ /***************************************************************/ -void +static void DecryptBuf(struct boot_data *boot, int cnt) { uchar *bufp = boot->buf.BootBuf; diff --git a/drivers/isdn/hysdn/hysdn_defs.h b/drivers/isdn/hysdn/hysdn_defs.h index 4cee26e558ee..432f6f99089e 100644 --- a/drivers/isdn/hysdn/hysdn_defs.h +++ b/drivers/isdn/hysdn/hysdn_defs.h @@ -227,7 +227,6 @@ typedef struct hycapictrl_info hycapictrl_info; /*****************/ /* exported vars */ /*****************/ -extern int cardmax; /* number of found cards */ extern hysdn_card *card_root; /* pointer to first card */ @@ -244,7 +243,6 @@ extern void hysdn_procconf_release(void); /* deinit proc config filesys */ /* hysdn_proclog.c */ extern int hysdn_proclog_init(hysdn_card *); /* init proc log entry */ extern void hysdn_proclog_release(hysdn_card *); /* deinit proc log entry */ -extern void put_log_buffer(hysdn_card *, char *); /* output log data */ extern void hysdn_addlog(hysdn_card *, char *,...); /* output data to log */ extern void hysdn_card_errlog(hysdn_card *, tErrLogEntry *, int); /* output card log */ @@ -278,16 +276,6 @@ extern unsigned int hycapi_enable; extern int hycapi_capi_create(hysdn_card *); /* create a new capi device */ extern int hycapi_capi_release(hysdn_card *); /* delete the device */ extern int hycapi_capi_stop(hysdn_card *card); /* suspend */ -extern int hycapi_load_firmware(struct capi_ctr *, capiloaddata *); -extern void hycapi_reset_ctr(struct capi_ctr *); -extern void hycapi_remove_ctr(struct capi_ctr *); -extern void hycapi_register_appl(struct capi_ctr *, __u16 appl, - capi_register_params *); -extern void hycapi_release_appl(struct capi_ctr *, __u16 appl); -extern u16 hycapi_send_message(struct capi_ctr *, struct sk_buff *skb); -extern char *hycapi_procinfo(struct capi_ctr *); -extern int hycapi_read_proc(char *page, char **start, off_t off, - int count, int *eof, struct capi_ctr *card); extern void hycapi_rx_capipkt(hysdn_card * card, uchar * buf, word len); extern void hycapi_tx_capiack(hysdn_card * card); extern struct sk_buff *hycapi_tx_capiget(hysdn_card *card); diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c index 5cac2bf5f4b0..12c8137b5161 100644 --- a/drivers/isdn/hysdn/hysdn_init.c +++ b/drivers/isdn/hysdn/hysdn_init.c @@ -34,7 +34,7 @@ MODULE_AUTHOR("Werner Cornelius"); MODULE_LICENSE("GPL"); static char *hysdn_init_revision = "$Revision: 1.6.6.6 $"; -int cardmax; /* number of found cards */ +static int cardmax; /* number of found cards */ hysdn_card *card_root = NULL; /* pointer to first card */ /**********************************************/ diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index 8ef2b7c952a6..4d57011c5737 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -22,6 +22,8 @@ /* the proc subdir for the interface is defined in the procconf module */ extern struct proc_dir_entry *hysdn_proc_entry; +static void put_log_buffer(hysdn_card * card, char *cp); + /*************************************************/ /* structure keeping ascii log for device output */ /*************************************************/ @@ -93,7 +95,7 @@ hysdn_addlog(hysdn_card * card, char *fmt,...) /* opened for read got the contents. */ /* Flushes buffers not longer in use. */ /********************************************/ -void +static void put_log_buffer(hysdn_card * card, char *cp) { struct log_data *ib; diff --git a/drivers/isdn/i4l/isdn_audio.c b/drivers/isdn/i4l/isdn_audio.c index 5350836a4f98..2cc56d6a9fae 100644 --- a/drivers/isdn/i4l/isdn_audio.c +++ b/drivers/isdn/i4l/isdn_audio.c @@ -392,16 +392,6 @@ isdn_audio_adpcm2xlaw(adpcm_state * s, int fmt, unsigned char *in, } int -isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out) -{ - int olen = 0; - - if (s->nleft) - isdn_audio_put_bits(0, 8 - s->nleft, s, &out, &olen); - return olen; -} - -int isdn_audio_xlaw2adpcm(adpcm_state * s, int fmt, unsigned char *in, unsigned char *out, int len) { diff --git a/drivers/isdn/i4l/isdn_audio.h b/drivers/isdn/i4l/isdn_audio.h index 5a977b21dcfa..013c3582e0d1 100644 --- a/drivers/isdn/i4l/isdn_audio.h +++ b/drivers/isdn/i4l/isdn_audio.h @@ -35,7 +35,6 @@ extern void isdn_audio_alaw2ulaw(unsigned char *, unsigned long); extern adpcm_state *isdn_audio_adpcm_init(adpcm_state *, int); extern int isdn_audio_adpcm2xlaw(adpcm_state *, int, unsigned char *, unsigned char *, int); extern int isdn_audio_xlaw2adpcm(adpcm_state *, int, unsigned char *, unsigned char *, int); -extern int isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out); extern void isdn_audio_calc_dtmf(modem_info *, unsigned char *, int, int); extern void isdn_audio_eval_dtmf(modem_info *); dtmf_state *isdn_audio_dtmf_init(dtmf_state *); diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index c406df6f268a..eebcb0b97f0e 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -67,7 +67,7 @@ static isdn_divert_if *divert_if; /* = NULL */ static int isdn_writebuf_stub(int, int, const u_char __user *, int); static void set_global_features(void); static int isdn_wildmat(char *s, char *p); - +static int isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding); static inline void isdn_lock_driver(isdn_driver_t *drv) @@ -388,7 +388,7 @@ isdn_all_eaz(int di, int ch) */ #include <linux/isdn/capicmd.h> -int +static int isdn_capi_rec_hl_msg(capi_msg *cm) { int di; @@ -1923,7 +1923,7 @@ isdn_writebuf_skb_stub(int drvidx, int chan, int ack, struct sk_buff *skb) return ret; } -int +static int isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding) { int j, k, m; diff --git a/drivers/isdn/i4l/isdn_common.h b/drivers/isdn/i4l/isdn_common.h index 808135c427ad..e27e9c3a81ed 100644 --- a/drivers/isdn/i4l/isdn_common.h +++ b/drivers/isdn/i4l/isdn_common.h @@ -41,7 +41,6 @@ extern int isdn_get_free_channel(int, int, int, int, int, char *); extern int isdn_writebuf_skb_stub(int, int, int, struct sk_buff *); extern int register_isdn(isdn_if * i); extern int isdn_msncmp( const char *, const char *); -extern int isdn_add_channels(isdn_driver_t *, int, int, int); #if defined(ISDN_DEBUG_NET_DUMP) || defined(ISDN_DEBUG_MODEM_DUMP) extern void isdn_dumppkt(char *, u_char *, int, int); #endif diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c index 83a4f5382bc2..0193b6f7c70c 100644 --- a/drivers/isdn/i4l/isdn_concap.c +++ b/drivers/isdn/i4l/isdn_concap.c @@ -39,7 +39,7 @@ */ -int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) +static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) { struct net_device *ndev = concap -> net_dev; isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev; @@ -58,7 +58,7 @@ int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) } -int isdn_concap_dl_connect_req(struct concap_proto *concap) +static int isdn_concap_dl_connect_req(struct concap_proto *concap) { struct net_device *ndev = concap -> net_dev; isdn_net_local *lp = (isdn_net_local *) ndev->priv; @@ -71,7 +71,7 @@ int isdn_concap_dl_connect_req(struct concap_proto *concap) return ret; } -int isdn_concap_dl_disconn_req(struct concap_proto *concap) +static int isdn_concap_dl_disconn_req(struct concap_proto *concap) { IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name); @@ -85,15 +85,6 @@ struct concap_device_ops isdn_concap_reliable_dl_dops = { &isdn_concap_dl_disconn_req }; -struct concap_device_ops isdn_concap_demand_dial_dops = { - NULL, /* set this first entry to something like &isdn_net_start_xmit, - but the entry part of the current isdn_net_start_xmit must be - separated first. */ - /* no connection control for demand dial semantics */ - NULL, - NULL, -}; - /* The following should better go into a dedicated source file such that this sourcefile does not need to include any protocol specific header files. For now: diff --git a/drivers/isdn/i4l/isdn_concap.h b/drivers/isdn/i4l/isdn_concap.h index 306eb180438f..6ac7e0445ea5 100644 --- a/drivers/isdn/i4l/isdn_concap.h +++ b/drivers/isdn/i4l/isdn_concap.h @@ -8,7 +8,6 @@ */ extern struct concap_device_ops isdn_concap_reliable_dl_dops; -extern struct concap_device_ops isdn_concap_demand_dial_dops; extern struct concap_proto * isdn_concap_new( int ); diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index e2b790e34510..f30e8e63ae0d 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c @@ -176,7 +176,7 @@ static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp) /* Prototypes */ -int isdn_net_force_dial_lp(isdn_net_local *); +static int isdn_net_force_dial_lp(isdn_net_local *); static int isdn_net_start_xmit(struct sk_buff *, struct net_device *); static void isdn_net_ciscohdlck_connected(isdn_net_local *lp); @@ -312,7 +312,7 @@ isdn_net_unbind_channel(isdn_net_local * lp) * Since this function is called every second, simply reset the * byte-counter of the interface after copying it to the cps-variable. */ -unsigned long last_jiffies = -HZ; +static unsigned long last_jiffies = -HZ; void isdn_net_autohup(void) @@ -1131,7 +1131,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev) } -void isdn_net_tx_timeout(struct net_device * ndev) +static void isdn_net_tx_timeout(struct net_device * ndev) { isdn_net_local *lp = (isdn_net_local *) ndev->priv; @@ -1424,7 +1424,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len) } /* cisco hdlck device private ioctls */ -int +static int isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { isdn_net_local *lp = (isdn_net_local *) dev->priv; @@ -2461,7 +2461,7 @@ isdn_net_findif(char *name) * This is called from the userlevel-routine below or * from isdn_net_start_xmit(). */ -int +static int isdn_net_force_dial_lp(isdn_net_local * lp) { if ((!(lp->flags & ISDN_NET_CONNECTED)) && !lp->dialstate) { diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index e21007eca0f0..ad5aa38fb5a6 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -273,7 +273,7 @@ isdn_tty_rcv_skb(int i, int di, int channel, struct sk_buff *skb) return 1; } -void +static void isdn_tty_cleanup_xmit(modem_info * info) { skb_queue_purge(&info->xmit_queue); @@ -560,7 +560,7 @@ isdn_tty_modem_ncarrier(modem_info * info) /* * return the usage calculated by si and layer 2 protocol */ -int +static int isdn_calc_usage(int si, int l2) { int usg = ISDN_USAGE_MODEM; diff --git a/drivers/isdn/i4l/isdn_tty.h b/drivers/isdn/i4l/isdn_tty.h index 2423a7ff0cc3..9f0fa9501f4d 100644 --- a/drivers/isdn/i4l/isdn_tty.h +++ b/drivers/isdn/i4l/isdn_tty.h @@ -109,7 +109,6 @@ extern int isdn_tty_modem_init(void); extern void isdn_tty_exit(void); extern void isdn_tty_readmodem(void); extern int isdn_tty_find_icall(int, int, setup_parm *); -extern void isdn_tty_cleanup_xmit(modem_info *); extern int isdn_tty_stat_callback(int, isdn_ctrl *); extern int isdn_tty_rcv_skb(int, int, int, struct sk_buff *); extern int isdn_tty_capi_facility(capi_msg *cm); diff --git a/drivers/isdn/i4l/isdn_ttyfax.c b/drivers/isdn/i4l/isdn_ttyfax.c index ce2c3ef92e46..a943d078bacc 100644 --- a/drivers/isdn/i4l/isdn_ttyfax.c +++ b/drivers/isdn/i4l/isdn_ttyfax.c @@ -148,7 +148,7 @@ isdn_tty_fax_modem_result(int code, modem_info * info) } } -int +static int isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c) { static char *msg[] = @@ -316,7 +316,7 @@ isdn_tty_fax_bitorder(modem_info * info, struct sk_buff *skb) * Parse AT+F.. FAX class 1 commands */ -int +static int isdn_tty_cmd_FCLASS1(char **p, modem_info * info) { static char *cmd[] = @@ -408,7 +408,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_info * info) * Parse AT+F.. FAX class 2 commands */ -int +static int isdn_tty_cmd_FCLASS2(char **p, modem_info * info) { atemu *m = &info->emu; diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c index 4ab7600cf9c1..edf14a2aa3c8 100644 --- a/drivers/isdn/i4l/isdn_x25iface.c +++ b/drivers/isdn/i4l/isdn_x25iface.c @@ -40,15 +40,15 @@ typedef struct isdn_x25iface_proto_data { /* is now in header file (extern): struct concap_proto * isdn_x25iface_proto_new(void); */ -void isdn_x25iface_proto_del( struct concap_proto * ); -int isdn_x25iface_proto_close( struct concap_proto * ); -int isdn_x25iface_proto_restart( struct concap_proto *, - struct net_device *, - struct concap_device_ops *); -int isdn_x25iface_xmit( struct concap_proto *, struct sk_buff * ); -int isdn_x25iface_receive( struct concap_proto *, struct sk_buff * ); -int isdn_x25iface_connect_ind( struct concap_proto * ); -int isdn_x25iface_disconn_ind( struct concap_proto * ); +static void isdn_x25iface_proto_del( struct concap_proto * ); +static int isdn_x25iface_proto_close( struct concap_proto * ); +static int isdn_x25iface_proto_restart( struct concap_proto *, + struct net_device *, + struct concap_device_ops *); +static int isdn_x25iface_xmit( struct concap_proto *, struct sk_buff * ); +static int isdn_x25iface_receive( struct concap_proto *, struct sk_buff * ); +static int isdn_x25iface_connect_ind( struct concap_proto * ); +static int isdn_x25iface_disconn_ind( struct concap_proto * ); static struct concap_proto_ops ix25_pops = { @@ -102,7 +102,7 @@ struct concap_proto * isdn_x25iface_proto_new(void) /* close the x25iface encapsulation protocol */ -int isdn_x25iface_proto_close(struct concap_proto *cprot){ +static int isdn_x25iface_proto_close(struct concap_proto *cprot){ ix25_pdata_t *tmp; int ret = 0; @@ -129,7 +129,7 @@ int isdn_x25iface_proto_close(struct concap_proto *cprot){ /* Delete the x25iface encapsulation protocol instance */ -void isdn_x25iface_proto_del(struct concap_proto *cprot){ +static void isdn_x25iface_proto_del(struct concap_proto *cprot){ ix25_pdata_t * tmp; @@ -158,9 +158,9 @@ void isdn_x25iface_proto_del(struct concap_proto *cprot){ /* (re-)initialize the data structures for x25iface encapsulation */ -int isdn_x25iface_proto_restart(struct concap_proto *cprot, - struct net_device *ndev, - struct concap_device_ops *dops) +static int isdn_x25iface_proto_restart(struct concap_proto *cprot, + struct net_device *ndev, + struct concap_device_ops *dops) { ix25_pdata_t * pda = cprot -> proto_data ; ulong flags; @@ -187,7 +187,7 @@ int isdn_x25iface_proto_restart(struct concap_proto *cprot, /* deliver a dl_data frame received from i4l HL driver to the network layer */ -int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb) +static int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb) { IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) ); if ( ( (ix25_pdata_t*) (cprot->proto_data) ) @@ -206,7 +206,7 @@ int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb) /* a connection set up is indicated by lower layer */ -int isdn_x25iface_connect_ind(struct concap_proto *cprot) +static int isdn_x25iface_connect_ind(struct concap_proto *cprot) { struct sk_buff * skb = dev_alloc_skb(1); enum wan_states *state_p @@ -235,7 +235,7 @@ int isdn_x25iface_connect_ind(struct concap_proto *cprot) /* a disconnect is indicated by lower layer */ -int isdn_x25iface_disconn_ind(struct concap_proto *cprot) +static int isdn_x25iface_disconn_ind(struct concap_proto *cprot) { struct sk_buff *skb; enum wan_states *state_p @@ -264,7 +264,7 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot) /* process a frame handed over to us from linux network layer. First byte semantics as defined in Documentation/networking/x25-iface.txt */ -int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) +static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) { unsigned char firstbyte = skb->data[0]; enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state; diff --git a/drivers/isdn/pcbit/callbacks.c b/drivers/isdn/pcbit/callbacks.c index 692ec72d1ee8..f151f36c8255 100644 --- a/drivers/isdn/pcbit/callbacks.c +++ b/drivers/isdn/pcbit/callbacks.c @@ -125,23 +125,6 @@ void cb_out_2(struct pcbit_dev * dev, struct pcbit_chan* chan, /* - * Disconnect received (actually RELEASE COMPLETE) - * This means we were not able to establish connection with remote - * Inform the big boss above - */ -void cb_out_3(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *data) -{ - isdn_ctrl ictl; - - ictl.command = ISDN_STAT_DHUP; - ictl.driver=dev->id; - ictl.arg=chan->id; - dev->dev_if->statcallb(&ictl); -} - - -/* * Incoming call received * inform user */ diff --git a/drivers/isdn/pcbit/callbacks.h b/drivers/isdn/pcbit/callbacks.h index f510dc56b57e..17aa0f54bfc3 100644 --- a/drivers/isdn/pcbit/callbacks.h +++ b/drivers/isdn/pcbit/callbacks.h @@ -19,9 +19,6 @@ extern void cb_out_1(struct pcbit_dev * dev, struct pcbit_chan* chan, extern void cb_out_2(struct pcbit_dev * dev, struct pcbit_chan* chan, struct callb_data *data); -extern void cb_out_3(struct pcbit_dev * dev, struct pcbit_chan* chan, - struct callb_data *data); - extern void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan, struct callb_data *data); extern void cb_in_2(struct pcbit_dev * dev, struct pcbit_chan* chan, diff --git a/drivers/isdn/pcbit/capi.c b/drivers/isdn/pcbit/capi.c index 29eb03a8c29d..bef321d0e51d 100644 --- a/drivers/isdn/pcbit/capi.c +++ b/drivers/isdn/pcbit/capi.c @@ -627,16 +627,6 @@ int capi_decode_disc_ind(struct pcbit_chan *chan, struct sk_buff *skb) return 0; } -int capi_decode_disc_conf(struct pcbit_chan *chan, struct sk_buff *skb) -{ - ushort errcode; - - errcode = *((ushort*) skb->data); - skb_pull(skb, 2); - - return errcode; -} - #ifdef DEBUG int capi_decode_debug_188(u_char *hdr, ushort hdrlen) { diff --git a/drivers/isdn/pcbit/capi.h b/drivers/isdn/pcbit/capi.h index 18e6aa360a8f..df8e73c04d7f 100644 --- a/drivers/isdn/pcbit/capi.h +++ b/drivers/isdn/pcbit/capi.h @@ -54,7 +54,6 @@ extern int capi_tdata_resp(struct pcbit_chan *chan, struct sk_buff ** skb); /* Connection Termination */ extern int capi_disc_req(ushort callref, struct sk_buff **skb, u_char cause); -extern int capi_decode_disc_conf(struct pcbit_chan *chan, struct sk_buff *skb); extern int capi_decode_disc_ind(struct pcbit_chan *chan, struct sk_buff *skb); extern int capi_disc_resp(struct pcbit_chan *chan, struct sk_buff **skb); diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index e98f9c48c184..5de861f40816 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -56,10 +56,10 @@ static char* pcbit_devname[MAX_PCBIT_CARDS] = { * prototypes */ -int pcbit_command(isdn_ctrl* ctl); -int pcbit_stat(u_char __user * buf, int len, int, int); -int pcbit_xmit(int driver, int chan, int ack, struct sk_buff *skb); -int pcbit_writecmd(const u_char __user *, int, int, int); +static int pcbit_command(isdn_ctrl* ctl); +static int pcbit_stat(u_char __user * buf, int len, int, int); +static int pcbit_xmit(int driver, int chan, int ack, struct sk_buff *skb); +static int pcbit_writecmd(const u_char __user *, int, int, int); static int set_protocol_running(struct pcbit_dev * dev); @@ -238,7 +238,7 @@ void pcbit_terminate(int board) } #endif -int pcbit_command(isdn_ctrl* ctl) +static int pcbit_command(isdn_ctrl* ctl) { struct pcbit_dev *dev; struct pcbit_chan *chan; @@ -330,7 +330,7 @@ static void pcbit_block_timer(unsigned long data) } #endif -int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) +static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) { ushort hdrlen; int refnum, len; @@ -389,7 +389,7 @@ int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb) return len; } -int pcbit_writecmd(const u_char __user *buf, int len, int driver, int channel) +static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int channel) { struct pcbit_dev * dev; int i, j; @@ -713,7 +713,7 @@ static char statbuf[STATBUF_LEN]; static int stat_st = 0; static int stat_end = 0; -int pcbit_stat(u_char __user *buf, int len, int driver, int channel) +static int pcbit_stat(u_char __user *buf, int len, int driver, int channel) { int stat_count; stat_count = stat_end - stat_st; diff --git a/drivers/isdn/sc/Makefile b/drivers/isdn/sc/Makefile index 9cc474cd0c44..0f2b7d602ac0 100644 --- a/drivers/isdn/sc/Makefile +++ b/drivers/isdn/sc/Makefile @@ -6,5 +6,5 @@ obj-$(CONFIG_ISDN_DRV_SC) += sc.o # Multipart objects. -sc-y := shmem.o init.o debug.o packet.o command.o event.o \ +sc-y := shmem.o init.o packet.o command.o event.o \ ioctl.o interrupt.o message.o timer.o diff --git a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c index b2c4eac7cef5..19f2fcf0ae4a 100644 --- a/drivers/isdn/sc/command.c +++ b/drivers/isdn/sc/command.c @@ -22,14 +22,14 @@ #include "card.h" #include "scioc.h" -int dial(int card, unsigned long channel, setup_parm setup); -int hangup(int card, unsigned long channel); -int answer(int card, unsigned long channel); -int clreaz(int card, unsigned long channel); -int seteaz(int card, unsigned long channel, char *); -int setl2(int card, unsigned long arg); -int setl3(int card, unsigned long arg); -int acceptb(int card, unsigned long channel); +static int dial(int card, unsigned long channel, setup_parm setup); +static int hangup(int card, unsigned long channel); +static int answer(int card, unsigned long channel); +static int clreaz(int card, unsigned long channel); +static int seteaz(int card, unsigned long channel, char *); +static int setl2(int card, unsigned long arg); +static int setl3(int card, unsigned long arg); +static int acceptb(int card, unsigned long channel); extern int cinst; extern board *sc_adapter[]; @@ -148,56 +148,6 @@ int command(isdn_ctrl *cmd) } /* - * Confirm our ability to communicate with the board. This test assumes no - * other message activity is present - */ -int loopback(int card) -{ - - int status; - static char testmsg[] = "Test Message"; - RspMessage rspmsg; - - if(!IS_VALID_CARD(card)) { - pr_debug("Invalid param: %d is not a valid card id\n", card); - return -ENODEV; - } - - pr_debug("%s: Sending loopback message\n", - sc_adapter[card]->devicename); - - /* - * Send the loopback message to confirm that memory transfer is - * operational - */ - status = send_and_receive(card, CMPID, cmReqType1, - cmReqClass0, - cmReqMsgLpbk, - 0, - (unsigned char) strlen(testmsg), - (unsigned char *)testmsg, - &rspmsg, SAR_TIMEOUT); - - - if (!status) { - pr_debug("%s: Loopback message successfully sent\n", - sc_adapter[card]->devicename); - if(strcmp(rspmsg.msg_data.byte_array, testmsg)) { - pr_debug("%s: Loopback return != sent\n", - sc_adapter[card]->devicename); - return -EIO; - } - return 0; - } - else { - pr_debug("%s: Send loopback message failed\n", - sc_adapter[card]->devicename); - return -EIO; - } - -} - -/* * start the onboard firmware */ int startproc(int card) @@ -222,16 +172,10 @@ int startproc(int card) } -int loadproc(int card, char *data) -{ - return -1; -} - - /* * Dials the number passed in */ -int dial(int card, unsigned long channel, setup_parm setup) +static int dial(int card, unsigned long channel, setup_parm setup) { int status; char Phone[48]; @@ -261,7 +205,7 @@ int dial(int card, unsigned long channel, setup_parm setup) /* * Answer an incoming call */ -int answer(int card, unsigned long channel) +static int answer(int card, unsigned long channel) { if(!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); @@ -282,7 +226,7 @@ int answer(int card, unsigned long channel) /* * Hangup up the call on specified channel */ -int hangup(int card, unsigned long channel) +static int hangup(int card, unsigned long channel) { int status; @@ -305,7 +249,7 @@ int hangup(int card, unsigned long channel) /* * Set the layer 2 protocol (X.25, HDLC, Raw) */ -int setl2(int card, unsigned long arg) +static int setl2(int card, unsigned long arg) { int status =0; int protocol,channel; @@ -340,7 +284,7 @@ int setl2(int card, unsigned long arg) /* * Set the layer 3 protocol */ -int setl3(int card, unsigned long channel) +static int setl3(int card, unsigned long channel) { int protocol = channel >> 8; @@ -355,7 +299,7 @@ int setl3(int card, unsigned long channel) return 0; } -int acceptb(int card, unsigned long channel) +static int acceptb(int card, unsigned long channel) { if(!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); @@ -374,7 +318,7 @@ int acceptb(int card, unsigned long channel) return 0; } -int clreaz(int card, unsigned long arg) +static int clreaz(int card, unsigned long arg) { if(!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); @@ -388,7 +332,7 @@ int clreaz(int card, unsigned long arg) return 0; } -int seteaz(int card, unsigned long arg, char *num) +static int seteaz(int card, unsigned long arg, char *num) { if(!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); diff --git a/drivers/isdn/sc/debug.c b/drivers/isdn/sc/debug.c deleted file mode 100644 index 1a992a75868b..000000000000 --- a/drivers/isdn/sc/debug.c +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id: debug.c,v 1.5.6.1 2001/09/23 22:24:59 kai Exp $ - * - * Copyright (C) 1996 SpellCaster Telecommunications Inc. - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - * - * For more information, please contact gpl-info@spellcast.com or write: - * - * SpellCaster Telecommunications Inc. - * 5621 Finch Avenue East, Unit #3 - * Scarborough, Ontario Canada - * M1B 2T9 - * +1 (416) 297-8565 - * +1 (416) 297-6433 Facsimile - */ - -#include <linux/kernel.h> -#include <linux/string.h> - -int dbg_level = 0; -static char dbg_funcname[255]; - -void dbg_endfunc(void) -{ - if (dbg_level) { - printk("<-- Leaving function %s\n", dbg_funcname); - strcpy(dbg_funcname, ""); - } -} - -void dbg_func(char *func) -{ - strcpy(dbg_funcname, func); - if(dbg_level) - printk("--> Entering function %s\n", dbg_funcname); -} - -inline void pullphone(char *dn, char *str) -{ - int i = 0; - - while(dn[i] != ',') - str[i] = dn[i], i++; - str[i] = 0x0; -} diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index efefedea37b9..40b0df04ed9f 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -20,9 +20,9 @@ board *sc_adapter[MAX_CARDS]; int cinst; static char devname[] = "scX"; -const char version[] = "2.0b1"; +static const char version[] = "2.0b1"; -const char *boardname[] = { "DataCommute/BRI", "DataCommute/PRI", "TeleCommute/BRI" }; +static const char *boardname[] = { "DataCommute/BRI", "DataCommute/PRI", "TeleCommute/BRI" }; /* insmod set parameters */ static unsigned int io[] = {0,0,0,0}; @@ -35,26 +35,13 @@ module_param_array(irq, int, NULL, 0); module_param_array(ram, int, NULL, 0); module_param(do_reset, bool, 0); -static int sup_irq[] = { 11, 10, 9, 5, 12, 14, 7, 3, 4, 6 }; -#define MAX_IRQS 10 - extern irqreturn_t interrupt_handler(int, void *, struct pt_regs *); extern int sndpkt(int, int, int, struct sk_buff *); extern int command(isdn_ctrl *); extern int indicate_status(int, int, ulong, char*); extern int reset(int); -int identify_board(unsigned long, unsigned int); - -int irq_supported(int irq_x) -{ - int i; - for(i=0 ; i < MAX_IRQS ; i++) { - if(sup_irq[i] == irq_x) - return 1; - } - return 0; -} +static int identify_board(unsigned long, unsigned int); static int __init sc_init(void) { @@ -454,7 +441,7 @@ static void __exit sc_exit(void) pr_info("SpellCaster ISA ISDN Adapter Driver Unloaded.\n"); } -int identify_board(unsigned long rambase, unsigned int iobase) +static int identify_board(unsigned long rambase, unsigned int iobase) { unsigned int pgport; unsigned long sig; diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c index e5e164aca7fa..8631d338d69a 100644 --- a/drivers/isdn/sc/interrupt.c +++ b/drivers/isdn/sc/interrupt.c @@ -31,7 +31,7 @@ extern void rcvpkt(int, RspMessage *); extern int cinst; extern board *sc_adapter[]; -int get_card_from_irq(int irq) +static int get_card_from_irq(int irq) { int i; diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c index 1371a990416a..3314a5a19854 100644 --- a/drivers/isdn/sc/ioctl.c +++ b/drivers/isdn/sc/ioctl.c @@ -14,7 +14,6 @@ extern int indicate_status(int, int, unsigned long, char *); extern int startproc(int); -extern int loadproc(int, char *record); extern int reset(int); extern int send_and_receive(int, unsigned int, unsigned char,unsigned char, unsigned char,unsigned char, @@ -23,7 +22,7 @@ extern int send_and_receive(int, unsigned int, unsigned char,unsigned char, extern board *sc_adapter[]; -int GetStatus(int card, boardInfo *); +static int GetStatus(int card, boardInfo *); /* * Process private IOCTL messages (typically from scctrl) @@ -428,7 +427,7 @@ int sc_ioctl(int card, scs_ioctl *data) return 0; } -int GetStatus(int card, boardInfo *bi) +static int GetStatus(int card, boardInfo *bi) { RspMessage rcvmsg; int i, status; diff --git a/drivers/isdn/sc/packet.c b/drivers/isdn/sc/packet.c index 8e3fac3ba1a1..f50defc38ae5 100644 --- a/drivers/isdn/sc/packet.c +++ b/drivers/isdn/sc/packet.c @@ -213,19 +213,3 @@ int setup_buffers(int card, int c) return 0; } -int print_skb(int card,char *skb_p, int len){ - int i,data; - pr_debug("%s: data at 0x%x len: 0x%x\n", sc_adapter[card]->devicename, - skb_p,len); - for(i=1;i<=len;i++,skb_p++){ - data = (int) (0xff & (*skb_p)); - pr_debug("%s: data = 0x%x", sc_adapter[card]->devicename,data); - if(!(i%4)) - pr_debug(" "); - if(!(i%32)) - pr_debug("\n"); - } - pr_debug("\n"); - return 0; -} - diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c index 7bc2dfad0775..24854826ca45 100644 --- a/drivers/isdn/sc/shmem.c +++ b/drivers/isdn/sc/shmem.c @@ -108,6 +108,7 @@ void memcpy_fromshmem(int card, void *dest, const void *src, size_t n) sc_adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */ } +#if 0 void memset_shmem(int card, void *dest, int c, size_t n) { unsigned long flags; @@ -141,3 +142,4 @@ void memset_shmem(int card, void *dest, int c, size_t n) ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); } +#endif /* 0 */ diff --git a/drivers/isdn/sc/timer.c b/drivers/isdn/sc/timer.c index 710d0f47ca35..aced19aac5a2 100644 --- a/drivers/isdn/sc/timer.c +++ b/drivers/isdn/sc/timer.c @@ -32,7 +32,7 @@ extern int sendmessage(int, unsigned int, unsigned int, unsigned int, /* * Write the proper values into the I/O ports following a reset */ -void setup_ports(int card) +static void setup_ports(int card) { outb((sc_adapter[card]->rambase >> 12), sc_adapter[card]->ioport[EXP_BASE]); @@ -129,19 +129,3 @@ void check_phystat(unsigned long data) ceReqPhyStatus,0,0,NULL); } -/* - * When in trace mode, this callback is used to swap the working shared - * RAM page to the trace page(s) and process all received messages. It - * must be called often enough to get all of the messages out of RAM before - * it loops around. - * Trace messages are \n terminated strings. - * We output the messages in 64 byte chunks through readstat. Each chunk - * is scanned for a \n followed by a time stamp. If the timerstamp is older - * than the current time, scanning stops and the page and offset are recorded - * as the starting point the next time the trace timer is called. The final - * step is to restore the working page and reset the timer. - */ -void trace_timer(unsigned long data) -{ - /* not implemented */ -} |