diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-06-25 17:59:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:25:07 -0400 |
commit | 672c3fd9069e5a138f9d4afc9aeb5aa34aacce32 (patch) | |
tree | eed95f7e577680c4a92e7f22b22b221b53934fd1 /drivers/isdn/hisax | |
parent | 8b3d4a2a3ef9488d4477e8823106abfd6039eb66 (diff) |
[PATCH] drivers/isdn/hisax/: possible cleanups
This patch contains the following possible cleanups:
- make needlessly global code static
- remove the compiled but unused st5481_hdlc.{c,h}
- kill enternow.h
- enternow_pci.c: kill InByte/OutByte/BYTE
- isdnl2.c: kill FreeSkb
- remove or #if 0 the following unused functions:
- config.c: IsdnCardState
- ipacx.c: ipacx_new_ph
- ipacx.c: dch_bh
- ipacx.c: setup_ipacx
- isdnl2.c: IsRR
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Kai Germaschewski <kai@germaschewski.name>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/hisax')
60 files changed, 263 insertions, 1050 deletions
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 | |||
23 | # Multipart objects. | 23 | # Multipart objects. |
24 | 24 | ||
25 | hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \ | 25 | hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \ |
26 | st5481_b.o st5481_hdlc.o | 26 | st5481_b.o |
27 | 27 | ||
28 | hisax-y := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \ | 28 | hisax-y := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \ |
29 | lmgr.o q931.o callc.o fsm.o | 29 | 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[] = { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | 99 | ||
100 | void /* macro wWordAMD */ | 100 | static void /* macro wWordAMD */ |
101 | WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) | 101 | WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) |
102 | { | 102 | { |
103 | wByteAMD(cs, 0x00, reg); | 103 | wByteAMD(cs, 0x00, reg); |
@@ -105,7 +105,7 @@ WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) | |||
105 | wByteAMD(cs, 0x01, HIBYTE(val)); | 105 | wByteAMD(cs, 0x01, HIBYTE(val)); |
106 | } | 106 | } |
107 | 107 | ||
108 | WORD /* macro rWordAMD */ | 108 | static WORD /* macro rWordAMD */ |
109 | ReadWordAmd7930(struct IsdnCardState *cs, BYTE reg) | 109 | ReadWordAmd7930(struct IsdnCardState *cs, BYTE reg) |
110 | { | 110 | { |
111 | WORD res; | 111 | WORD res; |
@@ -665,7 +665,7 @@ Amd7930_l1hw(struct PStack *st, int pr, void *arg) | |||
665 | } | 665 | } |
666 | } | 666 | } |
667 | 667 | ||
668 | void | 668 | static void |
669 | setstack_Amd7930(struct PStack *st, struct IsdnCardState *cs) | 669 | setstack_Amd7930(struct PStack *st, struct IsdnCardState *cs) |
670 | { | 670 | { |
671 | 671 | ||
@@ -676,7 +676,7 @@ setstack_Amd7930(struct PStack *st, struct IsdnCardState *cs) | |||
676 | } | 676 | } |
677 | 677 | ||
678 | 678 | ||
679 | void | 679 | static void |
680 | DC_Close_Amd7930(struct IsdnCardState *cs) { | 680 | DC_Close_Amd7930(struct IsdnCardState *cs) { |
681 | if (cs->debug & L1_DEB_ISAC) | 681 | if (cs->debug & L1_DEB_ISAC) |
682 | debugl1(cs, "Amd7930: DC_Close called"); | 682 | 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 @@ | |||
22 | 22 | ||
23 | extern const char *CardType[]; | 23 | extern const char *CardType[]; |
24 | 24 | ||
25 | const char *Asuscom_revision = "$Revision: 1.14.2.4 $"; | 25 | static const char *Asuscom_revision = "$Revision: 1.14.2.4 $"; |
26 | 26 | ||
27 | #define byteout(addr,val) outb(val,addr) | 27 | #define byteout(addr,val) outb(val,addr) |
28 | #define bytein(addr) inb(addr) | 28 | #define bytein(addr) inb(addr) |
@@ -239,7 +239,7 @@ Start_IPAC: | |||
239 | return IRQ_HANDLED; | 239 | return IRQ_HANDLED; |
240 | } | 240 | } |
241 | 241 | ||
242 | void | 242 | static void |
243 | release_io_asuscom(struct IsdnCardState *cs) | 243 | release_io_asuscom(struct IsdnCardState *cs) |
244 | { | 244 | { |
245 | int bytecnt = 8; | 245 | 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) | |||
172 | return(NULL); | 172 | return(NULL); |
173 | } | 173 | } |
174 | 174 | ||
175 | void | 175 | static void |
176 | write_ctrl(struct BCState *bcs, int which) { | 176 | write_ctrl(struct BCState *bcs, int which) { |
177 | 177 | ||
178 | if (bcs->cs->debug & L1_DEB_HSCX) | 178 | if (bcs->cs->debug & L1_DEB_HSCX) |
@@ -193,7 +193,7 @@ write_ctrl(struct BCState *bcs, int which) { | |||
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | void | 196 | static void |
197 | modehdlc(struct BCState *bcs, int mode, int bc) | 197 | modehdlc(struct BCState *bcs, int mode, int bc) |
198 | { | 198 | { |
199 | struct IsdnCardState *cs = bcs->cs; | 199 | struct IsdnCardState *cs = bcs->cs; |
@@ -451,7 +451,7 @@ HDLC_irq(struct BCState *bcs, u_int stat) { | |||
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 | ||
454 | inline void | 454 | static inline void |
455 | HDLC_irq_main(struct IsdnCardState *cs) | 455 | HDLC_irq_main(struct IsdnCardState *cs) |
456 | { | 456 | { |
457 | u_int stat; | 457 | u_int stat; |
@@ -487,7 +487,7 @@ HDLC_irq_main(struct IsdnCardState *cs) | |||
487 | } | 487 | } |
488 | } | 488 | } |
489 | 489 | ||
490 | void | 490 | static void |
491 | hdlc_l2l1(struct PStack *st, int pr, void *arg) | 491 | hdlc_l2l1(struct PStack *st, int pr, void *arg) |
492 | { | 492 | { |
493 | struct BCState *bcs = st->l1.bcs; | 493 | struct BCState *bcs = st->l1.bcs; |
@@ -547,7 +547,7 @@ hdlc_l2l1(struct PStack *st, int pr, void *arg) | |||
547 | } | 547 | } |
548 | } | 548 | } |
549 | 549 | ||
550 | void | 550 | static void |
551 | close_hdlcstate(struct BCState *bcs) | 551 | close_hdlcstate(struct BCState *bcs) |
552 | { | 552 | { |
553 | modehdlc(bcs, 0, 0); | 553 | modehdlc(bcs, 0, 0); |
@@ -570,7 +570,7 @@ close_hdlcstate(struct BCState *bcs) | |||
570 | } | 570 | } |
571 | } | 571 | } |
572 | 572 | ||
573 | int | 573 | static int |
574 | open_hdlcstate(struct IsdnCardState *cs, struct BCState *bcs) | 574 | open_hdlcstate(struct IsdnCardState *cs, struct BCState *bcs) |
575 | { | 575 | { |
576 | if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { | 576 | if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { |
@@ -598,7 +598,7 @@ open_hdlcstate(struct IsdnCardState *cs, struct BCState *bcs) | |||
598 | return (0); | 598 | return (0); |
599 | } | 599 | } |
600 | 600 | ||
601 | int | 601 | static int |
602 | setstack_hdlc(struct PStack *st, struct BCState *bcs) | 602 | setstack_hdlc(struct PStack *st, struct BCState *bcs) |
603 | { | 603 | { |
604 | bcs->channel = st->l1.bc; | 604 | bcs->channel = st->l1.bc; |
@@ -612,6 +612,7 @@ setstack_hdlc(struct PStack *st, struct BCState *bcs) | |||
612 | return (0); | 612 | return (0); |
613 | } | 613 | } |
614 | 614 | ||
615 | #if 0 | ||
615 | void __init | 616 | void __init |
616 | clear_pending_hdlc_ints(struct IsdnCardState *cs) | 617 | clear_pending_hdlc_ints(struct IsdnCardState *cs) |
617 | { | 618 | { |
@@ -641,8 +642,9 @@ clear_pending_hdlc_ints(struct IsdnCardState *cs) | |||
641 | debugl1(cs, "HDLC 2 VIN %x", val); | 642 | debugl1(cs, "HDLC 2 VIN %x", val); |
642 | } | 643 | } |
643 | } | 644 | } |
645 | #endif /* 0 */ | ||
644 | 646 | ||
645 | void __init | 647 | static void __init |
646 | inithdlc(struct IsdnCardState *cs) | 648 | inithdlc(struct IsdnCardState *cs) |
647 | { | 649 | { |
648 | cs->bcs[0].BC_SetStack = setstack_hdlc; | 650 | cs->bcs[0].BC_SetStack = setstack_hdlc; |
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 @@ | |||
23 | 23 | ||
24 | extern const char *CardType[]; | 24 | extern const char *CardType[]; |
25 | 25 | ||
26 | const char *bkm_a4t_revision = "$Revision: 1.22.2.4 $"; | 26 | static const char *bkm_a4t_revision = "$Revision: 1.22.2.4 $"; |
27 | 27 | ||
28 | 28 | ||
29 | static inline u_char | 29 | static inline u_char |
@@ -167,7 +167,7 @@ bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | void | 170 | static void |
171 | release_io_bkm(struct IsdnCardState *cs) | 171 | release_io_bkm(struct IsdnCardState *cs) |
172 | { | 172 | { |
173 | if (cs->hw.ax.base) { | 173 | 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 @@ | |||
27 | 27 | ||
28 | extern const char *CardType[]; | 28 | extern const char *CardType[]; |
29 | 29 | ||
30 | const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $"; | 30 | static const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $"; |
31 | 31 | ||
32 | static const char *sct_quadro_subtypes[] = | 32 | static const char *sct_quadro_subtypes[] = |
33 | { | 33 | { |
@@ -193,7 +193,7 @@ bkm_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) | |||
193 | return IRQ_HANDLED; | 193 | return IRQ_HANDLED; |
194 | } | 194 | } |
195 | 195 | ||
196 | void | 196 | static void |
197 | release_io_sct_quadro(struct IsdnCardState *cs) | 197 | release_io_sct_quadro(struct IsdnCardState *cs) |
198 | { | 198 | { |
199 | release_region(cs->hw.ax.base & 0xffffffc0, 128); | 199 | release_region(cs->hw.ax.base & 0xffffffc0, 128); |
@@ -261,7 +261,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg) | |||
261 | return (0); | 261 | return (0); |
262 | } | 262 | } |
263 | 263 | ||
264 | int __init | 264 | static int __init |
265 | sct_alloc_io(u_int adr, u_int len) | 265 | sct_alloc_io(u_int adr, u_int len) |
266 | { | 266 | { |
267 | if (!request_region(adr, len, "scitel")) { | 267 | 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) | |||
874 | } | 874 | } |
875 | } | 875 | } |
876 | 876 | ||
877 | struct Channel | 877 | static struct Channel |
878 | *selectfreechannel(struct PStack *st, int bch) | 878 | *selectfreechannel(struct PStack *st, int bch) |
879 | { | 879 | { |
880 | struct IsdnCardState *cs = st->l1.hardware; | 880 | struct IsdnCardState *cs = st->l1.hardware; |
@@ -1429,7 +1429,7 @@ capi_debug(struct Channel *chanp, capi_msg *cm) | |||
1429 | HiSax_putstatus(chanp->cs, "Ch", "%d CAPIMSG %s", chanp->chan, tmpbuf); | 1429 | HiSax_putstatus(chanp->cs, "Ch", "%d CAPIMSG %s", chanp->chan, tmpbuf); |
1430 | } | 1430 | } |
1431 | 1431 | ||
1432 | void | 1432 | static void |
1433 | lli_got_fac_req(struct Channel *chanp, capi_msg *cm) { | 1433 | lli_got_fac_req(struct Channel *chanp, capi_msg *cm) { |
1434 | if ((cm->para[0] != 3) || (cm->para[1] != 0)) | 1434 | if ((cm->para[0] != 3) || (cm->para[1] != 0)) |
1435 | return; | 1435 | return; |
@@ -1454,7 +1454,7 @@ lli_got_fac_req(struct Channel *chanp, capi_msg *cm) { | |||
1454 | } | 1454 | } |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | void | 1457 | static void |
1458 | lli_got_manufacturer(struct Channel *chanp, struct IsdnCardState *cs, capi_msg *cm) { | 1458 | lli_got_manufacturer(struct Channel *chanp, struct IsdnCardState *cs, capi_msg *cm) { |
1459 | if ((cs->typ == ISDN_CTYPE_ELSA) || (cs->typ == ISDN_CTYPE_ELSA_PNP) || | 1459 | if ((cs->typ == ISDN_CTYPE_ELSA) || (cs->typ == ISDN_CTYPE_ELSA_PNP) || |
1460 | (cs->typ == ISDN_CTYPE_ELSA_PCI)) { | 1460 | (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] = { | |||
332 | #define HISAX_IDSIZE (HISAX_MAX_CARDS*8) | 332 | #define HISAX_IDSIZE (HISAX_MAX_CARDS*8) |
333 | static char HiSaxID[HISAX_IDSIZE] = { 0, }; | 333 | static char HiSaxID[HISAX_IDSIZE] = { 0, }; |
334 | 334 | ||
335 | char *HiSax_id = HiSaxID; | 335 | static char *HiSax_id = HiSaxID; |
336 | #ifdef MODULE | 336 | #ifdef MODULE |
337 | /* Variables for insmod */ | 337 | /* Variables for insmod */ |
338 | static int type[HISAX_MAX_CARDS] = { 0, }; | 338 | static int type[HISAX_MAX_CARDS] = { 0, }; |
@@ -391,7 +391,7 @@ char *HiSax_getrev(const char *revision) | |||
391 | return rev; | 391 | return rev; |
392 | } | 392 | } |
393 | 393 | ||
394 | void __init HiSaxVersion(void) | 394 | static void __init HiSaxVersion(void) |
395 | { | 395 | { |
396 | char tmp[64]; | 396 | char tmp[64]; |
397 | 397 | ||
@@ -608,6 +608,7 @@ static inline struct IsdnCardState *hisax_findcard(int driverid) | |||
608 | /* | 608 | /* |
609 | * Find card with given card number | 609 | * Find card with given card number |
610 | */ | 610 | */ |
611 | #if 0 | ||
611 | struct IsdnCardState *hisax_get_card(int cardnr) | 612 | struct IsdnCardState *hisax_get_card(int cardnr) |
612 | { | 613 | { |
613 | if ((cardnr <= nrcards) && (cardnr > 0)) | 614 | if ((cardnr <= nrcards) && (cardnr > 0)) |
@@ -615,8 +616,9 @@ struct IsdnCardState *hisax_get_card(int cardnr) | |||
615 | return cards[cardnr - 1].cs; | 616 | return cards[cardnr - 1].cs; |
616 | return NULL; | 617 | return NULL; |
617 | } | 618 | } |
619 | #endif /* 0 */ | ||
618 | 620 | ||
619 | int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) | 621 | static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) |
620 | { | 622 | { |
621 | int count, cnt; | 623 | int count, cnt; |
622 | u_char __user *p = buf; | 624 | u_char __user *p = buf; |
@@ -768,7 +770,7 @@ int ll_run(struct IsdnCardState *cs, int addfeatures) | |||
768 | return 0; | 770 | return 0; |
769 | } | 771 | } |
770 | 772 | ||
771 | void ll_stop(struct IsdnCardState *cs) | 773 | static void ll_stop(struct IsdnCardState *cs) |
772 | { | 774 | { |
773 | isdn_ctrl ic; | 775 | isdn_ctrl ic; |
774 | 776 | ||
@@ -1184,7 +1186,7 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow | |||
1184 | return ret; | 1186 | return ret; |
1185 | } | 1187 | } |
1186 | 1188 | ||
1187 | void HiSax_shiftcards(int idx) | 1189 | static void HiSax_shiftcards(int idx) |
1188 | { | 1190 | { |
1189 | int i; | 1191 | int i; |
1190 | 1192 | ||
@@ -1192,7 +1194,7 @@ void HiSax_shiftcards(int idx) | |||
1192 | memcpy(&cards[i], &cards[i + 1], sizeof(cards[i])); | 1194 | memcpy(&cards[i], &cards[i + 1], sizeof(cards[i])); |
1193 | } | 1195 | } |
1194 | 1196 | ||
1195 | int HiSax_inithardware(int *busy_flag) | 1197 | static int HiSax_inithardware(int *busy_flag) |
1196 | { | 1198 | { |
1197 | int foundcards = 0; | 1199 | int foundcards = 0; |
1198 | int i = 0; | 1200 | 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 @@ | |||
28 | 28 | ||
29 | extern const char *CardType[]; | 29 | extern const char *CardType[]; |
30 | 30 | ||
31 | const char *Diva_revision = "$Revision: 1.33.2.6 $"; | 31 | static const char *Diva_revision = "$Revision: 1.33.2.6 $"; |
32 | 32 | ||
33 | #define byteout(addr,val) outb(val,addr) | 33 | #define byteout(addr,val) outb(val,addr) |
34 | #define bytein(addr) inb(addr) | 34 | #define bytein(addr) inb(addr) |
@@ -706,7 +706,7 @@ diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs) | |||
706 | return IRQ_HANDLED; | 706 | return IRQ_HANDLED; |
707 | } | 707 | } |
708 | 708 | ||
709 | void | 709 | static void |
710 | release_io_diva(struct IsdnCardState *cs) | 710 | release_io_diva(struct IsdnCardState *cs) |
711 | { | 711 | { |
712 | int bytecnt; | 712 | 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 @@ | |||
33 | 33 | ||
34 | extern const char *CardType[]; | 34 | extern const char *CardType[]; |
35 | 35 | ||
36 | const char *Elsa_revision = "$Revision: 2.32.2.4 $"; | 36 | static const char *Elsa_revision = "$Revision: 2.32.2.4 $"; |
37 | const char *Elsa_Types[] = | 37 | static const char *Elsa_Types[] = |
38 | {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", | 38 | {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", |
39 | "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", | 39 | "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", |
40 | "PCMCIA-IPAC" }; | 40 | "PCMCIA-IPAC" }; |
41 | 41 | ||
42 | const char *ITACVer[] = | 42 | static const char *ITACVer[] = |
43 | {"?0?", "?1?", "?2?", "?3?", "?4?", "V2.2", | 43 | {"?0?", "?1?", "?2?", "?3?", "?4?", "V2.2", |
44 | "B1", "A1"}; | 44 | "B1", "A1"}; |
45 | 45 | ||
@@ -425,7 +425,7 @@ Start_IPAC: | |||
425 | return IRQ_HANDLED; | 425 | return IRQ_HANDLED; |
426 | } | 426 | } |
427 | 427 | ||
428 | void | 428 | static void |
429 | release_io_elsa(struct IsdnCardState *cs) | 429 | release_io_elsa(struct IsdnCardState *cs) |
430 | { | 430 | { |
431 | int bytecnt = 8; | 431 | int bytecnt = 8; |
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) | |||
237 | #endif | 237 | #endif |
238 | } | 238 | } |
239 | 239 | ||
240 | inline int | 240 | static inline int |
241 | write_modem(struct BCState *bcs) { | 241 | write_modem(struct BCState *bcs) { |
242 | int ret=0; | 242 | int ret=0; |
243 | struct IsdnCardState *cs = bcs->cs; | 243 | struct IsdnCardState *cs = bcs->cs; |
@@ -275,7 +275,7 @@ write_modem(struct BCState *bcs) { | |||
275 | return(ret); | 275 | return(ret); |
276 | } | 276 | } |
277 | 277 | ||
278 | inline void | 278 | static inline void |
279 | modem_fill(struct BCState *bcs) { | 279 | modem_fill(struct BCState *bcs) { |
280 | 280 | ||
281 | if (bcs->tx_skb) { | 281 | if (bcs->tx_skb) { |
@@ -422,7 +422,7 @@ extern int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs); | |||
422 | extern void modehscx(struct BCState *bcs, int mode, int bc); | 422 | extern void modehscx(struct BCState *bcs, int mode, int bc); |
423 | extern void hscx_l2l1(struct PStack *st, int pr, void *arg); | 423 | extern void hscx_l2l1(struct PStack *st, int pr, void *arg); |
424 | 424 | ||
425 | void | 425 | static void |
426 | close_elsastate(struct BCState *bcs) | 426 | close_elsastate(struct BCState *bcs) |
427 | { | 427 | { |
428 | modehscx(bcs, 0, bcs->channel); | 428 | modehscx(bcs, 0, bcs->channel); |
@@ -442,7 +442,7 @@ close_elsastate(struct BCState *bcs) | |||
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | void | 445 | static void |
446 | modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) { | 446 | modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) { |
447 | int count, fp; | 447 | int count, fp; |
448 | u_char *msg = buf; | 448 | u_char *msg = buf; |
@@ -472,7 +472,7 @@ modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) { | |||
472 | } | 472 | } |
473 | } | 473 | } |
474 | 474 | ||
475 | void | 475 | static void |
476 | modem_set_init(struct IsdnCardState *cs) { | 476 | modem_set_init(struct IsdnCardState *cs) { |
477 | int timeout; | 477 | int timeout; |
478 | 478 | ||
@@ -521,7 +521,7 @@ modem_set_init(struct IsdnCardState *cs) { | |||
521 | udelay(RCV_DELAY); | 521 | udelay(RCV_DELAY); |
522 | } | 522 | } |
523 | 523 | ||
524 | void | 524 | static void |
525 | modem_set_dial(struct IsdnCardState *cs, int outgoing) { | 525 | modem_set_dial(struct IsdnCardState *cs, int outgoing) { |
526 | int timeout; | 526 | int timeout; |
527 | #define RCV_DELAY 20000 | 527 | #define RCV_DELAY 20000 |
@@ -543,7 +543,7 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) { | |||
543 | udelay(RCV_DELAY); | 543 | udelay(RCV_DELAY); |
544 | } | 544 | } |
545 | 545 | ||
546 | void | 546 | static void |
547 | modem_l2l1(struct PStack *st, int pr, void *arg) | 547 | modem_l2l1(struct PStack *st, int pr, void *arg) |
548 | { | 548 | { |
549 | struct BCState *bcs = st->l1.bcs; | 549 | struct BCState *bcs = st->l1.bcs; |
@@ -579,7 +579,7 @@ modem_l2l1(struct PStack *st, int pr, void *arg) | |||
579 | } | 579 | } |
580 | } | 580 | } |
581 | 581 | ||
582 | int | 582 | static int |
583 | setstack_elsa(struct PStack *st, struct BCState *bcs) | 583 | setstack_elsa(struct PStack *st, struct BCState *bcs) |
584 | { | 584 | { |
585 | 585 | ||
@@ -614,7 +614,7 @@ setstack_elsa(struct PStack *st, struct BCState *bcs) | |||
614 | return (0); | 614 | return (0); |
615 | } | 615 | } |
616 | 616 | ||
617 | void | 617 | static void |
618 | init_modem(struct IsdnCardState *cs) { | 618 | init_modem(struct IsdnCardState *cs) { |
619 | 619 | ||
620 | cs->bcs[0].BC_SetStack = setstack_elsa; | 620 | cs->bcs[0].BC_SetStack = setstack_elsa; |
@@ -641,7 +641,7 @@ init_modem(struct IsdnCardState *cs) { | |||
641 | modem_set_init(cs); | 641 | modem_set_init(cs); |
642 | } | 642 | } |
643 | 643 | ||
644 | void | 644 | static void |
645 | release_modem(struct IsdnCardState *cs) { | 645 | release_modem(struct IsdnCardState *cs) { |
646 | 646 | ||
647 | cs->hw.elsa.MFlag = 0; | 647 | 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 @@ | |||
1 | /* 2001/10/02 | ||
2 | * | ||
3 | * enternow.h Header-file included by | ||
4 | * enternow_pci.c | ||
5 | * | ||
6 | * Author Christoph Ersfeld <info@formula-n.de> | ||
7 | * Formula-n Europe AG (www.formula-n.com) | ||
8 | * previously Gerdes AG | ||
9 | * | ||
10 | * | ||
11 | * This file is (c) under GNU PUBLIC LICENSE | ||
12 | */ | ||
13 | |||
14 | |||
15 | /* ***************************************************************************************** * | ||
16 | * ****************************** datatypes and macros ************************************* * | ||
17 | * ***************************************************************************************** */ | ||
18 | |||
19 | #define BYTE unsigned char | ||
20 | #define WORD unsigned int | ||
21 | #define HIBYTE(w) ((unsigned char)((w & 0xff00) / 256)) | ||
22 | #define LOBYTE(w) ((unsigned char)(w & 0x00ff)) | ||
23 | #define InByte(addr) inb(addr) | ||
24 | #define OutByte(addr,val) outb(val,addr) | ||
25 | |||
26 | |||
27 | |||
28 | /* ***************************************************************************************** * | ||
29 | * *********************************** card-specific *************************************** * | ||
30 | * ***************************************************************************************** */ | ||
31 | |||
32 | /* für PowerISDN PCI */ | ||
33 | #define TJ_AMD_IRQ 0x20 | ||
34 | #define TJ_LED1 0x40 | ||
35 | #define TJ_LED2 0x80 | ||
36 | |||
37 | |||
38 | /* Das Fenster zum AMD... | ||
39 | * Ab Adresse hw.njet.base + TJ_AMD_PORT werden vom AMD jeweils 8 Bit in | ||
40 | * den TigerJet i/o-Raum gemappt | ||
41 | * -> 0x01 des AMD bei hw.njet.base + 0C4 */ | ||
42 | #define TJ_AMD_PORT 0xC0 | ||
43 | |||
44 | |||
45 | |||
46 | /* ***************************************************************************************** * | ||
47 | * *************************************** Prototypen ************************************** * | ||
48 | * ***************************************************************************************** */ | ||
49 | |||
50 | BYTE ReadByteAmd7930(struct IsdnCardState *cs, BYTE offset); | ||
51 | 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 @@ | |||
65 | #include "isac.h" | 65 | #include "isac.h" |
66 | #include "isdnl1.h" | 66 | #include "isdnl1.h" |
67 | #include "amd7930_fn.h" | 67 | #include "amd7930_fn.h" |
68 | #include "enternow.h" | ||
69 | #include <linux/interrupt.h> | 68 | #include <linux/interrupt.h> |
70 | #include <linux/ppp_defs.h> | 69 | #include <linux/ppp_defs.h> |
71 | #include <linux/pci.h> | 70 | #include <linux/pci.h> |
@@ -74,58 +73,72 @@ | |||
74 | 73 | ||
75 | 74 | ||
76 | 75 | ||
77 | const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; | 76 | static const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; |
77 | |||
78 | |||
79 | /* für PowerISDN PCI */ | ||
80 | #define TJ_AMD_IRQ 0x20 | ||
81 | #define TJ_LED1 0x40 | ||
82 | #define TJ_LED2 0x80 | ||
83 | |||
84 | |||
85 | /* Das Fenster zum AMD... | ||
86 | * Ab Adresse hw.njet.base + TJ_AMD_PORT werden vom AMD jeweils 8 Bit in | ||
87 | * den TigerJet i/o-Raum gemappt | ||
88 | * -> 0x01 des AMD bei hw.njet.base + 0C4 */ | ||
89 | #define TJ_AMD_PORT 0xC0 | ||
90 | |||
78 | 91 | ||
79 | 92 | ||
80 | /* *************************** I/O-Interface functions ************************************* */ | 93 | /* *************************** I/O-Interface functions ************************************* */ |
81 | 94 | ||
82 | 95 | ||
83 | /* cs->readisac, macro rByteAMD */ | 96 | /* cs->readisac, macro rByteAMD */ |
84 | BYTE | 97 | static unsigned char |
85 | ReadByteAmd7930(struct IsdnCardState *cs, BYTE offset) | 98 | ReadByteAmd7930(struct IsdnCardState *cs, unsigned char offset) |
86 | { | 99 | { |
87 | /* direktes Register */ | 100 | /* direktes Register */ |
88 | if(offset < 8) | 101 | if(offset < 8) |
89 | return (InByte(cs->hw.njet.isac + 4*offset)); | 102 | return (inb(cs->hw.njet.isac + 4*offset)); |
90 | 103 | ||
91 | /* indirektes Register */ | 104 | /* indirektes Register */ |
92 | else { | 105 | else { |
93 | OutByte(cs->hw.njet.isac + 4*AMD_CR, offset); | 106 | outb(offset, cs->hw.njet.isac + 4*AMD_CR); |
94 | return(InByte(cs->hw.njet.isac + 4*AMD_DR)); | 107 | return(inb(cs->hw.njet.isac + 4*AMD_DR)); |
95 | } | 108 | } |
96 | } | 109 | } |
97 | 110 | ||
98 | /* cs->writeisac, macro wByteAMD */ | 111 | /* cs->writeisac, macro wByteAMD */ |
99 | void | 112 | static void |
100 | WriteByteAmd7930(struct IsdnCardState *cs, BYTE offset, BYTE value) | 113 | WriteByteAmd7930(struct IsdnCardState *cs, unsigned char offset, unsigned char value) |
101 | { | 114 | { |
102 | /* direktes Register */ | 115 | /* direktes Register */ |
103 | if(offset < 8) | 116 | if(offset < 8) |
104 | OutByte(cs->hw.njet.isac + 4*offset, value); | 117 | outb(value, cs->hw.njet.isac + 4*offset); |
105 | 118 | ||
106 | /* indirektes Register */ | 119 | /* indirektes Register */ |
107 | else { | 120 | else { |
108 | OutByte(cs->hw.njet.isac + 4*AMD_CR, offset); | 121 | outb(offset, cs->hw.njet.isac + 4*AMD_CR); |
109 | OutByte(cs->hw.njet.isac + 4*AMD_DR, value); | 122 | outb(value, cs->hw.njet.isac + 4*AMD_DR); |
110 | } | 123 | } |
111 | } | 124 | } |
112 | 125 | ||
113 | 126 | ||
114 | void | 127 | static void |
115 | enpci_setIrqMask(struct IsdnCardState *cs, BYTE val) { | 128 | enpci_setIrqMask(struct IsdnCardState *cs, unsigned char val) { |
116 | if (!val) | 129 | if (!val) |
117 | OutByte(cs->hw.njet.base+NETJET_IRQMASK1, 0x00); | 130 | outb(0x00, cs->hw.njet.base+NETJET_IRQMASK1); |
118 | else | 131 | else |
119 | OutByte(cs->hw.njet.base+NETJET_IRQMASK1, TJ_AMD_IRQ); | 132 | outb(TJ_AMD_IRQ, cs->hw.njet.base+NETJET_IRQMASK1); |
120 | } | 133 | } |
121 | 134 | ||
122 | 135 | ||
123 | static BYTE dummyrr(struct IsdnCardState *cs, int chan, BYTE off) | 136 | static unsigned char dummyrr(struct IsdnCardState *cs, int chan, unsigned char off) |
124 | { | 137 | { |
125 | return(5); | 138 | return(5); |
126 | } | 139 | } |
127 | 140 | ||
128 | static void dummywr(struct IsdnCardState *cs, int chan, BYTE off, BYTE value) | 141 | static void dummywr(struct IsdnCardState *cs, int chan, unsigned char off, unsigned char value) |
129 | { | 142 | { |
130 | 143 | ||
131 | } | 144 | } |
@@ -142,18 +155,18 @@ reset_enpci(struct IsdnCardState *cs) | |||
142 | 155 | ||
143 | /* Reset on, (also for AMD) */ | 156 | /* Reset on, (also for AMD) */ |
144 | cs->hw.njet.ctrl_reg = 0x07; | 157 | cs->hw.njet.ctrl_reg = 0x07; |
145 | OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); | 158 | outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); |
146 | mdelay(20); | 159 | mdelay(20); |
147 | /* Reset off */ | 160 | /* Reset off */ |
148 | cs->hw.njet.ctrl_reg = 0x30; | 161 | cs->hw.njet.ctrl_reg = 0x30; |
149 | OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); | 162 | outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); |
150 | /* 20ms delay */ | 163 | /* 20ms delay */ |
151 | mdelay(20); | 164 | mdelay(20); |
152 | cs->hw.njet.auxd = 0; // LED-status | 165 | cs->hw.njet.auxd = 0; // LED-status |
153 | cs->hw.njet.dmactrl = 0; | 166 | cs->hw.njet.dmactrl = 0; |
154 | OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); | 167 | outb(~TJ_AMD_IRQ, cs->hw.njet.base + NETJET_AUXCTRL); |
155 | OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); | 168 | outb(TJ_AMD_IRQ, cs->hw.njet.base + NETJET_IRQMASK1); |
156 | OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); // LED off | 169 | outb(cs->hw.njet.auxd, cs->hw.njet.auxa); // LED off |
157 | } | 170 | } |
158 | 171 | ||
159 | 172 | ||
@@ -161,7 +174,7 @@ static int | |||
161 | enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) | 174 | enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) |
162 | { | 175 | { |
163 | u_long flags; | 176 | u_long flags; |
164 | BYTE *chan; | 177 | unsigned char *chan; |
165 | 178 | ||
166 | if (cs->debug & L1_DEB_ISAC) | 179 | if (cs->debug & L1_DEB_ISAC) |
167 | debugl1(cs, "enter:now PCI: card_msg: 0x%04X", mt); | 180 | debugl1(cs, "enter:now PCI: card_msg: 0x%04X", mt); |
@@ -187,16 +200,16 @@ enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) | |||
187 | case MDL_ASSIGN: | 200 | case MDL_ASSIGN: |
188 | /* TEI assigned, LED1 on */ | 201 | /* TEI assigned, LED1 on */ |
189 | cs->hw.njet.auxd = TJ_AMD_IRQ << 1; | 202 | cs->hw.njet.auxd = TJ_AMD_IRQ << 1; |
190 | OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); | 203 | outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); |
191 | break; | 204 | break; |
192 | case MDL_REMOVE: | 205 | case MDL_REMOVE: |
193 | /* TEI removed, LEDs off */ | 206 | /* TEI removed, LEDs off */ |
194 | cs->hw.njet.auxd = 0; | 207 | cs->hw.njet.auxd = 0; |
195 | OutByte(cs->hw.njet.base + NETJET_AUXDATA, 0x00); | 208 | outb(0x00, cs->hw.njet.base + NETJET_AUXDATA); |
196 | break; | 209 | break; |
197 | case MDL_BC_ASSIGN: | 210 | case MDL_BC_ASSIGN: |
198 | /* activate B-channel */ | 211 | /* activate B-channel */ |
199 | chan = (BYTE *)arg; | 212 | chan = (unsigned char *)arg; |
200 | 213 | ||
201 | if (cs->debug & L1_DEB_ISAC) | 214 | if (cs->debug & L1_DEB_ISAC) |
202 | debugl1(cs, "enter:now PCI: assign phys. BC %d in AMD LMR1", *chan); | 215 | 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) | |||
204 | cs->dc.amd7930.ph_command(cs, (cs->dc.amd7930.lmr1 | (*chan + 1)), "MDL_BC_ASSIGN"); | 217 | cs->dc.amd7930.ph_command(cs, (cs->dc.amd7930.lmr1 | (*chan + 1)), "MDL_BC_ASSIGN"); |
205 | /* at least one b-channel in use, LED 2 on */ | 218 | /* at least one b-channel in use, LED 2 on */ |
206 | cs->hw.njet.auxd |= TJ_AMD_IRQ << 2; | 219 | cs->hw.njet.auxd |= TJ_AMD_IRQ << 2; |
207 | OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); | 220 | outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); |
208 | break; | 221 | break; |
209 | case MDL_BC_RELEASE: | 222 | case MDL_BC_RELEASE: |
210 | /* deactivate B-channel */ | 223 | /* deactivate B-channel */ |
211 | chan = (BYTE *)arg; | 224 | chan = (unsigned char *)arg; |
212 | 225 | ||
213 | if (cs->debug & L1_DEB_ISAC) | 226 | if (cs->debug & L1_DEB_ISAC) |
214 | debugl1(cs, "enter:now PCI: release phys. BC %d in Amd LMR1", *chan); | 227 | 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) | |||
217 | /* no b-channel active -> LED2 off */ | 230 | /* no b-channel active -> LED2 off */ |
218 | if (!(cs->dc.amd7930.lmr1 & 3)) { | 231 | if (!(cs->dc.amd7930.lmr1 & 3)) { |
219 | cs->hw.njet.auxd &= ~(TJ_AMD_IRQ << 2); | 232 | cs->hw.njet.auxd &= ~(TJ_AMD_IRQ << 2); |
220 | OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); | 233 | outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); |
221 | } | 234 | } |
222 | break; | 235 | break; |
223 | default: | 236 | default: |
@@ -231,11 +244,11 @@ static irqreturn_t | |||
231 | enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) | 244 | enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) |
232 | { | 245 | { |
233 | struct IsdnCardState *cs = dev_id; | 246 | struct IsdnCardState *cs = dev_id; |
234 | BYTE s0val, s1val, ir; | 247 | unsigned char s0val, s1val, ir; |
235 | u_long flags; | 248 | u_long flags; |
236 | 249 | ||
237 | spin_lock_irqsave(&cs->lock, flags); | 250 | spin_lock_irqsave(&cs->lock, flags); |
238 | s1val = InByte(cs->hw.njet.base + NETJET_IRQSTAT1); | 251 | s1val = inb(cs->hw.njet.base + NETJET_IRQSTAT1); |
239 | 252 | ||
240 | /* AMD threw an interrupt */ | 253 | /* AMD threw an interrupt */ |
241 | if (!(s1val & TJ_AMD_IRQ)) { | 254 | if (!(s1val & TJ_AMD_IRQ)) { |
@@ -245,13 +258,13 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
245 | s1val = 1; | 258 | s1val = 1; |
246 | } else | 259 | } else |
247 | s1val = 0; | 260 | s1val = 0; |
248 | s0val = InByte(cs->hw.njet.base + NETJET_IRQSTAT0); | 261 | s0val = inb(cs->hw.njet.base + NETJET_IRQSTAT0); |
249 | if ((s0val | s1val)==0) { // shared IRQ | 262 | if ((s0val | s1val)==0) { // shared IRQ |
250 | spin_unlock_irqrestore(&cs->lock, flags); | 263 | spin_unlock_irqrestore(&cs->lock, flags); |
251 | return IRQ_NONE; | 264 | return IRQ_NONE; |
252 | } | 265 | } |
253 | if (s0val) | 266 | if (s0val) |
254 | OutByte(cs->hw.njet.base + NETJET_IRQSTAT0, s0val); | 267 | outb(s0val, cs->hw.njet.base + NETJET_IRQSTAT0); |
255 | 268 | ||
256 | /* DMA-Interrupt: B-channel-stuff */ | 269 | /* DMA-Interrupt: B-channel-stuff */ |
257 | /* set bits in sval to indicate which page is free */ | 270 | /* set bits in sval to indicate which page is free */ |
@@ -342,20 +355,20 @@ setup_enternow_pci(struct IsdnCard *card) | |||
342 | 355 | ||
343 | /* Reset an */ | 356 | /* Reset an */ |
344 | cs->hw.njet.ctrl_reg = 0x07; // geändert von 0xff | 357 | cs->hw.njet.ctrl_reg = 0x07; // geändert von 0xff |
345 | OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); | 358 | outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); |
346 | /* 20 ms Pause */ | 359 | /* 20 ms Pause */ |
347 | mdelay(20); | 360 | mdelay(20); |
348 | 361 | ||
349 | cs->hw.njet.ctrl_reg = 0x30; /* Reset Off and status read clear */ | 362 | cs->hw.njet.ctrl_reg = 0x30; /* Reset Off and status read clear */ |
350 | OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); | 363 | outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); |
351 | mdelay(10); | 364 | mdelay(10); |
352 | 365 | ||
353 | cs->hw.njet.auxd = 0x00; // war 0xc0 | 366 | cs->hw.njet.auxd = 0x00; // war 0xc0 |
354 | cs->hw.njet.dmactrl = 0; | 367 | cs->hw.njet.dmactrl = 0; |
355 | 368 | ||
356 | OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); | 369 | outb(~TJ_AMD_IRQ, cs->hw.njet.base + NETJET_AUXCTRL); |
357 | OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); | 370 | outb(TJ_AMD_IRQ, cs->hw.njet.base + NETJET_IRQMASK1); |
358 | OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); | 371 | outb(cs->hw.njet.auxd, cs->hw.njet.auxa); |
359 | 372 | ||
360 | break; | 373 | break; |
361 | } | 374 | } |
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 @@ | |||
21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
22 | 22 | ||
23 | extern const char *CardType[]; | 23 | extern const char *CardType[]; |
24 | const char *gazel_revision = "$Revision: 2.19.2.4 $"; | 24 | static const char *gazel_revision = "$Revision: 2.19.2.4 $"; |
25 | 25 | ||
26 | #define R647 1 | 26 | #define R647 1 |
27 | #define R685 2 | 27 | #define R685 2 |
@@ -317,7 +317,8 @@ gazel_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) | |||
317 | spin_unlock_irqrestore(&cs->lock, flags); | 317 | spin_unlock_irqrestore(&cs->lock, flags); |
318 | return IRQ_HANDLED; | 318 | return IRQ_HANDLED; |
319 | } | 319 | } |
320 | void | 320 | |
321 | static void | ||
321 | release_io_gazel(struct IsdnCardState *cs) | 322 | release_io_gazel(struct IsdnCardState *cs) |
322 | { | 323 | { |
323 | unsigned int i; | 324 | unsigned int i; |
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index ba1d028343ec..6e7e060716b7 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c | |||
@@ -1358,7 +1358,7 @@ chipreset(hfc4s8s_hw * hw) | |||
1358 | /********************************************/ | 1358 | /********************************************/ |
1359 | /* disable/enable hardware in nt or te mode */ | 1359 | /* disable/enable hardware in nt or te mode */ |
1360 | /********************************************/ | 1360 | /********************************************/ |
1361 | void | 1361 | static void |
1362 | hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode) | 1362 | hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode) |
1363 | { | 1363 | { |
1364 | u_long flags; | 1364 | u_long flags; |
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) | |||
345 | debugl1(cs,"send_data %d blocked", bcs->channel); | 345 | debugl1(cs,"send_data %d blocked", bcs->channel); |
346 | } | 346 | } |
347 | 347 | ||
348 | void | 348 | static void |
349 | main_rec_2bds0(struct BCState *bcs) | 349 | main_rec_2bds0(struct BCState *bcs) |
350 | { | 350 | { |
351 | struct IsdnCardState *cs = bcs->cs; | 351 | struct IsdnCardState *cs = bcs->cs; |
@@ -399,7 +399,7 @@ main_rec_2bds0(struct BCState *bcs) | |||
399 | return; | 399 | return; |
400 | } | 400 | } |
401 | 401 | ||
402 | void | 402 | static void |
403 | mode_2bs0(struct BCState *bcs, int mode, int bc) | 403 | mode_2bs0(struct BCState *bcs, int mode, int bc) |
404 | { | 404 | { |
405 | struct IsdnCardState *cs = bcs->cs; | 405 | struct IsdnCardState *cs = bcs->cs; |
@@ -505,7 +505,7 @@ hfc_l2l1(struct PStack *st, int pr, void *arg) | |||
505 | } | 505 | } |
506 | } | 506 | } |
507 | 507 | ||
508 | void | 508 | static void |
509 | close_2bs0(struct BCState *bcs) | 509 | close_2bs0(struct BCState *bcs) |
510 | { | 510 | { |
511 | mode_2bs0(bcs, 0, bcs->channel); | 511 | mode_2bs0(bcs, 0, bcs->channel); |
@@ -534,7 +534,7 @@ open_hfcstate(struct IsdnCardState *cs, struct BCState *bcs) | |||
534 | return (0); | 534 | return (0); |
535 | } | 535 | } |
536 | 536 | ||
537 | int | 537 | static int |
538 | setstack_2b(struct PStack *st, struct BCState *bcs) | 538 | setstack_2b(struct PStack *st, struct BCState *bcs) |
539 | { | 539 | { |
540 | bcs->channel = st->l1.bc; | 540 | bcs->channel = st->l1.bc; |
@@ -1004,7 +1004,7 @@ HFCD_l1hw(struct PStack *st, int pr, void *arg) | |||
1004 | } | 1004 | } |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | void | 1007 | static void |
1008 | setstack_hfcd(struct PStack *st, struct IsdnCardState *cs) | 1008 | setstack_hfcd(struct PStack *st, struct IsdnCardState *cs) |
1009 | { | 1009 | { |
1010 | st->l1.l1hw = HFCD_l1hw; | 1010 | st->l1.l1hw = HFCD_l1hw; |
@@ -1015,7 +1015,7 @@ hfc_dbusy_timer(struct IsdnCardState *cs) | |||
1015 | { | 1015 | { |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | unsigned int __init | 1018 | static unsigned int __init |
1019 | *init_send_hfcd(int cnt) | 1019 | *init_send_hfcd(int cnt) |
1020 | { | 1020 | { |
1021 | int i, *send; | 1021 | 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) | |||
52 | return (to); | 52 | return (to); |
53 | } | 53 | } |
54 | 54 | ||
55 | int | 55 | static int |
56 | GetFreeFifoBytes(struct BCState *bcs) | 56 | GetFreeFifoBytes(struct BCState *bcs) |
57 | { | 57 | { |
58 | int s; | 58 | int s; |
@@ -66,7 +66,7 @@ GetFreeFifoBytes(struct BCState *bcs) | |||
66 | return (s); | 66 | return (s); |
67 | } | 67 | } |
68 | 68 | ||
69 | int | 69 | static int |
70 | ReadZReg(struct BCState *bcs, u_char reg) | 70 | ReadZReg(struct BCState *bcs, u_char reg) |
71 | { | 71 | { |
72 | int val; | 72 | int val; |
@@ -394,7 +394,7 @@ main_irq_hfc(struct BCState *bcs) | |||
394 | return; | 394 | return; |
395 | } | 395 | } |
396 | 396 | ||
397 | void | 397 | static void |
398 | mode_hfc(struct BCState *bcs, int mode, int bc) | 398 | mode_hfc(struct BCState *bcs, int mode, int bc) |
399 | { | 399 | { |
400 | struct IsdnCardState *cs = bcs->cs; | 400 | struct IsdnCardState *cs = bcs->cs; |
@@ -507,7 +507,7 @@ hfc_l2l1(struct PStack *st, int pr, void *arg) | |||
507 | } | 507 | } |
508 | 508 | ||
509 | 509 | ||
510 | void | 510 | static void |
511 | close_hfcstate(struct BCState *bcs) | 511 | close_hfcstate(struct BCState *bcs) |
512 | { | 512 | { |
513 | mode_hfc(bcs, 0, bcs->channel); | 513 | mode_hfc(bcs, 0, bcs->channel); |
@@ -537,7 +537,7 @@ open_hfcstate(struct IsdnCardState *cs, struct BCState *bcs) | |||
537 | return (0); | 537 | return (0); |
538 | } | 538 | } |
539 | 539 | ||
540 | int | 540 | static int |
541 | setstack_hfc(struct PStack *st, struct BCState *bcs) | 541 | setstack_hfc(struct PStack *st, struct BCState *bcs) |
542 | { | 542 | { |
543 | bcs->channel = st->l1.bc; | 543 | bcs->channel = st->l1.bc; |
@@ -551,7 +551,7 @@ setstack_hfc(struct PStack *st, struct BCState *bcs) | |||
551 | return (0); | 551 | return (0); |
552 | } | 552 | } |
553 | 553 | ||
554 | void __init | 554 | static void __init |
555 | init_send(struct BCState *bcs) | 555 | init_send(struct BCState *bcs) |
556 | { | 556 | { |
557 | int i; | 557 | 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[] = | |||
70 | /******************************************/ | 70 | /******************************************/ |
71 | /* free hardware resources used by driver */ | 71 | /* free hardware resources used by driver */ |
72 | /******************************************/ | 72 | /******************************************/ |
73 | void | 73 | static void |
74 | release_io_hfcpci(struct IsdnCardState *cs) | 74 | release_io_hfcpci(struct IsdnCardState *cs) |
75 | { | 75 | { |
76 | printk(KERN_INFO "HiSax: release hfcpci at %p\n", | 76 | printk(KERN_INFO "HiSax: release hfcpci at %p\n", |
@@ -394,7 +394,7 @@ receive_dmsg(struct IsdnCardState *cs) | |||
394 | /*******************************************************************************/ | 394 | /*******************************************************************************/ |
395 | /* check for transparent receive data and read max one threshold size if avail */ | 395 | /* check for transparent receive data and read max one threshold size if avail */ |
396 | /*******************************************************************************/ | 396 | /*******************************************************************************/ |
397 | int | 397 | static int |
398 | hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata) | 398 | hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata) |
399 | { | 399 | { |
400 | unsigned short *z1r, *z2r; | 400 | unsigned short *z1r, *z2r; |
@@ -446,7 +446,7 @@ hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata) | |||
446 | /**********************************/ | 446 | /**********************************/ |
447 | /* B-channel main receive routine */ | 447 | /* B-channel main receive routine */ |
448 | /**********************************/ | 448 | /**********************************/ |
449 | void | 449 | static void |
450 | main_rec_hfcpci(struct BCState *bcs) | 450 | main_rec_hfcpci(struct BCState *bcs) |
451 | { | 451 | { |
452 | struct IsdnCardState *cs = bcs->cs; | 452 | struct IsdnCardState *cs = bcs->cs; |
@@ -1244,7 +1244,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg) | |||
1244 | /***********************************************/ | 1244 | /***********************************************/ |
1245 | /* called during init setting l1 stack pointer */ | 1245 | /* called during init setting l1 stack pointer */ |
1246 | /***********************************************/ | 1246 | /***********************************************/ |
1247 | void | 1247 | static void |
1248 | setstack_hfcpci(struct PStack *st, struct IsdnCardState *cs) | 1248 | setstack_hfcpci(struct PStack *st, struct IsdnCardState *cs) |
1249 | { | 1249 | { |
1250 | st->l1.l1hw = HFCPCI_l1hw; | 1250 | st->l1.l1hw = HFCPCI_l1hw; |
@@ -1268,7 +1268,7 @@ hfcpci_send_data(struct BCState *bcs) | |||
1268 | /***************************************************************/ | 1268 | /***************************************************************/ |
1269 | /* activate/deactivate hardware for selected channels and mode */ | 1269 | /* activate/deactivate hardware for selected channels and mode */ |
1270 | /***************************************************************/ | 1270 | /***************************************************************/ |
1271 | void | 1271 | static void |
1272 | mode_hfcpci(struct BCState *bcs, int mode, int bc) | 1272 | mode_hfcpci(struct BCState *bcs, int mode, int bc) |
1273 | { | 1273 | { |
1274 | struct IsdnCardState *cs = bcs->cs; | 1274 | struct IsdnCardState *cs = bcs->cs; |
@@ -1579,7 +1579,7 @@ hfcpci_bh(struct IsdnCardState *cs) | |||
1579 | /********************************/ | 1579 | /********************************/ |
1580 | /* called for card init message */ | 1580 | /* called for card init message */ |
1581 | /********************************/ | 1581 | /********************************/ |
1582 | void __init | 1582 | static void __init |
1583 | inithfcpci(struct IsdnCardState *cs) | 1583 | inithfcpci(struct IsdnCardState *cs) |
1584 | { | 1584 | { |
1585 | cs->bcs[0].BC_SetStack = setstack_2b; | 1585 | 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 { | |||
232 | #define Read_hfc(a,b) (*(((u_char *)a->hw.hfcpci.pci_io)+b)) | 232 | #define Read_hfc(a,b) (*(((u_char *)a->hw.hfcpci.pci_io)+b)) |
233 | 233 | ||
234 | extern void main_irq_hcpci(struct BCState *bcs); | 234 | extern void main_irq_hcpci(struct BCState *bcs); |
235 | extern void inithfcpci(struct IsdnCardState *cs); | ||
236 | extern void releasehfcpci(struct IsdnCardState *cs); | 235 | 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) | |||
308 | /******************************************/ | 308 | /******************************************/ |
309 | /* free hardware resources used by driver */ | 309 | /* free hardware resources used by driver */ |
310 | /******************************************/ | 310 | /******************************************/ |
311 | void | 311 | static void |
312 | release_io_hfcsx(struct IsdnCardState *cs) | 312 | release_io_hfcsx(struct IsdnCardState *cs) |
313 | { | 313 | { |
314 | cs->hw.hfcsx.int_m2 = 0; /* interrupt output off ! */ | 314 | cs->hw.hfcsx.int_m2 = 0; /* interrupt output off ! */ |
@@ -472,7 +472,7 @@ receive_dmsg(struct IsdnCardState *cs) | |||
472 | /**********************************/ | 472 | /**********************************/ |
473 | /* B-channel main receive routine */ | 473 | /* B-channel main receive routine */ |
474 | /**********************************/ | 474 | /**********************************/ |
475 | void | 475 | static void |
476 | main_rec_hfcsx(struct BCState *bcs) | 476 | main_rec_hfcsx(struct BCState *bcs) |
477 | { | 477 | { |
478 | struct IsdnCardState *cs = bcs->cs; | 478 | struct IsdnCardState *cs = bcs->cs; |
@@ -1003,7 +1003,7 @@ HFCSX_l1hw(struct PStack *st, int pr, void *arg) | |||
1003 | /***********************************************/ | 1003 | /***********************************************/ |
1004 | /* called during init setting l1 stack pointer */ | 1004 | /* called during init setting l1 stack pointer */ |
1005 | /***********************************************/ | 1005 | /***********************************************/ |
1006 | void | 1006 | static void |
1007 | setstack_hfcsx(struct PStack *st, struct IsdnCardState *cs) | 1007 | setstack_hfcsx(struct PStack *st, struct IsdnCardState *cs) |
1008 | { | 1008 | { |
1009 | st->l1.l1hw = HFCSX_l1hw; | 1009 | st->l1.l1hw = HFCSX_l1hw; |
@@ -1027,7 +1027,7 @@ hfcsx_send_data(struct BCState *bcs) | |||
1027 | /***************************************************************/ | 1027 | /***************************************************************/ |
1028 | /* activate/deactivate hardware for selected channels and mode */ | 1028 | /* activate/deactivate hardware for selected channels and mode */ |
1029 | /***************************************************************/ | 1029 | /***************************************************************/ |
1030 | void | 1030 | static void |
1031 | mode_hfcsx(struct BCState *bcs, int mode, int bc) | 1031 | mode_hfcsx(struct BCState *bcs, int mode, int bc) |
1032 | { | 1032 | { |
1033 | struct IsdnCardState *cs = bcs->cs; | 1033 | struct IsdnCardState *cs = bcs->cs; |
@@ -1328,7 +1328,7 @@ hfcsx_bh(struct IsdnCardState *cs) | |||
1328 | /********************************/ | 1328 | /********************************/ |
1329 | /* called for card init message */ | 1329 | /* called for card init message */ |
1330 | /********************************/ | 1330 | /********************************/ |
1331 | void __devinit | 1331 | static void __devinit |
1332 | inithfcsx(struct IsdnCardState *cs) | 1332 | inithfcsx(struct IsdnCardState *cs) |
1333 | { | 1333 | { |
1334 | cs->setstack_d = setstack_hfcsx; | 1334 | 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 { | |||
193 | }; | 193 | }; |
194 | 194 | ||
195 | extern void main_irq_hfcsx(struct BCState *bcs); | 195 | extern void main_irq_hfcsx(struct BCState *bcs); |
196 | extern void inithfcsx(struct IsdnCardState *cs); | ||
197 | extern void releasehfcsx(struct IsdnCardState *cs); | 196 | 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 = | |||
60 | #include "hisax_debug.h" | 60 | #include "hisax_debug.h" |
61 | static u_int debug; | 61 | static u_int debug; |
62 | module_param(debug, uint, 0); | 62 | module_param(debug, uint, 0); |
63 | int hfc_debug; | 63 | static int hfc_debug; |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | 66 | ||
@@ -85,7 +85,7 @@ static struct usb_device_id hfc_usb_idtab[] = { | |||
85 | * VendorID, ProductID, Devicename, LED_SCHEME, | 85 | * VendorID, ProductID, Devicename, LED_SCHEME, |
86 | * LED's BitMask in HFCUSB_P_DATA Register : LED_USB, LED_S0, LED_B1, LED_B2 | 86 | * LED's BitMask in HFCUSB_P_DATA Register : LED_USB, LED_S0, LED_B1, LED_B2 |
87 | */ | 87 | */ |
88 | vendor_data vdata[] = { | 88 | static vendor_data vdata[] = { |
89 | /* CologneChip Eval TA */ | 89 | /* CologneChip Eval TA */ |
90 | {0x0959, 0x2bd0, "ISDN USB TA (Cologne Chip HFC-S USB based)", | 90 | {0x0959, 0x2bd0, "ISDN USB TA (Cologne Chip HFC-S USB based)", |
91 | LED_OFF, {4, 0, 2, 1} | 91 | LED_OFF, {4, 0, 2, 1} |
@@ -1137,7 +1137,7 @@ set_hfcmode(hfcusb_data * hfc, int channel, int mode) | |||
1137 | } | 1137 | } |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | void | 1140 | static void |
1141 | hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) | 1141 | hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) |
1142 | { | 1142 | { |
1143 | usb_fifo *fifo = my_hisax_if->priv; | 1143 | 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[] = { | |||
168 | * 3 entries are the configuration number, the minimum interval for | 168 | * 3 entries are the configuration number, the minimum interval for |
169 | * Interrupt endpoints & boolean if E-channel logging possible | 169 | * Interrupt endpoints & boolean if E-channel logging possible |
170 | */ | 170 | */ |
171 | int validconf[][19] = { | 171 | static int validconf[][19] = { |
172 | // INT in, ISO out config | 172 | // INT in, ISO out config |
173 | {EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NOP, EP_INT, | 173 | {EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NOP, EP_INT, |
174 | EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_NUL, EP_NUL, | 174 | EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_NUL, EP_NUL, |
@@ -187,7 +187,7 @@ int validconf[][19] = { | |||
187 | }; | 187 | }; |
188 | 188 | ||
189 | // string description of chosen config | 189 | // string description of chosen config |
190 | char *conf_str[] = { | 190 | static char *conf_str[] = { |
191 | "4 Interrupt IN + 3 Isochron OUT", | 191 | "4 Interrupt IN + 3 Isochron OUT", |
192 | "3 Interrupt IN + 3 Isochron OUT", | 192 | "3 Interrupt IN + 3 Isochron OUT", |
193 | "4 Isochron IN + 3 Isochron OUT", | 193 | "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) | |||
52 | */ | 52 | */ |
53 | } | 53 | } |
54 | 54 | ||
55 | void | 55 | static void |
56 | release_io_hfcs(struct IsdnCardState *cs) | 56 | release_io_hfcs(struct IsdnCardState *cs) |
57 | { | 57 | { |
58 | release2bds0(cs); | 58 | 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, | |||
1271 | void init_bcstate(struct IsdnCardState *cs, int bc); | 1271 | void init_bcstate(struct IsdnCardState *cs, int bc); |
1272 | 1272 | ||
1273 | void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs); | 1273 | void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs); |
1274 | unsigned int random_ri(void); | ||
1275 | void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st); | 1274 | void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st); |
1276 | void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st); | 1275 | void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st); |
1277 | 1276 | ||
@@ -1315,15 +1314,11 @@ int QuickHex(char *txt, u_char * p, int cnt); | |||
1315 | void LogFrame(struct IsdnCardState *cs, u_char * p, int size); | 1314 | void LogFrame(struct IsdnCardState *cs, u_char * p, int size); |
1316 | void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir); | 1315 | void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir); |
1317 | void iecpy(u_char * dest, u_char * iestart, int ieoffset); | 1316 | void iecpy(u_char * dest, u_char * iestart, int ieoffset); |
1318 | #ifdef ISDN_CHIP_ISAC | ||
1319 | void setstack_isac(struct PStack *st, struct IsdnCardState *cs); | ||
1320 | #endif /* ISDN_CHIP_ISAC */ | ||
1321 | #endif /* __KERNEL__ */ | 1317 | #endif /* __KERNEL__ */ |
1322 | 1318 | ||
1323 | #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);} | 1319 | #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);} |
1324 | 1320 | ||
1325 | int ll_run(struct IsdnCardState *cs, int addfeatures); | 1321 | int ll_run(struct IsdnCardState *cs, int addfeatures); |
1326 | void ll_stop(struct IsdnCardState *cs); | ||
1327 | int CallcNew(void); | 1322 | int CallcNew(void); |
1328 | void CallcFree(void); | 1323 | void CallcFree(void); |
1329 | int CallcNewChan(struct IsdnCardState *cs); | 1324 | 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) | |||
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | void | 154 | static void |
155 | close_hscxstate(struct BCState *bcs) | 155 | close_hscxstate(struct BCState *bcs) |
156 | { | 156 | { |
157 | modehscx(bcs, 0, bcs->channel); | 157 | modehscx(bcs, 0, bcs->channel); |
@@ -203,7 +203,7 @@ open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs) | |||
203 | return (0); | 203 | return (0); |
204 | } | 204 | } |
205 | 205 | ||
206 | int | 206 | static int |
207 | setstack_hscx(struct PStack *st, struct BCState *bcs) | 207 | setstack_hscx(struct PStack *st, struct BCState *bcs) |
208 | { | 208 | { |
209 | bcs->channel = st->l1.bc; | 209 | 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) | |||
108 | #endif | 108 | #endif |
109 | } | 109 | } |
110 | 110 | ||
111 | void | 111 | static void |
112 | icc_empty_fifo(struct IsdnCardState *cs, int count) | 112 | icc_empty_fifo(struct IsdnCardState *cs, int count) |
113 | { | 113 | { |
114 | u_char *ptr; | 114 | u_char *ptr; |
@@ -563,13 +563,13 @@ ICC_l1hw(struct PStack *st, int pr, void *arg) | |||
563 | } | 563 | } |
564 | } | 564 | } |
565 | 565 | ||
566 | void | 566 | static void |
567 | setstack_icc(struct PStack *st, struct IsdnCardState *cs) | 567 | setstack_icc(struct PStack *st, struct IsdnCardState *cs) |
568 | { | 568 | { |
569 | st->l1.l1hw = ICC_l1hw; | 569 | st->l1.l1hw = ICC_l1hw; |
570 | } | 570 | } |
571 | 571 | ||
572 | void | 572 | static void |
573 | DC_Close_icc(struct IsdnCardState *cs) { | 573 | DC_Close_icc(struct IsdnCardState *cs) { |
574 | if (cs->dc.icc.mon_rx) { | 574 | if (cs->dc.icc.mon_rx) { |
575 | kfree(cs->dc.icc.mon_rx); | 575 | 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); | |||
36 | static inline void cic_int(struct IsdnCardState *cs); | 36 | static inline void cic_int(struct IsdnCardState *cs); |
37 | static void dch_l2l1(struct PStack *st, int pr, void *arg); | 37 | static void dch_l2l1(struct PStack *st, int pr, void *arg); |
38 | static void dbusy_timer_handler(struct IsdnCardState *cs); | 38 | static void dbusy_timer_handler(struct IsdnCardState *cs); |
39 | static void ipacx_new_ph(struct IsdnCardState *cs); | ||
40 | static void dch_bh(struct IsdnCardState *cs); | ||
41 | static void dch_empty_fifo(struct IsdnCardState *cs, int count); | 39 | static void dch_empty_fifo(struct IsdnCardState *cs, int count); |
42 | static void dch_fill_fifo(struct IsdnCardState *cs); | 40 | static void dch_fill_fifo(struct IsdnCardState *cs); |
43 | static inline void dch_int(struct IsdnCardState *cs); | 41 | static inline void dch_int(struct IsdnCardState *cs); |
@@ -232,81 +230,6 @@ dbusy_timer_handler(struct IsdnCardState *cs) | |||
232 | } | 230 | } |
233 | 231 | ||
234 | //---------------------------------------------------------- | 232 | //---------------------------------------------------------- |
235 | // L1 state machine intermediate layer to isdnl1 module | ||
236 | //---------------------------------------------------------- | ||
237 | static void | ||
238 | ipacx_new_ph(struct IsdnCardState *cs) | ||
239 | { | ||
240 | switch (cs->dc.isac.ph_state) { | ||
241 | case (IPACX_IND_RES): | ||
242 | ph_command(cs, IPACX_CMD_DI); | ||
243 | l1_msg(cs, HW_RESET | INDICATION, NULL); | ||
244 | break; | ||
245 | |||
246 | case (IPACX_IND_DC): | ||
247 | l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL); | ||
248 | break; | ||
249 | |||
250 | case (IPACX_IND_DR): | ||
251 | l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL); | ||
252 | break; | ||
253 | |||
254 | case (IPACX_IND_PU): | ||
255 | l1_msg(cs, HW_POWERUP | CONFIRM, NULL); | ||
256 | break; | ||
257 | |||
258 | case (IPACX_IND_RSY): | ||
259 | l1_msg(cs, HW_RSYNC | INDICATION, NULL); | ||
260 | break; | ||
261 | |||
262 | case (IPACX_IND_AR): | ||
263 | l1_msg(cs, HW_INFO2 | INDICATION, NULL); | ||
264 | break; | ||
265 | |||
266 | case (IPACX_IND_AI8): | ||
267 | l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); | ||
268 | break; | ||
269 | |||
270 | case (IPACX_IND_AI10): | ||
271 | l1_msg(cs, HW_INFO4_P10 | INDICATION, NULL); | ||
272 | break; | ||
273 | |||
274 | default: | ||
275 | break; | ||
276 | } | ||
277 | } | ||
278 | |||
279 | //---------------------------------------------------------- | ||
280 | // bottom half handler for D channel | ||
281 | //---------------------------------------------------------- | ||
282 | static void | ||
283 | dch_bh(struct IsdnCardState *cs) | ||
284 | { | ||
285 | struct PStack *st; | ||
286 | |||
287 | if (!cs) return; | ||
288 | |||
289 | if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { | ||
290 | if (cs->debug) debugl1(cs, "D-Channel Busy cleared"); | ||
291 | for (st = cs->stlist; st; st = st->next) { | ||
292 | st->l1.l1l2(st, PH_PAUSE | CONFIRM, NULL); | ||
293 | } | ||
294 | } | ||
295 | |||
296 | if (test_and_clear_bit(D_RCVBUFREADY, &cs->event)) { | ||
297 | DChannel_proc_rcv(cs); | ||
298 | } | ||
299 | |||
300 | if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) { | ||
301 | DChannel_proc_xmt(cs); | ||
302 | } | ||
303 | |||
304 | if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { | ||
305 | ipacx_new_ph(cs); | ||
306 | } | ||
307 | } | ||
308 | |||
309 | //---------------------------------------------------------- | ||
310 | // Fill buffer from receive FIFO | 233 | // Fill buffer from receive FIFO |
311 | //---------------------------------------------------------- | 234 | //---------------------------------------------------------- |
312 | static void | 235 | static void |
@@ -991,14 +914,5 @@ init_ipacx(struct IsdnCardState *cs, int part) | |||
991 | } | 914 | } |
992 | } | 915 | } |
993 | 916 | ||
994 | |||
995 | void __devinit | ||
996 | setup_ipacx(struct IsdnCardState *cs) | ||
997 | { | ||
998 | INIT_WORK(&cs->tqueue, (void *)(void *) dch_bh, cs); | ||
999 | cs->dbusytimer.function = (void *) dbusy_timer_handler; | ||
1000 | cs->dbusytimer.data = (long) cs; | ||
1001 | init_timer(&cs->dbusytimer); | ||
1002 | } | ||
1003 | //----------------- end of file ----------------------- | 917 | //----------------- end of file ----------------------- |
1004 | 918 | ||
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) | |||
112 | #endif | 112 | #endif |
113 | } | 113 | } |
114 | 114 | ||
115 | void | 115 | static void |
116 | isac_empty_fifo(struct IsdnCardState *cs, int count) | 116 | isac_empty_fifo(struct IsdnCardState *cs, int count) |
117 | { | 117 | { |
118 | u_char *ptr; | 118 | u_char *ptr; |
@@ -563,13 +563,13 @@ ISAC_l1hw(struct PStack *st, int pr, void *arg) | |||
563 | } | 563 | } |
564 | } | 564 | } |
565 | 565 | ||
566 | void | 566 | static void |
567 | setstack_isac(struct PStack *st, struct IsdnCardState *cs) | 567 | setstack_isac(struct PStack *st, struct IsdnCardState *cs) |
568 | { | 568 | { |
569 | st->l1.l1hw = ISAC_l1hw; | 569 | st->l1.l1hw = ISAC_l1hw; |
570 | } | 570 | } |
571 | 571 | ||
572 | void | 572 | static void |
573 | DC_Close_isac(struct IsdnCardState *cs) { | 573 | DC_Close_isac(struct IsdnCardState *cs) { |
574 | if (cs->dc.isac.mon_rx) { | 574 | if (cs->dc.isac.mon_rx) { |
575 | kfree(cs->dc.isac.mon_rx); | 575 | 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 @@ | |||
21 | #define ETX 0x03 | 21 | #define ETX 0x03 |
22 | 22 | ||
23 | #define FAXMODCNT 13 | 23 | #define FAXMODCNT 13 |
24 | const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146}; | 24 | static const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146}; |
25 | static u_int modmask = 0x1fff; | 25 | static u_int modmask = 0x1fff; |
26 | static int frm_extra_delay = 2; | 26 | static int frm_extra_delay = 2; |
27 | static int para_TOA = 6; | 27 | static int para_TOA = 6; |
28 | const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" }; | 28 | static const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" }; |
29 | 29 | ||
30 | void isar_setup(struct IsdnCardState *cs); | 30 | static void isar_setup(struct IsdnCardState *cs); |
31 | static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para); | 31 | static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para); |
32 | static void ll_deliver_faxstat(struct BCState *bcs, u_char status); | 32 | static void ll_deliver_faxstat(struct BCState *bcs, u_char status); |
33 | 33 | ||
@@ -45,7 +45,7 @@ waitforHIA(struct IsdnCardState *cs, int timeout) | |||
45 | } | 45 | } |
46 | 46 | ||
47 | 47 | ||
48 | int | 48 | static int |
49 | sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, | 49 | sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, |
50 | u_char *msg) | 50 | u_char *msg) |
51 | { | 51 | { |
@@ -85,7 +85,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, | |||
85 | } | 85 | } |
86 | 86 | ||
87 | /* Call only with IRQ disabled !!! */ | 87 | /* Call only with IRQ disabled !!! */ |
88 | inline void | 88 | static inline void |
89 | rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) | 89 | rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) |
90 | { | 90 | { |
91 | int i; | 91 | int i; |
@@ -114,7 +114,7 @@ rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | /* Call only with IRQ disabled !!! */ | 116 | /* Call only with IRQ disabled !!! */ |
117 | inline void | 117 | static inline void |
118 | get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg) | 118 | get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg) |
119 | { | 119 | { |
120 | ireg->iis = cs->BC_Read_Reg(cs, 1, ISAR_IIS); | 120 | ireg->iis = cs->BC_Read_Reg(cs, 1, ISAR_IIS); |
@@ -127,7 +127,7 @@ get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg) | |||
127 | #endif | 127 | #endif |
128 | } | 128 | } |
129 | 129 | ||
130 | int | 130 | static int |
131 | waitrecmsg(struct IsdnCardState *cs, u_char *len, | 131 | waitrecmsg(struct IsdnCardState *cs, u_char *len, |
132 | u_char *msg, int maxdelay) | 132 | u_char *msg, int maxdelay) |
133 | { | 133 | { |
@@ -185,7 +185,7 @@ ISARVersion(struct IsdnCardState *cs, char *s) | |||
185 | return(ver); | 185 | return(ver); |
186 | } | 186 | } |
187 | 187 | ||
188 | int | 188 | static int |
189 | isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) | 189 | isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) |
190 | { | 190 | { |
191 | int ret, size, cnt, debug; | 191 | int ret, size, cnt, debug; |
@@ -739,7 +739,7 @@ isar_fill_fifo(struct BCState *bcs) | |||
739 | } | 739 | } |
740 | } | 740 | } |
741 | 741 | ||
742 | inline | 742 | static inline |
743 | struct BCState *sel_bcs_isar(struct IsdnCardState *cs, u_char dpath) | 743 | struct BCState *sel_bcs_isar(struct IsdnCardState *cs, u_char dpath) |
744 | { | 744 | { |
745 | if ((!dpath) || (dpath == 3)) | 745 | if ((!dpath) || (dpath == 3)) |
@@ -751,7 +751,7 @@ struct BCState *sel_bcs_isar(struct IsdnCardState *cs, u_char dpath) | |||
751 | return(NULL); | 751 | return(NULL); |
752 | } | 752 | } |
753 | 753 | ||
754 | void | 754 | static void |
755 | send_frames(struct BCState *bcs) | 755 | send_frames(struct BCState *bcs) |
756 | { | 756 | { |
757 | if (bcs->tx_skb) { | 757 | if (bcs->tx_skb) { |
@@ -806,7 +806,7 @@ send_frames(struct BCState *bcs) | |||
806 | } | 806 | } |
807 | } | 807 | } |
808 | 808 | ||
809 | inline void | 809 | static inline void |
810 | check_send(struct IsdnCardState *cs, u_char rdm) | 810 | check_send(struct IsdnCardState *cs, u_char rdm) |
811 | { | 811 | { |
812 | struct BCState *bcs; | 812 | struct BCState *bcs; |
@@ -828,11 +828,13 @@ check_send(struct IsdnCardState *cs, u_char rdm) | |||
828 | 828 | ||
829 | } | 829 | } |
830 | 830 | ||
831 | const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4", | 831 | static const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", |
832 | "300", "600", "1200", "2400", "4800", "7200", | 832 | "NODEF4", "300", "600", "1200", "2400", |
833 | "9600nt", "9600t", "12000", "14400", "WRONG"}; | 833 | "4800", "7200", "9600nt", "9600t", "12000", |
834 | const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", | 834 | "14400", "WRONG"}; |
835 | "Bell103", "V23", "Bell202", "V17", "V29", "V27ter"}; | 835 | static const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", |
836 | "Bell103", "V23", "Bell202", "V17", "V29", | ||
837 | "V27ter"}; | ||
836 | 838 | ||
837 | static void | 839 | static void |
838 | isar_pump_status_rsp(struct BCState *bcs, struct isar_reg *ireg) { | 840 | isar_pump_status_rsp(struct BCState *bcs, struct isar_reg *ireg) { |
@@ -1388,7 +1390,7 @@ setup_iom2(struct BCState *bcs) { | |||
1388 | udelay(1000); | 1390 | udelay(1000); |
1389 | } | 1391 | } |
1390 | 1392 | ||
1391 | int | 1393 | static int |
1392 | modeisar(struct BCState *bcs, int mode, int bc) | 1394 | modeisar(struct BCState *bcs, int mode, int bc) |
1393 | { | 1395 | { |
1394 | struct IsdnCardState *cs = bcs->cs; | 1396 | struct IsdnCardState *cs = bcs->cs; |
@@ -1562,7 +1564,7 @@ isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para) | |||
1562 | sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1); | 1564 | sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1); |
1563 | } | 1565 | } |
1564 | 1566 | ||
1565 | void | 1567 | static void |
1566 | isar_setup(struct IsdnCardState *cs) | 1568 | isar_setup(struct IsdnCardState *cs) |
1567 | { | 1569 | { |
1568 | u_char msg; | 1570 | u_char msg; |
@@ -1582,7 +1584,7 @@ isar_setup(struct IsdnCardState *cs) | |||
1582 | } | 1584 | } |
1583 | } | 1585 | } |
1584 | 1586 | ||
1585 | void | 1587 | static void |
1586 | isar_l2l1(struct PStack *st, int pr, void *arg) | 1588 | isar_l2l1(struct PStack *st, int pr, void *arg) |
1587 | { | 1589 | { |
1588 | struct BCState *bcs = st->l1.bcs; | 1590 | struct BCState *bcs = st->l1.bcs; |
@@ -1681,7 +1683,7 @@ isar_l2l1(struct PStack *st, int pr, void *arg) | |||
1681 | } | 1683 | } |
1682 | } | 1684 | } |
1683 | 1685 | ||
1684 | void | 1686 | static void |
1685 | close_isarstate(struct BCState *bcs) | 1687 | close_isarstate(struct BCState *bcs) |
1686 | { | 1688 | { |
1687 | modeisar(bcs, 0, bcs->channel); | 1689 | modeisar(bcs, 0, bcs->channel); |
@@ -1703,7 +1705,7 @@ close_isarstate(struct BCState *bcs) | |||
1703 | del_timer(&bcs->hw.isar.ftimer); | 1705 | del_timer(&bcs->hw.isar.ftimer); |
1704 | } | 1706 | } |
1705 | 1707 | ||
1706 | int | 1708 | static int |
1707 | open_isarstate(struct IsdnCardState *cs, struct BCState *bcs) | 1709 | open_isarstate(struct IsdnCardState *cs, struct BCState *bcs) |
1708 | { | 1710 | { |
1709 | if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { | 1711 | if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { |
@@ -1725,7 +1727,7 @@ open_isarstate(struct IsdnCardState *cs, struct BCState *bcs) | |||
1725 | return (0); | 1727 | return (0); |
1726 | } | 1728 | } |
1727 | 1729 | ||
1728 | int | 1730 | static int |
1729 | setstack_isar(struct PStack *st, struct BCState *bcs) | 1731 | setstack_isar(struct PStack *st, struct BCState *bcs) |
1730 | { | 1732 | { |
1731 | bcs->channel = st->l1.bc; | 1733 | 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, ...) | |||
151 | va_end(args); | 151 | va_end(args); |
152 | } | 152 | } |
153 | 153 | ||
154 | void | 154 | static void |
155 | L1activated(struct IsdnCardState *cs) | 155 | L1activated(struct IsdnCardState *cs) |
156 | { | 156 | { |
157 | struct PStack *st; | 157 | struct PStack *st; |
@@ -166,7 +166,7 @@ L1activated(struct IsdnCardState *cs) | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | void | 169 | static void |
170 | L1deactivated(struct IsdnCardState *cs) | 170 | L1deactivated(struct IsdnCardState *cs) |
171 | { | 171 | { |
172 | struct PStack *st; | 172 | struct PStack *st; |
@@ -370,7 +370,7 @@ init_bcstate(struct IsdnCardState *cs, int bc) | |||
370 | 370 | ||
371 | #ifdef L2FRAME_DEBUG /* psa */ | 371 | #ifdef L2FRAME_DEBUG /* psa */ |
372 | 372 | ||
373 | char * | 373 | static char * |
374 | l2cmd(u_char cmd) | 374 | l2cmd(u_char cmd) |
375 | { | 375 | { |
376 | switch (cmd & ~0x10) { | 376 | switch (cmd & ~0x10) { |
@@ -404,7 +404,7 @@ l2cmd(u_char cmd) | |||
404 | 404 | ||
405 | static char tmpdeb[32]; | 405 | static char tmpdeb[32]; |
406 | 406 | ||
407 | char * | 407 | static char * |
408 | l2frames(u_char * ptr) | 408 | l2frames(u_char * ptr) |
409 | { | 409 | { |
410 | switch (ptr[2] & ~0x10) { | 410 | 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) | |||
142 | return cnt; | 142 | return cnt; |
143 | } | 143 | } |
144 | 144 | ||
145 | inline void | 145 | static inline void |
146 | freewin(struct PStack *st) | 146 | freewin(struct PStack *st) |
147 | { | 147 | { |
148 | freewin1(&st->l2); | 148 | freewin1(&st->l2); |
@@ -157,7 +157,7 @@ ReleaseWin(struct Layer2 *l2) | |||
157 | printk(KERN_WARNING "isdl2 freed %d skbuffs in release\n", cnt); | 157 | printk(KERN_WARNING "isdl2 freed %d skbuffs in release\n", cnt); |
158 | } | 158 | } |
159 | 159 | ||
160 | inline unsigned int | 160 | static inline unsigned int |
161 | cansend(struct PStack *st) | 161 | cansend(struct PStack *st) |
162 | { | 162 | { |
163 | unsigned int p1; | 163 | unsigned int p1; |
@@ -169,7 +169,7 @@ cansend(struct PStack *st) | |||
169 | return ((p1 < st->l2.window) && !test_bit(FLG_PEER_BUSY, &st->l2.flag)); | 169 | return ((p1 < st->l2.window) && !test_bit(FLG_PEER_BUSY, &st->l2.flag)); |
170 | } | 170 | } |
171 | 171 | ||
172 | inline void | 172 | static inline void |
173 | clear_exception(struct Layer2 *l2) | 173 | clear_exception(struct Layer2 *l2) |
174 | { | 174 | { |
175 | test_and_clear_bit(FLG_ACK_PEND, &l2->flag); | 175 | test_and_clear_bit(FLG_ACK_PEND, &l2->flag); |
@@ -178,7 +178,7 @@ clear_exception(struct Layer2 *l2) | |||
178 | clear_peer_busy(l2); | 178 | clear_peer_busy(l2); |
179 | } | 179 | } |
180 | 180 | ||
181 | inline int | 181 | static inline int |
182 | l2headersize(struct Layer2 *l2, int ui) | 182 | l2headersize(struct Layer2 *l2, int ui) |
183 | { | 183 | { |
184 | return (((test_bit(FLG_MOD128, &l2->flag) && (!ui)) ? 2 : 1) + | 184 | return (((test_bit(FLG_MOD128, &l2->flag) && (!ui)) ? 2 : 1) + |
@@ -223,40 +223,31 @@ enqueue_super(struct PStack *st, | |||
223 | 223 | ||
224 | #define enqueue_ui(a, b) enqueue_super(a, b) | 224 | #define enqueue_ui(a, b) enqueue_super(a, b) |
225 | 225 | ||
226 | inline int | 226 | static inline int |
227 | IsUI(u_char * data) | 227 | IsUI(u_char * data) |
228 | { | 228 | { |
229 | return ((data[0] & 0xef) == UI); | 229 | return ((data[0] & 0xef) == UI); |
230 | } | 230 | } |
231 | 231 | ||
232 | inline int | 232 | static inline int |
233 | IsUA(u_char * data) | 233 | IsUA(u_char * data) |
234 | { | 234 | { |
235 | return ((data[0] & 0xef) == UA); | 235 | return ((data[0] & 0xef) == UA); |
236 | } | 236 | } |
237 | 237 | ||
238 | inline int | 238 | static inline int |
239 | IsDM(u_char * data) | 239 | IsDM(u_char * data) |
240 | { | 240 | { |
241 | return ((data[0] & 0xef) == DM); | 241 | return ((data[0] & 0xef) == DM); |
242 | } | 242 | } |
243 | 243 | ||
244 | inline int | 244 | static inline int |
245 | IsDISC(u_char * data) | 245 | IsDISC(u_char * data) |
246 | { | 246 | { |
247 | return ((data[0] & 0xef) == DISC); | 247 | return ((data[0] & 0xef) == DISC); |
248 | } | 248 | } |
249 | 249 | ||
250 | inline int | 250 | static inline int |
251 | IsRR(u_char * data, struct PStack *st) | ||
252 | { | ||
253 | if (test_bit(FLG_MOD128, &st->l2.flag)) | ||
254 | return (data[0] == RR); | ||
255 | else | ||
256 | return ((data[0] & 0xf) == 1); | ||
257 | } | ||
258 | |||
259 | inline int | ||
260 | IsSFrame(u_char * data, struct PStack *st) | 251 | IsSFrame(u_char * data, struct PStack *st) |
261 | { | 252 | { |
262 | register u_char d = *data; | 253 | register u_char d = *data; |
@@ -266,7 +257,7 @@ IsSFrame(u_char * data, struct PStack *st) | |||
266 | return(((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c)); | 257 | return(((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c)); |
267 | } | 258 | } |
268 | 259 | ||
269 | inline int | 260 | static inline int |
270 | IsSABME(u_char * data, struct PStack *st) | 261 | IsSABME(u_char * data, struct PStack *st) |
271 | { | 262 | { |
272 | u_char d = data[0] & ~0x10; | 263 | u_char d = data[0] & ~0x10; |
@@ -274,25 +265,25 @@ IsSABME(u_char * data, struct PStack *st) | |||
274 | return (test_bit(FLG_MOD128, &st->l2.flag) ? d == SABME : d == SABM); | 265 | return (test_bit(FLG_MOD128, &st->l2.flag) ? d == SABME : d == SABM); |
275 | } | 266 | } |
276 | 267 | ||
277 | inline int | 268 | static inline int |
278 | IsREJ(u_char * data, struct PStack *st) | 269 | IsREJ(u_char * data, struct PStack *st) |
279 | { | 270 | { |
280 | return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == REJ : (data[0] & 0xf) == REJ); | 271 | return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == REJ : (data[0] & 0xf) == REJ); |
281 | } | 272 | } |
282 | 273 | ||
283 | inline int | 274 | static inline int |
284 | IsFRMR(u_char * data) | 275 | IsFRMR(u_char * data) |
285 | { | 276 | { |
286 | return ((data[0] & 0xef) == FRMR); | 277 | return ((data[0] & 0xef) == FRMR); |
287 | } | 278 | } |
288 | 279 | ||
289 | inline int | 280 | static inline int |
290 | IsRNR(u_char * data, struct PStack *st) | 281 | IsRNR(u_char * data, struct PStack *st) |
291 | { | 282 | { |
292 | return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == RNR : (data[0] & 0xf) == RNR); | 283 | return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == RNR : (data[0] & 0xf) == RNR); |
293 | } | 284 | } |
294 | 285 | ||
295 | int | 286 | static int |
296 | iframe_error(struct PStack *st, struct sk_buff *skb) | 287 | iframe_error(struct PStack *st, struct sk_buff *skb) |
297 | { | 288 | { |
298 | int i = l2addrsize(&st->l2) + (test_bit(FLG_MOD128, &st->l2.flag) ? 2 : 1); | 289 | 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) | |||
315 | return 0; | 306 | return 0; |
316 | } | 307 | } |
317 | 308 | ||
318 | int | 309 | static int |
319 | super_error(struct PStack *st, struct sk_buff *skb) | 310 | super_error(struct PStack *st, struct sk_buff *skb) |
320 | { | 311 | { |
321 | if (skb->len != l2addrsize(&st->l2) + | 312 | if (skb->len != l2addrsize(&st->l2) + |
@@ -325,7 +316,7 @@ super_error(struct PStack *st, struct sk_buff *skb) | |||
325 | return 0; | 316 | return 0; |
326 | } | 317 | } |
327 | 318 | ||
328 | int | 319 | static int |
329 | unnum_error(struct PStack *st, struct sk_buff *skb, int wantrsp) | 320 | unnum_error(struct PStack *st, struct sk_buff *skb, int wantrsp) |
330 | { | 321 | { |
331 | int rsp = (*skb->data & 0x2) >> 1; | 322 | int rsp = (*skb->data & 0x2) >> 1; |
@@ -341,7 +332,7 @@ unnum_error(struct PStack *st, struct sk_buff *skb, int wantrsp) | |||
341 | return 0; | 332 | return 0; |
342 | } | 333 | } |
343 | 334 | ||
344 | int | 335 | static int |
345 | UI_error(struct PStack *st, struct sk_buff *skb) | 336 | UI_error(struct PStack *st, struct sk_buff *skb) |
346 | { | 337 | { |
347 | int rsp = *skb->data & 0x2; | 338 | int rsp = *skb->data & 0x2; |
@@ -357,7 +348,7 @@ UI_error(struct PStack *st, struct sk_buff *skb) | |||
357 | return 0; | 348 | return 0; |
358 | } | 349 | } |
359 | 350 | ||
360 | int | 351 | static int |
361 | FRMR_error(struct PStack *st, struct sk_buff *skb) | 352 | FRMR_error(struct PStack *st, struct sk_buff *skb) |
362 | { | 353 | { |
363 | int headers = l2addrsize(&st->l2) + 1; | 354 | int headers = l2addrsize(&st->l2) + 1; |
@@ -444,51 +435,44 @@ send_uframe(struct PStack *st, u_char cmd, u_char cr) | |||
444 | enqueue_super(st, skb); | 435 | enqueue_super(st, skb); |
445 | } | 436 | } |
446 | 437 | ||
447 | inline u_char | 438 | static inline u_char |
448 | get_PollFlag(struct PStack * st, struct sk_buff * skb) | 439 | get_PollFlag(struct PStack * st, struct sk_buff * skb) |
449 | { | 440 | { |
450 | return (skb->data[l2addrsize(&(st->l2))] & 0x10); | 441 | return (skb->data[l2addrsize(&(st->l2))] & 0x10); |
451 | } | 442 | } |
452 | 443 | ||
453 | inline void | 444 | static inline u_char |
454 | FreeSkb(struct sk_buff *skb) | ||
455 | { | ||
456 | dev_kfree_skb(skb); | ||
457 | } | ||
458 | |||
459 | |||
460 | inline u_char | ||
461 | get_PollFlagFree(struct PStack *st, struct sk_buff *skb) | 445 | get_PollFlagFree(struct PStack *st, struct sk_buff *skb) |
462 | { | 446 | { |
463 | u_char PF; | 447 | u_char PF; |
464 | 448 | ||
465 | PF = get_PollFlag(st, skb); | 449 | PF = get_PollFlag(st, skb); |
466 | FreeSkb(skb); | 450 | dev_kfree_skb(skb); |
467 | return (PF); | 451 | return (PF); |
468 | } | 452 | } |
469 | 453 | ||
470 | inline void | 454 | static inline void |
471 | start_t200(struct PStack *st, int i) | 455 | start_t200(struct PStack *st, int i) |
472 | { | 456 | { |
473 | FsmAddTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); | 457 | FsmAddTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); |
474 | test_and_set_bit(FLG_T200_RUN, &st->l2.flag); | 458 | test_and_set_bit(FLG_T200_RUN, &st->l2.flag); |
475 | } | 459 | } |
476 | 460 | ||
477 | inline void | 461 | static inline void |
478 | restart_t200(struct PStack *st, int i) | 462 | restart_t200(struct PStack *st, int i) |
479 | { | 463 | { |
480 | FsmRestartTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); | 464 | FsmRestartTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); |
481 | test_and_set_bit(FLG_T200_RUN, &st->l2.flag); | 465 | test_and_set_bit(FLG_T200_RUN, &st->l2.flag); |
482 | } | 466 | } |
483 | 467 | ||
484 | inline void | 468 | static inline void |
485 | stop_t200(struct PStack *st, int i) | 469 | stop_t200(struct PStack *st, int i) |
486 | { | 470 | { |
487 | if(test_and_clear_bit(FLG_T200_RUN, &st->l2.flag)) | 471 | if(test_and_clear_bit(FLG_T200_RUN, &st->l2.flag)) |
488 | FsmDelTimer(&st->l2.t200, i); | 472 | FsmDelTimer(&st->l2.t200, i); |
489 | } | 473 | } |
490 | 474 | ||
491 | inline void | 475 | static inline void |
492 | st5_dl_release_l2l3(struct PStack *st) | 476 | st5_dl_release_l2l3(struct PStack *st) |
493 | { | 477 | { |
494 | int pr; | 478 | int pr; |
@@ -501,7 +485,7 @@ st5_dl_release_l2l3(struct PStack *st) | |||
501 | st->l2.l2l3(st, pr, NULL); | 485 | st->l2.l2l3(st, pr, NULL); |
502 | } | 486 | } |
503 | 487 | ||
504 | inline void | 488 | static inline void |
505 | lapb_dl_release_l2l3(struct PStack *st, int f) | 489 | lapb_dl_release_l2l3(struct PStack *st, int f) |
506 | { | 490 | { |
507 | if (test_bit(FLG_LAPB, &st->l2.flag)) | 491 | if (test_bit(FLG_LAPB, &st->l2.flag)) |
@@ -802,7 +786,7 @@ l2_connected(struct FsmInst *fi, int event, void *arg) | |||
802 | l2_mdl_error_ua(fi, event, arg); | 786 | l2_mdl_error_ua(fi, event, arg); |
803 | return; | 787 | return; |
804 | } | 788 | } |
805 | FreeSkb(skb); | 789 | dev_kfree_skb(skb); |
806 | 790 | ||
807 | if (test_and_clear_bit(FLG_PEND_REL, &st->l2.flag)) | 791 | if (test_and_clear_bit(FLG_PEND_REL, &st->l2.flag)) |
808 | l2_disconnect(fi, event, arg); | 792 | l2_disconnect(fi, event, arg); |
@@ -840,7 +824,7 @@ l2_released(struct FsmInst *fi, int event, void *arg) | |||
840 | l2_mdl_error_ua(fi, event, arg); | 824 | l2_mdl_error_ua(fi, event, arg); |
841 | return; | 825 | return; |
842 | } | 826 | } |
843 | FreeSkb(skb); | 827 | dev_kfree_skb(skb); |
844 | 828 | ||
845 | stop_t200(st, 6); | 829 | stop_t200(st, 6); |
846 | lapb_dl_release_l2l3(st, CONFIRM); | 830 | lapb_dl_release_l2l3(st, CONFIRM); |
@@ -889,7 +873,7 @@ l2_st6_dm_release(struct FsmInst *fi, int event, void *arg) | |||
889 | } | 873 | } |
890 | } | 874 | } |
891 | 875 | ||
892 | inline void | 876 | static inline void |
893 | enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) | 877 | enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) |
894 | { | 878 | { |
895 | struct sk_buff *skb; | 879 | struct sk_buff *skb; |
@@ -912,7 +896,7 @@ enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) | |||
912 | enqueue_super(st, skb); | 896 | enqueue_super(st, skb); |
913 | } | 897 | } |
914 | 898 | ||
915 | inline void | 899 | static inline void |
916 | enquiry_response(struct PStack *st) | 900 | enquiry_response(struct PStack *st) |
917 | { | 901 | { |
918 | if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) | 902 | if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) |
@@ -922,7 +906,7 @@ enquiry_response(struct PStack *st) | |||
922 | test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); | 906 | test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); |
923 | } | 907 | } |
924 | 908 | ||
925 | inline void | 909 | static inline void |
926 | transmit_enquiry(struct PStack *st) | 910 | transmit_enquiry(struct PStack *st) |
927 | { | 911 | { |
928 | if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) | 912 | if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) |
@@ -1004,7 +988,7 @@ l2_st7_got_super(struct FsmInst *fi, int event, void *arg) | |||
1004 | PollFlag = (skb->data[0] & 0x10); | 988 | PollFlag = (skb->data[0] & 0x10); |
1005 | nr = (skb->data[0] >> 5) & 0x7; | 989 | nr = (skb->data[0] >> 5) & 0x7; |
1006 | } | 990 | } |
1007 | FreeSkb(skb); | 991 | dev_kfree_skb(skb); |
1008 | 992 | ||
1009 | if (PollFlag) { | 993 | if (PollFlag) { |
1010 | if (rsp) | 994 | if (rsp) |
@@ -1047,7 +1031,7 @@ l2_feed_i_if_reest(struct FsmInst *fi, int event, void *arg) | |||
1047 | if (!test_bit(FLG_L3_INIT, &st->l2.flag)) | 1031 | if (!test_bit(FLG_L3_INIT, &st->l2.flag)) |
1048 | skb_queue_tail(&st->l2.i_queue, skb); | 1032 | skb_queue_tail(&st->l2.i_queue, skb); |
1049 | else | 1033 | else |
1050 | FreeSkb(skb); | 1034 | dev_kfree_skb(skb); |
1051 | } | 1035 | } |
1052 | 1036 | ||
1053 | static void | 1037 | static void |
@@ -1093,7 +1077,7 @@ l2_got_iframe(struct FsmInst *fi, int event, void *arg) | |||
1093 | nr = (skb->data[i] >> 5) & 0x7; | 1077 | nr = (skb->data[i] >> 5) & 0x7; |
1094 | } | 1078 | } |
1095 | if (test_bit(FLG_OWN_BUSY, &l2->flag)) { | 1079 | if (test_bit(FLG_OWN_BUSY, &l2->flag)) { |
1096 | FreeSkb(skb); | 1080 | dev_kfree_skb(skb); |
1097 | if(PollFlag) enquiry_response(st); | 1081 | if(PollFlag) enquiry_response(st); |
1098 | } else if (l2->vr == ns) { | 1082 | } else if (l2->vr == ns) { |
1099 | (l2->vr)++; | 1083 | (l2->vr)++; |
@@ -1111,7 +1095,7 @@ l2_got_iframe(struct FsmInst *fi, int event, void *arg) | |||
1111 | st->l2.l2l3(st, DL_DATA | INDICATION, skb); | 1095 | st->l2.l2l3(st, DL_DATA | INDICATION, skb); |
1112 | } else { | 1096 | } else { |
1113 | /* n(s)!=v(r) */ | 1097 | /* n(s)!=v(r) */ |
1114 | FreeSkb(skb); | 1098 | dev_kfree_skb(skb); |
1115 | if (test_and_set_bit(FLG_REJEXC, &l2->flag)) { | 1099 | if (test_and_set_bit(FLG_REJEXC, &l2->flag)) { |
1116 | if (PollFlag) | 1100 | if (PollFlag) |
1117 | enquiry_response(st); | 1101 | enquiry_response(st); |
@@ -1309,7 +1293,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | |||
1309 | skb = alloc_skb(oskb->len + i, GFP_ATOMIC); | 1293 | skb = alloc_skb(oskb->len + i, GFP_ATOMIC); |
1310 | memcpy(skb_put(skb, i), header, i); | 1294 | memcpy(skb_put(skb, i), header, i); |
1311 | memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len); | 1295 | memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len); |
1312 | FreeSkb(oskb); | 1296 | dev_kfree_skb(oskb); |
1313 | } | 1297 | } |
1314 | st->l2.l2l1(st, PH_PULL | INDICATION, skb); | 1298 | st->l2.l2l1(st, PH_PULL | INDICATION, skb); |
1315 | test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); | 1299 | 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) | |||
1349 | PollFlag = (skb->data[0] & 0x10); | 1333 | PollFlag = (skb->data[0] & 0x10); |
1350 | nr = (skb->data[0] >> 5) & 0x7; | 1334 | nr = (skb->data[0] >> 5) & 0x7; |
1351 | } | 1335 | } |
1352 | FreeSkb(skb); | 1336 | dev_kfree_skb(skb); |
1353 | 1337 | ||
1354 | if (rsp && PollFlag) { | 1338 | if (rsp && PollFlag) { |
1355 | if (legalnr(st, nr)) { | 1339 | if (legalnr(st, nr)) { |
@@ -1391,7 +1375,7 @@ l2_got_FRMR(struct FsmInst *fi, int event, void *arg) | |||
1391 | establishlink(fi); | 1375 | establishlink(fi); |
1392 | test_and_clear_bit(FLG_L3_INIT, &st->l2.flag); | 1376 | test_and_clear_bit(FLG_L3_INIT, &st->l2.flag); |
1393 | } | 1377 | } |
1394 | FreeSkb(skb); | 1378 | dev_kfree_skb(skb); |
1395 | } | 1379 | } |
1396 | 1380 | ||
1397 | static void | 1381 | static void |
@@ -1655,7 +1639,7 @@ isdnl2_l1l2(struct PStack *st, int pr, void *arg) | |||
1655 | datap += len; | 1639 | datap += len; |
1656 | else { | 1640 | else { |
1657 | FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'N'); | 1641 | FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'N'); |
1658 | FreeSkb(skb); | 1642 | dev_kfree_skb(skb); |
1659 | return; | 1643 | return; |
1660 | } | 1644 | } |
1661 | if (!(*datap & 1)) { /* I-Frame */ | 1645 | if (!(*datap & 1)) { /* I-Frame */ |
@@ -1684,16 +1668,16 @@ isdnl2_l1l2(struct PStack *st, int pr, void *arg) | |||
1684 | ret = FsmEvent(&st->l2.l2m, EV_L2_FRMR, skb); | 1668 | ret = FsmEvent(&st->l2.l2m, EV_L2_FRMR, skb); |
1685 | } else { | 1669 | } else { |
1686 | FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'L'); | 1670 | FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'L'); |
1687 | FreeSkb(skb); | 1671 | dev_kfree_skb(skb); |
1688 | ret = 0; | 1672 | ret = 0; |
1689 | } | 1673 | } |
1690 | if(c) { | 1674 | if(c) { |
1691 | FreeSkb(skb); | 1675 | dev_kfree_skb(skb); |
1692 | FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *)(long)c); | 1676 | FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *)(long)c); |
1693 | ret = 0; | 1677 | ret = 0; |
1694 | } | 1678 | } |
1695 | if (ret) | 1679 | if (ret) |
1696 | FreeSkb(skb); | 1680 | dev_kfree_skb(skb); |
1697 | break; | 1681 | break; |
1698 | case (PH_PULL | CONFIRM): | 1682 | case (PH_PULL | CONFIRM): |
1699 | FsmEvent(&st->l2.l2m, EV_L2_ACK_PULL, arg); | 1683 | 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) | |||
390 | } | 390 | } |
391 | } | 391 | } |
392 | 392 | ||
393 | void | 393 | static void |
394 | isdnl3_trans(struct PStack *st, int pr, void *arg) { | 394 | isdnl3_trans(struct PStack *st, int pr, void *arg) { |
395 | st->l3.l3l2(st, pr, arg); | 395 | st->l3.l3l2(st, pr, arg); |
396 | } | 396 | } |
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) | |||
122 | return IRQ_HANDLED; | 122 | return IRQ_HANDLED; |
123 | } | 123 | } |
124 | 124 | ||
125 | void | 125 | static void |
126 | release_io_isurf(struct IsdnCardState *cs) | 126 | release_io_isurf(struct IsdnCardState *cs) |
127 | { | 127 | { |
128 | release_region(cs->hw.isurf.reset, 1); | 128 | 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 @@ | |||
25 | #include "isdnl1.h" | 25 | #include "isdnl1.h" |
26 | 26 | ||
27 | extern const char *CardType[]; | 27 | extern const char *CardType[]; |
28 | const char *ix1_revision = "$Revision: 2.12.2.4 $"; | 28 | static const char *ix1_revision = "$Revision: 2.12.2.4 $"; |
29 | 29 | ||
30 | #define byteout(addr,val) outb(val,addr) | 30 | #define byteout(addr,val) outb(val,addr) |
31 | #define bytein(addr) inb(addr) | 31 | #define bytein(addr) inb(addr) |
@@ -162,7 +162,7 @@ ix1micro_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
162 | return IRQ_HANDLED; | 162 | return IRQ_HANDLED; |
163 | } | 163 | } |
164 | 164 | ||
165 | void | 165 | static void |
166 | release_io_ix1micro(struct IsdnCardState *cs) | 166 | release_io_ix1micro(struct IsdnCardState *cs) |
167 | { | 167 | { |
168 | if (cs->hw.ix1.cfg_reg) | 168 | 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) | |||
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | void | 77 | static void |
78 | modejade(struct BCState *bcs, int mode, int bc) | 78 | modejade(struct BCState *bcs, int mode, int bc) |
79 | { | 79 | { |
80 | struct IsdnCardState *cs = bcs->cs; | 80 | struct IsdnCardState *cs = bcs->cs; |
@@ -190,7 +190,7 @@ jade_l2l1(struct PStack *st, int pr, void *arg) | |||
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | void | 193 | static void |
194 | close_jadestate(struct BCState *bcs) | 194 | close_jadestate(struct BCState *bcs) |
195 | { | 195 | { |
196 | modejade(bcs, 0, bcs->channel); | 196 | modejade(bcs, 0, bcs->channel); |
@@ -243,7 +243,7 @@ open_jadestate(struct IsdnCardState *cs, struct BCState *bcs) | |||
243 | } | 243 | } |
244 | 244 | ||
245 | 245 | ||
246 | int | 246 | static int |
247 | setstack_jade(struct PStack *st, struct BCState *bcs) | 247 | setstack_jade(struct PStack *st, struct BCState *bcs) |
248 | { | 248 | { |
249 | bcs->channel = st->l1.bc; | 249 | 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 @@ | |||
128 | #define jade_TXAUDIOCH2CFG 0x1A | 128 | #define jade_TXAUDIOCH2CFG 0x1A |
129 | 129 | ||
130 | extern int JadeVersion(struct IsdnCardState *cs, char *s); | 130 | extern int JadeVersion(struct IsdnCardState *cs, char *s); |
131 | extern void modejade(struct BCState *bcs, int mode, int bc); | ||
132 | extern void clear_pending_jade_ints(struct IsdnCardState *cs); | 131 | extern void clear_pending_jade_ints(struct IsdnCardState *cs); |
133 | extern void initjade(struct IsdnCardState *cs); | 132 | extern void initjade(struct IsdnCardState *cs); |
134 | 133 | ||
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 @@ | |||
19 | #include <linux/ctype.h> | 19 | #include <linux/ctype.h> |
20 | 20 | ||
21 | extern char *HiSax_getrev(const char *revision); | 21 | extern char *HiSax_getrev(const char *revision); |
22 | const char *l3_1tr6_revision = "$Revision: 2.15.2.3 $"; | 22 | static const char *l3_1tr6_revision = "$Revision: 2.15.2.3 $"; |
23 | 23 | ||
24 | #define MsgHead(ptr, cref, mty, dis) \ | 24 | #define MsgHead(ptr, cref, mty, dis) \ |
25 | *ptr++ = dis; \ | 25 | *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 @@ | |||
26 | #include <linux/config.h> | 26 | #include <linux/config.h> |
27 | 27 | ||
28 | extern char *HiSax_getrev(const char *revision); | 28 | extern char *HiSax_getrev(const char *revision); |
29 | const char *dss1_revision = "$Revision: 2.32.2.3 $"; | 29 | static const char *dss1_revision = "$Revision: 2.32.2.3 $"; |
30 | 30 | ||
31 | #define EXT_BEARER_CAPS 1 | 31 | #define EXT_BEARER_CAPS 1 |
32 | 32 | ||
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 @@ | |||
24 | #include <linux/ctype.h> | 24 | #include <linux/ctype.h> |
25 | 25 | ||
26 | extern char *HiSax_getrev(const char *revision); | 26 | extern char *HiSax_getrev(const char *revision); |
27 | const char *ni1_revision = "$Revision: 2.8.2.3 $"; | 27 | static const char *ni1_revision = "$Revision: 2.8.2.3 $"; |
28 | 28 | ||
29 | #define EXT_BEARER_CAPS 1 | 29 | #define EXT_BEARER_CAPS 1 |
30 | 30 | ||
@@ -2665,7 +2665,7 @@ static void l3ni1_spid_send( struct l3_process *pc, u_char pr, void *arg ) | |||
2665 | l3ni1_SendSpid( pc, pr, arg, 20 ); | 2665 | l3ni1_SendSpid( pc, pr, arg, 20 ); |
2666 | } | 2666 | } |
2667 | 2667 | ||
2668 | void l3ni1_spid_epid( struct l3_process *pc, u_char pr, void *arg ) | 2668 | static void l3ni1_spid_epid( struct l3_process *pc, u_char pr, void *arg ) |
2669 | { | 2669 | { |
2670 | struct sk_buff *skb = arg; | 2670 | struct sk_buff *skb = arg; |
2671 | 2671 | ||
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 @@ | |||
18 | 18 | ||
19 | extern const char *CardType[]; | 19 | extern const char *CardType[]; |
20 | 20 | ||
21 | const char *mic_revision = "$Revision: 1.12.2.4 $"; | 21 | static const char *mic_revision = "$Revision: 1.12.2.4 $"; |
22 | 22 | ||
23 | #define byteout(addr,val) outb(val,addr) | 23 | #define byteout(addr,val) outb(val,addr) |
24 | #define bytein(addr) inb(addr) | 24 | #define bytein(addr) inb(addr) |
@@ -157,7 +157,7 @@ mic_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
157 | return IRQ_HANDLED; | 157 | return IRQ_HANDLED; |
158 | } | 158 | } |
159 | 159 | ||
160 | void | 160 | static void |
161 | release_io_mic(struct IsdnCardState *cs) | 161 | release_io_mic(struct IsdnCardState *cs) |
162 | { | 162 | { |
163 | int bytecnt = 8; | 163 | 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 @@ | |||
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | #include "netjet.h" | 26 | #include "netjet.h" |
27 | 27 | ||
28 | const char *NETjet_revision = "$Revision: 1.29.2.4 $"; | ||
29 | |||
30 | /* Interface functions */ | 28 | /* Interface functions */ |
31 | 29 | ||
32 | u_char | 30 | u_char |
@@ -66,7 +64,7 @@ NETjet_WriteICfifo(struct IsdnCardState *cs, u_char *data, int size) | |||
66 | outsb(cs->hw.njet.isac, data, size); | 64 | outsb(cs->hw.njet.isac, data, size); |
67 | } | 65 | } |
68 | 66 | ||
69 | void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) | 67 | static void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) |
70 | { | 68 | { |
71 | u_int mask=0x000000ff, val = 0, *p=pos; | 69 | u_int mask=0x000000ff, val = 0, *p=pos; |
72 | u_int i; | 70 | u_int i; |
@@ -85,7 +83,7 @@ void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) | |||
85 | } | 83 | } |
86 | } | 84 | } |
87 | 85 | ||
88 | void | 86 | static void |
89 | mode_tiger(struct BCState *bcs, int mode, int bc) | 87 | mode_tiger(struct BCState *bcs, int mode, int bc) |
90 | { | 88 | { |
91 | struct IsdnCardState *cs = bcs->cs; | 89 | struct IsdnCardState *cs = bcs->cs; |
@@ -852,7 +850,7 @@ tiger_l2l1(struct PStack *st, int pr, void *arg) | |||
852 | } | 850 | } |
853 | 851 | ||
854 | 852 | ||
855 | void | 853 | static void |
856 | close_tigerstate(struct BCState *bcs) | 854 | close_tigerstate(struct BCState *bcs) |
857 | { | 855 | { |
858 | mode_tiger(bcs, 0, bcs->channel); | 856 | mode_tiger(bcs, 0, bcs->channel); |
@@ -900,7 +898,7 @@ open_tigerstate(struct IsdnCardState *cs, struct BCState *bcs) | |||
900 | return (0); | 898 | return (0); |
901 | } | 899 | } |
902 | 900 | ||
903 | int | 901 | static int |
904 | setstack_tiger(struct PStack *st, struct BCState *bcs) | 902 | setstack_tiger(struct PStack *st, struct BCState *bcs) |
905 | { | 903 | { |
906 | bcs->channel = st->l1.bc; | 904 | bcs->channel = st->l1.bc; |
@@ -966,7 +964,7 @@ inittiger(struct IsdnCardState *cs) | |||
966 | cs->bcs[1].BC_Close = close_tigerstate; | 964 | cs->bcs[1].BC_Close = close_tigerstate; |
967 | } | 965 | } |
968 | 966 | ||
969 | void | 967 | static void |
970 | releasetiger(struct IsdnCardState *cs) | 968 | releasetiger(struct IsdnCardState *cs) |
971 | { | 969 | { |
972 | if (cs->bcs[0].hw.tiger.send) { | 970 | 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 @@ | |||
24 | #include <linux/isapnp.h> | 24 | #include <linux/isapnp.h> |
25 | 25 | ||
26 | extern const char *CardType[]; | 26 | extern const char *CardType[]; |
27 | const char *niccy_revision = "$Revision: 1.21.2.4 $"; | 27 | static const char *niccy_revision = "$Revision: 1.21.2.4 $"; |
28 | 28 | ||
29 | #define byteout(addr,val) outb(val,addr) | 29 | #define byteout(addr,val) outb(val,addr) |
30 | #define bytein(addr) inb(addr) | 30 | #define bytein(addr) inb(addr) |
@@ -178,7 +178,7 @@ niccy_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
178 | return IRQ_HANDLED; | 178 | return IRQ_HANDLED; |
179 | } | 179 | } |
180 | 180 | ||
181 | void | 181 | static void |
182 | release_io_niccy(struct IsdnCardState *cs) | 182 | release_io_niccy(struct IsdnCardState *cs) |
183 | { | 183 | { |
184 | if (cs->subtyp == NICCY_PCI) { | 184 | 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 @@ | |||
15 | #include <linux/ppp_defs.h> | 15 | #include <linux/ppp_defs.h> |
16 | #include "netjet.h" | 16 | #include "netjet.h" |
17 | 17 | ||
18 | const char *NETjet_S_revision = "$Revision: 2.13.2.4 $"; | 18 | static const char *NETjet_S_revision = "$Revision: 2.13.2.4 $"; |
19 | 19 | ||
20 | static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) | 20 | static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) |
21 | { | 21 | { |
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 @@ | |||
15 | #include <linux/ppp_defs.h> | 15 | #include <linux/ppp_defs.h> |
16 | #include "netjet.h" | 16 | #include "netjet.h" |
17 | 17 | ||
18 | const char *NETjet_U_revision = "$Revision: 2.14.2.3 $"; | 18 | static const char *NETjet_U_revision = "$Revision: 2.14.2.3 $"; |
19 | 19 | ||
20 | static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) | 20 | static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) |
21 | { | 21 | { |
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[] = | |||
516 | {CAUSE_UserInfoDiscarded, "User Info Discarded"} | 516 | {CAUSE_UserInfoDiscarded, "User Info Discarded"} |
517 | }; | 517 | }; |
518 | 518 | ||
519 | int cause_1tr6_len = (sizeof(cause_1tr6) / sizeof(struct MessageType)); | 519 | static int cause_1tr6_len = (sizeof(cause_1tr6) / sizeof(struct MessageType)); |
520 | 520 | ||
521 | static int | 521 | static int |
522 | prcause_1tr6(char *dest, u_char * p) | 522 | prcause_1tr6(char *dest, u_char * p) |
@@ -935,7 +935,7 @@ display(char *dest, u_char * p) | |||
935 | return (dp - dest); | 935 | return (dp - dest); |
936 | } | 936 | } |
937 | 937 | ||
938 | int | 938 | static int |
939 | prfacility(char *dest, u_char * p) | 939 | prfacility(char *dest, u_char * p) |
940 | { | 940 | { |
941 | char *dp = dest; | 941 | 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 @@ | |||
17 | #include "isdnl1.h" | 17 | #include "isdnl1.h" |
18 | 18 | ||
19 | extern const char *CardType[]; | 19 | extern const char *CardType[]; |
20 | const char *s0box_revision = "$Revision: 2.6.2.4 $"; | 20 | static const char *s0box_revision = "$Revision: 2.6.2.4 $"; |
21 | 21 | ||
22 | static inline void | 22 | static inline void |
23 | writereg(unsigned int padr, signed int addr, u_char off, u_char val) { | 23 | 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) | |||
183 | return IRQ_HANDLED; | 183 | return IRQ_HANDLED; |
184 | } | 184 | } |
185 | 185 | ||
186 | void | 186 | static void |
187 | release_io_s0box(struct IsdnCardState *cs) | 187 | release_io_s0box(struct IsdnCardState *cs) |
188 | { | 188 | { |
189 | release_region(cs->hw.teles3.cfg_reg, 8); | 189 | 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) | |||
171 | mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); | 171 | mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void | 174 | static void |
175 | release_io_saphir(struct IsdnCardState *cs) | 175 | release_io_saphir(struct IsdnCardState *cs) |
176 | { | 176 | { |
177 | byteout(cs->hw.saphir.cfg_reg + IRQ_REG, 0xff); | 177 | 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 @@ | |||
51 | 51 | ||
52 | extern const char *CardType[]; | 52 | extern const char *CardType[]; |
53 | 53 | ||
54 | const char *Sedlbauer_revision = "$Revision: 1.34.2.6 $"; | 54 | static const char *Sedlbauer_revision = "$Revision: 1.34.2.6 $"; |
55 | 55 | ||
56 | const char *Sedlbauer_Types[] = | 56 | static const char *Sedlbauer_Types[] = |
57 | {"None", "speed card/win", "speed star", "speed fax+", | 57 | {"None", "speed card/win", "speed star", "speed fax+", |
58 | "speed win II / ISDN PC/104", "speed star II", "speed pci", | 58 | "speed win II / ISDN PC/104", "speed star II", "speed pci", |
59 | "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"}; | 59 | "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) | |||
394 | return IRQ_HANDLED; | 394 | return IRQ_HANDLED; |
395 | } | 395 | } |
396 | 396 | ||
397 | void | 397 | static void |
398 | release_io_sedlbauer(struct IsdnCardState *cs) | 398 | release_io_sedlbauer(struct IsdnCardState *cs) |
399 | { | 399 | { |
400 | int bytecnt = 8; | 400 | int bytecnt = 8; |
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 @@ | |||
19 | #include "isdnl1.h" | 19 | #include "isdnl1.h" |
20 | 20 | ||
21 | extern const char *CardType[]; | 21 | extern const char *CardType[]; |
22 | const char *sportster_revision = "$Revision: 1.16.2.4 $"; | 22 | static const char *sportster_revision = "$Revision: 1.16.2.4 $"; |
23 | 23 | ||
24 | #define byteout(addr,val) outb(val,addr) | 24 | #define byteout(addr,val) outb(val,addr) |
25 | #define bytein(addr) inb(addr) | 25 | #define bytein(addr) inb(addr) |
@@ -132,7 +132,7 @@ sportster_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
132 | return IRQ_HANDLED; | 132 | return IRQ_HANDLED; |
133 | } | 133 | } |
134 | 134 | ||
135 | void | 135 | static void |
136 | release_io_sportster(struct IsdnCardState *cs) | 136 | release_io_sportster(struct IsdnCardState *cs) |
137 | { | 137 | { |
138 | int i, adr; | 138 | int i, adr; |
@@ -144,7 +144,7 @@ release_io_sportster(struct IsdnCardState *cs) | |||
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
147 | void | 147 | static void |
148 | reset_sportster(struct IsdnCardState *cs) | 148 | reset_sportster(struct IsdnCardState *cs) |
149 | { | 149 | { |
150 | cs->hw.spt.res_irq |= SPORTSTER_RESET; /* Reset On */ | 150 | 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, | |||
450 | usb_complete_t complete, void *context); | 450 | usb_complete_t complete, void *context); |
451 | void st5481_release_isocpipes(struct urb* urb[2]); | 451 | void st5481_release_isocpipes(struct urb* urb[2]); |
452 | 452 | ||
453 | int st5481_isoc_flatten(struct urb *urb); | ||
454 | void st5481_usb_pipe_reset(struct st5481_adapter *adapter, | 453 | void st5481_usb_pipe_reset(struct st5481_adapter *adapter, |
455 | u_char pipe, ctrl_complete_t complete, void *context); | 454 | u_char pipe, ctrl_complete_t complete, void *context); |
456 | void st5481_usb_ctrl_msg(struct st5481_adapter *adapter, | ||
457 | u8 request, u8 requesttype, u16 value, u16 index, | ||
458 | ctrl_complete_t complete, void *context); | ||
459 | void st5481_usb_device_ctrl_msg(struct st5481_adapter *adapter, | 455 | void st5481_usb_device_ctrl_msg(struct st5481_adapter *adapter, |
460 | u8 request, u16 value, | 456 | u8 request, u16 value, |
461 | ctrl_complete_t complete, void *context); | 457 | 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 @@ | |||
1 | /* | ||
2 | * Driver for ST5481 USB ISDN modem | ||
3 | * | ||
4 | * Author Frode Isaksen | ||
5 | * Copyright 2001 by Frode Isaksen <fisaksen@bewan.com> | ||
6 | * 2001 by Kai Germaschewski <kai.germaschewski@gmx.de> | ||
7 | * | ||
8 | * This software may be used and distributed according to the terms | ||
9 | * of the GNU General Public License, incorporated herein by reference. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #include <linux/crc-ccitt.h> | ||
14 | #include "st5481_hdlc.h" | ||
15 | |||
16 | |||
17 | enum { | ||
18 | HDLC_FAST_IDLE,HDLC_GET_FLAG_B0,HDLC_GETFLAG_B1A6,HDLC_GETFLAG_B7, | ||
19 | HDLC_GET_DATA,HDLC_FAST_FLAG | ||
20 | }; | ||
21 | |||
22 | enum { | ||
23 | HDLC_SEND_DATA,HDLC_SEND_CRC1,HDLC_SEND_FAST_FLAG, | ||
24 | HDLC_SEND_FIRST_FLAG,HDLC_SEND_CRC2,HDLC_SEND_CLOSING_FLAG, | ||
25 | HDLC_SEND_IDLE1,HDLC_SEND_FAST_IDLE,HDLC_SENDFLAG_B0, | ||
26 | HDLC_SENDFLAG_B1A6,HDLC_SENDFLAG_B7,STOPPED | ||
27 | }; | ||
28 | |||
29 | void | ||
30 | hdlc_rcv_init(struct hdlc_vars *hdlc, int do_adapt56) | ||
31 | { | ||
32 | hdlc->bit_shift = 0; | ||
33 | hdlc->hdlc_bits1 = 0; | ||
34 | hdlc->data_bits = 0; | ||
35 | hdlc->ffbit_shift = 0; | ||
36 | hdlc->data_received = 0; | ||
37 | hdlc->state = HDLC_GET_DATA; | ||
38 | hdlc->do_adapt56 = do_adapt56; | ||
39 | hdlc->dchannel = 0; | ||
40 | hdlc->crc = 0; | ||
41 | hdlc->cbin = 0; | ||
42 | hdlc->shift_reg = 0; | ||
43 | hdlc->ffvalue = 0; | ||
44 | hdlc->dstpos = 0; | ||
45 | } | ||
46 | |||
47 | void | ||
48 | hdlc_out_init(struct hdlc_vars *hdlc, int is_d_channel, int do_adapt56) | ||
49 | { | ||
50 | hdlc->bit_shift = 0; | ||
51 | hdlc->hdlc_bits1 = 0; | ||
52 | hdlc->data_bits = 0; | ||
53 | hdlc->ffbit_shift = 0; | ||
54 | hdlc->data_received = 0; | ||
55 | hdlc->do_closing = 0; | ||
56 | hdlc->ffvalue = 0; | ||
57 | if (is_d_channel) { | ||
58 | hdlc->dchannel = 1; | ||
59 | hdlc->state = HDLC_SEND_FIRST_FLAG; | ||
60 | } else { | ||
61 | hdlc->dchannel = 0; | ||
62 | hdlc->state = HDLC_SEND_FAST_FLAG; | ||
63 | hdlc->ffvalue = 0x7e; | ||
64 | } | ||
65 | hdlc->cbin = 0x7e; | ||
66 | hdlc->bit_shift = 0; | ||
67 | if(do_adapt56){ | ||
68 | hdlc->do_adapt56 = 1; | ||
69 | hdlc->data_bits = 0; | ||
70 | hdlc->state = HDLC_SENDFLAG_B0; | ||
71 | } else { | ||
72 | hdlc->do_adapt56 = 0; | ||
73 | hdlc->data_bits = 8; | ||
74 | } | ||
75 | hdlc->shift_reg = 0; | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | hdlc_decode - decodes HDLC frames from a transparent bit stream. | ||
80 | |||
81 | The source buffer is scanned for valid HDLC frames looking for | ||
82 | flags (01111110) to indicate the start of a frame. If the start of | ||
83 | the frame is found, the bit stuffing is removed (0 after 5 1's). | ||
84 | When a new flag is found, the complete frame has been received | ||
85 | and the CRC is checked. | ||
86 | If a valid frame is found, the function returns the frame length | ||
87 | excluding the CRC with the bit HDLC_END_OF_FRAME set. | ||
88 | If the beginning of a valid frame is found, the function returns | ||
89 | the length. | ||
90 | If a framing error is found (too many 1s and not a flag) the function | ||
91 | returns the length with the bit HDLC_FRAMING_ERROR set. | ||
92 | If a CRC error is found the function returns the length with the | ||
93 | bit HDLC_CRC_ERROR set. | ||
94 | If the frame length exceeds the destination buffer size, the function | ||
95 | returns the length with the bit HDLC_LENGTH_ERROR set. | ||
96 | |||
97 | src - source buffer | ||
98 | slen - source buffer length | ||
99 | count - number of bytes removed (decoded) from the source buffer | ||
100 | dst _ destination buffer | ||
101 | dsize - destination buffer size | ||
102 | returns - number of decoded bytes in the destination buffer and status | ||
103 | flag. | ||
104 | */ | ||
105 | int hdlc_decode(struct hdlc_vars *hdlc, const unsigned char *src, | ||
106 | int slen, int *count, unsigned char *dst, int dsize) | ||
107 | { | ||
108 | int status=0; | ||
109 | |||
110 | static const unsigned char fast_flag[]={ | ||
111 | 0x00,0x00,0x00,0x20,0x30,0x38,0x3c,0x3e,0x3f | ||
112 | }; | ||
113 | |||
114 | static const unsigned char fast_flag_value[]={ | ||
115 | 0x00,0x7e,0xfc,0xf9,0xf3,0xe7,0xcf,0x9f,0x3f | ||
116 | }; | ||
117 | |||
118 | static const unsigned char fast_abort[]={ | ||
119 | 0x00,0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff | ||
120 | }; | ||
121 | |||
122 | *count = slen; | ||
123 | |||
124 | while(slen > 0){ | ||
125 | if(hdlc->bit_shift==0){ | ||
126 | hdlc->cbin = *src++; | ||
127 | slen--; | ||
128 | hdlc->bit_shift = 8; | ||
129 | if(hdlc->do_adapt56){ | ||
130 | hdlc->bit_shift --; | ||
131 | } | ||
132 | } | ||
133 | |||
134 | switch(hdlc->state){ | ||
135 | case STOPPED: | ||
136 | return 0; | ||
137 | case HDLC_FAST_IDLE: | ||
138 | if(hdlc->cbin == 0xff){ | ||
139 | hdlc->bit_shift = 0; | ||
140 | break; | ||
141 | } | ||
142 | hdlc->state = HDLC_GET_FLAG_B0; | ||
143 | hdlc->hdlc_bits1 = 0; | ||
144 | hdlc->bit_shift = 8; | ||
145 | break; | ||
146 | case HDLC_GET_FLAG_B0: | ||
147 | if(!(hdlc->cbin & 0x80)) { | ||
148 | hdlc->state = HDLC_GETFLAG_B1A6; | ||
149 | hdlc->hdlc_bits1 = 0; | ||
150 | } else { | ||
151 | if(!hdlc->do_adapt56){ | ||
152 | if(++hdlc->hdlc_bits1 >=8 ) if(hdlc->bit_shift==1) | ||
153 | hdlc->state = HDLC_FAST_IDLE; | ||
154 | } | ||
155 | } | ||
156 | hdlc->cbin<<=1; | ||
157 | hdlc->bit_shift --; | ||
158 | break; | ||
159 | case HDLC_GETFLAG_B1A6: | ||
160 | if(hdlc->cbin & 0x80){ | ||
161 | hdlc->hdlc_bits1++; | ||
162 | if(hdlc->hdlc_bits1==6){ | ||
163 | hdlc->state = HDLC_GETFLAG_B7; | ||
164 | } | ||
165 | } else { | ||
166 | hdlc->hdlc_bits1 = 0; | ||
167 | } | ||
168 | hdlc->cbin<<=1; | ||
169 | hdlc->bit_shift --; | ||
170 | break; | ||
171 | case HDLC_GETFLAG_B7: | ||
172 | if(hdlc->cbin & 0x80) { | ||
173 | hdlc->state = HDLC_GET_FLAG_B0; | ||
174 | } else { | ||
175 | hdlc->state = HDLC_GET_DATA; | ||
176 | hdlc->crc = 0xffff; | ||
177 | hdlc->shift_reg = 0; | ||
178 | hdlc->hdlc_bits1 = 0; | ||
179 | hdlc->data_bits = 0; | ||
180 | hdlc->data_received = 0; | ||
181 | } | ||
182 | hdlc->cbin<<=1; | ||
183 | hdlc->bit_shift --; | ||
184 | break; | ||
185 | case HDLC_GET_DATA: | ||
186 | if(hdlc->cbin & 0x80){ | ||
187 | hdlc->hdlc_bits1++; | ||
188 | switch(hdlc->hdlc_bits1){ | ||
189 | case 6: | ||
190 | break; | ||
191 | case 7: | ||
192 | if(hdlc->data_received) { | ||
193 | // bad frame | ||
194 | status = -HDLC_FRAMING_ERROR; | ||
195 | } | ||
196 | if(!hdlc->do_adapt56){ | ||
197 | if(hdlc->cbin==fast_abort[hdlc->bit_shift+1]){ | ||
198 | hdlc->state = HDLC_FAST_IDLE; | ||
199 | hdlc->bit_shift=1; | ||
200 | break; | ||
201 | } | ||
202 | } else { | ||
203 | hdlc->state = HDLC_GET_FLAG_B0; | ||
204 | } | ||
205 | break; | ||
206 | default: | ||
207 | hdlc->shift_reg>>=1; | ||
208 | hdlc->shift_reg |= 0x80; | ||
209 | hdlc->data_bits++; | ||
210 | break; | ||
211 | } | ||
212 | } else { | ||
213 | switch(hdlc->hdlc_bits1){ | ||
214 | case 5: | ||
215 | break; | ||
216 | case 6: | ||
217 | if(hdlc->data_received){ | ||
218 | if (hdlc->dstpos < 2) { | ||
219 | status = -HDLC_FRAMING_ERROR; | ||
220 | } else if (hdlc->crc != 0xf0b8){ | ||
221 | // crc error | ||
222 | status = -HDLC_CRC_ERROR; | ||
223 | } else { | ||
224 | // remove CRC | ||
225 | hdlc->dstpos -= 2; | ||
226 | // good frame | ||
227 | status = hdlc->dstpos; | ||
228 | } | ||
229 | } | ||
230 | hdlc->crc = 0xffff; | ||
231 | hdlc->shift_reg = 0; | ||
232 | hdlc->data_bits = 0; | ||
233 | if(!hdlc->do_adapt56){ | ||
234 | if(hdlc->cbin==fast_flag[hdlc->bit_shift]){ | ||
235 | hdlc->ffvalue = fast_flag_value[hdlc->bit_shift]; | ||
236 | hdlc->state = HDLC_FAST_FLAG; | ||
237 | hdlc->ffbit_shift = hdlc->bit_shift; | ||
238 | hdlc->bit_shift = 1; | ||
239 | } else { | ||
240 | hdlc->state = HDLC_GET_DATA; | ||
241 | hdlc->data_received = 0; | ||
242 | } | ||
243 | } else { | ||
244 | hdlc->state = HDLC_GET_DATA; | ||
245 | hdlc->data_received = 0; | ||
246 | } | ||
247 | break; | ||
248 | default: | ||
249 | hdlc->shift_reg>>=1; | ||
250 | hdlc->data_bits++; | ||
251 | break; | ||
252 | } | ||
253 | hdlc->hdlc_bits1 = 0; | ||
254 | } | ||
255 | if (status) { | ||
256 | hdlc->dstpos = 0; | ||
257 | *count -= slen; | ||
258 | hdlc->cbin <<= 1; | ||
259 | hdlc->bit_shift--; | ||
260 | return status; | ||
261 | } | ||
262 | if(hdlc->data_bits==8){ | ||
263 | hdlc->data_bits = 0; | ||
264 | hdlc->data_received = 1; | ||
265 | hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg); | ||
266 | |||
267 | // good byte received | ||
268 | if (dsize--) { | ||
269 | dst[hdlc->dstpos++] = hdlc->shift_reg; | ||
270 | } else { | ||
271 | // frame too long | ||
272 | status = -HDLC_LENGTH_ERROR; | ||
273 | hdlc->dstpos = 0; | ||
274 | } | ||
275 | } | ||
276 | hdlc->cbin <<= 1; | ||
277 | hdlc->bit_shift--; | ||
278 | break; | ||
279 | case HDLC_FAST_FLAG: | ||
280 | if(hdlc->cbin==hdlc->ffvalue){ | ||
281 | hdlc->bit_shift = 0; | ||
282 | break; | ||
283 | } else { | ||
284 | if(hdlc->cbin == 0xff){ | ||
285 | hdlc->state = HDLC_FAST_IDLE; | ||
286 | hdlc->bit_shift=0; | ||
287 | } else if(hdlc->ffbit_shift==8){ | ||
288 | hdlc->state = HDLC_GETFLAG_B7; | ||
289 | break; | ||
290 | } else { | ||
291 | hdlc->shift_reg = fast_abort[hdlc->ffbit_shift-1]; | ||
292 | hdlc->hdlc_bits1 = hdlc->ffbit_shift-2; | ||
293 | if(hdlc->hdlc_bits1<0)hdlc->hdlc_bits1 = 0; | ||
294 | hdlc->data_bits = hdlc->ffbit_shift-1; | ||
295 | hdlc->state = HDLC_GET_DATA; | ||
296 | hdlc->data_received = 0; | ||
297 | } | ||
298 | } | ||
299 | break; | ||
300 | default: | ||
301 | break; | ||
302 | } | ||
303 | } | ||
304 | *count -= slen; | ||
305 | return 0; | ||
306 | } | ||
307 | |||
308 | /* | ||
309 | hdlc_encode - encodes HDLC frames to a transparent bit stream. | ||
310 | |||
311 | The bit stream starts with a beginning flag (01111110). After | ||
312 | that each byte is added to the bit stream with bit stuffing added | ||
313 | (0 after 5 1's). | ||
314 | When the last byte has been removed from the source buffer, the | ||
315 | CRC (2 bytes is added) and the frame terminates with the ending flag. | ||
316 | For the dchannel, the idle character (all 1's) is also added at the end. | ||
317 | If this function is called with empty source buffer (slen=0), flags or | ||
318 | idle character will be generated. | ||
319 | |||
320 | src - source buffer | ||
321 | slen - source buffer length | ||
322 | count - number of bytes removed (encoded) from source buffer | ||
323 | dst _ destination buffer | ||
324 | dsize - destination buffer size | ||
325 | returns - number of encoded bytes in the destination buffer | ||
326 | */ | ||
327 | int hdlc_encode(struct hdlc_vars *hdlc, const unsigned char *src, | ||
328 | unsigned short slen, int *count, | ||
329 | unsigned char *dst, int dsize) | ||
330 | { | ||
331 | static const unsigned char xfast_flag_value[] = { | ||
332 | 0x7e,0x3f,0x9f,0xcf,0xe7,0xf3,0xf9,0xfc,0x7e | ||
333 | }; | ||
334 | |||
335 | int len = 0; | ||
336 | |||
337 | *count = slen; | ||
338 | |||
339 | while (dsize > 0) { | ||
340 | if(hdlc->bit_shift==0){ | ||
341 | if(slen && !hdlc->do_closing){ | ||
342 | hdlc->shift_reg = *src++; | ||
343 | slen--; | ||
344 | if (slen == 0) | ||
345 | hdlc->do_closing = 1; /* closing sequence, CRC + flag(s) */ | ||
346 | hdlc->bit_shift = 8; | ||
347 | } else { | ||
348 | if(hdlc->state == HDLC_SEND_DATA){ | ||
349 | if(hdlc->data_received){ | ||
350 | hdlc->state = HDLC_SEND_CRC1; | ||
351 | hdlc->crc ^= 0xffff; | ||
352 | hdlc->bit_shift = 8; | ||
353 | hdlc->shift_reg = hdlc->crc & 0xff; | ||
354 | } else if(!hdlc->do_adapt56){ | ||
355 | hdlc->state = HDLC_SEND_FAST_FLAG; | ||
356 | } else { | ||
357 | hdlc->state = HDLC_SENDFLAG_B0; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | } | ||
362 | } | ||
363 | |||
364 | switch(hdlc->state){ | ||
365 | case STOPPED: | ||
366 | while (dsize--) | ||
367 | *dst++ = 0xff; | ||
368 | |||
369 | return dsize; | ||
370 | case HDLC_SEND_FAST_FLAG: | ||
371 | hdlc->do_closing = 0; | ||
372 | if(slen == 0){ | ||
373 | *dst++ = hdlc->ffvalue; | ||
374 | len++; | ||
375 | dsize--; | ||
376 | break; | ||
377 | } | ||
378 | if(hdlc->bit_shift==8){ | ||
379 | hdlc->cbin = hdlc->ffvalue>>(8-hdlc->data_bits); | ||
380 | hdlc->state = HDLC_SEND_DATA; | ||
381 | hdlc->crc = 0xffff; | ||
382 | hdlc->hdlc_bits1 = 0; | ||
383 | hdlc->data_received = 1; | ||
384 | } | ||
385 | break; | ||
386 | case HDLC_SENDFLAG_B0: | ||
387 | hdlc->do_closing = 0; | ||
388 | hdlc->cbin <<= 1; | ||
389 | hdlc->data_bits++; | ||
390 | hdlc->hdlc_bits1 = 0; | ||
391 | hdlc->state = HDLC_SENDFLAG_B1A6; | ||
392 | break; | ||
393 | case HDLC_SENDFLAG_B1A6: | ||
394 | hdlc->cbin <<= 1; | ||
395 | hdlc->data_bits++; | ||
396 | hdlc->cbin++; | ||
397 | if(++hdlc->hdlc_bits1 == 6) | ||
398 | hdlc->state = HDLC_SENDFLAG_B7; | ||
399 | break; | ||
400 | case HDLC_SENDFLAG_B7: | ||
401 | hdlc->cbin <<= 1; | ||
402 | hdlc->data_bits++; | ||
403 | if(slen == 0){ | ||
404 | hdlc->state = HDLC_SENDFLAG_B0; | ||
405 | break; | ||
406 | } | ||
407 | if(hdlc->bit_shift==8){ | ||
408 | hdlc->state = HDLC_SEND_DATA; | ||
409 | hdlc->crc = 0xffff; | ||
410 | hdlc->hdlc_bits1 = 0; | ||
411 | hdlc->data_received = 1; | ||
412 | } | ||
413 | break; | ||
414 | case HDLC_SEND_FIRST_FLAG: | ||
415 | hdlc->data_received = 1; | ||
416 | if(hdlc->data_bits==8){ | ||
417 | hdlc->state = HDLC_SEND_DATA; | ||
418 | hdlc->crc = 0xffff; | ||
419 | hdlc->hdlc_bits1 = 0; | ||
420 | break; | ||
421 | } | ||
422 | hdlc->cbin <<= 1; | ||
423 | hdlc->data_bits++; | ||
424 | if(hdlc->shift_reg & 0x01) | ||
425 | hdlc->cbin++; | ||
426 | hdlc->shift_reg >>= 1; | ||
427 | hdlc->bit_shift--; | ||
428 | if(hdlc->bit_shift==0){ | ||
429 | hdlc->state = HDLC_SEND_DATA; | ||
430 | hdlc->crc = 0xffff; | ||
431 | hdlc->hdlc_bits1 = 0; | ||
432 | } | ||
433 | break; | ||
434 | case HDLC_SEND_DATA: | ||
435 | hdlc->cbin <<= 1; | ||
436 | hdlc->data_bits++; | ||
437 | if(hdlc->hdlc_bits1 == 5){ | ||
438 | hdlc->hdlc_bits1 = 0; | ||
439 | break; | ||
440 | } | ||
441 | if(hdlc->bit_shift==8){ | ||
442 | hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg); | ||
443 | } | ||
444 | if(hdlc->shift_reg & 0x01){ | ||
445 | hdlc->hdlc_bits1++; | ||
446 | hdlc->cbin++; | ||
447 | hdlc->shift_reg >>= 1; | ||
448 | hdlc->bit_shift--; | ||
449 | } else { | ||
450 | hdlc->hdlc_bits1 = 0; | ||
451 | hdlc->shift_reg >>= 1; | ||
452 | hdlc->bit_shift--; | ||
453 | } | ||
454 | break; | ||
455 | case HDLC_SEND_CRC1: | ||
456 | hdlc->cbin <<= 1; | ||
457 | hdlc->data_bits++; | ||
458 | if(hdlc->hdlc_bits1 == 5){ | ||
459 | hdlc->hdlc_bits1 = 0; | ||
460 | break; | ||
461 | } | ||
462 | if(hdlc->shift_reg & 0x01){ | ||
463 | hdlc->hdlc_bits1++; | ||
464 | hdlc->cbin++; | ||
465 | hdlc->shift_reg >>= 1; | ||
466 | hdlc->bit_shift--; | ||
467 | } else { | ||
468 | hdlc->hdlc_bits1 = 0; | ||
469 | hdlc->shift_reg >>= 1; | ||
470 | hdlc->bit_shift--; | ||
471 | } | ||
472 | if(hdlc->bit_shift==0){ | ||
473 | hdlc->shift_reg = (hdlc->crc >> 8); | ||
474 | hdlc->state = HDLC_SEND_CRC2; | ||
475 | hdlc->bit_shift = 8; | ||
476 | } | ||
477 | break; | ||
478 | case HDLC_SEND_CRC2: | ||
479 | hdlc->cbin <<= 1; | ||
480 | hdlc->data_bits++; | ||
481 | if(hdlc->hdlc_bits1 == 5){ | ||
482 | hdlc->hdlc_bits1 = 0; | ||
483 | break; | ||
484 | } | ||
485 | if(hdlc->shift_reg & 0x01){ | ||
486 | hdlc->hdlc_bits1++; | ||
487 | hdlc->cbin++; | ||
488 | hdlc->shift_reg >>= 1; | ||
489 | hdlc->bit_shift--; | ||
490 | } else { | ||
491 | hdlc->hdlc_bits1 = 0; | ||
492 | hdlc->shift_reg >>= 1; | ||
493 | hdlc->bit_shift--; | ||
494 | } | ||
495 | if(hdlc->bit_shift==0){ | ||
496 | hdlc->shift_reg = 0x7e; | ||
497 | hdlc->state = HDLC_SEND_CLOSING_FLAG; | ||
498 | hdlc->bit_shift = 8; | ||
499 | } | ||
500 | break; | ||
501 | case HDLC_SEND_CLOSING_FLAG: | ||
502 | hdlc->cbin <<= 1; | ||
503 | hdlc->data_bits++; | ||
504 | if(hdlc->hdlc_bits1 == 5){ | ||
505 | hdlc->hdlc_bits1 = 0; | ||
506 | break; | ||
507 | } | ||
508 | if(hdlc->shift_reg & 0x01){ | ||
509 | hdlc->cbin++; | ||
510 | } | ||
511 | hdlc->shift_reg >>= 1; | ||
512 | hdlc->bit_shift--; | ||
513 | if(hdlc->bit_shift==0){ | ||
514 | hdlc->ffvalue = xfast_flag_value[hdlc->data_bits]; | ||
515 | if(hdlc->dchannel){ | ||
516 | hdlc->ffvalue = 0x7e; | ||
517 | hdlc->state = HDLC_SEND_IDLE1; | ||
518 | hdlc->bit_shift = 8-hdlc->data_bits; | ||
519 | if(hdlc->bit_shift==0) | ||
520 | hdlc->state = HDLC_SEND_FAST_IDLE; | ||
521 | } else { | ||
522 | if(!hdlc->do_adapt56){ | ||
523 | hdlc->state = HDLC_SEND_FAST_FLAG; | ||
524 | hdlc->data_received = 0; | ||
525 | } else { | ||
526 | hdlc->state = HDLC_SENDFLAG_B0; | ||
527 | hdlc->data_received = 0; | ||
528 | } | ||
529 | // Finished with this frame, send flags | ||
530 | if (dsize > 1) dsize = 1; | ||
531 | } | ||
532 | } | ||
533 | break; | ||
534 | case HDLC_SEND_IDLE1: | ||
535 | hdlc->do_closing = 0; | ||
536 | hdlc->cbin <<= 1; | ||
537 | hdlc->cbin++; | ||
538 | hdlc->data_bits++; | ||
539 | hdlc->bit_shift--; | ||
540 | if(hdlc->bit_shift==0){ | ||
541 | hdlc->state = HDLC_SEND_FAST_IDLE; | ||
542 | hdlc->bit_shift = 0; | ||
543 | } | ||
544 | break; | ||
545 | case HDLC_SEND_FAST_IDLE: | ||
546 | hdlc->do_closing = 0; | ||
547 | hdlc->cbin = 0xff; | ||
548 | hdlc->data_bits = 8; | ||
549 | if(hdlc->bit_shift == 8){ | ||
550 | hdlc->cbin = 0x7e; | ||
551 | hdlc->state = HDLC_SEND_FIRST_FLAG; | ||
552 | } else { | ||
553 | *dst++ = hdlc->cbin; | ||
554 | hdlc->bit_shift = hdlc->data_bits = 0; | ||
555 | len++; | ||
556 | dsize = 0; | ||
557 | } | ||
558 | break; | ||
559 | default: | ||
560 | break; | ||
561 | } | ||
562 | if(hdlc->do_adapt56){ | ||
563 | if(hdlc->data_bits==7){ | ||
564 | hdlc->cbin <<= 1; | ||
565 | hdlc->cbin++; | ||
566 | hdlc->data_bits++; | ||
567 | } | ||
568 | } | ||
569 | if(hdlc->data_bits==8){ | ||
570 | *dst++ = hdlc->cbin; | ||
571 | hdlc->data_bits = 0; | ||
572 | len++; | ||
573 | dsize--; | ||
574 | } | ||
575 | } | ||
576 | *count -= slen; | ||
577 | |||
578 | return len; | ||
579 | } | ||
580 | |||
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 @@ | |||
1 | /* | ||
2 | * Driver for ST5481 USB ISDN modem | ||
3 | * | ||
4 | * Author Frode Isaksen | ||
5 | * Copyright 2001 by Frode Isaksen <fisaksen@bewan.com> | ||
6 | * 2001 by Kai Germaschewski <kai.germaschewski@gmx.de> | ||
7 | * | ||
8 | * This software may be used and distributed according to the terms | ||
9 | * of the GNU General Public License, incorporated herein by reference. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __ST5481_HDLC_H__ | ||
14 | #define __ST5481_HDLC_H__ | ||
15 | |||
16 | struct hdlc_vars { | ||
17 | int bit_shift; | ||
18 | int hdlc_bits1; | ||
19 | int data_bits; | ||
20 | int ffbit_shift; // encoding only | ||
21 | int state; | ||
22 | int dstpos; | ||
23 | |||
24 | int data_received:1; // set if transferring data | ||
25 | int dchannel:1; // set if D channel (send idle instead of flags) | ||
26 | int do_adapt56:1; // set if 56K adaptation | ||
27 | int do_closing:1; // set if in closing phase (need to send CRC + flag | ||
28 | |||
29 | unsigned short crc; | ||
30 | |||
31 | unsigned char cbin; | ||
32 | unsigned char shift_reg; | ||
33 | unsigned char ffvalue; | ||
34 | |||
35 | }; | ||
36 | |||
37 | |||
38 | /* | ||
39 | The return value from hdlc_decode is | ||
40 | the frame length, 0 if no complete frame was decoded, | ||
41 | or a negative error number | ||
42 | */ | ||
43 | |||
44 | #define HDLC_FRAMING_ERROR 1 | ||
45 | #define HDLC_CRC_ERROR 2 | ||
46 | #define HDLC_LENGTH_ERROR 3 | ||
47 | |||
48 | void | ||
49 | hdlc_rcv_init(struct hdlc_vars *hdlc, int do_adapt56); | ||
50 | |||
51 | int | ||
52 | hdlc_decode(struct hdlc_vars *hdlc, const unsigned char *src, int slen,int *count, | ||
53 | unsigned char *dst, int dsize); | ||
54 | |||
55 | void | ||
56 | hdlc_out_init(struct hdlc_vars *hdlc,int is_d_channel,int do_adapt56); | ||
57 | |||
58 | int | ||
59 | hdlc_encode(struct hdlc_vars *hdlc,const unsigned char *src,unsigned short slen,int *count, | ||
60 | unsigned char *dst,int dsize); | ||
61 | |||
62 | #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 @@ | |||
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include "st5481.h" | 16 | #include "st5481.h" |
17 | 17 | ||
18 | static int st5481_isoc_flatten(struct urb *urb); | ||
19 | |||
18 | /* ====================================================================== | 20 | /* ====================================================================== |
19 | * control pipe | 21 | * control pipe |
20 | */ | 22 | */ |
@@ -55,9 +57,9 @@ static void usb_next_ctrl_msg(struct urb *urb, | |||
55 | * Asynchronous endpoint 0 request (async version of usb_control_msg). | 57 | * Asynchronous endpoint 0 request (async version of usb_control_msg). |
56 | * The request will be queued up in a FIFO if the endpoint is busy. | 58 | * The request will be queued up in a FIFO if the endpoint is busy. |
57 | */ | 59 | */ |
58 | void usb_ctrl_msg(struct st5481_adapter *adapter, | 60 | static void usb_ctrl_msg(struct st5481_adapter *adapter, |
59 | u8 request, u8 requesttype, u16 value, u16 index, | 61 | u8 request, u8 requesttype, u16 value, u16 index, |
60 | ctrl_complete_t complete, void *context) | 62 | ctrl_complete_t complete, void *context) |
61 | { | 63 | { |
62 | struct st5481_ctrl *ctrl = &adapter->ctrl; | 64 | struct st5481_ctrl *ctrl = &adapter->ctrl; |
63 | int w_index; | 65 | int w_index; |
@@ -571,7 +573,7 @@ void st5481_release_in(struct st5481_in *in) | |||
571 | * Make the transfer_buffer contiguous by | 573 | * Make the transfer_buffer contiguous by |
572 | * copying from the iso descriptors if necessary. | 574 | * copying from the iso descriptors if necessary. |
573 | */ | 575 | */ |
574 | int st5481_isoc_flatten(struct urb *urb) | 576 | static int st5481_isoc_flatten(struct urb *urb) |
575 | { | 577 | { |
576 | struct usb_iso_packet_descriptor *pipd,*pend; | 578 | struct usb_iso_packet_descriptor *pipd,*pend; |
577 | unsigned char *src,*dst; | 579 | 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[] = | |||
74 | "EV_T202", | 74 | "EV_T202", |
75 | }; | 75 | }; |
76 | 76 | ||
77 | unsigned int | 77 | static unsigned int |
78 | random_ri(void) | 78 | random_ri(void) |
79 | { | 79 | { |
80 | unsigned int x; | 80 | 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 @@ | |||
18 | 18 | ||
19 | extern const char *CardType[]; | 19 | extern const char *CardType[]; |
20 | 20 | ||
21 | const char *TeleInt_revision = "$Revision: 1.16.2.5 $"; | 21 | static const char *TeleInt_revision = "$Revision: 1.16.2.5 $"; |
22 | 22 | ||
23 | #define byteout(addr,val) outb(val,addr) | 23 | #define byteout(addr,val) outb(val,addr) |
24 | #define bytein(addr) inb(addr) | 24 | #define bytein(addr) inb(addr) |
@@ -203,7 +203,7 @@ TeleInt_Timer(struct IsdnCardState *cs) | |||
203 | add_timer(&cs->hw.hfc.timer); | 203 | add_timer(&cs->hw.hfc.timer); |
204 | } | 204 | } |
205 | 205 | ||
206 | void | 206 | static void |
207 | release_io_TeleInt(struct IsdnCardState *cs) | 207 | release_io_TeleInt(struct IsdnCardState *cs) |
208 | { | 208 | { |
209 | del_timer(&cs->hw.hfc.timer); | 209 | 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 @@ | |||
23 | 23 | ||
24 | extern const char *CardType[]; | 24 | extern const char *CardType[]; |
25 | 25 | ||
26 | const char *teles0_revision = "$Revision: 2.15.2.4 $"; | 26 | static const char *teles0_revision = "$Revision: 2.15.2.4 $"; |
27 | 27 | ||
28 | #define TELES_IOMEM_SIZE 0x400 | 28 | #define TELES_IOMEM_SIZE 0x400 |
29 | #define byteout(addr,val) outb(val,addr) | 29 | #define byteout(addr,val) outb(val,addr) |
@@ -183,7 +183,7 @@ teles0_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
183 | return IRQ_HANDLED; | 183 | return IRQ_HANDLED; |
184 | } | 184 | } |
185 | 185 | ||
186 | void | 186 | static void |
187 | release_io_teles0(struct IsdnCardState *cs) | 187 | release_io_teles0(struct IsdnCardState *cs) |
188 | { | 188 | { |
189 | if (cs->hw.teles0.cfg_reg) | 189 | 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 @@ | |||
21 | #include "isdnl1.h" | 21 | #include "isdnl1.h" |
22 | 22 | ||
23 | extern const char *CardType[]; | 23 | extern const char *CardType[]; |
24 | const char *teles3_revision = "$Revision: 2.19.2.4 $"; | 24 | static const char *teles3_revision = "$Revision: 2.19.2.4 $"; |
25 | 25 | ||
26 | #define byteout(addr,val) outb(val,addr) | 26 | #define byteout(addr,val) outb(val,addr) |
27 | #define bytein(addr) inb(addr) | 27 | #define bytein(addr) inb(addr) |
@@ -154,7 +154,7 @@ release_ioregs(struct IsdnCardState *cs, int mask) | |||
154 | release_region(cs->hw.teles3.hscx[1] + 32, 32); | 154 | release_region(cs->hw.teles3.hscx[1] + 32, 32); |
155 | } | 155 | } |
156 | 156 | ||
157 | void | 157 | static void |
158 | release_io_teles3(struct IsdnCardState *cs) | 158 | release_io_teles3(struct IsdnCardState *cs) |
159 | { | 159 | { |
160 | if (cs->typ == ISDN_CTYPE_TELESPCMCIA) { | 160 | if (cs->typ == ISDN_CTYPE_TELESPCMCIA) { |
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 @@ | |||
21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
22 | 22 | ||
23 | extern const char *CardType[]; | 23 | extern const char *CardType[]; |
24 | const char *telespci_revision = "$Revision: 2.23.2.3 $"; | 24 | static const char *telespci_revision = "$Revision: 2.23.2.3 $"; |
25 | 25 | ||
26 | #define ZORAN_PO_RQ_PEN 0x02000000 | 26 | #define ZORAN_PO_RQ_PEN 0x02000000 |
27 | #define ZORAN_PO_WR 0x00800000 | 27 | #define ZORAN_PO_WR 0x00800000 |
@@ -257,7 +257,7 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs) | |||
257 | return IRQ_HANDLED; | 257 | return IRQ_HANDLED; |
258 | } | 258 | } |
259 | 259 | ||
260 | void | 260 | static void |
261 | release_io_telespci(struct IsdnCardState *cs) | 261 | release_io_telespci(struct IsdnCardState *cs) |
262 | { | 262 | { |
263 | iounmap(cs->hw.teles0.membase); | 263 | 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[] = | |||
41 | 41 | ||
42 | extern const char *CardType[]; | 42 | extern const char *CardType[]; |
43 | 43 | ||
44 | const char *w6692_revision = "$Revision: 1.18.2.4 $"; | 44 | static const char *w6692_revision = "$Revision: 1.18.2.4 $"; |
45 | 45 | ||
46 | #define DBUSY_TIMER_VALUE 80 | 46 | #define DBUSY_TIMER_VALUE 80 |
47 | 47 | ||
@@ -880,7 +880,7 @@ setstack_w6692(struct PStack *st, struct BCState *bcs) | |||
880 | return (0); | 880 | return (0); |
881 | } | 881 | } |
882 | 882 | ||
883 | void resetW6692(struct IsdnCardState *cs) | 883 | static void resetW6692(struct IsdnCardState *cs) |
884 | { | 884 | { |
885 | cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST); | 885 | cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST); |
886 | mdelay(10); | 886 | mdelay(10); |
@@ -902,7 +902,7 @@ void resetW6692(struct IsdnCardState *cs) | |||
902 | } | 902 | } |
903 | } | 903 | } |
904 | 904 | ||
905 | void __init initW6692(struct IsdnCardState *cs, int part) | 905 | static void __init initW6692(struct IsdnCardState *cs, int part) |
906 | { | 906 | { |
907 | if (part & 1) { | 907 | if (part & 1) { |
908 | cs->setstack_d = setstack_W6692; | 908 | cs->setstack_d = setstack_W6692; |