1 // SPDX-License-Identifier: GPL-2.0-only
3 * w6692.c mISDN driver for Winbond w6692 based cards
5 * Author Karsten Keil <kkeil@suse.de>
6 * based on the w6692 I4L driver from Petr Novak <petr.novak@i.cz>
8 * Copyright 2009 by Karsten Keil <keil@isdn4linux.de>
11 #include <linux/interrupt.h>
12 #include <linux/module.h>
13 #include <linux/pci.h>
14 #include <linux/delay.h>
15 #include <linux/mISDNhw.h>
16 #include <linux/slab.h>
19 #define W6692_REV "2.0"
21 #define DBUSY_TIMER_VALUE 80
29 /* private data in the PCI devices list */
35 static const struct w6692map w6692_map
[] =
37 {W6692_ASUS
, "Dynalink/AsusCom IS64PH"},
38 {W6692_WINBOND
, "Winbond W6692"},
39 {W6692_USR
, "USR W6692"}
42 #define PCI_DEVICE_ID_USR_6692 0x3409
47 struct timer_list timer
;
52 struct list_head list
;
54 char name
[MISDN_MAX_IDLEN
];
58 u32 fmask
; /* feature mask - bit set per card nr */
60 spinlock_t lock
; /* hw lock */
66 struct w6692_ch bc
[2];
71 static LIST_HEAD(Cards
);
72 static DEFINE_RWLOCK(card_lock
); /* protect Cards */
80 _set_debug(struct w6692_hw
*card
)
82 card
->dch
.debug
= debug
;
83 card
->bc
[0].bch
.debug
= debug
;
84 card
->bc
[1].bch
.debug
= debug
;
88 set_debug(const char *val
, const struct kernel_param
*kp
)
91 struct w6692_hw
*card
;
93 ret
= param_set_uint(val
, kp
);
95 read_lock(&card_lock
);
96 list_for_each_entry(card
, &Cards
, list
)
98 read_unlock(&card_lock
);
103 MODULE_AUTHOR("Karsten Keil");
104 MODULE_LICENSE("GPL v2");
105 MODULE_VERSION(W6692_REV
);
106 module_param_call(debug
, set_debug
, param_get_uint
, &debug
, S_IRUGO
| S_IWUSR
);
107 MODULE_PARM_DESC(debug
, "W6692 debug mask");
108 module_param(led
, uint
, S_IRUGO
| S_IWUSR
);
109 MODULE_PARM_DESC(led
, "W6692 LED support bitmask (one bit per card)");
110 module_param(pots
, uint
, S_IRUGO
| S_IWUSR
);
111 MODULE_PARM_DESC(pots
, "W6692 POTS support bitmask (one bit per card)");
114 ReadW6692(struct w6692_hw
*card
, u8 offset
)
116 return inb(card
->addr
+ offset
);
120 WriteW6692(struct w6692_hw
*card
, u8 offset
, u8 value
)
122 outb(value
, card
->addr
+ offset
);
126 ReadW6692B(struct w6692_ch
*bc
, u8 offset
)
128 return inb(bc
->addr
+ offset
);
132 WriteW6692B(struct w6692_ch
*bc
, u8 offset
, u8 value
)
134 outb(value
, bc
->addr
+ offset
);
138 enable_hwirq(struct w6692_hw
*card
)
140 WriteW6692(card
, W_IMASK
, card
->imask
);
144 disable_hwirq(struct w6692_hw
*card
)
146 WriteW6692(card
, W_IMASK
, 0xff);
149 static const char *W6692Ver
[] = {"V00", "V01", "V10", "V11"};
152 W6692Version(struct w6692_hw
*card
)
156 val
= ReadW6692(card
, W_D_RBCH
);
157 pr_notice("%s: Winbond W6692 version: %s\n", card
->name
,
158 W6692Ver
[(val
>> 6) & 3]);
162 w6692_led_handler(struct w6692_hw
*card
, int on
)
164 if ((!(card
->fmask
& led
)) || card
->subtype
== W6692_USR
)
167 card
->xdata
&= 0xfb; /* LED ON */
168 WriteW6692(card
, W_XDATA
, card
->xdata
);
170 card
->xdata
|= 0x04; /* LED OFF */
171 WriteW6692(card
, W_XDATA
, card
->xdata
);
176 ph_command(struct w6692_hw
*card
, u8 cmd
)
178 pr_debug("%s: ph_command %x\n", card
->name
, cmd
);
179 WriteW6692(card
, W_CIX
, cmd
);
183 W6692_new_ph(struct w6692_hw
*card
)
185 if (card
->state
== W_L1CMD_RST
)
186 ph_command(card
, W_L1CMD_DRC
);
187 schedule_event(&card
->dch
, FLG_PHCHANGE
);
191 W6692_ph_bh(struct dchannel
*dch
)
193 struct w6692_hw
*card
= dch
->hw
;
195 switch (card
->state
) {
198 l1_event(dch
->l1
, HW_RESET_IND
);
202 l1_event(dch
->l1
, HW_DEACT_CNF
);
206 l1_event(dch
->l1
, HW_DEACT_IND
);
210 l1_event(dch
->l1
, HW_POWERUP_IND
);
213 if (dch
->state
<= 5) {
215 l1_event(dch
->l1
, ANYSIGNAL
);
218 l1_event(dch
->l1
, LOSTFRAMING
);
223 l1_event(dch
->l1
, INFO2
);
227 l1_event(dch
->l1
, INFO4_P8
);
231 l1_event(dch
->l1
, INFO4_P10
);
234 pr_debug("%s: TE unknown state %02x dch state %02x\n",
235 card
->name
, card
->state
, dch
->state
);
238 pr_debug("%s: TE newstate %02x\n", card
->name
, dch
->state
);
242 W6692_empty_Dfifo(struct w6692_hw
*card
, int count
)
244 struct dchannel
*dch
= &card
->dch
;
247 pr_debug("%s: empty_Dfifo %d\n", card
->name
, count
);
249 dch
->rx_skb
= mI_alloc_skb(card
->dch
.maxlen
, GFP_ATOMIC
);
251 pr_info("%s: D receive out of memory\n", card
->name
);
252 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
256 if ((dch
->rx_skb
->len
+ count
) >= dch
->maxlen
) {
257 pr_debug("%s: empty_Dfifo overrun %d\n", card
->name
,
258 dch
->rx_skb
->len
+ count
);
259 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
262 ptr
= skb_put(dch
->rx_skb
, count
);
263 insb(card
->addr
+ W_D_RFIFO
, ptr
, count
);
264 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
265 if (debug
& DEBUG_HW_DFIFO
) {
266 snprintf(card
->log
, 63, "D-recv %s %d ",
268 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
273 W6692_fill_Dfifo(struct w6692_hw
*card
)
275 struct dchannel
*dch
= &card
->dch
;
278 u8 cmd
= W_D_CMDR_XMS
;
280 pr_debug("%s: fill_Dfifo\n", card
->name
);
283 count
= dch
->tx_skb
->len
- dch
->tx_idx
;
286 if (count
> W_D_FIFO_THRESH
)
287 count
= W_D_FIFO_THRESH
;
290 ptr
= dch
->tx_skb
->data
+ dch
->tx_idx
;
291 dch
->tx_idx
+= count
;
292 outsb(card
->addr
+ W_D_XFIFO
, ptr
, count
);
293 WriteW6692(card
, W_D_CMDR
, cmd
);
294 if (test_and_set_bit(FLG_BUSY_TIMER
, &dch
->Flags
)) {
295 pr_debug("%s: fill_Dfifo dbusytimer running\n", card
->name
);
296 del_timer(&dch
->timer
);
298 dch
->timer
.expires
= jiffies
+ ((DBUSY_TIMER_VALUE
* HZ
) / 1000);
299 add_timer(&dch
->timer
);
300 if (debug
& DEBUG_HW_DFIFO
) {
301 snprintf(card
->log
, 63, "D-send %s %d ",
303 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
308 d_retransmit(struct w6692_hw
*card
)
310 struct dchannel
*dch
= &card
->dch
;
312 if (test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
))
313 del_timer(&dch
->timer
);
315 if (test_and_clear_bit(FLG_L1_BUSY
, &dch
->Flags
))
316 dchannel_sched_event(dch
, D_CLEARBUSY
);
318 if (test_bit(FLG_TX_BUSY
, &dch
->Flags
)) {
321 W6692_fill_Dfifo(card
);
322 } else if (dch
->tx_skb
) { /* should not happen */
323 pr_info("%s: %s without TX_BUSY\n", card
->name
, __func__
);
324 test_and_set_bit(FLG_TX_BUSY
, &dch
->Flags
);
326 W6692_fill_Dfifo(card
);
328 pr_info("%s: XDU no TX_BUSY\n", card
->name
);
329 if (get_next_dframe(dch
))
330 W6692_fill_Dfifo(card
);
335 handle_rxD(struct w6692_hw
*card
) {
339 stat
= ReadW6692(card
, W_D_RSTA
);
340 if (stat
& (W_D_RSTA_RDOV
| W_D_RSTA_CRCE
| W_D_RSTA_RMB
)) {
341 if (stat
& W_D_RSTA_RDOV
) {
342 pr_debug("%s: D-channel RDOV\n", card
->name
);
343 #ifdef ERROR_STATISTIC
347 if (stat
& W_D_RSTA_CRCE
) {
348 pr_debug("%s: D-channel CRC error\n", card
->name
);
349 #ifdef ERROR_STATISTIC
353 if (stat
& W_D_RSTA_RMB
) {
354 pr_debug("%s: D-channel ABORT\n", card
->name
);
355 #ifdef ERROR_STATISTIC
359 dev_kfree_skb(card
->dch
.rx_skb
);
360 card
->dch
.rx_skb
= NULL
;
361 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
| W_D_CMDR_RRST
);
363 count
= ReadW6692(card
, W_D_RBCL
) & (W_D_FIFO_THRESH
- 1);
365 count
= W_D_FIFO_THRESH
;
366 W6692_empty_Dfifo(card
, count
);
367 recv_Dchannel(&card
->dch
);
372 handle_txD(struct w6692_hw
*card
) {
373 if (test_and_clear_bit(FLG_BUSY_TIMER
, &card
->dch
.Flags
))
374 del_timer(&card
->dch
.timer
);
375 if (card
->dch
.tx_skb
&& card
->dch
.tx_idx
< card
->dch
.tx_skb
->len
) {
376 W6692_fill_Dfifo(card
);
378 dev_kfree_skb(card
->dch
.tx_skb
);
379 if (get_next_dframe(&card
->dch
))
380 W6692_fill_Dfifo(card
);
385 handle_statusD(struct w6692_hw
*card
)
387 struct dchannel
*dch
= &card
->dch
;
390 exval
= ReadW6692(card
, W_D_EXIR
);
392 pr_debug("%s: D_EXIR %02x\n", card
->name
, exval
);
393 if (exval
& (W_D_EXI_XDUN
| W_D_EXI_XCOL
)) {
394 /* Transmit underrun/collision */
395 pr_debug("%s: D-channel underrun/collision\n", card
->name
);
396 #ifdef ERROR_STATISTIC
401 if (exval
& W_D_EXI_RDOV
) { /* RDOV */
402 pr_debug("%s: D-channel RDOV\n", card
->name
);
403 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RRST
);
405 if (exval
& W_D_EXI_TIN2
) /* TIN2 - never */
406 pr_debug("%s: spurious TIN2 interrupt\n", card
->name
);
407 if (exval
& W_D_EXI_MOC
) { /* MOC - not supported */
408 v1
= ReadW6692(card
, W_MOSR
);
409 pr_debug("%s: spurious MOC interrupt MOSR %02x\n",
412 if (exval
& W_D_EXI_ISC
) { /* ISC - Level1 change */
413 cir
= ReadW6692(card
, W_CIR
);
414 pr_debug("%s: ISC CIR %02X\n", card
->name
, cir
);
415 if (cir
& W_CIR_ICC
) {
416 v1
= cir
& W_CIR_COD_MASK
;
417 pr_debug("%s: ph_state_change %x -> %x\n", card
->name
,
420 if (card
->fmask
& led
) {
424 w6692_led_handler(card
, 1);
427 w6692_led_handler(card
, 0);
433 if (cir
& W_CIR_SCC
) {
434 v1
= ReadW6692(card
, W_SQR
);
435 pr_debug("%s: SCC SQR %02X\n", card
->name
, v1
);
438 if (exval
& W_D_EXI_WEXP
)
439 pr_debug("%s: spurious WEXP interrupt!\n", card
->name
);
440 if (exval
& W_D_EXI_TEXP
)
441 pr_debug("%s: spurious TEXP interrupt!\n", card
->name
);
445 W6692_empty_Bfifo(struct w6692_ch
*wch
, int count
)
447 struct w6692_hw
*card
= wch
->bch
.hw
;
451 pr_debug("%s: empty_Bfifo %d\n", card
->name
, count
);
452 if (unlikely(wch
->bch
.state
== ISDN_P_NONE
)) {
453 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card
->name
);
454 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
456 skb_trim(wch
->bch
.rx_skb
, 0);
459 if (test_bit(FLG_RX_OFF
, &wch
->bch
.Flags
)) {
460 wch
->bch
.dropcnt
+= count
;
461 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
464 maxlen
= bchannel_get_rxbuf(&wch
->bch
, count
);
466 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
468 skb_trim(wch
->bch
.rx_skb
, 0);
469 pr_warn("%s.B%d: No bufferspace for %d bytes\n",
470 card
->name
, wch
->bch
.nr
, count
);
473 ptr
= skb_put(wch
->bch
.rx_skb
, count
);
474 insb(wch
->addr
+ W_B_RFIFO
, ptr
, count
);
475 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
476 if (debug
& DEBUG_HW_DFIFO
) {
477 snprintf(card
->log
, 63, "B%1d-recv %s %d ",
478 wch
->bch
.nr
, card
->name
, count
);
479 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
484 W6692_fill_Bfifo(struct w6692_ch
*wch
)
486 struct w6692_hw
*card
= wch
->bch
.hw
;
487 int count
, fillempty
= 0;
488 u8
*ptr
, cmd
= W_B_CMDR_RACT
| W_B_CMDR_XMS
;
490 pr_debug("%s: fill Bfifo\n", card
->name
);
491 if (!wch
->bch
.tx_skb
) {
492 if (!test_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
))
495 count
= W_B_FIFO_THRESH
;
498 count
= wch
->bch
.tx_skb
->len
- wch
->bch
.tx_idx
;
501 ptr
= wch
->bch
.tx_skb
->data
+ wch
->bch
.tx_idx
;
503 if (count
> W_B_FIFO_THRESH
)
504 count
= W_B_FIFO_THRESH
;
505 else if (test_bit(FLG_HDLC
, &wch
->bch
.Flags
))
508 pr_debug("%s: fill Bfifo%d/%d\n", card
->name
,
509 count
, wch
->bch
.tx_idx
);
510 wch
->bch
.tx_idx
+= count
;
513 outsb(wch
->addr
+ W_B_XFIFO
, ptr
, MISDN_BCH_FILL_SIZE
);
514 count
-= MISDN_BCH_FILL_SIZE
;
517 outsb(wch
->addr
+ W_B_XFIFO
, ptr
, count
);
519 WriteW6692B(wch
, W_B_CMDR
, cmd
);
520 if ((debug
& DEBUG_HW_BFIFO
) && !fillempty
) {
521 snprintf(card
->log
, 63, "B%1d-send %s %d ",
522 wch
->bch
.nr
, card
->name
, count
);
523 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
529 setvolume(struct w6692_ch
*wch
, int mic
, struct sk_buff
*skb
)
531 struct w6692_hw
*card
= wch
->bch
.hw
;
532 u16
*vol
= (u16
*)skb
->data
;
535 if ((!(card
->fmask
& pots
)) ||
536 !test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
551 WriteW6692(card
, W_XADDR
, card
->xaddr
);
556 enable_pots(struct w6692_ch
*wch
)
558 struct w6692_hw
*card
= wch
->bch
.hw
;
560 if ((!(card
->fmask
& pots
)) ||
561 !test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
563 wch
->b_mode
|= W_B_MODE_EPCM
| W_B_MODE_BSW0
;
564 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
565 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
566 card
->pctl
|= ((wch
->bch
.nr
& 2) ? W_PCTL_PCX
: 0);
567 WriteW6692(card
, W_PCTL
, card
->pctl
);
573 disable_pots(struct w6692_ch
*wch
)
575 struct w6692_hw
*card
= wch
->bch
.hw
;
577 if (!(card
->fmask
& pots
))
579 wch
->b_mode
&= ~(W_B_MODE_EPCM
| W_B_MODE_BSW0
);
580 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
581 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
587 w6692_mode(struct w6692_ch
*wch
, u32 pr
)
589 struct w6692_hw
*card
;
592 pr_debug("%s: B%d protocol %x-->%x\n", card
->name
,
593 wch
->bch
.nr
, wch
->bch
.state
, pr
);
596 if ((card
->fmask
& pots
) && (wch
->b_mode
& W_B_MODE_EPCM
))
599 mISDN_clear_bchannel(&wch
->bch
);
600 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
601 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
602 test_and_clear_bit(FLG_HDLC
, &wch
->bch
.Flags
);
603 test_and_clear_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
);
606 wch
->b_mode
= W_B_MODE_MMS
;
607 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
608 WriteW6692B(wch
, W_B_EXIM
, 0);
609 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
611 test_and_set_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
);
614 wch
->b_mode
= W_B_MODE_ITF
;
615 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
616 WriteW6692B(wch
, W_B_ADM1
, 0xff);
617 WriteW6692B(wch
, W_B_ADM2
, 0xff);
618 WriteW6692B(wch
, W_B_EXIM
, 0);
619 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
621 test_and_set_bit(FLG_HDLC
, &wch
->bch
.Flags
);
624 pr_info("%s: protocol %x not known\n", card
->name
, pr
);
632 send_next(struct w6692_ch
*wch
)
634 if (wch
->bch
.tx_skb
&& wch
->bch
.tx_idx
< wch
->bch
.tx_skb
->len
) {
635 W6692_fill_Bfifo(wch
);
637 dev_kfree_skb(wch
->bch
.tx_skb
);
638 if (get_next_bframe(&wch
->bch
)) {
639 W6692_fill_Bfifo(wch
);
640 test_and_clear_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
);
641 } else if (test_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
)) {
642 W6692_fill_Bfifo(wch
);
648 W6692B_interrupt(struct w6692_hw
*card
, int ch
)
650 struct w6692_ch
*wch
= &card
->bc
[ch
];
654 stat
= ReadW6692B(wch
, W_B_EXIR
);
655 pr_debug("%s: B%d EXIR %02x\n", card
->name
, wch
->bch
.nr
, stat
);
656 if (stat
& W_B_EXI_RME
) {
657 star
= ReadW6692B(wch
, W_B_STAR
);
658 if (star
& (W_B_STAR_RDOV
| W_B_STAR_CRCE
| W_B_STAR_RMB
)) {
659 if ((star
& W_B_STAR_RDOV
) &&
660 test_bit(FLG_ACTIVE
, &wch
->bch
.Flags
)) {
661 pr_debug("%s: B%d RDOV proto=%x\n", card
->name
,
662 wch
->bch
.nr
, wch
->bch
.state
);
663 #ifdef ERROR_STATISTIC
667 if (test_bit(FLG_HDLC
, &wch
->bch
.Flags
)) {
668 if (star
& W_B_STAR_CRCE
) {
669 pr_debug("%s: B%d CRC error\n",
670 card
->name
, wch
->bch
.nr
);
671 #ifdef ERROR_STATISTIC
675 if (star
& W_B_STAR_RMB
) {
676 pr_debug("%s: B%d message abort\n",
677 card
->name
, wch
->bch
.nr
);
678 #ifdef ERROR_STATISTIC
683 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
684 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
686 skb_trim(wch
->bch
.rx_skb
, 0);
688 count
= ReadW6692B(wch
, W_B_RBCL
) &
689 (W_B_FIFO_THRESH
- 1);
691 count
= W_B_FIFO_THRESH
;
692 W6692_empty_Bfifo(wch
, count
);
693 recv_Bchannel(&wch
->bch
, 0, false);
696 if (stat
& W_B_EXI_RMR
) {
697 if (!(stat
& W_B_EXI_RME
))
698 star
= ReadW6692B(wch
, W_B_STAR
);
699 if (star
& W_B_STAR_RDOV
) {
700 pr_debug("%s: B%d RDOV proto=%x\n", card
->name
,
701 wch
->bch
.nr
, wch
->bch
.state
);
702 #ifdef ERROR_STATISTIC
705 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
706 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
708 W6692_empty_Bfifo(wch
, W_B_FIFO_THRESH
);
709 if (test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
710 recv_Bchannel(&wch
->bch
, 0, false);
713 if (stat
& W_B_EXI_RDOV
) {
714 /* only if it is not handled yet */
715 if (!(star
& W_B_STAR_RDOV
)) {
716 pr_debug("%s: B%d RDOV IRQ proto=%x\n", card
->name
,
717 wch
->bch
.nr
, wch
->bch
.state
);
718 #ifdef ERROR_STATISTIC
721 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
722 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
725 if (stat
& W_B_EXI_XFR
) {
726 if (!(stat
& (W_B_EXI_RME
| W_B_EXI_RMR
))) {
727 star
= ReadW6692B(wch
, W_B_STAR
);
728 pr_debug("%s: B%d star %02x\n", card
->name
,
731 if (star
& W_B_STAR_XDOW
) {
732 pr_warn("%s: B%d XDOW proto=%x\n", card
->name
,
733 wch
->bch
.nr
, wch
->bch
.state
);
734 #ifdef ERROR_STATISTIC
737 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_XRST
|
740 if (wch
->bch
.tx_skb
) {
741 if (!test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
746 if (star
& W_B_STAR_XDOW
)
747 return; /* handle XDOW only once */
749 if (stat
& W_B_EXI_XDUN
) {
750 pr_warn("%s: B%d XDUN proto=%x\n", card
->name
,
751 wch
->bch
.nr
, wch
->bch
.state
);
752 #ifdef ERROR_STATISTIC
755 /* resend - no XRST needed */
756 if (wch
->bch
.tx_skb
) {
757 if (!test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
759 } else if (test_bit(FLG_FILLEMPTY
, &wch
->bch
.Flags
)) {
760 test_and_set_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
);
767 w6692_irq(int intno
, void *dev_id
)
769 struct w6692_hw
*card
= dev_id
;
772 spin_lock(&card
->lock
);
773 ista
= ReadW6692(card
, W_ISTA
);
774 if ((ista
| card
->imask
) == card
->imask
) {
775 /* possible a shared IRQ reqest */
776 spin_unlock(&card
->lock
);
780 pr_debug("%s: ista %02x\n", card
->name
, ista
);
781 ista
&= ~card
->imask
;
782 if (ista
& W_INT_B1_EXI
)
783 W6692B_interrupt(card
, 0);
784 if (ista
& W_INT_B2_EXI
)
785 W6692B_interrupt(card
, 1);
786 if (ista
& W_INT_D_RME
)
788 if (ista
& W_INT_D_RMR
)
789 W6692_empty_Dfifo(card
, W_D_FIFO_THRESH
);
790 if (ista
& W_INT_D_XFR
)
792 if (ista
& W_INT_D_EXI
)
793 handle_statusD(card
);
794 if (ista
& (W_INT_XINT0
| W_INT_XINT1
)) /* XINT0/1 - never */
795 pr_debug("%s: W6692 spurious XINT!\n", card
->name
);
796 /* End IRQ Handler */
797 spin_unlock(&card
->lock
);
802 dbusy_timer_handler(struct timer_list
*t
)
804 struct dchannel
*dch
= from_timer(dch
, t
, timer
);
805 struct w6692_hw
*card
= dch
->hw
;
809 if (test_bit(FLG_BUSY_TIMER
, &dch
->Flags
)) {
810 spin_lock_irqsave(&card
->lock
, flags
);
811 rbch
= ReadW6692(card
, W_D_RBCH
);
812 star
= ReadW6692(card
, W_D_STAR
);
813 pr_debug("%s: D-Channel Busy RBCH %02x STAR %02x\n",
814 card
->name
, rbch
, star
);
815 if (star
& W_D_STAR_XBZ
) /* D-Channel Busy */
816 test_and_set_bit(FLG_L1_BUSY
, &dch
->Flags
);
818 /* discard frame; reset transceiver */
819 test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
);
823 pr_info("%s: W6692 D-Channel Busy no tx_idx\n",
825 /* Transmitter reset */
826 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_XRST
);
828 spin_unlock_irqrestore(&card
->lock
, flags
);
832 static void initW6692(struct w6692_hw
*card
)
836 timer_setup(&card
->dch
.timer
, dbusy_timer_handler
, 0);
837 w6692_mode(&card
->bc
[0], ISDN_P_NONE
);
838 w6692_mode(&card
->bc
[1], ISDN_P_NONE
);
839 WriteW6692(card
, W_D_CTL
, 0x00);
841 WriteW6692(card
, W_D_SAM
, 0xff);
842 WriteW6692(card
, W_D_TAM
, 0xff);
843 WriteW6692(card
, W_D_MODE
, W_D_MODE_RACT
);
844 card
->state
= W_L1CMD_RST
;
845 ph_command(card
, W_L1CMD_RST
);
846 ph_command(card
, W_L1CMD_ECK
);
847 /* enable all IRQ but extern */
849 WriteW6692(card
, W_D_EXIM
, 0x00);
850 WriteW6692B(&card
->bc
[0], W_B_EXIM
, 0);
851 WriteW6692B(&card
->bc
[1], W_B_EXIM
, 0);
852 /* Reset D-chan receiver and transmitter */
853 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RRST
| W_D_CMDR_XRST
);
854 /* Reset B-chan receiver and transmitter */
855 WriteW6692B(&card
->bc
[0], W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
856 WriteW6692B(&card
->bc
[1], W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
857 /* enable peripheral */
858 if (card
->subtype
== W6692_USR
) {
859 /* seems that USR implemented some power control features
860 * Pin 79 is connected to the oscilator circuit so we
861 * have to handle it here
865 WriteW6692(card
, W_PCTL
, card
->pctl
);
866 WriteW6692(card
, W_XDATA
, card
->xdata
);
868 card
->pctl
= W_PCTL_OE5
| W_PCTL_OE4
| W_PCTL_OE2
|
869 W_PCTL_OE1
| W_PCTL_OE0
;
870 card
->xaddr
= 0x00;/* all sw off */
871 if (card
->fmask
& pots
)
872 card
->xdata
|= 0x06; /* POWER UP/ LED OFF / ALAW */
873 if (card
->fmask
& led
)
874 card
->xdata
|= 0x04; /* LED OFF */
875 if ((card
->fmask
& pots
) || (card
->fmask
& led
)) {
876 WriteW6692(card
, W_PCTL
, card
->pctl
);
877 WriteW6692(card
, W_XADDR
, card
->xaddr
);
878 WriteW6692(card
, W_XDATA
, card
->xdata
);
879 val
= ReadW6692(card
, W_XADDR
);
880 if (debug
& DEBUG_HW
)
881 pr_notice("%s: W_XADDR=%02x\n",
888 reset_w6692(struct w6692_hw
*card
)
890 WriteW6692(card
, W_D_CTL
, W_D_CTL_SRST
);
892 WriteW6692(card
, W_D_CTL
, 0);
896 init_card(struct w6692_hw
*card
)
901 spin_lock_irqsave(&card
->lock
, flags
);
903 spin_unlock_irqrestore(&card
->lock
, flags
);
904 if (request_irq(card
->irq
, w6692_irq
, IRQF_SHARED
, card
->name
, card
)) {
905 pr_info("%s: couldn't get interrupt %d\n", card
->name
,
910 spin_lock_irqsave(&card
->lock
, flags
);
913 spin_unlock_irqrestore(&card
->lock
, flags
);
915 msleep_interruptible(10);
916 if (debug
& DEBUG_HW
)
917 pr_notice("%s: IRQ %d count %d\n", card
->name
,
918 card
->irq
, card
->irqcnt
);
920 pr_info("%s: IRQ(%d) getting no IRQs during init %d\n",
921 card
->name
, card
->irq
, 3 - cnt
);
926 free_irq(card
->irq
, card
);
931 w6692_l2l1B(struct mISDNchannel
*ch
, struct sk_buff
*skb
)
933 struct bchannel
*bch
= container_of(ch
, struct bchannel
, ch
);
934 struct w6692_ch
*bc
= container_of(bch
, struct w6692_ch
, bch
);
935 struct w6692_hw
*card
= bch
->hw
;
937 struct mISDNhead
*hh
= mISDN_HEAD_P(skb
);
942 spin_lock_irqsave(&card
->lock
, flags
);
943 ret
= bchannel_senddata(bch
, skb
);
944 if (ret
> 0) { /* direct TX */
946 W6692_fill_Bfifo(bc
);
948 spin_unlock_irqrestore(&card
->lock
, flags
);
950 case PH_ACTIVATE_REQ
:
951 spin_lock_irqsave(&card
->lock
, flags
);
952 if (!test_and_set_bit(FLG_ACTIVE
, &bch
->Flags
))
953 ret
= w6692_mode(bc
, ch
->protocol
);
956 spin_unlock_irqrestore(&card
->lock
, flags
);
958 _queue_data(ch
, PH_ACTIVATE_IND
, MISDN_ID_ANY
, 0,
961 case PH_DEACTIVATE_REQ
:
962 spin_lock_irqsave(&card
->lock
, flags
);
963 mISDN_clear_bchannel(bch
);
964 w6692_mode(bc
, ISDN_P_NONE
);
965 spin_unlock_irqrestore(&card
->lock
, flags
);
966 _queue_data(ch
, PH_DEACTIVATE_IND
, MISDN_ID_ANY
, 0,
971 pr_info("%s: %s unknown prim(%x,%x)\n",
972 card
->name
, __func__
, hh
->prim
, hh
->id
);
981 channel_bctrl(struct bchannel
*bch
, struct mISDN_ctrl_req
*cq
)
983 return mISDN_ctrl_bchannel(bch
, cq
);
987 open_bchannel(struct w6692_hw
*card
, struct channel_req
*rq
)
989 struct bchannel
*bch
;
991 if (rq
->adr
.channel
== 0 || rq
->adr
.channel
> 2)
993 if (rq
->protocol
== ISDN_P_NONE
)
995 bch
= &card
->bc
[rq
->adr
.channel
- 1].bch
;
996 if (test_and_set_bit(FLG_OPEN
, &bch
->Flags
))
997 return -EBUSY
; /* b-channel can be only open once */
998 bch
->ch
.protocol
= rq
->protocol
;
1004 channel_ctrl(struct w6692_hw
*card
, struct mISDN_ctrl_req
*cq
)
1009 case MISDN_CTRL_GETOP
:
1010 cq
->op
= MISDN_CTRL_L1_TIMER3
;
1012 case MISDN_CTRL_L1_TIMER3
:
1013 ret
= l1_event(card
->dch
.l1
, HW_TIMER3_VALUE
| (cq
->p1
& 0xff));
1016 pr_info("%s: unknown CTRL OP %x\n", card
->name
, cq
->op
);
1024 w6692_bctrl(struct mISDNchannel
*ch
, u32 cmd
, void *arg
)
1026 struct bchannel
*bch
= container_of(ch
, struct bchannel
, ch
);
1027 struct w6692_ch
*bc
= container_of(bch
, struct w6692_ch
, bch
);
1028 struct w6692_hw
*card
= bch
->hw
;
1032 pr_debug("%s: %s cmd:%x %p\n", card
->name
, __func__
, cmd
, arg
);
1035 test_and_clear_bit(FLG_OPEN
, &bch
->Flags
);
1036 cancel_work_sync(&bch
->workq
);
1037 spin_lock_irqsave(&card
->lock
, flags
);
1038 mISDN_clear_bchannel(bch
);
1039 w6692_mode(bc
, ISDN_P_NONE
);
1040 spin_unlock_irqrestore(&card
->lock
, flags
);
1041 ch
->protocol
= ISDN_P_NONE
;
1043 module_put(THIS_MODULE
);
1046 case CONTROL_CHANNEL
:
1047 ret
= channel_bctrl(bch
, arg
);
1050 pr_info("%s: %s unknown prim(%x)\n",
1051 card
->name
, __func__
, cmd
);
1057 w6692_l2l1D(struct mISDNchannel
*ch
, struct sk_buff
*skb
)
1059 struct mISDNdevice
*dev
= container_of(ch
, struct mISDNdevice
, D
);
1060 struct dchannel
*dch
= container_of(dev
, struct dchannel
, dev
);
1061 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1063 struct mISDNhead
*hh
= mISDN_HEAD_P(skb
);
1069 spin_lock_irqsave(&card
->lock
, flags
);
1070 ret
= dchannel_senddata(dch
, skb
);
1071 if (ret
> 0) { /* direct TX */
1072 id
= hh
->id
; /* skb can be freed */
1073 W6692_fill_Dfifo(card
);
1075 spin_unlock_irqrestore(&card
->lock
, flags
);
1076 queue_ch_frame(ch
, PH_DATA_CNF
, id
, NULL
);
1078 spin_unlock_irqrestore(&card
->lock
, flags
);
1080 case PH_ACTIVATE_REQ
:
1081 ret
= l1_event(dch
->l1
, hh
->prim
);
1083 case PH_DEACTIVATE_REQ
:
1084 test_and_clear_bit(FLG_L2_ACTIVATED
, &dch
->Flags
);
1085 ret
= l1_event(dch
->l1
, hh
->prim
);
1095 w6692_l1callback(struct dchannel
*dch
, u32 cmd
)
1097 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1100 pr_debug("%s: cmd(%x) state(%02x)\n", card
->name
, cmd
, card
->state
);
1103 spin_lock_irqsave(&card
->lock
, flags
);
1104 ph_command(card
, W_L1CMD_AR8
);
1105 spin_unlock_irqrestore(&card
->lock
, flags
);
1108 spin_lock_irqsave(&card
->lock
, flags
);
1109 ph_command(card
, W_L1CMD_AR10
);
1110 spin_unlock_irqrestore(&card
->lock
, flags
);
1113 spin_lock_irqsave(&card
->lock
, flags
);
1114 if (card
->state
!= W_L1IND_DRD
)
1115 ph_command(card
, W_L1CMD_RST
);
1116 ph_command(card
, W_L1CMD_ECK
);
1117 spin_unlock_irqrestore(&card
->lock
, flags
);
1120 skb_queue_purge(&dch
->squeue
);
1122 dev_kfree_skb(dch
->tx_skb
);
1127 dev_kfree_skb(dch
->rx_skb
);
1130 test_and_clear_bit(FLG_TX_BUSY
, &dch
->Flags
);
1131 if (test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
))
1132 del_timer(&dch
->timer
);
1134 case HW_POWERUP_REQ
:
1135 spin_lock_irqsave(&card
->lock
, flags
);
1136 ph_command(card
, W_L1CMD_ECK
);
1137 spin_unlock_irqrestore(&card
->lock
, flags
);
1139 case PH_ACTIVATE_IND
:
1140 test_and_set_bit(FLG_ACTIVE
, &dch
->Flags
);
1141 _queue_data(&dch
->dev
.D
, cmd
, MISDN_ID_ANY
, 0, NULL
,
1144 case PH_DEACTIVATE_IND
:
1145 test_and_clear_bit(FLG_ACTIVE
, &dch
->Flags
);
1146 _queue_data(&dch
->dev
.D
, cmd
, MISDN_ID_ANY
, 0, NULL
,
1150 pr_debug("%s: %s unknown command %x\n", card
->name
,
1158 open_dchannel(struct w6692_hw
*card
, struct channel_req
*rq
, void *caller
)
1160 pr_debug("%s: %s dev(%d) open from %p\n", card
->name
, __func__
,
1161 card
->dch
.dev
.id
, caller
);
1162 if (rq
->protocol
!= ISDN_P_TE_S0
)
1164 if (rq
->adr
.channel
== 1)
1165 /* E-Channel not supported */
1167 rq
->ch
= &card
->dch
.dev
.D
;
1168 rq
->ch
->protocol
= rq
->protocol
;
1169 if (card
->dch
.state
== 7)
1170 _queue_data(rq
->ch
, PH_ACTIVATE_IND
, MISDN_ID_ANY
,
1171 0, NULL
, GFP_KERNEL
);
1176 w6692_dctrl(struct mISDNchannel
*ch
, u32 cmd
, void *arg
)
1178 struct mISDNdevice
*dev
= container_of(ch
, struct mISDNdevice
, D
);
1179 struct dchannel
*dch
= container_of(dev
, struct dchannel
, dev
);
1180 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1181 struct channel_req
*rq
;
1184 pr_debug("%s: DCTRL: %x %p\n", card
->name
, cmd
, arg
);
1188 if (rq
->protocol
== ISDN_P_TE_S0
)
1189 err
= open_dchannel(card
, rq
, __builtin_return_address(0));
1191 err
= open_bchannel(card
, rq
);
1194 if (!try_module_get(THIS_MODULE
))
1195 pr_info("%s: cannot get module\n", card
->name
);
1198 pr_debug("%s: dev(%d) close from %p\n", card
->name
,
1199 dch
->dev
.id
, __builtin_return_address(0));
1200 module_put(THIS_MODULE
);
1202 case CONTROL_CHANNEL
:
1203 err
= channel_ctrl(card
, arg
);
1206 pr_debug("%s: unknown DCTRL command %x\n", card
->name
, cmd
);
1213 setup_w6692(struct w6692_hw
*card
)
1217 if (!request_region(card
->addr
, 256, card
->name
)) {
1218 pr_info("%s: config port %x-%x already in use\n", card
->name
,
1219 card
->addr
, card
->addr
+ 255);
1223 card
->bc
[0].addr
= card
->addr
;
1224 card
->bc
[1].addr
= card
->addr
+ 0x40;
1225 val
= ReadW6692(card
, W_ISTA
);
1226 if (debug
& DEBUG_HW
)
1227 pr_notice("%s ISTA=%02x\n", card
->name
, val
);
1228 val
= ReadW6692(card
, W_IMASK
);
1229 if (debug
& DEBUG_HW
)
1230 pr_notice("%s IMASK=%02x\n", card
->name
, val
);
1231 val
= ReadW6692(card
, W_D_EXIR
);
1232 if (debug
& DEBUG_HW
)
1233 pr_notice("%s D_EXIR=%02x\n", card
->name
, val
);
1234 val
= ReadW6692(card
, W_D_EXIM
);
1235 if (debug
& DEBUG_HW
)
1236 pr_notice("%s D_EXIM=%02x\n", card
->name
, val
);
1237 val
= ReadW6692(card
, W_D_RSTA
);
1238 if (debug
& DEBUG_HW
)
1239 pr_notice("%s D_RSTA=%02x\n", card
->name
, val
);
1244 release_card(struct w6692_hw
*card
)
1248 spin_lock_irqsave(&card
->lock
, flags
);
1249 disable_hwirq(card
);
1250 w6692_mode(&card
->bc
[0], ISDN_P_NONE
);
1251 w6692_mode(&card
->bc
[1], ISDN_P_NONE
);
1252 if ((card
->fmask
& led
) || card
->subtype
== W6692_USR
) {
1253 card
->xdata
|= 0x04; /* LED OFF */
1254 WriteW6692(card
, W_XDATA
, card
->xdata
);
1256 spin_unlock_irqrestore(&card
->lock
, flags
);
1257 free_irq(card
->irq
, card
);
1258 l1_event(card
->dch
.l1
, CLOSE_CHANNEL
);
1259 mISDN_unregister_device(&card
->dch
.dev
);
1260 release_region(card
->addr
, 256);
1261 mISDN_freebchannel(&card
->bc
[1].bch
);
1262 mISDN_freebchannel(&card
->bc
[0].bch
);
1263 mISDN_freedchannel(&card
->dch
);
1264 write_lock_irqsave(&card_lock
, flags
);
1265 list_del(&card
->list
);
1266 write_unlock_irqrestore(&card_lock
, flags
);
1267 pci_disable_device(card
->pdev
);
1268 pci_set_drvdata(card
->pdev
, NULL
);
1273 setup_instance(struct w6692_hw
*card
)
1278 snprintf(card
->name
, MISDN_MAX_IDLEN
- 1, "w6692.%d", w6692_cnt
+ 1);
1279 write_lock_irqsave(&card_lock
, flags
);
1280 list_add_tail(&card
->list
, &Cards
);
1281 write_unlock_irqrestore(&card_lock
, flags
);
1282 card
->fmask
= (1 << w6692_cnt
);
1284 spin_lock_init(&card
->lock
);
1285 mISDN_initdchannel(&card
->dch
, MAX_DFRAME_LEN_L1
, W6692_ph_bh
);
1286 card
->dch
.dev
.Dprotocols
= (1 << ISDN_P_TE_S0
);
1287 card
->dch
.dev
.D
.send
= w6692_l2l1D
;
1288 card
->dch
.dev
.D
.ctrl
= w6692_dctrl
;
1289 card
->dch
.dev
.Bprotocols
= (1 << (ISDN_P_B_RAW
& ISDN_P_B_MASK
)) |
1290 (1 << (ISDN_P_B_HDLC
& ISDN_P_B_MASK
));
1291 card
->dch
.hw
= card
;
1292 card
->dch
.dev
.nrbchan
= 2;
1293 for (i
= 0; i
< 2; i
++) {
1294 mISDN_initbchannel(&card
->bc
[i
].bch
, MAX_DATA_MEM
,
1296 card
->bc
[i
].bch
.hw
= card
;
1297 card
->bc
[i
].bch
.nr
= i
+ 1;
1298 card
->bc
[i
].bch
.ch
.nr
= i
+ 1;
1299 card
->bc
[i
].bch
.ch
.send
= w6692_l2l1B
;
1300 card
->bc
[i
].bch
.ch
.ctrl
= w6692_bctrl
;
1301 set_channelmap(i
+ 1, card
->dch
.dev
.channelmap
);
1302 list_add(&card
->bc
[i
].bch
.ch
.list
, &card
->dch
.dev
.bchannels
);
1304 err
= setup_w6692(card
);
1307 err
= mISDN_register_device(&card
->dch
.dev
, &card
->pdev
->dev
,
1311 err
= init_card(card
);
1314 err
= create_l1(&card
->dch
, w6692_l1callback
);
1317 pr_notice("W6692 %d cards installed\n", w6692_cnt
);
1321 free_irq(card
->irq
, card
);
1323 mISDN_unregister_device(&card
->dch
.dev
);
1325 release_region(card
->addr
, 256);
1327 mISDN_freebchannel(&card
->bc
[1].bch
);
1328 mISDN_freebchannel(&card
->bc
[0].bch
);
1329 mISDN_freedchannel(&card
->dch
);
1330 write_lock_irqsave(&card_lock
, flags
);
1331 list_del(&card
->list
);
1332 write_unlock_irqrestore(&card_lock
, flags
);
1338 w6692_probe(struct pci_dev
*pdev
, const struct pci_device_id
*ent
)
1341 struct w6692_hw
*card
;
1342 struct w6692map
*m
= (struct w6692map
*)ent
->driver_data
;
1344 card
= kzalloc(sizeof(struct w6692_hw
), GFP_KERNEL
);
1346 pr_info("No kmem for w6692 card\n");
1350 card
->subtype
= m
->subtype
;
1351 err
= pci_enable_device(pdev
);
1357 printk(KERN_INFO
"mISDN_w6692: found adapter %s at %s\n",
1358 m
->name
, pci_name(pdev
));
1360 card
->addr
= pci_resource_start(pdev
, 1);
1361 card
->irq
= pdev
->irq
;
1362 pci_set_drvdata(pdev
, card
);
1363 err
= setup_instance(card
);
1365 pci_set_drvdata(pdev
, NULL
);
1370 w6692_remove_pci(struct pci_dev
*pdev
)
1372 struct w6692_hw
*card
= pci_get_drvdata(pdev
);
1378 pr_notice("%s: drvdata already removed\n", __func__
);
1381 static const struct pci_device_id w6692_ids
[] = {
1382 { PCI_VENDOR_ID_DYNALINK
, PCI_DEVICE_ID_DYNALINK_IS64PH
,
1383 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, (ulong
)&w6692_map
[0]},
1384 { PCI_VENDOR_ID_WINBOND2
, PCI_DEVICE_ID_WINBOND2_6692
,
1385 PCI_VENDOR_ID_USR
, PCI_DEVICE_ID_USR_6692
, 0, 0,
1386 (ulong
)&w6692_map
[2]},
1387 { PCI_VENDOR_ID_WINBOND2
, PCI_DEVICE_ID_WINBOND2_6692
,
1388 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, (ulong
)&w6692_map
[1]},
1391 MODULE_DEVICE_TABLE(pci
, w6692_ids
);
1393 static struct pci_driver w6692_driver
= {
1395 .probe
= w6692_probe
,
1396 .remove
= w6692_remove_pci
,
1397 .id_table
= w6692_ids
,
1400 static int __init
w6692_init(void)
1404 pr_notice("Winbond W6692 PCI driver Rev. %s\n", W6692_REV
);
1406 err
= pci_register_driver(&w6692_driver
);
1410 static void __exit
w6692_cleanup(void)
1412 pci_unregister_driver(&w6692_driver
);
1415 module_init(w6692_init
);
1416 module_exit(w6692_cleanup
);