[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>

authored by Adrian Bunk and committed by Linus Torvalds 672c3fd9 8b3d4a2a

+263 -1050
+1 -1
drivers/isdn/hisax/Makefile
··· 23 23 # Multipart objects. 24 24 25 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 28 hisax-y := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \ 29 29 lmgr.o q931.o callc.o fsm.o
+4 -4
drivers/isdn/hisax/amd7930_fn.c
··· 97 97 }; 98 98 99 99 100 - void /* macro wWordAMD */ 100 + static void /* macro wWordAMD */ 101 101 WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) 102 102 { 103 103 wByteAMD(cs, 0x00, reg); ··· 105 105 wByteAMD(cs, 0x01, HIBYTE(val)); 106 106 } 107 107 108 - WORD /* macro rWordAMD */ 108 + static WORD /* macro rWordAMD */ 109 109 ReadWordAmd7930(struct IsdnCardState *cs, BYTE reg) 110 110 { 111 111 WORD res; ··· 665 665 } 666 666 } 667 667 668 - void 668 + static void 669 669 setstack_Amd7930(struct PStack *st, struct IsdnCardState *cs) 670 670 { 671 671 ··· 676 676 } 677 677 678 678 679 - void 679 + static void 680 680 DC_Close_Amd7930(struct IsdnCardState *cs) { 681 681 if (cs->debug & L1_DEB_ISAC) 682 682 debugl1(cs, "Amd7930: DC_Close called");
+2 -2
drivers/isdn/hisax/asuscom.c
··· 22 22 23 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 27 #define byteout(addr,val) outb(val,addr) 28 28 #define bytein(addr) inb(addr) ··· 239 239 return IRQ_HANDLED; 240 240 } 241 241 242 - void 242 + static void 243 243 release_io_asuscom(struct IsdnCardState *cs) 244 244 { 245 245 int bytecnt = 8;
+10 -8
drivers/isdn/hisax/avm_pci.c
··· 172 172 return(NULL); 173 173 } 174 174 175 - void 175 + static void 176 176 write_ctrl(struct BCState *bcs, int which) { 177 177 178 178 if (bcs->cs->debug & L1_DEB_HSCX) ··· 193 193 } 194 194 } 195 195 196 - void 196 + static void 197 197 modehdlc(struct BCState *bcs, int mode, int bc) 198 198 { 199 199 struct IsdnCardState *cs = bcs->cs; ··· 451 451 } 452 452 } 453 453 454 - inline void 454 + static inline void 455 455 HDLC_irq_main(struct IsdnCardState *cs) 456 456 { 457 457 u_int stat; ··· 487 487 } 488 488 } 489 489 490 - void 490 + static void 491 491 hdlc_l2l1(struct PStack *st, int pr, void *arg) 492 492 { 493 493 struct BCState *bcs = st->l1.bcs; ··· 547 547 } 548 548 } 549 549 550 - void 550 + static void 551 551 close_hdlcstate(struct BCState *bcs) 552 552 { 553 553 modehdlc(bcs, 0, 0); ··· 570 570 } 571 571 } 572 572 573 - int 573 + static int 574 574 open_hdlcstate(struct IsdnCardState *cs, struct BCState *bcs) 575 575 { 576 576 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { ··· 598 598 return (0); 599 599 } 600 600 601 - int 601 + static int 602 602 setstack_hdlc(struct PStack *st, struct BCState *bcs) 603 603 { 604 604 bcs->channel = st->l1.bc; ··· 612 612 return (0); 613 613 } 614 614 615 + #if 0 615 616 void __init 616 617 clear_pending_hdlc_ints(struct IsdnCardState *cs) 617 618 { ··· 642 641 debugl1(cs, "HDLC 2 VIN %x", val); 643 642 } 644 643 } 644 + #endif /* 0 */ 645 645 646 - void __init 646 + static void __init 647 647 inithdlc(struct IsdnCardState *cs) 648 648 { 649 649 cs->bcs[0].BC_SetStack = setstack_hdlc;
+2 -2
drivers/isdn/hisax/bkm_a4t.c
··· 23 23 24 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 29 static inline u_char ··· 167 167 } 168 168 } 169 169 170 - void 170 + static void 171 171 release_io_bkm(struct IsdnCardState *cs) 172 172 { 173 173 if (cs->hw.ax.base) {
+3 -3
drivers/isdn/hisax/bkm_a8.c
··· 27 27 28 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 32 static const char *sct_quadro_subtypes[] = 33 33 { ··· 193 193 return IRQ_HANDLED; 194 194 } 195 195 196 - void 196 + static void 197 197 release_io_sct_quadro(struct IsdnCardState *cs) 198 198 { 199 199 release_region(cs->hw.ax.base & 0xffffffc0, 128); ··· 261 261 return (0); 262 262 } 263 263 264 - int __init 264 + static int __init 265 265 sct_alloc_io(u_int adr, u_int len) 266 266 { 267 267 if (!request_region(adr, len, "scitel")) {
+3 -3
drivers/isdn/hisax/callc.c
··· 874 874 } 875 875 } 876 876 877 - struct Channel 877 + static struct Channel 878 878 *selectfreechannel(struct PStack *st, int bch) 879 879 { 880 880 struct IsdnCardState *cs = st->l1.hardware; ··· 1429 1429 HiSax_putstatus(chanp->cs, "Ch", "%d CAPIMSG %s", chanp->chan, tmpbuf); 1430 1430 } 1431 1431 1432 - void 1432 + static void 1433 1433 lli_got_fac_req(struct Channel *chanp, capi_msg *cm) { 1434 1434 if ((cm->para[0] != 3) || (cm->para[1] != 0)) 1435 1435 return; ··· 1454 1454 } 1455 1455 } 1456 1456 1457 - void 1457 + static void 1458 1458 lli_got_manufacturer(struct Channel *chanp, struct IsdnCardState *cs, capi_msg *cm) { 1459 1459 if ((cs->typ == ISDN_CTYPE_ELSA) || (cs->typ == ISDN_CTYPE_ELSA_PNP) || 1460 1460 (cs->typ == ISDN_CTYPE_ELSA_PCI)) {
+8 -6
drivers/isdn/hisax/config.c
··· 332 332 #define HISAX_IDSIZE (HISAX_MAX_CARDS*8) 333 333 static char HiSaxID[HISAX_IDSIZE] = { 0, }; 334 334 335 - char *HiSax_id = HiSaxID; 335 + static char *HiSax_id = HiSaxID; 336 336 #ifdef MODULE 337 337 /* Variables for insmod */ 338 338 static int type[HISAX_MAX_CARDS] = { 0, }; ··· 391 391 return rev; 392 392 } 393 393 394 - void __init HiSaxVersion(void) 394 + static void __init HiSaxVersion(void) 395 395 { 396 396 char tmp[64]; 397 397 ··· 608 608 /* 609 609 * Find card with given card number 610 610 */ 611 + #if 0 611 612 struct IsdnCardState *hisax_get_card(int cardnr) 612 613 { 613 614 if ((cardnr <= nrcards) && (cardnr > 0)) ··· 616 615 return cards[cardnr - 1].cs; 617 616 return NULL; 618 617 } 618 + #endif /* 0 */ 619 619 620 - int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) 620 + static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) 621 621 { 622 622 int count, cnt; 623 623 u_char __user *p = buf; ··· 770 768 return 0; 771 769 } 772 770 773 - void ll_stop(struct IsdnCardState *cs) 771 + static void ll_stop(struct IsdnCardState *cs) 774 772 { 775 773 isdn_ctrl ic; 776 774 ··· 1186 1184 return ret; 1187 1185 } 1188 1186 1189 - void HiSax_shiftcards(int idx) 1187 + static void HiSax_shiftcards(int idx) 1190 1188 { 1191 1189 int i; 1192 1190 ··· 1194 1192 memcpy(&cards[i], &cards[i + 1], sizeof(cards[i])); 1195 1193 } 1196 1194 1197 - int HiSax_inithardware(int *busy_flag) 1195 + static int HiSax_inithardware(int *busy_flag) 1198 1196 { 1199 1197 int foundcards = 0; 1200 1198 int i = 0;
+2 -2
drivers/isdn/hisax/diva.c
··· 28 28 29 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 33 #define byteout(addr,val) outb(val,addr) 34 34 #define bytein(addr) inb(addr) ··· 706 706 return IRQ_HANDLED; 707 707 } 708 708 709 - void 709 + static void 710 710 release_io_diva(struct IsdnCardState *cs) 711 711 { 712 712 int bytecnt;
+4 -4
drivers/isdn/hisax/elsa.c
··· 33 33 34 34 extern const char *CardType[]; 35 35 36 - const char *Elsa_revision = "$Revision: 2.32.2.4 $"; 37 - const char *Elsa_Types[] = 36 + static const char *Elsa_revision = "$Revision: 2.32.2.4 $"; 37 + static const char *Elsa_Types[] = 38 38 {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", 39 39 "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI", 40 40 "PCMCIA-IPAC" }; 41 41 42 - const char *ITACVer[] = 42 + static const char *ITACVer[] = 43 43 {"?0?", "?1?", "?2?", "?3?", "?4?", "V2.2", 44 44 "B1", "A1"}; 45 45 ··· 425 425 return IRQ_HANDLED; 426 426 } 427 427 428 - void 428 + static void 429 429 release_io_elsa(struct IsdnCardState *cs) 430 430 { 431 431 int bytecnt = 8;
+10 -10
drivers/isdn/hisax/elsa_ser.c
··· 237 237 #endif 238 238 } 239 239 240 - inline int 240 + static inline int 241 241 write_modem(struct BCState *bcs) { 242 242 int ret=0; 243 243 struct IsdnCardState *cs = bcs->cs; ··· 275 275 return(ret); 276 276 } 277 277 278 - inline void 278 + static inline void 279 279 modem_fill(struct BCState *bcs) { 280 280 281 281 if (bcs->tx_skb) { ··· 422 422 extern void modehscx(struct BCState *bcs, int mode, int bc); 423 423 extern void hscx_l2l1(struct PStack *st, int pr, void *arg); 424 424 425 - void 425 + static void 426 426 close_elsastate(struct BCState *bcs) 427 427 { 428 428 modehscx(bcs, 0, bcs->channel); ··· 442 442 } 443 443 } 444 444 445 - void 445 + static void 446 446 modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) { 447 447 int count, fp; 448 448 u_char *msg = buf; ··· 472 472 } 473 473 } 474 474 475 - void 475 + static void 476 476 modem_set_init(struct IsdnCardState *cs) { 477 477 int timeout; 478 478 ··· 521 521 udelay(RCV_DELAY); 522 522 } 523 523 524 - void 524 + static void 525 525 modem_set_dial(struct IsdnCardState *cs, int outgoing) { 526 526 int timeout; 527 527 #define RCV_DELAY 20000 ··· 543 543 udelay(RCV_DELAY); 544 544 } 545 545 546 - void 546 + static void 547 547 modem_l2l1(struct PStack *st, int pr, void *arg) 548 548 { 549 549 struct BCState *bcs = st->l1.bcs; ··· 579 579 } 580 580 } 581 581 582 - int 582 + static int 583 583 setstack_elsa(struct PStack *st, struct BCState *bcs) 584 584 { 585 585 ··· 614 614 return (0); 615 615 } 616 616 617 - void 617 + static void 618 618 init_modem(struct IsdnCardState *cs) { 619 619 620 620 cs->bcs[0].BC_SetStack = setstack_elsa; ··· 641 641 modem_set_init(cs); 642 642 } 643 643 644 - void 644 + static void 645 645 release_modem(struct IsdnCardState *cs) { 646 646 647 647 cs->hw.elsa.MFlag = 0;
-51
drivers/isdn/hisax/enternow.h
··· 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);
+52 -39
drivers/isdn/hisax/enternow_pci.c
··· 65 65 #include "isac.h" 66 66 #include "isdnl1.h" 67 67 #include "amd7930_fn.h" 68 - #include "enternow.h" 69 68 #include <linux/interrupt.h> 70 69 #include <linux/ppp_defs.h> 71 70 #include <linux/pci.h> ··· 73 74 74 75 75 76 76 - const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; 77 + static const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; 78 + 79 + 80 + /* f�r PowerISDN PCI */ 81 + #define TJ_AMD_IRQ 0x20 82 + #define TJ_LED1 0x40 83 + #define TJ_LED2 0x80 84 + 85 + 86 + /* Das Fenster zum AMD... 87 + * Ab Adresse hw.njet.base + TJ_AMD_PORT werden vom AMD jeweils 8 Bit in 88 + * den TigerJet i/o-Raum gemappt 89 + * -> 0x01 des AMD bei hw.njet.base + 0C4 */ 90 + #define TJ_AMD_PORT 0xC0 91 + 77 92 78 93 79 94 /* *************************** I/O-Interface functions ************************************* */ 80 95 81 96 82 97 /* cs->readisac, macro rByteAMD */ 83 - BYTE 84 - ReadByteAmd7930(struct IsdnCardState *cs, BYTE offset) 98 + static unsigned char 99 + ReadByteAmd7930(struct IsdnCardState *cs, unsigned char offset) 85 100 { 86 101 /* direktes Register */ 87 102 if(offset < 8) 88 - return (InByte(cs->hw.njet.isac + 4*offset)); 103 + return (inb(cs->hw.njet.isac + 4*offset)); 89 104 90 105 /* indirektes Register */ 91 106 else { 92 - OutByte(cs->hw.njet.isac + 4*AMD_CR, offset); 93 - return(InByte(cs->hw.njet.isac + 4*AMD_DR)); 107 + outb(offset, cs->hw.njet.isac + 4*AMD_CR); 108 + return(inb(cs->hw.njet.isac + 4*AMD_DR)); 94 109 } 95 110 } 96 111 97 112 /* cs->writeisac, macro wByteAMD */ 98 - void 99 - WriteByteAmd7930(struct IsdnCardState *cs, BYTE offset, BYTE value) 113 + static void 114 + WriteByteAmd7930(struct IsdnCardState *cs, unsigned char offset, unsigned char value) 100 115 { 101 116 /* direktes Register */ 102 117 if(offset < 8) 103 - OutByte(cs->hw.njet.isac + 4*offset, value); 118 + outb(value, cs->hw.njet.isac + 4*offset); 104 119 105 120 /* indirektes Register */ 106 121 else { 107 - OutByte(cs->hw.njet.isac + 4*AMD_CR, offset); 108 - OutByte(cs->hw.njet.isac + 4*AMD_DR, value); 122 + outb(offset, cs->hw.njet.isac + 4*AMD_CR); 123 + outb(value, cs->hw.njet.isac + 4*AMD_DR); 109 124 } 110 125 } 111 126 112 127 113 - void 114 - enpci_setIrqMask(struct IsdnCardState *cs, BYTE val) { 128 + static void 129 + enpci_setIrqMask(struct IsdnCardState *cs, unsigned char val) { 115 130 if (!val) 116 - OutByte(cs->hw.njet.base+NETJET_IRQMASK1, 0x00); 131 + outb(0x00, cs->hw.njet.base+NETJET_IRQMASK1); 117 132 else 118 - OutByte(cs->hw.njet.base+NETJET_IRQMASK1, TJ_AMD_IRQ); 133 + outb(TJ_AMD_IRQ, cs->hw.njet.base+NETJET_IRQMASK1); 119 134 } 120 135 121 136 122 - static BYTE dummyrr(struct IsdnCardState *cs, int chan, BYTE off) 137 + static unsigned char dummyrr(struct IsdnCardState *cs, int chan, unsigned char off) 123 138 { 124 139 return(5); 125 140 } 126 141 127 - static void dummywr(struct IsdnCardState *cs, int chan, BYTE off, BYTE value) 142 + static void dummywr(struct IsdnCardState *cs, int chan, unsigned char off, unsigned char value) 128 143 { 129 144 130 145 } ··· 155 142 156 143 /* Reset on, (also for AMD) */ 157 144 cs->hw.njet.ctrl_reg = 0x07; 158 - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); 145 + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); 159 146 mdelay(20); 160 147 /* Reset off */ 161 148 cs->hw.njet.ctrl_reg = 0x30; 162 - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); 149 + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); 163 150 /* 20ms delay */ 164 151 mdelay(20); 165 152 cs->hw.njet.auxd = 0; // LED-status 166 153 cs->hw.njet.dmactrl = 0; 167 - OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); 168 - OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); 169 - OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); // LED off 154 + outb(~TJ_AMD_IRQ, cs->hw.njet.base + NETJET_AUXCTRL); 155 + outb(TJ_AMD_IRQ, cs->hw.njet.base + NETJET_IRQMASK1); 156 + outb(cs->hw.njet.auxd, cs->hw.njet.auxa); // LED off 170 157 } 171 158 172 159 ··· 174 161 enpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) 175 162 { 176 163 u_long flags; 177 - BYTE *chan; 164 + unsigned char *chan; 178 165 179 166 if (cs->debug & L1_DEB_ISAC) 180 167 debugl1(cs, "enter:now PCI: card_msg: 0x%04X", mt); ··· 200 187 case MDL_ASSIGN: 201 188 /* TEI assigned, LED1 on */ 202 189 cs->hw.njet.auxd = TJ_AMD_IRQ << 1; 203 - OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); 190 + outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); 204 191 break; 205 192 case MDL_REMOVE: 206 193 /* TEI removed, LEDs off */ 207 194 cs->hw.njet.auxd = 0; 208 - OutByte(cs->hw.njet.base + NETJET_AUXDATA, 0x00); 195 + outb(0x00, cs->hw.njet.base + NETJET_AUXDATA); 209 196 break; 210 197 case MDL_BC_ASSIGN: 211 198 /* activate B-channel */ 212 - chan = (BYTE *)arg; 199 + chan = (unsigned char *)arg; 213 200 214 201 if (cs->debug & L1_DEB_ISAC) 215 202 debugl1(cs, "enter:now PCI: assign phys. BC %d in AMD LMR1", *chan); ··· 217 204 cs->dc.amd7930.ph_command(cs, (cs->dc.amd7930.lmr1 | (*chan + 1)), "MDL_BC_ASSIGN"); 218 205 /* at least one b-channel in use, LED 2 on */ 219 206 cs->hw.njet.auxd |= TJ_AMD_IRQ << 2; 220 - OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); 207 + outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); 221 208 break; 222 209 case MDL_BC_RELEASE: 223 210 /* deactivate B-channel */ 224 - chan = (BYTE *)arg; 211 + chan = (unsigned char *)arg; 225 212 226 213 if (cs->debug & L1_DEB_ISAC) 227 214 debugl1(cs, "enter:now PCI: release phys. BC %d in Amd LMR1", *chan); ··· 230 217 /* no b-channel active -> LED2 off */ 231 218 if (!(cs->dc.amd7930.lmr1 & 3)) { 232 219 cs->hw.njet.auxd &= ~(TJ_AMD_IRQ << 2); 233 - OutByte(cs->hw.njet.base + NETJET_AUXDATA, cs->hw.njet.auxd); 220 + outb(cs->hw.njet.auxd, cs->hw.njet.base + NETJET_AUXDATA); 234 221 } 235 222 break; 236 223 default: ··· 244 231 enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) 245 232 { 246 233 struct IsdnCardState *cs = dev_id; 247 - BYTE s0val, s1val, ir; 234 + unsigned char s0val, s1val, ir; 248 235 u_long flags; 249 236 250 237 spin_lock_irqsave(&cs->lock, flags); 251 - s1val = InByte(cs->hw.njet.base + NETJET_IRQSTAT1); 238 + s1val = inb(cs->hw.njet.base + NETJET_IRQSTAT1); 252 239 253 240 /* AMD threw an interrupt */ 254 241 if (!(s1val & TJ_AMD_IRQ)) { ··· 258 245 s1val = 1; 259 246 } else 260 247 s1val = 0; 261 - s0val = InByte(cs->hw.njet.base + NETJET_IRQSTAT0); 248 + s0val = inb(cs->hw.njet.base + NETJET_IRQSTAT0); 262 249 if ((s0val | s1val)==0) { // shared IRQ 263 250 spin_unlock_irqrestore(&cs->lock, flags); 264 251 return IRQ_NONE; 265 252 } 266 253 if (s0val) 267 - OutByte(cs->hw.njet.base + NETJET_IRQSTAT0, s0val); 254 + outb(s0val, cs->hw.njet.base + NETJET_IRQSTAT0); 268 255 269 256 /* DMA-Interrupt: B-channel-stuff */ 270 257 /* set bits in sval to indicate which page is free */ ··· 355 342 356 343 /* Reset an */ 357 344 cs->hw.njet.ctrl_reg = 0x07; // ge�ndert von 0xff 358 - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); 345 + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); 359 346 /* 20 ms Pause */ 360 347 mdelay(20); 361 348 362 349 cs->hw.njet.ctrl_reg = 0x30; /* Reset Off and status read clear */ 363 - OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); 350 + outb(cs->hw.njet.ctrl_reg, cs->hw.njet.base + NETJET_CTRL); 364 351 mdelay(10); 365 352 366 353 cs->hw.njet.auxd = 0x00; // war 0xc0 367 354 cs->hw.njet.dmactrl = 0; 368 355 369 - OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); 370 - OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); 371 - OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); 356 + outb(~TJ_AMD_IRQ, cs->hw.njet.base + NETJET_AUXCTRL); 357 + outb(TJ_AMD_IRQ, cs->hw.njet.base + NETJET_IRQMASK1); 358 + outb(cs->hw.njet.auxd, cs->hw.njet.auxa); 372 359 373 360 break; 374 361 }
+3 -2
drivers/isdn/hisax/gazel.c
··· 21 21 #include <linux/pci.h> 22 22 23 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 26 #define R647 1 27 27 #define R685 2 ··· 317 317 spin_unlock_irqrestore(&cs->lock, flags); 318 318 return IRQ_HANDLED; 319 319 } 320 - void 320 + 321 + static void 321 322 release_io_gazel(struct IsdnCardState *cs) 322 323 { 323 324 unsigned int i;
+1 -1
drivers/isdn/hisax/hfc4s8s_l1.c
··· 1358 1358 /********************************************/ 1359 1359 /* disable/enable hardware in nt or te mode */ 1360 1360 /********************************************/ 1361 - void 1361 + static void 1362 1362 hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode) 1363 1363 { 1364 1364 u_long flags;
+6 -6
drivers/isdn/hisax/hfc_2bds0.c
··· 345 345 debugl1(cs,"send_data %d blocked", bcs->channel); 346 346 } 347 347 348 - void 348 + static void 349 349 main_rec_2bds0(struct BCState *bcs) 350 350 { 351 351 struct IsdnCardState *cs = bcs->cs; ··· 399 399 return; 400 400 } 401 401 402 - void 402 + static void 403 403 mode_2bs0(struct BCState *bcs, int mode, int bc) 404 404 { 405 405 struct IsdnCardState *cs = bcs->cs; ··· 505 505 } 506 506 } 507 507 508 - void 508 + static void 509 509 close_2bs0(struct BCState *bcs) 510 510 { 511 511 mode_2bs0(bcs, 0, bcs->channel); ··· 534 534 return (0); 535 535 } 536 536 537 - int 537 + static int 538 538 setstack_2b(struct PStack *st, struct BCState *bcs) 539 539 { 540 540 bcs->channel = st->l1.bc; ··· 1004 1004 } 1005 1005 } 1006 1006 1007 - void 1007 + static void 1008 1008 setstack_hfcd(struct PStack *st, struct IsdnCardState *cs) 1009 1009 { 1010 1010 st->l1.l1hw = HFCD_l1hw; ··· 1015 1015 { 1016 1016 } 1017 1017 1018 - unsigned int __init 1018 + static unsigned int __init 1019 1019 *init_send_hfcd(int cnt) 1020 1020 { 1021 1021 int i, *send;
+6 -6
drivers/isdn/hisax/hfc_2bs0.c
··· 52 52 return (to); 53 53 } 54 54 55 - int 55 + static int 56 56 GetFreeFifoBytes(struct BCState *bcs) 57 57 { 58 58 int s; ··· 66 66 return (s); 67 67 } 68 68 69 - int 69 + static int 70 70 ReadZReg(struct BCState *bcs, u_char reg) 71 71 { 72 72 int val; ··· 394 394 return; 395 395 } 396 396 397 - void 397 + static void 398 398 mode_hfc(struct BCState *bcs, int mode, int bc) 399 399 { 400 400 struct IsdnCardState *cs = bcs->cs; ··· 507 507 } 508 508 509 509 510 - void 510 + static void 511 511 close_hfcstate(struct BCState *bcs) 512 512 { 513 513 mode_hfc(bcs, 0, bcs->channel); ··· 537 537 return (0); 538 538 } 539 539 540 - int 540 + static int 541 541 setstack_hfc(struct PStack *st, struct BCState *bcs) 542 542 { 543 543 bcs->channel = st->l1.bc; ··· 551 551 return (0); 552 552 } 553 553 554 - void __init 554 + static void __init 555 555 init_send(struct BCState *bcs) 556 556 { 557 557 int i;
+6 -6
drivers/isdn/hisax/hfc_pci.c
··· 70 70 /******************************************/ 71 71 /* free hardware resources used by driver */ 72 72 /******************************************/ 73 - void 73 + static void 74 74 release_io_hfcpci(struct IsdnCardState *cs) 75 75 { 76 76 printk(KERN_INFO "HiSax: release hfcpci at %p\n", ··· 394 394 /*******************************************************************************/ 395 395 /* check for transparent receive data and read max one threshold size if avail */ 396 396 /*******************************************************************************/ 397 - int 397 + static int 398 398 hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type * bz, u_char * bdata) 399 399 { 400 400 unsigned short *z1r, *z2r; ··· 446 446 /**********************************/ 447 447 /* B-channel main receive routine */ 448 448 /**********************************/ 449 - void 449 + static void 450 450 main_rec_hfcpci(struct BCState *bcs) 451 451 { 452 452 struct IsdnCardState *cs = bcs->cs; ··· 1244 1244 /***********************************************/ 1245 1245 /* called during init setting l1 stack pointer */ 1246 1246 /***********************************************/ 1247 - void 1247 + static void 1248 1248 setstack_hfcpci(struct PStack *st, struct IsdnCardState *cs) 1249 1249 { 1250 1250 st->l1.l1hw = HFCPCI_l1hw; ··· 1268 1268 /***************************************************************/ 1269 1269 /* activate/deactivate hardware for selected channels and mode */ 1270 1270 /***************************************************************/ 1271 - void 1271 + static void 1272 1272 mode_hfcpci(struct BCState *bcs, int mode, int bc) 1273 1273 { 1274 1274 struct IsdnCardState *cs = bcs->cs; ··· 1579 1579 /********************************/ 1580 1580 /* called for card init message */ 1581 1581 /********************************/ 1582 - void __init 1582 + static void __init 1583 1583 inithfcpci(struct IsdnCardState *cs) 1584 1584 { 1585 1585 cs->bcs[0].BC_SetStack = setstack_2b;
-1
drivers/isdn/hisax/hfc_pci.h
··· 232 232 #define Read_hfc(a,b) (*(((u_char *)a->hw.hfcpci.pci_io)+b)) 233 233 234 234 extern void main_irq_hcpci(struct BCState *bcs); 235 - extern void inithfcpci(struct IsdnCardState *cs); 236 235 extern void releasehfcpci(struct IsdnCardState *cs);
+5 -5
drivers/isdn/hisax/hfc_sx.c
··· 308 308 /******************************************/ 309 309 /* free hardware resources used by driver */ 310 310 /******************************************/ 311 - void 311 + static void 312 312 release_io_hfcsx(struct IsdnCardState *cs) 313 313 { 314 314 cs->hw.hfcsx.int_m2 = 0; /* interrupt output off ! */ ··· 472 472 /**********************************/ 473 473 /* B-channel main receive routine */ 474 474 /**********************************/ 475 - void 475 + static void 476 476 main_rec_hfcsx(struct BCState *bcs) 477 477 { 478 478 struct IsdnCardState *cs = bcs->cs; ··· 1003 1003 /***********************************************/ 1004 1004 /* called during init setting l1 stack pointer */ 1005 1005 /***********************************************/ 1006 - void 1006 + static void 1007 1007 setstack_hfcsx(struct PStack *st, struct IsdnCardState *cs) 1008 1008 { 1009 1009 st->l1.l1hw = HFCSX_l1hw; ··· 1027 1027 /***************************************************************/ 1028 1028 /* activate/deactivate hardware for selected channels and mode */ 1029 1029 /***************************************************************/ 1030 - void 1030 + static void 1031 1031 mode_hfcsx(struct BCState *bcs, int mode, int bc) 1032 1032 { 1033 1033 struct IsdnCardState *cs = bcs->cs; ··· 1328 1328 /********************************/ 1329 1329 /* called for card init message */ 1330 1330 /********************************/ 1331 - void __devinit 1331 + static void __devinit 1332 1332 inithfcsx(struct IsdnCardState *cs) 1333 1333 { 1334 1334 cs->setstack_d = setstack_hfcsx;
-1
drivers/isdn/hisax/hfc_sx.h
··· 193 193 }; 194 194 195 195 extern void main_irq_hfcsx(struct BCState *bcs); 196 - extern void inithfcsx(struct IsdnCardState *cs); 197 196 extern void releasehfcsx(struct IsdnCardState *cs);
+3 -3
drivers/isdn/hisax/hfc_usb.c
··· 60 60 #include "hisax_debug.h" 61 61 static u_int debug; 62 62 module_param(debug, uint, 0); 63 - int hfc_debug; 63 + static int hfc_debug; 64 64 #endif 65 65 66 66 ··· 85 85 * VendorID, ProductID, Devicename, LED_SCHEME, 86 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 89 /* CologneChip Eval TA */ 90 90 {0x0959, 0x2bd0, "ISDN USB TA (Cologne Chip HFC-S USB based)", 91 91 LED_OFF, {4, 0, 2, 1} ··· 1137 1137 } 1138 1138 } 1139 1139 1140 - void 1140 + static void 1141 1141 hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) 1142 1142 { 1143 1143 usb_fifo *fifo = my_hisax_if->priv;
+2 -2
drivers/isdn/hisax/hfc_usb.h
··· 168 168 * 3 entries are the configuration number, the minimum interval for 169 169 * Interrupt endpoints & boolean if E-channel logging possible 170 170 */ 171 - int validconf[][19] = { 171 + static int validconf[][19] = { 172 172 // INT in, ISO out config 173 173 {EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NOP, EP_INT, 174 174 EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_ISO, EP_NUL, EP_NUL, EP_NUL, ··· 187 187 }; 188 188 189 189 // string description of chosen config 190 - char *conf_str[] = { 190 + static char *conf_str[] = { 191 191 "4 Interrupt IN + 3 Isochron OUT", 192 192 "3 Interrupt IN + 3 Isochron OUT", 193 193 "4 Isochron IN + 3 Isochron OUT",
+1 -1
drivers/isdn/hisax/hfcscard.c
··· 52 52 */ 53 53 } 54 54 55 - void 55 + static void 56 56 release_io_hfcs(struct IsdnCardState *cs) 57 57 { 58 58 release2bds0(cs);
-5
drivers/isdn/hisax/hisax.h
··· 1271 1271 void init_bcstate(struct IsdnCardState *cs, int bc); 1272 1272 1273 1273 void setstack_HiSax(struct PStack *st, struct IsdnCardState *cs); 1274 - unsigned int random_ri(void); 1275 1274 void HiSax_addlist(struct IsdnCardState *sp, struct PStack *st); 1276 1275 void HiSax_rmlist(struct IsdnCardState *sp, struct PStack *st); 1277 1276 ··· 1314 1315 void LogFrame(struct IsdnCardState *cs, u_char * p, int size); 1315 1316 void dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir); 1316 1317 void iecpy(u_char * dest, u_char * iestart, int ieoffset); 1317 - #ifdef ISDN_CHIP_ISAC 1318 - void setstack_isac(struct PStack *st, struct IsdnCardState *cs); 1319 - #endif /* ISDN_CHIP_ISAC */ 1320 1318 #endif /* __KERNEL__ */ 1321 1319 1322 1320 #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);} 1323 1321 1324 1322 int ll_run(struct IsdnCardState *cs, int addfeatures); 1325 - void ll_stop(struct IsdnCardState *cs); 1326 1323 int CallcNew(void); 1327 1324 void CallcFree(void); 1328 1325 int CallcNewChan(struct IsdnCardState *cs);
+2 -2
drivers/isdn/hisax/hscx.c
··· 151 151 } 152 152 } 153 153 154 - void 154 + static void 155 155 close_hscxstate(struct BCState *bcs) 156 156 { 157 157 modehscx(bcs, 0, bcs->channel); ··· 203 203 return (0); 204 204 } 205 205 206 - int 206 + static int 207 207 setstack_hscx(struct PStack *st, struct BCState *bcs) 208 208 { 209 209 bcs->channel = st->l1.bc;
+3 -3
drivers/isdn/hisax/icc.c
··· 108 108 #endif 109 109 } 110 110 111 - void 111 + static void 112 112 icc_empty_fifo(struct IsdnCardState *cs, int count) 113 113 { 114 114 u_char *ptr; ··· 563 563 } 564 564 } 565 565 566 - void 566 + static void 567 567 setstack_icc(struct PStack *st, struct IsdnCardState *cs) 568 568 { 569 569 st->l1.l1hw = ICC_l1hw; 570 570 } 571 571 572 - void 572 + static void 573 573 DC_Close_icc(struct IsdnCardState *cs) { 574 574 if (cs->dc.icc.mon_rx) { 575 575 kfree(cs->dc.icc.mon_rx);
-86
drivers/isdn/hisax/ipacx.c
··· 36 36 static inline void cic_int(struct IsdnCardState *cs); 37 37 static void dch_l2l1(struct PStack *st, int pr, void *arg); 38 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 39 static void dch_empty_fifo(struct IsdnCardState *cs, int count); 42 40 static void dch_fill_fifo(struct IsdnCardState *cs); 43 41 static inline void dch_int(struct IsdnCardState *cs); ··· 227 229 cs->writeisac(cs, IPACX_CMDRD, 0x01); // Tx reset, generates XPR 228 230 } 229 231 } 230 - } 231 - 232 - //---------------------------------------------------------- 233 - // L1 state machine intermediate layer to isdnl1 module 234 - //---------------------------------------------------------- 235 - static void 236 - ipacx_new_ph(struct IsdnCardState *cs) 237 - { 238 - switch (cs->dc.isac.ph_state) { 239 - case (IPACX_IND_RES): 240 - ph_command(cs, IPACX_CMD_DI); 241 - l1_msg(cs, HW_RESET | INDICATION, NULL); 242 - break; 243 - 244 - case (IPACX_IND_DC): 245 - l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL); 246 - break; 247 - 248 - case (IPACX_IND_DR): 249 - l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL); 250 - break; 251 - 252 - case (IPACX_IND_PU): 253 - l1_msg(cs, HW_POWERUP | CONFIRM, NULL); 254 - break; 255 - 256 - case (IPACX_IND_RSY): 257 - l1_msg(cs, HW_RSYNC | INDICATION, NULL); 258 - break; 259 - 260 - case (IPACX_IND_AR): 261 - l1_msg(cs, HW_INFO2 | INDICATION, NULL); 262 - break; 263 - 264 - case (IPACX_IND_AI8): 265 - l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); 266 - break; 267 - 268 - case (IPACX_IND_AI10): 269 - l1_msg(cs, HW_INFO4_P10 | INDICATION, NULL); 270 - break; 271 - 272 - default: 273 - break; 274 - } 275 - } 276 - 277 - //---------------------------------------------------------- 278 - // bottom half handler for D channel 279 - //---------------------------------------------------------- 280 - static void 281 - dch_bh(struct IsdnCardState *cs) 282 - { 283 - struct PStack *st; 284 - 285 - if (!cs) return; 286 - 287 - if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { 288 - if (cs->debug) debugl1(cs, "D-Channel Busy cleared"); 289 - for (st = cs->stlist; st; st = st->next) { 290 - st->l1.l1l2(st, PH_PAUSE | CONFIRM, NULL); 291 - } 292 - } 293 - 294 - if (test_and_clear_bit(D_RCVBUFREADY, &cs->event)) { 295 - DChannel_proc_rcv(cs); 296 - } 297 - 298 - if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) { 299 - DChannel_proc_xmt(cs); 300 - } 301 - 302 - if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { 303 - ipacx_new_ph(cs); 304 - } 305 232 } 306 233 307 234 //---------------------------------------------------------- ··· 914 991 } 915 992 } 916 993 917 - 918 - void __devinit 919 - setup_ipacx(struct IsdnCardState *cs) 920 - { 921 - INIT_WORK(&cs->tqueue, (void *)(void *) dch_bh, cs); 922 - cs->dbusytimer.function = (void *) dbusy_timer_handler; 923 - cs->dbusytimer.data = (long) cs; 924 - init_timer(&cs->dbusytimer); 925 - } 926 994 //----------------- end of file ----------------------- 927 995
+3 -3
drivers/isdn/hisax/isac.c
··· 112 112 #endif 113 113 } 114 114 115 - void 115 + static void 116 116 isac_empty_fifo(struct IsdnCardState *cs, int count) 117 117 { 118 118 u_char *ptr; ··· 563 563 } 564 564 } 565 565 566 - void 566 + static void 567 567 setstack_isac(struct PStack *st, struct IsdnCardState *cs) 568 568 { 569 569 st->l1.l1hw = ISAC_l1hw; 570 570 } 571 571 572 - void 572 + static void 573 573 DC_Close_isac(struct IsdnCardState *cs) { 574 574 if (cs->dc.isac.mon_rx) { 575 575 kfree(cs->dc.isac.mon_rx);
+24 -22
drivers/isdn/hisax/isar.c
··· 21 21 #define ETX 0x03 22 22 23 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 25 static u_int modmask = 0x1fff; 26 26 static int frm_extra_delay = 2; 27 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 31 static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para); 32 32 static void ll_deliver_faxstat(struct BCState *bcs, u_char status); 33 33 ··· 45 45 } 46 46 47 47 48 - int 48 + static int 49 49 sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, 50 50 u_char *msg) 51 51 { ··· 85 85 } 86 86 87 87 /* Call only with IRQ disabled !!! */ 88 - inline void 88 + static inline void 89 89 rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) 90 90 { 91 91 int i; ··· 114 114 } 115 115 116 116 /* Call only with IRQ disabled !!! */ 117 - inline void 117 + static inline void 118 118 get_irq_infos(struct IsdnCardState *cs, struct isar_reg *ireg) 119 119 { 120 120 ireg->iis = cs->BC_Read_Reg(cs, 1, ISAR_IIS); ··· 127 127 #endif 128 128 } 129 129 130 - int 130 + static int 131 131 waitrecmsg(struct IsdnCardState *cs, u_char *len, 132 132 u_char *msg, int maxdelay) 133 133 { ··· 185 185 return(ver); 186 186 } 187 187 188 - int 188 + static int 189 189 isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) 190 190 { 191 191 int ret, size, cnt, debug; ··· 739 739 } 740 740 } 741 741 742 - inline 742 + static inline 743 743 struct BCState *sel_bcs_isar(struct IsdnCardState *cs, u_char dpath) 744 744 { 745 745 if ((!dpath) || (dpath == 3)) ··· 751 751 return(NULL); 752 752 } 753 753 754 - void 754 + static void 755 755 send_frames(struct BCState *bcs) 756 756 { 757 757 if (bcs->tx_skb) { ··· 806 806 } 807 807 } 808 808 809 - inline void 809 + static inline void 810 810 check_send(struct IsdnCardState *cs, u_char rdm) 811 811 { 812 812 struct BCState *bcs; ··· 828 828 829 829 } 830 830 831 - const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4", 832 - "300", "600", "1200", "2400", "4800", "7200", 833 - "9600nt", "9600t", "12000", "14400", "WRONG"}; 834 - const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", 835 - "Bell103", "V23", "Bell202", "V17", "V29", "V27ter"}; 831 + static const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", 832 + "NODEF4", "300", "600", "1200", "2400", 833 + "4800", "7200", "9600nt", "9600t", "12000", 834 + "14400", "WRONG"}; 835 + static const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", 836 + "Bell103", "V23", "Bell202", "V17", "V29", 837 + "V27ter"}; 836 838 837 839 static void 838 840 isar_pump_status_rsp(struct BCState *bcs, struct isar_reg *ireg) { ··· 1390 1388 udelay(1000); 1391 1389 } 1392 1390 1393 - int 1391 + static int 1394 1392 modeisar(struct BCState *bcs, int mode, int bc) 1395 1393 { 1396 1394 struct IsdnCardState *cs = bcs->cs; ··· 1564 1562 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1); 1565 1563 } 1566 1564 1567 - void 1565 + static void 1568 1566 isar_setup(struct IsdnCardState *cs) 1569 1567 { 1570 1568 u_char msg; ··· 1584 1582 } 1585 1583 } 1586 1584 1587 - void 1585 + static void 1588 1586 isar_l2l1(struct PStack *st, int pr, void *arg) 1589 1587 { 1590 1588 struct BCState *bcs = st->l1.bcs; ··· 1683 1681 } 1684 1682 } 1685 1683 1686 - void 1684 + static void 1687 1685 close_isarstate(struct BCState *bcs) 1688 1686 { 1689 1687 modeisar(bcs, 0, bcs->channel); ··· 1705 1703 del_timer(&bcs->hw.isar.ftimer); 1706 1704 } 1707 1705 1708 - int 1706 + static int 1709 1707 open_isarstate(struct IsdnCardState *cs, struct BCState *bcs) 1710 1708 { 1711 1709 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { ··· 1727 1725 return (0); 1728 1726 } 1729 1727 1730 - int 1728 + static int 1731 1729 setstack_isar(struct PStack *st, struct BCState *bcs) 1732 1730 { 1733 1731 bcs->channel = st->l1.bc;
+4 -4
drivers/isdn/hisax/isdnl1.c
··· 151 151 va_end(args); 152 152 } 153 153 154 - void 154 + static void 155 155 L1activated(struct IsdnCardState *cs) 156 156 { 157 157 struct PStack *st; ··· 166 166 } 167 167 } 168 168 169 - void 169 + static void 170 170 L1deactivated(struct IsdnCardState *cs) 171 171 { 172 172 struct PStack *st; ··· 370 370 371 371 #ifdef L2FRAME_DEBUG /* psa */ 372 372 373 - char * 373 + static char * 374 374 l2cmd(u_char cmd) 375 375 { 376 376 switch (cmd & ~0x10) { ··· 404 404 405 405 static char tmpdeb[32]; 406 406 407 - char * 407 + static char * 408 408 l2frames(u_char * ptr) 409 409 { 410 410 switch (ptr[2] & ~0x10) {
+42 -58
drivers/isdn/hisax/isdnl2.c
··· 142 142 return cnt; 143 143 } 144 144 145 - inline void 145 + static inline void 146 146 freewin(struct PStack *st) 147 147 { 148 148 freewin1(&st->l2); ··· 157 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 161 cansend(struct PStack *st) 162 162 { 163 163 unsigned int p1; ··· 169 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 173 clear_exception(struct Layer2 *l2) 174 174 { 175 175 test_and_clear_bit(FLG_ACK_PEND, &l2->flag); ··· 178 178 clear_peer_busy(l2); 179 179 } 180 180 181 - inline int 181 + static inline int 182 182 l2headersize(struct Layer2 *l2, int ui) 183 183 { 184 184 return (((test_bit(FLG_MOD128, &l2->flag) && (!ui)) ? 2 : 1) + ··· 223 223 224 224 #define enqueue_ui(a, b) enqueue_super(a, b) 225 225 226 - inline int 226 + static inline int 227 227 IsUI(u_char * data) 228 228 { 229 229 return ((data[0] & 0xef) == UI); 230 230 } 231 231 232 - inline int 232 + static inline int 233 233 IsUA(u_char * data) 234 234 { 235 235 return ((data[0] & 0xef) == UA); 236 236 } 237 237 238 - inline int 238 + static inline int 239 239 IsDM(u_char * data) 240 240 { 241 241 return ((data[0] & 0xef) == DM); 242 242 } 243 243 244 - inline int 244 + static inline int 245 245 IsDISC(u_char * data) 246 246 { 247 247 return ((data[0] & 0xef) == DISC); 248 248 } 249 249 250 - 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 250 + static inline int 260 251 IsSFrame(u_char * data, struct PStack *st) 261 252 { 262 253 register u_char d = *data; ··· 257 266 return(((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c)); 258 267 } 259 268 260 - inline int 269 + static inline int 261 270 IsSABME(u_char * data, struct PStack *st) 262 271 { 263 272 u_char d = data[0] & ~0x10; ··· 265 274 return (test_bit(FLG_MOD128, &st->l2.flag) ? d == SABME : d == SABM); 266 275 } 267 276 268 - inline int 277 + static inline int 269 278 IsREJ(u_char * data, struct PStack *st) 270 279 { 271 280 return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == REJ : (data[0] & 0xf) == REJ); 272 281 } 273 282 274 - inline int 283 + static inline int 275 284 IsFRMR(u_char * data) 276 285 { 277 286 return ((data[0] & 0xef) == FRMR); 278 287 } 279 288 280 - inline int 289 + static inline int 281 290 IsRNR(u_char * data, struct PStack *st) 282 291 { 283 292 return (test_bit(FLG_MOD128, &st->l2.flag) ? data[0] == RNR : (data[0] & 0xf) == RNR); 284 293 } 285 294 286 - int 295 + static int 287 296 iframe_error(struct PStack *st, struct sk_buff *skb) 288 297 { 289 298 int i = l2addrsize(&st->l2) + (test_bit(FLG_MOD128, &st->l2.flag) ? 2 : 1); ··· 306 315 return 0; 307 316 } 308 317 309 - int 318 + static int 310 319 super_error(struct PStack *st, struct sk_buff *skb) 311 320 { 312 321 if (skb->len != l2addrsize(&st->l2) + ··· 316 325 return 0; 317 326 } 318 327 319 - int 328 + static int 320 329 unnum_error(struct PStack *st, struct sk_buff *skb, int wantrsp) 321 330 { 322 331 int rsp = (*skb->data & 0x2) >> 1; ··· 332 341 return 0; 333 342 } 334 343 335 - int 344 + static int 336 345 UI_error(struct PStack *st, struct sk_buff *skb) 337 346 { 338 347 int rsp = *skb->data & 0x2; ··· 348 357 return 0; 349 358 } 350 359 351 - int 360 + static int 352 361 FRMR_error(struct PStack *st, struct sk_buff *skb) 353 362 { 354 363 int headers = l2addrsize(&st->l2) + 1; ··· 435 444 enqueue_super(st, skb); 436 445 } 437 446 438 - inline u_char 447 + static inline u_char 439 448 get_PollFlag(struct PStack * st, struct sk_buff * skb) 440 449 { 441 450 return (skb->data[l2addrsize(&(st->l2))] & 0x10); 442 451 } 443 452 444 - inline void 445 - FreeSkb(struct sk_buff *skb) 446 - { 447 - dev_kfree_skb(skb); 448 - } 449 - 450 - 451 - inline u_char 453 + static inline u_char 452 454 get_PollFlagFree(struct PStack *st, struct sk_buff *skb) 453 455 { 454 456 u_char PF; 455 457 456 458 PF = get_PollFlag(st, skb); 457 - FreeSkb(skb); 459 + dev_kfree_skb(skb); 458 460 return (PF); 459 461 } 460 462 461 - inline void 463 + static inline void 462 464 start_t200(struct PStack *st, int i) 463 465 { 464 466 FsmAddTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); 465 467 test_and_set_bit(FLG_T200_RUN, &st->l2.flag); 466 468 } 467 469 468 - inline void 470 + static inline void 469 471 restart_t200(struct PStack *st, int i) 470 472 { 471 473 FsmRestartTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, i); 472 474 test_and_set_bit(FLG_T200_RUN, &st->l2.flag); 473 475 } 474 476 475 - inline void 477 + static inline void 476 478 stop_t200(struct PStack *st, int i) 477 479 { 478 480 if(test_and_clear_bit(FLG_T200_RUN, &st->l2.flag)) 479 481 FsmDelTimer(&st->l2.t200, i); 480 482 } 481 483 482 - inline void 484 + static inline void 483 485 st5_dl_release_l2l3(struct PStack *st) 484 486 { 485 487 int pr; ··· 485 501 st->l2.l2l3(st, pr, NULL); 486 502 } 487 503 488 - inline void 504 + static inline void 489 505 lapb_dl_release_l2l3(struct PStack *st, int f) 490 506 { 491 507 if (test_bit(FLG_LAPB, &st->l2.flag)) ··· 786 802 l2_mdl_error_ua(fi, event, arg); 787 803 return; 788 804 } 789 - FreeSkb(skb); 805 + dev_kfree_skb(skb); 790 806 791 807 if (test_and_clear_bit(FLG_PEND_REL, &st->l2.flag)) 792 808 l2_disconnect(fi, event, arg); ··· 824 840 l2_mdl_error_ua(fi, event, arg); 825 841 return; 826 842 } 827 - FreeSkb(skb); 843 + dev_kfree_skb(skb); 828 844 829 845 stop_t200(st, 6); 830 846 lapb_dl_release_l2l3(st, CONFIRM); ··· 873 889 } 874 890 } 875 891 876 - inline void 892 + static inline void 877 893 enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) 878 894 { 879 895 struct sk_buff *skb; ··· 896 912 enqueue_super(st, skb); 897 913 } 898 914 899 - inline void 915 + static inline void 900 916 enquiry_response(struct PStack *st) 901 917 { 902 918 if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) ··· 906 922 test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); 907 923 } 908 924 909 - inline void 925 + static inline void 910 926 transmit_enquiry(struct PStack *st) 911 927 { 912 928 if (test_bit(FLG_OWN_BUSY, &st->l2.flag)) ··· 988 1004 PollFlag = (skb->data[0] & 0x10); 989 1005 nr = (skb->data[0] >> 5) & 0x7; 990 1006 } 991 - FreeSkb(skb); 1007 + dev_kfree_skb(skb); 992 1008 993 1009 if (PollFlag) { 994 1010 if (rsp) ··· 1031 1047 if (!test_bit(FLG_L3_INIT, &st->l2.flag)) 1032 1048 skb_queue_tail(&st->l2.i_queue, skb); 1033 1049 else 1034 - FreeSkb(skb); 1050 + dev_kfree_skb(skb); 1035 1051 } 1036 1052 1037 1053 static void ··· 1077 1093 nr = (skb->data[i] >> 5) & 0x7; 1078 1094 } 1079 1095 if (test_bit(FLG_OWN_BUSY, &l2->flag)) { 1080 - FreeSkb(skb); 1096 + dev_kfree_skb(skb); 1081 1097 if(PollFlag) enquiry_response(st); 1082 1098 } else if (l2->vr == ns) { 1083 1099 (l2->vr)++; ··· 1095 1111 st->l2.l2l3(st, DL_DATA | INDICATION, skb); 1096 1112 } else { 1097 1113 /* n(s)!=v(r) */ 1098 - FreeSkb(skb); 1114 + dev_kfree_skb(skb); 1099 1115 if (test_and_set_bit(FLG_REJEXC, &l2->flag)) { 1100 1116 if (PollFlag) 1101 1117 enquiry_response(st); ··· 1293 1309 skb = alloc_skb(oskb->len + i, GFP_ATOMIC); 1294 1310 memcpy(skb_put(skb, i), header, i); 1295 1311 memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len); 1296 - FreeSkb(oskb); 1312 + dev_kfree_skb(oskb); 1297 1313 } 1298 1314 st->l2.l2l1(st, PH_PULL | INDICATION, skb); 1299 1315 test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); ··· 1333 1349 PollFlag = (skb->data[0] & 0x10); 1334 1350 nr = (skb->data[0] >> 5) & 0x7; 1335 1351 } 1336 - FreeSkb(skb); 1352 + dev_kfree_skb(skb); 1337 1353 1338 1354 if (rsp && PollFlag) { 1339 1355 if (legalnr(st, nr)) { ··· 1375 1391 establishlink(fi); 1376 1392 test_and_clear_bit(FLG_L3_INIT, &st->l2.flag); 1377 1393 } 1378 - FreeSkb(skb); 1394 + dev_kfree_skb(skb); 1379 1395 } 1380 1396 1381 1397 static void ··· 1639 1655 datap += len; 1640 1656 else { 1641 1657 FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'N'); 1642 - FreeSkb(skb); 1658 + dev_kfree_skb(skb); 1643 1659 return; 1644 1660 } 1645 1661 if (!(*datap & 1)) { /* I-Frame */ ··· 1668 1684 ret = FsmEvent(&st->l2.l2m, EV_L2_FRMR, skb); 1669 1685 } else { 1670 1686 FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) 'L'); 1671 - FreeSkb(skb); 1687 + dev_kfree_skb(skb); 1672 1688 ret = 0; 1673 1689 } 1674 1690 if(c) { 1675 - FreeSkb(skb); 1691 + dev_kfree_skb(skb); 1676 1692 FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *)(long)c); 1677 1693 ret = 0; 1678 1694 } 1679 1695 if (ret) 1680 - FreeSkb(skb); 1696 + dev_kfree_skb(skb); 1681 1697 break; 1682 1698 case (PH_PULL | CONFIRM): 1683 1699 FsmEvent(&st->l2.l2m, EV_L2_ACK_PULL, arg);
+1 -1
drivers/isdn/hisax/isdnl3.c
··· 390 390 } 391 391 } 392 392 393 - void 393 + static void 394 394 isdnl3_trans(struct PStack *st, int pr, void *arg) { 395 395 st->l3.l3l2(st, pr, arg); 396 396 }
+1 -1
drivers/isdn/hisax/isurf.c
··· 122 122 return IRQ_HANDLED; 123 123 } 124 124 125 - void 125 + static void 126 126 release_io_isurf(struct IsdnCardState *cs) 127 127 { 128 128 release_region(cs->hw.isurf.reset, 1);
+2 -2
drivers/isdn/hisax/ix1_micro.c
··· 25 25 #include "isdnl1.h" 26 26 27 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 30 #define byteout(addr,val) outb(val,addr) 31 31 #define bytein(addr) inb(addr) ··· 162 162 return IRQ_HANDLED; 163 163 } 164 164 165 - void 165 + static void 166 166 release_io_ix1micro(struct IsdnCardState *cs) 167 167 { 168 168 if (cs->hw.ix1.cfg_reg)
+3 -3
drivers/isdn/hisax/jade.c
··· 74 74 75 75 76 76 77 - void 77 + static void 78 78 modejade(struct BCState *bcs, int mode, int bc) 79 79 { 80 80 struct IsdnCardState *cs = bcs->cs; ··· 190 190 } 191 191 } 192 192 193 - void 193 + static void 194 194 close_jadestate(struct BCState *bcs) 195 195 { 196 196 modejade(bcs, 0, bcs->channel); ··· 243 243 } 244 244 245 245 246 - int 246 + static int 247 247 setstack_jade(struct PStack *st, struct BCState *bcs) 248 248 { 249 249 bcs->channel = st->l1.bc;
-1
drivers/isdn/hisax/jade.h
··· 128 128 #define jade_TXAUDIOCH2CFG 0x1A 129 129 130 130 extern int JadeVersion(struct IsdnCardState *cs, char *s); 131 - extern void modejade(struct BCState *bcs, int mode, int bc); 132 131 extern void clear_pending_jade_ints(struct IsdnCardState *cs); 133 132 extern void initjade(struct IsdnCardState *cs); 134 133
+1 -1
drivers/isdn/hisax/l3_1tr6.c
··· 19 19 #include <linux/ctype.h> 20 20 21 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 24 #define MsgHead(ptr, cref, mty, dis) \ 25 25 *ptr++ = dis; \
+1 -1
drivers/isdn/hisax/l3dss1.c
··· 26 26 #include <linux/config.h> 27 27 28 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 31 #define EXT_BEARER_CAPS 1 32 32
+2 -2
drivers/isdn/hisax/l3ni1.c
··· 24 24 #include <linux/ctype.h> 25 25 26 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 29 #define EXT_BEARER_CAPS 1 30 30 ··· 2665 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 2670 struct sk_buff *skb = arg; 2671 2671
+2 -2
drivers/isdn/hisax/mic.c
··· 18 18 19 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 23 #define byteout(addr,val) outb(val,addr) 24 24 #define bytein(addr) inb(addr) ··· 157 157 return IRQ_HANDLED; 158 158 } 159 159 160 - void 160 + static void 161 161 release_io_mic(struct IsdnCardState *cs) 162 162 { 163 163 int bytecnt = 8;
+5 -7
drivers/isdn/hisax/netjet.c
··· 25 25 #include <asm/io.h> 26 26 #include "netjet.h" 27 27 28 - const char *NETjet_revision = "$Revision: 1.29.2.4 $"; 29 - 30 28 /* Interface functions */ 31 29 32 30 u_char ··· 64 66 outsb(cs->hw.njet.isac, data, size); 65 67 } 66 68 67 - void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) 69 + static void fill_mem(struct BCState *bcs, u_int *pos, u_int cnt, int chan, u_char fill) 68 70 { 69 71 u_int mask=0x000000ff, val = 0, *p=pos; 70 72 u_int i; ··· 83 85 } 84 86 } 85 87 86 - void 88 + static void 87 89 mode_tiger(struct BCState *bcs, int mode, int bc) 88 90 { 89 91 struct IsdnCardState *cs = bcs->cs; ··· 850 852 } 851 853 852 854 853 - void 855 + static void 854 856 close_tigerstate(struct BCState *bcs) 855 857 { 856 858 mode_tiger(bcs, 0, bcs->channel); ··· 898 900 return (0); 899 901 } 900 902 901 - int 903 + static int 902 904 setstack_tiger(struct PStack *st, struct BCState *bcs) 903 905 { 904 906 bcs->channel = st->l1.bc; ··· 964 966 cs->bcs[1].BC_Close = close_tigerstate; 965 967 } 966 968 967 - void 969 + static void 968 970 releasetiger(struct IsdnCardState *cs) 969 971 { 970 972 if (cs->bcs[0].hw.tiger.send) {
+2 -2
drivers/isdn/hisax/niccy.c
··· 24 24 #include <linux/isapnp.h> 25 25 26 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 29 #define byteout(addr,val) outb(val,addr) 30 30 #define bytein(addr) inb(addr) ··· 178 178 return IRQ_HANDLED; 179 179 } 180 180 181 - void 181 + static void 182 182 release_io_niccy(struct IsdnCardState *cs) 183 183 { 184 184 if (cs->subtyp == NICCY_PCI) {
+1 -1
drivers/isdn/hisax/nj_s.c
··· 15 15 #include <linux/ppp_defs.h> 16 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 20 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) 21 21 {
+1 -1
drivers/isdn/hisax/nj_u.c
··· 15 15 #include <linux/ppp_defs.h> 16 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 20 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) 21 21 {
+2 -2
drivers/isdn/hisax/q931.c
··· 516 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 521 static int 522 522 prcause_1tr6(char *dest, u_char * p) ··· 935 935 return (dp - dest); 936 936 } 937 937 938 - int 938 + static int 939 939 prfacility(char *dest, u_char * p) 940 940 { 941 941 char *dp = dest;
+2 -2
drivers/isdn/hisax/s0box.c
··· 17 17 #include "isdnl1.h" 18 18 19 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 22 static inline void 23 23 writereg(unsigned int padr, signed int addr, u_char off, u_char val) { ··· 183 183 return IRQ_HANDLED; 184 184 } 185 185 186 - void 186 + static void 187 187 release_io_s0box(struct IsdnCardState *cs) 188 188 { 189 189 release_region(cs->hw.teles3.cfg_reg, 8);
+1 -1
drivers/isdn/hisax/saphir.c
··· 171 171 mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); 172 172 } 173 173 174 - void 174 + static void 175 175 release_io_saphir(struct IsdnCardState *cs) 176 176 { 177 177 byteout(cs->hw.saphir.cfg_reg + IRQ_REG, 0xff);
+3 -3
drivers/isdn/hisax/sedlbauer.c
··· 51 51 52 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 57 {"None", "speed card/win", "speed star", "speed fax+", 58 58 "speed win II / ISDN PC/104", "speed star II", "speed pci", 59 59 "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"}; ··· 394 394 return IRQ_HANDLED; 395 395 } 396 396 397 - void 397 + static void 398 398 release_io_sedlbauer(struct IsdnCardState *cs) 399 399 { 400 400 int bytecnt = 8;
+3 -3
drivers/isdn/hisax/sportster.c
··· 19 19 #include "isdnl1.h" 20 20 21 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 24 #define byteout(addr,val) outb(val,addr) 25 25 #define bytein(addr) inb(addr) ··· 132 132 return IRQ_HANDLED; 133 133 } 134 134 135 - void 135 + static void 136 136 release_io_sportster(struct IsdnCardState *cs) 137 137 { 138 138 int i, adr; ··· 144 144 } 145 145 } 146 146 147 - void 147 + static void 148 148 reset_sportster(struct IsdnCardState *cs) 149 149 { 150 150 cs->hw.spt.res_irq |= SPORTSTER_RESET; /* Reset On */
-4
drivers/isdn/hisax/st5481.h
··· 450 450 usb_complete_t complete, void *context); 451 451 void st5481_release_isocpipes(struct urb* urb[2]); 452 452 453 - int st5481_isoc_flatten(struct urb *urb); 454 453 void st5481_usb_pipe_reset(struct st5481_adapter *adapter, 455 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 455 void st5481_usb_device_ctrl_msg(struct st5481_adapter *adapter, 460 456 u8 request, u16 value, 461 457 ctrl_complete_t complete, void *context);
-580
drivers/isdn/hisax/st5481_hdlc.c
··· 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 -
-62
drivers/isdn/hisax/st5481_hdlc.h
··· 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
+6 -4
drivers/isdn/hisax/st5481_usb.c
··· 15 15 #include <linux/slab.h> 16 16 #include "st5481.h" 17 17 18 + static int st5481_isoc_flatten(struct urb *urb); 19 + 18 20 /* ====================================================================== 19 21 * control pipe 20 22 */ ··· 57 55 * Asynchronous endpoint 0 request (async version of usb_control_msg). 58 56 * The request will be queued up in a FIFO if the endpoint is busy. 59 57 */ 60 - void usb_ctrl_msg(struct st5481_adapter *adapter, 61 - u8 request, u8 requesttype, u16 value, u16 index, 62 - ctrl_complete_t complete, void *context) 58 + static void usb_ctrl_msg(struct st5481_adapter *adapter, 59 + u8 request, u8 requesttype, u16 value, u16 index, 60 + ctrl_complete_t complete, void *context) 63 61 { 64 62 struct st5481_ctrl *ctrl = &adapter->ctrl; 65 63 int w_index; ··· 573 571 * Make the transfer_buffer contiguous by 574 572 * copying from the iso descriptors if necessary. 575 573 */ 576 - int st5481_isoc_flatten(struct urb *urb) 574 + static int st5481_isoc_flatten(struct urb *urb) 577 575 { 578 576 struct usb_iso_packet_descriptor *pipd,*pend; 579 577 unsigned char *src,*dst;
+1 -1
drivers/isdn/hisax/tei.c
··· 74 74 "EV_T202", 75 75 }; 76 76 77 - unsigned int 77 + static unsigned int 78 78 random_ri(void) 79 79 { 80 80 unsigned int x;
+2 -2
drivers/isdn/hisax/teleint.c
··· 18 18 19 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 23 #define byteout(addr,val) outb(val,addr) 24 24 #define bytein(addr) inb(addr) ··· 203 203 add_timer(&cs->hw.hfc.timer); 204 204 } 205 205 206 - void 206 + static void 207 207 release_io_TeleInt(struct IsdnCardState *cs) 208 208 { 209 209 del_timer(&cs->hw.hfc.timer);
+2 -2
drivers/isdn/hisax/teles0.c
··· 23 23 24 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 28 #define TELES_IOMEM_SIZE 0x400 29 29 #define byteout(addr,val) outb(val,addr) ··· 183 183 return IRQ_HANDLED; 184 184 } 185 185 186 - void 186 + static void 187 187 release_io_teles0(struct IsdnCardState *cs) 188 188 { 189 189 if (cs->hw.teles0.cfg_reg)
+2 -2
drivers/isdn/hisax/teles3.c
··· 21 21 #include "isdnl1.h" 22 22 23 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 26 #define byteout(addr,val) outb(val,addr) 27 27 #define bytein(addr) inb(addr) ··· 154 154 release_region(cs->hw.teles3.hscx[1] + 32, 32); 155 155 } 156 156 157 - void 157 + static void 158 158 release_io_teles3(struct IsdnCardState *cs) 159 159 { 160 160 if (cs->typ == ISDN_CTYPE_TELESPCMCIA) {
+2 -2
drivers/isdn/hisax/telespci.c
··· 21 21 #include <linux/pci.h> 22 22 23 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 26 #define ZORAN_PO_RQ_PEN 0x02000000 27 27 #define ZORAN_PO_WR 0x00800000 ··· 257 257 return IRQ_HANDLED; 258 258 } 259 259 260 - void 260 + static void 261 261 release_io_telespci(struct IsdnCardState *cs) 262 262 { 263 263 iounmap(cs->hw.teles0.membase);
+3 -3
drivers/isdn/hisax/w6692.c
··· 41 41 42 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 46 #define DBUSY_TIMER_VALUE 80 47 47 ··· 880 880 return (0); 881 881 } 882 882 883 - void resetW6692(struct IsdnCardState *cs) 883 + static void resetW6692(struct IsdnCardState *cs) 884 884 { 885 885 cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST); 886 886 mdelay(10); ··· 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 907 if (part & 1) { 908 908 cs->setstack_d = setstack_W6692;