diff options
author | Joe Perches <joe@perches.com> | 2012-02-19 22:52:38 -0500 |
---|---|---|
committer | Joe Perches <joe@perches.com> | 2012-02-21 12:04:01 -0500 |
commit | 475be4d85a274d0961593db41cf85689db1d583c (patch) | |
tree | b2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/hisax/gazel.c | |
parent | 0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff) |
isdn: whitespace coding style cleanup
isdn source code uses a not-current coding style.
Update the coding style used on a per-line basis
so that git diff -w shows only elided blank lines
at EOF.
Done with emacs and some scripts and some typing.
Built x86 allyesconfig.
No detected change in objdump -d or size.
Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/isdn/hisax/gazel.c')
-rw-r--r-- | drivers/isdn/hisax/gazel.c | 518 |
1 files changed, 259 insertions, 259 deletions
diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c index 353982fc1436..4fef77562554 100644 --- a/drivers/isdn/hisax/gazel.c +++ b/drivers/isdn/hisax/gazel.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * Author BeWan Systems | 5 | * Author BeWan Systems |
6 | * based on source code from Karsten Keil | 6 | * based on source code from Karsten Keil |
7 | * Copyright by BeWan Systems | 7 | * Copyright by BeWan Systems |
8 | * | 8 | * |
9 | * This software may be used and distributed according to the terms | 9 | * This software may be used and distributed according to the terms |
10 | * of the GNU General Public License, incorporated herein by reference. | 10 | * of the GNU General Public License, incorporated herein by reference. |
11 | * | 11 | * |
@@ -38,7 +38,7 @@ static const char *gazel_revision = "$Revision: 2.19.2.4 $"; | |||
38 | #define INT_IPAC_EN 0x3 /* enable IT ipac */ | 38 | #define INT_IPAC_EN 0x3 /* enable IT ipac */ |
39 | 39 | ||
40 | 40 | ||
41 | #define byteout(addr,val) outb(val,addr) | 41 | #define byteout(addr, val) outb(val, addr) |
42 | #define bytein(addr) inb(addr) | 42 | #define bytein(addr) inb(addr) |
43 | 43 | ||
44 | static inline u_char | 44 | static inline u_char |
@@ -55,13 +55,13 @@ writereg(unsigned int adr, u_short off, u_char data) | |||
55 | 55 | ||
56 | 56 | ||
57 | static inline void | 57 | static inline void |
58 | read_fifo(unsigned int adr, u_char * data, int size) | 58 | read_fifo(unsigned int adr, u_char *data, int size) |
59 | { | 59 | { |
60 | insb(adr, data, size); | 60 | insb(adr, data, size); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void | 63 | static void |
64 | write_fifo(unsigned int adr, u_char * data, int size) | 64 | write_fifo(unsigned int adr, u_char *data, int size) |
65 | { | 65 | { |
66 | outsb(adr, data, size); | 66 | outsb(adr, data, size); |
67 | } | 67 | } |
@@ -85,14 +85,14 @@ writereg_ipac(unsigned int adr, u_short off, u_char data) | |||
85 | 85 | ||
86 | 86 | ||
87 | static inline void | 87 | static inline void |
88 | read_fifo_ipac(unsigned int adr, u_short off, u_char * data, int size) | 88 | read_fifo_ipac(unsigned int adr, u_short off, u_char *data, int size) |
89 | { | 89 | { |
90 | byteout(adr, off); | 90 | byteout(adr, off); |
91 | insb(adr + 4, data, size); | 91 | insb(adr + 4, data, size); |
92 | } | 92 | } |
93 | 93 | ||
94 | static void | 94 | static void |
95 | write_fifo_ipac(unsigned int adr, u_short off, u_char * data, int size) | 95 | write_fifo_ipac(unsigned int adr, u_short off, u_char *data, int size) |
96 | { | 96 | { |
97 | byteout(adr, off); | 97 | byteout(adr, off); |
98 | outsb(adr + 4, data, size); | 98 | outsb(adr + 4, data, size); |
@@ -106,13 +106,13 @@ ReadISAC(struct IsdnCardState *cs, u_char offset) | |||
106 | u_short off2 = offset; | 106 | u_short off2 = offset; |
107 | 107 | ||
108 | switch (cs->subtyp) { | 108 | switch (cs->subtyp) { |
109 | case R647: | 109 | case R647: |
110 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); | 110 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); |
111 | case R685: | 111 | case R685: |
112 | return (readreg(cs->hw.gazel.isac, off2)); | 112 | return (readreg(cs->hw.gazel.isac, off2)); |
113 | case R753: | 113 | case R753: |
114 | case R742: | 114 | case R742: |
115 | return (readreg_ipac(cs->hw.gazel.ipac, 0x80 + off2)); | 115 | return (readreg_ipac(cs->hw.gazel.ipac, 0x80 + off2)); |
116 | } | 116 | } |
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
@@ -123,75 +123,75 @@ WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) | |||
123 | u_short off2 = offset; | 123 | u_short off2 = offset; |
124 | 124 | ||
125 | switch (cs->subtyp) { | 125 | switch (cs->subtyp) { |
126 | case R647: | 126 | case R647: |
127 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); | 127 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); |
128 | case R685: | 128 | case R685: |
129 | writereg(cs->hw.gazel.isac, off2, value); | 129 | writereg(cs->hw.gazel.isac, off2, value); |
130 | break; | 130 | break; |
131 | case R753: | 131 | case R753: |
132 | case R742: | 132 | case R742: |
133 | writereg_ipac(cs->hw.gazel.ipac, 0x80 + off2, value); | 133 | writereg_ipac(cs->hw.gazel.ipac, 0x80 + off2, value); |
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | } | 136 | } |
137 | 137 | ||
138 | static void | 138 | static void |
139 | ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) | 139 | ReadISACfifo(struct IsdnCardState *cs, u_char *data, int size) |
140 | { | 140 | { |
141 | switch (cs->subtyp) { | 141 | switch (cs->subtyp) { |
142 | case R647: | 142 | case R647: |
143 | case R685: | 143 | case R685: |
144 | read_fifo(cs->hw.gazel.isacfifo, data, size); | 144 | read_fifo(cs->hw.gazel.isacfifo, data, size); |
145 | break; | 145 | break; |
146 | case R753: | 146 | case R753: |
147 | case R742: | 147 | case R742: |
148 | read_fifo_ipac(cs->hw.gazel.ipac, 0x80, data, size); | 148 | read_fifo_ipac(cs->hw.gazel.ipac, 0x80, data, size); |
149 | break; | 149 | break; |
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | static void | 153 | static void |
154 | WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) | 154 | WriteISACfifo(struct IsdnCardState *cs, u_char *data, int size) |
155 | { | 155 | { |
156 | switch (cs->subtyp) { | 156 | switch (cs->subtyp) { |
157 | case R647: | 157 | case R647: |
158 | case R685: | 158 | case R685: |
159 | write_fifo(cs->hw.gazel.isacfifo, data, size); | 159 | write_fifo(cs->hw.gazel.isacfifo, data, size); |
160 | break; | 160 | break; |
161 | case R753: | 161 | case R753: |
162 | case R742: | 162 | case R742: |
163 | write_fifo_ipac(cs->hw.gazel.ipac, 0x80, data, size); | 163 | write_fifo_ipac(cs->hw.gazel.ipac, 0x80, data, size); |
164 | break; | 164 | break; |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | static void | 168 | static void |
169 | ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) | 169 | ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char *data, int size) |
170 | { | 170 | { |
171 | switch (cs->subtyp) { | 171 | switch (cs->subtyp) { |
172 | case R647: | 172 | case R647: |
173 | case R685: | 173 | case R685: |
174 | read_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); | 174 | read_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); |
175 | break; | 175 | break; |
176 | case R753: | 176 | case R753: |
177 | case R742: | 177 | case R742: |
178 | read_fifo_ipac(cs->hw.gazel.ipac, hscx * 0x40, data, size); | 178 | read_fifo_ipac(cs->hw.gazel.ipac, hscx * 0x40, data, size); |
179 | break; | 179 | break; |
180 | } | 180 | } |
181 | } | 181 | } |
182 | 182 | ||
183 | static void | 183 | static void |
184 | WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) | 184 | WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char *data, int size) |
185 | { | 185 | { |
186 | switch (cs->subtyp) { | 186 | switch (cs->subtyp) { |
187 | case R647: | 187 | case R647: |
188 | case R685: | 188 | case R685: |
189 | write_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); | 189 | write_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); |
190 | break; | 190 | break; |
191 | case R753: | 191 | case R753: |
192 | case R742: | 192 | case R742: |
193 | write_fifo_ipac(cs->hw.gazel.ipac, hscx * 0x40, data, size); | 193 | write_fifo_ipac(cs->hw.gazel.ipac, hscx * 0x40, data, size); |
194 | break; | 194 | break; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
@@ -201,13 +201,13 @@ ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) | |||
201 | u_short off2 = offset; | 201 | u_short off2 = offset; |
202 | 202 | ||
203 | switch (cs->subtyp) { | 203 | switch (cs->subtyp) { |
204 | case R647: | 204 | case R647: |
205 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); | 205 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); |
206 | case R685: | 206 | case R685: |
207 | return (readreg(cs->hw.gazel.hscx[hscx], off2)); | 207 | return (readreg(cs->hw.gazel.hscx[hscx], off2)); |
208 | case R753: | 208 | case R753: |
209 | case R742: | 209 | case R742: |
210 | return (readreg_ipac(cs->hw.gazel.ipac, hscx * 0x40 + off2)); | 210 | return (readreg_ipac(cs->hw.gazel.ipac, hscx * 0x40 + off2)); |
211 | } | 211 | } |
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
@@ -218,15 +218,15 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) | |||
218 | u_short off2 = offset; | 218 | u_short off2 = offset; |
219 | 219 | ||
220 | switch (cs->subtyp) { | 220 | switch (cs->subtyp) { |
221 | case R647: | 221 | case R647: |
222 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); | 222 | off2 = ((off2 << 8 & 0xf000) | (off2 & 0xf)); |
223 | case R685: | 223 | case R685: |
224 | writereg(cs->hw.gazel.hscx[hscx], off2, value); | 224 | writereg(cs->hw.gazel.hscx[hscx], off2, value); |
225 | break; | 225 | break; |
226 | case R753: | 226 | case R753: |
227 | case R742: | 227 | case R742: |
228 | writereg_ipac(cs->hw.gazel.ipac, hscx * 0x40 + off2, value); | 228 | writereg_ipac(cs->hw.gazel.ipac, hscx * 0x40 + off2, value); |
229 | break; | 229 | break; |
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
@@ -279,7 +279,7 @@ gazel_interrupt_ipac(int intno, void *dev_id) | |||
279 | u_char ista, val; | 279 | u_char ista, val; |
280 | int count = 0; | 280 | int count = 0; |
281 | u_long flags; | 281 | u_long flags; |
282 | 282 | ||
283 | spin_lock_irqsave(&cs->lock, flags); | 283 | spin_lock_irqsave(&cs->lock, flags); |
284 | ista = ReadISAC(cs, IPAC_ISTA - 0x80); | 284 | ista = ReadISAC(cs, IPAC_ISTA - 0x80); |
285 | do { | 285 | do { |
@@ -322,25 +322,25 @@ release_io_gazel(struct IsdnCardState *cs) | |||
322 | unsigned int i; | 322 | unsigned int i; |
323 | 323 | ||
324 | switch (cs->subtyp) { | 324 | switch (cs->subtyp) { |
325 | case R647: | 325 | case R647: |
326 | for (i = 0x0000; i < 0xC000; i += 0x1000) | 326 | for (i = 0x0000; i < 0xC000; i += 0x1000) |
327 | release_region(i + cs->hw.gazel.hscx[0], 16); | 327 | release_region(i + cs->hw.gazel.hscx[0], 16); |
328 | release_region(0xC000 + cs->hw.gazel.hscx[0], 1); | 328 | release_region(0xC000 + cs->hw.gazel.hscx[0], 1); |
329 | break; | 329 | break; |
330 | 330 | ||
331 | case R685: | 331 | case R685: |
332 | release_region(cs->hw.gazel.hscx[0], 0x100); | 332 | release_region(cs->hw.gazel.hscx[0], 0x100); |
333 | release_region(cs->hw.gazel.cfg_reg, 0x80); | 333 | release_region(cs->hw.gazel.cfg_reg, 0x80); |
334 | break; | 334 | break; |
335 | 335 | ||
336 | case R753: | 336 | case R753: |
337 | release_region(cs->hw.gazel.ipac, 0x8); | 337 | release_region(cs->hw.gazel.ipac, 0x8); |
338 | release_region(cs->hw.gazel.cfg_reg, 0x80); | 338 | release_region(cs->hw.gazel.cfg_reg, 0x80); |
339 | break; | 339 | break; |
340 | 340 | ||
341 | case R742: | 341 | case R742: |
342 | release_region(cs->hw.gazel.ipac, 8); | 342 | release_region(cs->hw.gazel.ipac, 8); |
343 | break; | 343 | break; |
344 | } | 344 | } |
345 | } | 345 | } |
346 | 346 | ||
@@ -350,49 +350,49 @@ reset_gazel(struct IsdnCardState *cs) | |||
350 | unsigned long plxcntrl, addr = cs->hw.gazel.cfg_reg; | 350 | unsigned long plxcntrl, addr = cs->hw.gazel.cfg_reg; |
351 | 351 | ||
352 | switch (cs->subtyp) { | 352 | switch (cs->subtyp) { |
353 | case R647: | 353 | case R647: |
354 | writereg(addr, 0, 0); | 354 | writereg(addr, 0, 0); |
355 | HZDELAY(10); | 355 | HZDELAY(10); |
356 | writereg(addr, 0, 1); | 356 | writereg(addr, 0, 1); |
357 | HZDELAY(2); | 357 | HZDELAY(2); |
358 | break; | 358 | break; |
359 | case R685: | 359 | case R685: |
360 | plxcntrl = inl(addr + PLX_CNTRL); | 360 | plxcntrl = inl(addr + PLX_CNTRL); |
361 | plxcntrl |= (RESET_9050 + RESET_GAZEL); | 361 | plxcntrl |= (RESET_9050 + RESET_GAZEL); |
362 | outl(plxcntrl, addr + PLX_CNTRL); | 362 | outl(plxcntrl, addr + PLX_CNTRL); |
363 | plxcntrl &= ~(RESET_9050 + RESET_GAZEL); | 363 | plxcntrl &= ~(RESET_9050 + RESET_GAZEL); |
364 | HZDELAY(4); | 364 | HZDELAY(4); |
365 | outl(plxcntrl, addr + PLX_CNTRL); | 365 | outl(plxcntrl, addr + PLX_CNTRL); |
366 | HZDELAY(10); | 366 | HZDELAY(10); |
367 | outb(INT_ISAC_EN + INT_HSCX_EN + INT_PCI_EN, addr + PLX_INCSR); | 367 | outb(INT_ISAC_EN + INT_HSCX_EN + INT_PCI_EN, addr + PLX_INCSR); |
368 | break; | 368 | break; |
369 | case R753: | 369 | case R753: |
370 | plxcntrl = inl(addr + PLX_CNTRL); | 370 | plxcntrl = inl(addr + PLX_CNTRL); |
371 | plxcntrl |= (RESET_9050 + RESET_GAZEL); | 371 | plxcntrl |= (RESET_9050 + RESET_GAZEL); |
372 | outl(plxcntrl, addr + PLX_CNTRL); | 372 | outl(plxcntrl, addr + PLX_CNTRL); |
373 | plxcntrl &= ~(RESET_9050 + RESET_GAZEL); | 373 | plxcntrl &= ~(RESET_9050 + RESET_GAZEL); |
374 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); | 374 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); |
375 | HZDELAY(4); | 375 | HZDELAY(4); |
376 | outl(plxcntrl, addr + PLX_CNTRL); | 376 | outl(plxcntrl, addr + PLX_CNTRL); |
377 | HZDELAY(10); | 377 | HZDELAY(10); |
378 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); | 378 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); |
379 | WriteISAC(cs, IPAC_ACFG - 0x80, 0xff); | 379 | WriteISAC(cs, IPAC_ACFG - 0x80, 0xff); |
380 | WriteISAC(cs, IPAC_AOE - 0x80, 0x0); | 380 | WriteISAC(cs, IPAC_AOE - 0x80, 0x0); |
381 | WriteISAC(cs, IPAC_MASK - 0x80, 0xff); | 381 | WriteISAC(cs, IPAC_MASK - 0x80, 0xff); |
382 | WriteISAC(cs, IPAC_CONF - 0x80, 0x1); | 382 | WriteISAC(cs, IPAC_CONF - 0x80, 0x1); |
383 | outb(INT_IPAC_EN + INT_PCI_EN, addr + PLX_INCSR); | 383 | outb(INT_IPAC_EN + INT_PCI_EN, addr + PLX_INCSR); |
384 | WriteISAC(cs, IPAC_MASK - 0x80, 0xc0); | 384 | WriteISAC(cs, IPAC_MASK - 0x80, 0xc0); |
385 | break; | 385 | break; |
386 | case R742: | 386 | case R742: |
387 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); | 387 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); |
388 | HZDELAY(4); | 388 | HZDELAY(4); |
389 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); | 389 | WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); |
390 | WriteISAC(cs, IPAC_ACFG - 0x80, 0xff); | 390 | WriteISAC(cs, IPAC_ACFG - 0x80, 0xff); |
391 | WriteISAC(cs, IPAC_AOE - 0x80, 0x0); | 391 | WriteISAC(cs, IPAC_AOE - 0x80, 0x0); |
392 | WriteISAC(cs, IPAC_MASK - 0x80, 0xff); | 392 | WriteISAC(cs, IPAC_MASK - 0x80, 0xff); |
393 | WriteISAC(cs, IPAC_CONF - 0x80, 0x1); | 393 | WriteISAC(cs, IPAC_CONF - 0x80, 0x1); |
394 | WriteISAC(cs, IPAC_MASK - 0x80, 0xc0); | 394 | WriteISAC(cs, IPAC_MASK - 0x80, 0xc0); |
395 | break; | 395 | break; |
396 | } | 396 | } |
397 | return (0); | 397 | return (0); |
398 | } | 398 | } |
@@ -403,28 +403,28 @@ Gazel_card_msg(struct IsdnCardState *cs, int mt, void *arg) | |||
403 | u_long flags; | 403 | u_long flags; |
404 | 404 | ||
405 | switch (mt) { | 405 | switch (mt) { |
406 | case CARD_RESET: | 406 | case CARD_RESET: |
407 | spin_lock_irqsave(&cs->lock, flags); | 407 | spin_lock_irqsave(&cs->lock, flags); |
408 | reset_gazel(cs); | 408 | reset_gazel(cs); |
409 | spin_unlock_irqrestore(&cs->lock, flags); | 409 | spin_unlock_irqrestore(&cs->lock, flags); |
410 | return (0); | 410 | return (0); |
411 | case CARD_RELEASE: | 411 | case CARD_RELEASE: |
412 | release_io_gazel(cs); | 412 | release_io_gazel(cs); |
413 | return (0); | 413 | return (0); |
414 | case CARD_INIT: | 414 | case CARD_INIT: |
415 | spin_lock_irqsave(&cs->lock, flags); | 415 | spin_lock_irqsave(&cs->lock, flags); |
416 | inithscxisac(cs, 1); | 416 | inithscxisac(cs, 1); |
417 | if ((cs->subtyp==R647)||(cs->subtyp==R685)) { | 417 | if ((cs->subtyp == R647) || (cs->subtyp == R685)) { |
418 | int i; | 418 | int i; |
419 | for (i=0;i<(2+MAX_WAITING_CALLS);i++) { | 419 | for (i = 0; i < (2 + MAX_WAITING_CALLS); i++) { |
420 | cs->bcs[i].hw.hscx.tsaxr0 = 0x1f; | 420 | cs->bcs[i].hw.hscx.tsaxr0 = 0x1f; |
421 | cs->bcs[i].hw.hscx.tsaxr1 = 0x23; | 421 | cs->bcs[i].hw.hscx.tsaxr1 = 0x23; |
422 | } | ||
423 | } | 422 | } |
424 | spin_unlock_irqrestore(&cs->lock, flags); | 423 | } |
425 | return (0); | 424 | spin_unlock_irqrestore(&cs->lock, flags); |
426 | case CARD_TEST: | 425 | return (0); |
427 | return (0); | 426 | case CARD_TEST: |
427 | return (0); | ||
428 | } | 428 | } |
429 | return (0); | 429 | return (0); |
430 | } | 430 | } |
@@ -435,49 +435,49 @@ reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs) | |||
435 | unsigned int i, j, base = 0, adr = 0, len = 0; | 435 | unsigned int i, j, base = 0, adr = 0, len = 0; |
436 | 436 | ||
437 | switch (cs->subtyp) { | 437 | switch (cs->subtyp) { |
438 | case R647: | 438 | case R647: |
439 | base = cs->hw.gazel.hscx[0]; | 439 | base = cs->hw.gazel.hscx[0]; |
440 | if (!request_region(adr = (0xC000 + base), len = 1, "gazel")) | 440 | if (!request_region(adr = (0xC000 + base), len = 1, "gazel")) |
441 | goto error; | 441 | goto error; |
442 | for (i = 0x0000; i < 0xC000; i += 0x1000) { | 442 | for (i = 0x0000; i < 0xC000; i += 0x1000) { |
443 | if (!request_region(adr = (i + base), len = 16, "gazel")) | 443 | if (!request_region(adr = (i + base), len = 16, "gazel")) |
444 | goto error; | ||
445 | } | ||
446 | if (i != 0xC000) { | ||
447 | for (j = 0; j < i; j+= 0x1000) | ||
448 | release_region(j + base, 16); | ||
449 | release_region(0xC000 + base, 1); | ||
450 | goto error; | 444 | goto error; |
451 | } | 445 | } |
452 | break; | 446 | if (i != 0xC000) { |
447 | for (j = 0; j < i; j += 0x1000) | ||
448 | release_region(j + base, 16); | ||
449 | release_region(0xC000 + base, 1); | ||
450 | goto error; | ||
451 | } | ||
452 | break; | ||
453 | 453 | ||
454 | case R685: | 454 | case R685: |
455 | if (!request_region(adr = cs->hw.gazel.hscx[0], len = 0x100, "gazel")) | 455 | if (!request_region(adr = cs->hw.gazel.hscx[0], len = 0x100, "gazel")) |
456 | goto error; | 456 | goto error; |
457 | if (!request_region(adr = cs->hw.gazel.cfg_reg, len = 0x80, "gazel")) { | 457 | if (!request_region(adr = cs->hw.gazel.cfg_reg, len = 0x80, "gazel")) { |
458 | release_region(cs->hw.gazel.hscx[0],0x100); | 458 | release_region(cs->hw.gazel.hscx[0], 0x100); |
459 | goto error; | 459 | goto error; |
460 | } | 460 | } |
461 | break; | 461 | break; |
462 | 462 | ||
463 | case R753: | 463 | case R753: |
464 | if (!request_region(adr = cs->hw.gazel.ipac, len = 0x8, "gazel")) | 464 | if (!request_region(adr = cs->hw.gazel.ipac, len = 0x8, "gazel")) |
465 | goto error; | 465 | goto error; |
466 | if (!request_region(adr = cs->hw.gazel.cfg_reg, len = 0x80, "gazel")) { | 466 | if (!request_region(adr = cs->hw.gazel.cfg_reg, len = 0x80, "gazel")) { |
467 | release_region(cs->hw.gazel.ipac, 8); | 467 | release_region(cs->hw.gazel.ipac, 8); |
468 | goto error; | 468 | goto error; |
469 | } | 469 | } |
470 | break; | 470 | break; |
471 | 471 | ||
472 | case R742: | 472 | case R742: |
473 | if (!request_region(adr = cs->hw.gazel.ipac, len = 0x8, "gazel")) | 473 | if (!request_region(adr = cs->hw.gazel.ipac, len = 0x8, "gazel")) |
474 | goto error; | 474 | goto error; |
475 | break; | 475 | break; |
476 | } | 476 | } |
477 | 477 | ||
478 | return 0; | 478 | return 0; |
479 | 479 | ||
480 | error: | 480 | error: |
481 | printk(KERN_WARNING "Gazel: io ports 0x%x-0x%x already in use\n", | 481 | printk(KERN_WARNING "Gazel: io ports 0x%x-0x%x already in use\n", |
482 | adr, adr + len); | 482 | adr, adr + len); |
483 | return 1; | 483 | return 1; |
@@ -508,24 +508,24 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) | |||
508 | cs->hw.gazel.hscxfifo[1] = cs->hw.gazel.hscx[1]; | 508 | cs->hw.gazel.hscxfifo[1] = cs->hw.gazel.hscx[1]; |
509 | 509 | ||
510 | switch (cs->subtyp) { | 510 | switch (cs->subtyp) { |
511 | case R647: | 511 | case R647: |
512 | printk(KERN_INFO "Gazel: Card ISA R647/R648 found\n"); | 512 | printk(KERN_INFO "Gazel: Card ISA R647/R648 found\n"); |
513 | cs->dc.isac.adf2 = 0x87; | 513 | cs->dc.isac.adf2 = 0x87; |
514 | printk(KERN_INFO | 514 | printk(KERN_INFO |
515 | "Gazel: config irq:%d isac:0x%X cfg:0x%X\n", | 515 | "Gazel: config irq:%d isac:0x%X cfg:0x%X\n", |
516 | cs->irq, cs->hw.gazel.isac, cs->hw.gazel.cfg_reg); | 516 | cs->irq, cs->hw.gazel.isac, cs->hw.gazel.cfg_reg); |
517 | printk(KERN_INFO | 517 | printk(KERN_INFO |
518 | "Gazel: hscx A:0x%X hscx B:0x%X\n", | 518 | "Gazel: hscx A:0x%X hscx B:0x%X\n", |
519 | cs->hw.gazel.hscx[0], cs->hw.gazel.hscx[1]); | 519 | cs->hw.gazel.hscx[0], cs->hw.gazel.hscx[1]); |
520 | 520 | ||
521 | break; | 521 | break; |
522 | case R742: | 522 | case R742: |
523 | printk(KERN_INFO "Gazel: Card ISA R742 found\n"); | 523 | printk(KERN_INFO "Gazel: Card ISA R742 found\n"); |
524 | test_and_set_bit(HW_IPAC, &cs->HW_Flags); | 524 | test_and_set_bit(HW_IPAC, &cs->HW_Flags); |
525 | printk(KERN_INFO | 525 | printk(KERN_INFO |
526 | "Gazel: config irq:%d ipac:0x%X\n", | 526 | "Gazel: config irq:%d ipac:0x%X\n", |
527 | cs->irq, cs->hw.gazel.ipac); | 527 | cs->irq, cs->hw.gazel.ipac); |
528 | break; | 528 | break; |
529 | } | 529 | } |
530 | 530 | ||
531 | return (0); | 531 | return (0); |
@@ -547,7 +547,7 @@ setup_gazelpci(struct IsdnCardState *cs) | |||
547 | seekcard = PCI_DEVICE_ID_PLX_R685; | 547 | seekcard = PCI_DEVICE_ID_PLX_R685; |
548 | for (nbseek = 0; nbseek < 4; nbseek++) { | 548 | for (nbseek = 0; nbseek < 4; nbseek++) { |
549 | if ((dev_tel = hisax_find_pci_device(PCI_VENDOR_ID_PLX, | 549 | if ((dev_tel = hisax_find_pci_device(PCI_VENDOR_ID_PLX, |
550 | seekcard, dev_tel))) { | 550 | seekcard, dev_tel))) { |
551 | if (pci_enable_device(dev_tel)) | 551 | if (pci_enable_device(dev_tel)) |
552 | return 1; | 552 | return 1; |
553 | pci_irq = dev_tel->irq; | 553 | pci_irq = dev_tel->irq; |
@@ -559,15 +559,15 @@ setup_gazelpci(struct IsdnCardState *cs) | |||
559 | break; | 559 | break; |
560 | else { | 560 | else { |
561 | switch (seekcard) { | 561 | switch (seekcard) { |
562 | case PCI_DEVICE_ID_PLX_R685: | 562 | case PCI_DEVICE_ID_PLX_R685: |
563 | seekcard = PCI_DEVICE_ID_PLX_R753; | 563 | seekcard = PCI_DEVICE_ID_PLX_R753; |
564 | break; | 564 | break; |
565 | case PCI_DEVICE_ID_PLX_R753: | 565 | case PCI_DEVICE_ID_PLX_R753: |
566 | seekcard = PCI_DEVICE_ID_PLX_DJINN_ITOO; | 566 | seekcard = PCI_DEVICE_ID_PLX_DJINN_ITOO; |
567 | break; | 567 | break; |
568 | case PCI_DEVICE_ID_PLX_DJINN_ITOO: | 568 | case PCI_DEVICE_ID_PLX_DJINN_ITOO: |
569 | seekcard = PCI_DEVICE_ID_PLX_OLITEC; | 569 | seekcard = PCI_DEVICE_ID_PLX_OLITEC; |
570 | break; | 570 | break; |
571 | } | 571 | } |
572 | } | 572 | } |
573 | } | 573 | } |
@@ -595,27 +595,27 @@ setup_gazelpci(struct IsdnCardState *cs) | |||
595 | cs->irq_flags |= IRQF_SHARED; | 595 | cs->irq_flags |= IRQF_SHARED; |
596 | 596 | ||
597 | switch (seekcard) { | 597 | switch (seekcard) { |
598 | case PCI_DEVICE_ID_PLX_R685: | 598 | case PCI_DEVICE_ID_PLX_R685: |
599 | printk(KERN_INFO "Gazel: Card PCI R685 found\n"); | 599 | printk(KERN_INFO "Gazel: Card PCI R685 found\n"); |
600 | cs->subtyp = R685; | 600 | cs->subtyp = R685; |
601 | cs->dc.isac.adf2 = 0x87; | 601 | cs->dc.isac.adf2 = 0x87; |
602 | printk(KERN_INFO | 602 | printk(KERN_INFO |
603 | "Gazel: config irq:%d isac:0x%X cfg:0x%X\n", | 603 | "Gazel: config irq:%d isac:0x%X cfg:0x%X\n", |
604 | cs->irq, cs->hw.gazel.isac, cs->hw.gazel.cfg_reg); | 604 | cs->irq, cs->hw.gazel.isac, cs->hw.gazel.cfg_reg); |
605 | printk(KERN_INFO | 605 | printk(KERN_INFO |
606 | "Gazel: hscx A:0x%X hscx B:0x%X\n", | 606 | "Gazel: hscx A:0x%X hscx B:0x%X\n", |
607 | cs->hw.gazel.hscx[0], cs->hw.gazel.hscx[1]); | 607 | cs->hw.gazel.hscx[0], cs->hw.gazel.hscx[1]); |
608 | break; | 608 | break; |
609 | case PCI_DEVICE_ID_PLX_R753: | 609 | case PCI_DEVICE_ID_PLX_R753: |
610 | case PCI_DEVICE_ID_PLX_DJINN_ITOO: | 610 | case PCI_DEVICE_ID_PLX_DJINN_ITOO: |
611 | case PCI_DEVICE_ID_PLX_OLITEC: | 611 | case PCI_DEVICE_ID_PLX_OLITEC: |
612 | printk(KERN_INFO "Gazel: Card PCI R753 found\n"); | 612 | printk(KERN_INFO "Gazel: Card PCI R753 found\n"); |
613 | cs->subtyp = R753; | 613 | cs->subtyp = R753; |
614 | test_and_set_bit(HW_IPAC, &cs->HW_Flags); | 614 | test_and_set_bit(HW_IPAC, &cs->HW_Flags); |
615 | printk(KERN_INFO | 615 | printk(KERN_INFO |
616 | "Gazel: config irq:%d ipac:0x%X cfg:0x%X\n", | 616 | "Gazel: config irq:%d ipac:0x%X cfg:0x%X\n", |
617 | cs->irq, cs->hw.gazel.ipac, cs->hw.gazel.cfg_reg); | 617 | cs->irq, cs->hw.gazel.ipac, cs->hw.gazel.cfg_reg); |
618 | break; | 618 | break; |
619 | } | 619 | } |
620 | 620 | ||
621 | return (0); | 621 | return (0); |
@@ -667,23 +667,23 @@ setup_gazel(struct IsdnCard *card) | |||
667 | cs->cardmsg = &Gazel_card_msg; | 667 | cs->cardmsg = &Gazel_card_msg; |
668 | 668 | ||
669 | switch (cs->subtyp) { | 669 | switch (cs->subtyp) { |
670 | case R647: | 670 | case R647: |
671 | case R685: | 671 | case R685: |
672 | cs->irq_func = &gazel_interrupt; | 672 | cs->irq_func = &gazel_interrupt; |
673 | ISACVersion(cs, "Gazel:"); | 673 | ISACVersion(cs, "Gazel:"); |
674 | if (HscxVersion(cs, "Gazel:")) { | 674 | if (HscxVersion(cs, "Gazel:")) { |
675 | printk(KERN_WARNING | 675 | printk(KERN_WARNING |
676 | "Gazel: wrong HSCX versions check IO address\n"); | 676 | "Gazel: wrong HSCX versions check IO address\n"); |
677 | release_io_gazel(cs); | 677 | release_io_gazel(cs); |
678 | return (0); | 678 | return (0); |
679 | } | 679 | } |
680 | break; | 680 | break; |
681 | case R742: | 681 | case R742: |
682 | case R753: | 682 | case R753: |
683 | cs->irq_func = &gazel_interrupt_ipac; | 683 | cs->irq_func = &gazel_interrupt_ipac; |
684 | val = ReadISAC(cs, IPAC_ID - 0x80); | 684 | val = ReadISAC(cs, IPAC_ID - 0x80); |
685 | printk(KERN_INFO "Gazel: IPAC version %x\n", val); | 685 | printk(KERN_INFO "Gazel: IPAC version %x\n", val); |
686 | break; | 686 | break; |
687 | } | 687 | } |
688 | 688 | ||
689 | return (1); | 689 | return (1); |