2 * w6692.c mISDN driver for Winbond w6692 based cards
4 * Author Karsten Keil <kkeil@suse.de>
5 * based on the w6692 I4L driver from Petr Novak <petr.novak@i.cz>
7 * Copyright 2009 by Karsten Keil <keil@isdn4linux.de>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/interrupt.h>
25 #include <linux/module.h>
26 #include <linux/pci.h>
27 #include <linux/delay.h>
28 #include <linux/mISDNhw.h>
29 #include <linux/slab.h>
32 #define W6692_REV "2.0"
34 #define DBUSY_TIMER_VALUE 80
42 /* private data in the PCI devices list */
48 static const struct w6692map w6692_map
[] =
50 {W6692_ASUS
, "Dynalink/AsusCom IS64PH"},
51 {W6692_WINBOND
, "Winbond W6692"},
52 {W6692_USR
, "USR W6692"}
55 #define PCI_DEVICE_ID_USR_6692 0x3409
60 struct timer_list timer
;
65 struct list_head list
;
67 char name
[MISDN_MAX_IDLEN
];
71 u32 fmask
; /* feature mask - bit set per card nr */
73 spinlock_t lock
; /* hw lock */
79 struct w6692_ch bc
[2];
84 static LIST_HEAD(Cards
);
85 static DEFINE_RWLOCK(card_lock
); /* protect Cards */
93 _set_debug(struct w6692_hw
*card
)
95 card
->dch
.debug
= debug
;
96 card
->bc
[0].bch
.debug
= debug
;
97 card
->bc
[1].bch
.debug
= debug
;
101 set_debug(const char *val
, const struct kernel_param
*kp
)
104 struct w6692_hw
*card
;
106 ret
= param_set_uint(val
, kp
);
108 read_lock(&card_lock
);
109 list_for_each_entry(card
, &Cards
, list
)
111 read_unlock(&card_lock
);
116 MODULE_AUTHOR("Karsten Keil");
117 MODULE_LICENSE("GPL v2");
118 MODULE_VERSION(W6692_REV
);
119 module_param_call(debug
, set_debug
, param_get_uint
, &debug
, S_IRUGO
| S_IWUSR
);
120 MODULE_PARM_DESC(debug
, "W6692 debug mask");
121 module_param(led
, uint
, S_IRUGO
| S_IWUSR
);
122 MODULE_PARM_DESC(led
, "W6692 LED support bitmask (one bit per card)");
123 module_param(pots
, uint
, S_IRUGO
| S_IWUSR
);
124 MODULE_PARM_DESC(pots
, "W6692 POTS support bitmask (one bit per card)");
127 ReadW6692(struct w6692_hw
*card
, u8 offset
)
129 return inb(card
->addr
+ offset
);
133 WriteW6692(struct w6692_hw
*card
, u8 offset
, u8 value
)
135 outb(value
, card
->addr
+ offset
);
139 ReadW6692B(struct w6692_ch
*bc
, u8 offset
)
141 return inb(bc
->addr
+ offset
);
145 WriteW6692B(struct w6692_ch
*bc
, u8 offset
, u8 value
)
147 outb(value
, bc
->addr
+ offset
);
151 enable_hwirq(struct w6692_hw
*card
)
153 WriteW6692(card
, W_IMASK
, card
->imask
);
157 disable_hwirq(struct w6692_hw
*card
)
159 WriteW6692(card
, W_IMASK
, 0xff);
162 static const char *W6692Ver
[] = {"V00", "V01", "V10", "V11"};
165 W6692Version(struct w6692_hw
*card
)
169 val
= ReadW6692(card
, W_D_RBCH
);
170 pr_notice("%s: Winbond W6692 version: %s\n", card
->name
,
171 W6692Ver
[(val
>> 6) & 3]);
175 w6692_led_handler(struct w6692_hw
*card
, int on
)
177 if ((!(card
->fmask
& led
)) || card
->subtype
== W6692_USR
)
180 card
->xdata
&= 0xfb; /* LED ON */
181 WriteW6692(card
, W_XDATA
, card
->xdata
);
183 card
->xdata
|= 0x04; /* LED OFF */
184 WriteW6692(card
, W_XDATA
, card
->xdata
);
189 ph_command(struct w6692_hw
*card
, u8 cmd
)
191 pr_debug("%s: ph_command %x\n", card
->name
, cmd
);
192 WriteW6692(card
, W_CIX
, cmd
);
196 W6692_new_ph(struct w6692_hw
*card
)
198 if (card
->state
== W_L1CMD_RST
)
199 ph_command(card
, W_L1CMD_DRC
);
200 schedule_event(&card
->dch
, FLG_PHCHANGE
);
204 W6692_ph_bh(struct dchannel
*dch
)
206 struct w6692_hw
*card
= dch
->hw
;
208 switch (card
->state
) {
211 l1_event(dch
->l1
, HW_RESET_IND
);
215 l1_event(dch
->l1
, HW_DEACT_CNF
);
219 l1_event(dch
->l1
, HW_DEACT_IND
);
223 l1_event(dch
->l1
, HW_POWERUP_IND
);
226 if (dch
->state
<= 5) {
228 l1_event(dch
->l1
, ANYSIGNAL
);
231 l1_event(dch
->l1
, LOSTFRAMING
);
236 l1_event(dch
->l1
, INFO2
);
240 l1_event(dch
->l1
, INFO4_P8
);
244 l1_event(dch
->l1
, INFO4_P10
);
247 pr_debug("%s: TE unknown state %02x dch state %02x\n",
248 card
->name
, card
->state
, dch
->state
);
251 pr_debug("%s: TE newstate %02x\n", card
->name
, dch
->state
);
255 W6692_empty_Dfifo(struct w6692_hw
*card
, int count
)
257 struct dchannel
*dch
= &card
->dch
;
260 pr_debug("%s: empty_Dfifo %d\n", card
->name
, count
);
262 dch
->rx_skb
= mI_alloc_skb(card
->dch
.maxlen
, GFP_ATOMIC
);
264 pr_info("%s: D receive out of memory\n", card
->name
);
265 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
269 if ((dch
->rx_skb
->len
+ count
) >= dch
->maxlen
) {
270 pr_debug("%s: empty_Dfifo overrun %d\n", card
->name
,
271 dch
->rx_skb
->len
+ count
);
272 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
275 ptr
= skb_put(dch
->rx_skb
, count
);
276 insb(card
->addr
+ W_D_RFIFO
, ptr
, count
);
277 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
278 if (debug
& DEBUG_HW_DFIFO
) {
279 snprintf(card
->log
, 63, "D-recv %s %d ",
281 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
286 W6692_fill_Dfifo(struct w6692_hw
*card
)
288 struct dchannel
*dch
= &card
->dch
;
291 u8 cmd
= W_D_CMDR_XMS
;
293 pr_debug("%s: fill_Dfifo\n", card
->name
);
296 count
= dch
->tx_skb
->len
- dch
->tx_idx
;
299 if (count
> W_D_FIFO_THRESH
)
300 count
= W_D_FIFO_THRESH
;
303 ptr
= dch
->tx_skb
->data
+ dch
->tx_idx
;
304 dch
->tx_idx
+= count
;
305 outsb(card
->addr
+ W_D_XFIFO
, ptr
, count
);
306 WriteW6692(card
, W_D_CMDR
, cmd
);
307 if (test_and_set_bit(FLG_BUSY_TIMER
, &dch
->Flags
)) {
308 pr_debug("%s: fill_Dfifo dbusytimer running\n", card
->name
);
309 del_timer(&dch
->timer
);
311 dch
->timer
.expires
= jiffies
+ ((DBUSY_TIMER_VALUE
* HZ
) / 1000);
312 add_timer(&dch
->timer
);
313 if (debug
& DEBUG_HW_DFIFO
) {
314 snprintf(card
->log
, 63, "D-send %s %d ",
316 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
321 d_retransmit(struct w6692_hw
*card
)
323 struct dchannel
*dch
= &card
->dch
;
325 if (test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
))
326 del_timer(&dch
->timer
);
328 if (test_and_clear_bit(FLG_L1_BUSY
, &dch
->Flags
))
329 dchannel_sched_event(dch
, D_CLEARBUSY
);
331 if (test_bit(FLG_TX_BUSY
, &dch
->Flags
)) {
334 W6692_fill_Dfifo(card
);
335 } else if (dch
->tx_skb
) { /* should not happen */
336 pr_info("%s: %s without TX_BUSY\n", card
->name
, __func__
);
337 test_and_set_bit(FLG_TX_BUSY
, &dch
->Flags
);
339 W6692_fill_Dfifo(card
);
341 pr_info("%s: XDU no TX_BUSY\n", card
->name
);
342 if (get_next_dframe(dch
))
343 W6692_fill_Dfifo(card
);
348 handle_rxD(struct w6692_hw
*card
) {
352 stat
= ReadW6692(card
, W_D_RSTA
);
353 if (stat
& (W_D_RSTA_RDOV
| W_D_RSTA_CRCE
| W_D_RSTA_RMB
)) {
354 if (stat
& W_D_RSTA_RDOV
) {
355 pr_debug("%s: D-channel RDOV\n", card
->name
);
356 #ifdef ERROR_STATISTIC
360 if (stat
& W_D_RSTA_CRCE
) {
361 pr_debug("%s: D-channel CRC error\n", card
->name
);
362 #ifdef ERROR_STATISTIC
366 if (stat
& W_D_RSTA_RMB
) {
367 pr_debug("%s: D-channel ABORT\n", card
->name
);
368 #ifdef ERROR_STATISTIC
372 if (card
->dch
.rx_skb
)
373 dev_kfree_skb(card
->dch
.rx_skb
);
374 card
->dch
.rx_skb
= NULL
;
375 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
| W_D_CMDR_RRST
);
377 count
= ReadW6692(card
, W_D_RBCL
) & (W_D_FIFO_THRESH
- 1);
379 count
= W_D_FIFO_THRESH
;
380 W6692_empty_Dfifo(card
, count
);
381 recv_Dchannel(&card
->dch
);
386 handle_txD(struct w6692_hw
*card
) {
387 if (test_and_clear_bit(FLG_BUSY_TIMER
, &card
->dch
.Flags
))
388 del_timer(&card
->dch
.timer
);
389 if (card
->dch
.tx_skb
&& card
->dch
.tx_idx
< card
->dch
.tx_skb
->len
) {
390 W6692_fill_Dfifo(card
);
392 if (card
->dch
.tx_skb
)
393 dev_kfree_skb(card
->dch
.tx_skb
);
394 if (get_next_dframe(&card
->dch
))
395 W6692_fill_Dfifo(card
);
400 handle_statusD(struct w6692_hw
*card
)
402 struct dchannel
*dch
= &card
->dch
;
405 exval
= ReadW6692(card
, W_D_EXIR
);
407 pr_debug("%s: D_EXIR %02x\n", card
->name
, exval
);
408 if (exval
& (W_D_EXI_XDUN
| W_D_EXI_XCOL
)) {
409 /* Transmit underrun/collision */
410 pr_debug("%s: D-channel underrun/collision\n", card
->name
);
411 #ifdef ERROR_STATISTIC
416 if (exval
& W_D_EXI_RDOV
) { /* RDOV */
417 pr_debug("%s: D-channel RDOV\n", card
->name
);
418 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RRST
);
420 if (exval
& W_D_EXI_TIN2
) /* TIN2 - never */
421 pr_debug("%s: spurious TIN2 interrupt\n", card
->name
);
422 if (exval
& W_D_EXI_MOC
) { /* MOC - not supported */
423 v1
= ReadW6692(card
, W_MOSR
);
424 pr_debug("%s: spurious MOC interrupt MOSR %02x\n",
427 if (exval
& W_D_EXI_ISC
) { /* ISC - Level1 change */
428 cir
= ReadW6692(card
, W_CIR
);
429 pr_debug("%s: ISC CIR %02X\n", card
->name
, cir
);
430 if (cir
& W_CIR_ICC
) {
431 v1
= cir
& W_CIR_COD_MASK
;
432 pr_debug("%s: ph_state_change %x -> %x\n", card
->name
,
435 if (card
->fmask
& led
) {
439 w6692_led_handler(card
, 1);
442 w6692_led_handler(card
, 0);
448 if (cir
& W_CIR_SCC
) {
449 v1
= ReadW6692(card
, W_SQR
);
450 pr_debug("%s: SCC SQR %02X\n", card
->name
, v1
);
453 if (exval
& W_D_EXI_WEXP
)
454 pr_debug("%s: spurious WEXP interrupt!\n", card
->name
);
455 if (exval
& W_D_EXI_TEXP
)
456 pr_debug("%s: spurious TEXP interrupt!\n", card
->name
);
460 W6692_empty_Bfifo(struct w6692_ch
*wch
, int count
)
462 struct w6692_hw
*card
= wch
->bch
.hw
;
466 pr_debug("%s: empty_Bfifo %d\n", card
->name
, count
);
467 if (unlikely(wch
->bch
.state
== ISDN_P_NONE
)) {
468 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card
->name
);
469 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
471 skb_trim(wch
->bch
.rx_skb
, 0);
474 if (test_bit(FLG_RX_OFF
, &wch
->bch
.Flags
)) {
475 wch
->bch
.dropcnt
+= count
;
476 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
479 maxlen
= bchannel_get_rxbuf(&wch
->bch
, count
);
481 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
483 skb_trim(wch
->bch
.rx_skb
, 0);
484 pr_warning("%s.B%d: No bufferspace for %d bytes\n",
485 card
->name
, wch
->bch
.nr
, count
);
488 ptr
= skb_put(wch
->bch
.rx_skb
, count
);
489 insb(wch
->addr
+ W_B_RFIFO
, ptr
, count
);
490 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
491 if (debug
& DEBUG_HW_DFIFO
) {
492 snprintf(card
->log
, 63, "B%1d-recv %s %d ",
493 wch
->bch
.nr
, card
->name
, count
);
494 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
499 W6692_fill_Bfifo(struct w6692_ch
*wch
)
501 struct w6692_hw
*card
= wch
->bch
.hw
;
502 int count
, fillempty
= 0;
503 u8
*ptr
, cmd
= W_B_CMDR_RACT
| W_B_CMDR_XMS
;
505 pr_debug("%s: fill Bfifo\n", card
->name
);
506 if (!wch
->bch
.tx_skb
) {
507 if (!test_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
))
510 count
= W_B_FIFO_THRESH
;
513 count
= wch
->bch
.tx_skb
->len
- wch
->bch
.tx_idx
;
516 ptr
= wch
->bch
.tx_skb
->data
+ wch
->bch
.tx_idx
;
518 if (count
> W_B_FIFO_THRESH
)
519 count
= W_B_FIFO_THRESH
;
520 else if (test_bit(FLG_HDLC
, &wch
->bch
.Flags
))
523 pr_debug("%s: fill Bfifo%d/%d\n", card
->name
,
524 count
, wch
->bch
.tx_idx
);
525 wch
->bch
.tx_idx
+= count
;
528 outsb(wch
->addr
+ W_B_XFIFO
, ptr
, MISDN_BCH_FILL_SIZE
);
529 count
-= MISDN_BCH_FILL_SIZE
;
532 outsb(wch
->addr
+ W_B_XFIFO
, ptr
, count
);
534 WriteW6692B(wch
, W_B_CMDR
, cmd
);
535 if ((debug
& DEBUG_HW_BFIFO
) && !fillempty
) {
536 snprintf(card
->log
, 63, "B%1d-send %s %d ",
537 wch
->bch
.nr
, card
->name
, count
);
538 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
544 setvolume(struct w6692_ch
*wch
, int mic
, struct sk_buff
*skb
)
546 struct w6692_hw
*card
= wch
->bch
.hw
;
547 u16
*vol
= (u16
*)skb
->data
;
550 if ((!(card
->fmask
& pots
)) ||
551 !test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
566 WriteW6692(card
, W_XADDR
, card
->xaddr
);
571 enable_pots(struct w6692_ch
*wch
)
573 struct w6692_hw
*card
= wch
->bch
.hw
;
575 if ((!(card
->fmask
& pots
)) ||
576 !test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
578 wch
->b_mode
|= W_B_MODE_EPCM
| W_B_MODE_BSW0
;
579 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
580 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
581 card
->pctl
|= ((wch
->bch
.nr
& 2) ? W_PCTL_PCX
: 0);
582 WriteW6692(card
, W_PCTL
, card
->pctl
);
588 disable_pots(struct w6692_ch
*wch
)
590 struct w6692_hw
*card
= wch
->bch
.hw
;
592 if (!(card
->fmask
& pots
))
594 wch
->b_mode
&= ~(W_B_MODE_EPCM
| W_B_MODE_BSW0
);
595 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
596 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
602 w6692_mode(struct w6692_ch
*wch
, u32 pr
)
604 struct w6692_hw
*card
;
607 pr_debug("%s: B%d protocol %x-->%x\n", card
->name
,
608 wch
->bch
.nr
, wch
->bch
.state
, pr
);
611 if ((card
->fmask
& pots
) && (wch
->b_mode
& W_B_MODE_EPCM
))
614 mISDN_clear_bchannel(&wch
->bch
);
615 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
616 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
617 test_and_clear_bit(FLG_HDLC
, &wch
->bch
.Flags
);
618 test_and_clear_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
);
621 wch
->b_mode
= W_B_MODE_MMS
;
622 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
623 WriteW6692B(wch
, W_B_EXIM
, 0);
624 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
626 test_and_set_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
);
629 wch
->b_mode
= W_B_MODE_ITF
;
630 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
631 WriteW6692B(wch
, W_B_ADM1
, 0xff);
632 WriteW6692B(wch
, W_B_ADM2
, 0xff);
633 WriteW6692B(wch
, W_B_EXIM
, 0);
634 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
636 test_and_set_bit(FLG_HDLC
, &wch
->bch
.Flags
);
639 pr_info("%s: protocol %x not known\n", card
->name
, pr
);
647 send_next(struct w6692_ch
*wch
)
649 if (wch
->bch
.tx_skb
&& wch
->bch
.tx_idx
< wch
->bch
.tx_skb
->len
) {
650 W6692_fill_Bfifo(wch
);
653 dev_kfree_skb(wch
->bch
.tx_skb
);
654 if (get_next_bframe(&wch
->bch
)) {
655 W6692_fill_Bfifo(wch
);
656 test_and_clear_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
);
657 } else if (test_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
)) {
658 W6692_fill_Bfifo(wch
);
664 W6692B_interrupt(struct w6692_hw
*card
, int ch
)
666 struct w6692_ch
*wch
= &card
->bc
[ch
];
670 stat
= ReadW6692B(wch
, W_B_EXIR
);
671 pr_debug("%s: B%d EXIR %02x\n", card
->name
, wch
->bch
.nr
, stat
);
672 if (stat
& W_B_EXI_RME
) {
673 star
= ReadW6692B(wch
, W_B_STAR
);
674 if (star
& (W_B_STAR_RDOV
| W_B_STAR_CRCE
| W_B_STAR_RMB
)) {
675 if ((star
& W_B_STAR_RDOV
) &&
676 test_bit(FLG_ACTIVE
, &wch
->bch
.Flags
)) {
677 pr_debug("%s: B%d RDOV proto=%x\n", card
->name
,
678 wch
->bch
.nr
, wch
->bch
.state
);
679 #ifdef ERROR_STATISTIC
683 if (test_bit(FLG_HDLC
, &wch
->bch
.Flags
)) {
684 if (star
& W_B_STAR_CRCE
) {
685 pr_debug("%s: B%d CRC error\n",
686 card
->name
, wch
->bch
.nr
);
687 #ifdef ERROR_STATISTIC
691 if (star
& W_B_STAR_RMB
) {
692 pr_debug("%s: B%d message abort\n",
693 card
->name
, wch
->bch
.nr
);
694 #ifdef ERROR_STATISTIC
699 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
700 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
702 skb_trim(wch
->bch
.rx_skb
, 0);
704 count
= ReadW6692B(wch
, W_B_RBCL
) &
705 (W_B_FIFO_THRESH
- 1);
707 count
= W_B_FIFO_THRESH
;
708 W6692_empty_Bfifo(wch
, count
);
709 recv_Bchannel(&wch
->bch
, 0, false);
712 if (stat
& W_B_EXI_RMR
) {
713 if (!(stat
& W_B_EXI_RME
))
714 star
= ReadW6692B(wch
, W_B_STAR
);
715 if (star
& W_B_STAR_RDOV
) {
716 pr_debug("%s: B%d RDOV 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
);
724 W6692_empty_Bfifo(wch
, W_B_FIFO_THRESH
);
725 if (test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
726 recv_Bchannel(&wch
->bch
, 0, false);
729 if (stat
& W_B_EXI_RDOV
) {
730 /* only if it is not handled yet */
731 if (!(star
& W_B_STAR_RDOV
)) {
732 pr_debug("%s: B%d RDOV IRQ 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_RACK
|
738 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
741 if (stat
& W_B_EXI_XFR
) {
742 if (!(stat
& (W_B_EXI_RME
| W_B_EXI_RMR
))) {
743 star
= ReadW6692B(wch
, W_B_STAR
);
744 pr_debug("%s: B%d star %02x\n", card
->name
,
747 if (star
& W_B_STAR_XDOW
) {
748 pr_warning("%s: B%d XDOW proto=%x\n", card
->name
,
749 wch
->bch
.nr
, wch
->bch
.state
);
750 #ifdef ERROR_STATISTIC
753 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_XRST
|
756 if (wch
->bch
.tx_skb
) {
757 if (!test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
762 if (star
& W_B_STAR_XDOW
)
763 return; /* handle XDOW only once */
765 if (stat
& W_B_EXI_XDUN
) {
766 pr_warning("%s: B%d XDUN proto=%x\n", card
->name
,
767 wch
->bch
.nr
, wch
->bch
.state
);
768 #ifdef ERROR_STATISTIC
771 /* resend - no XRST needed */
772 if (wch
->bch
.tx_skb
) {
773 if (!test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
775 } else if (test_bit(FLG_FILLEMPTY
, &wch
->bch
.Flags
)) {
776 test_and_set_bit(FLG_TX_EMPTY
, &wch
->bch
.Flags
);
783 w6692_irq(int intno
, void *dev_id
)
785 struct w6692_hw
*card
= dev_id
;
788 spin_lock(&card
->lock
);
789 ista
= ReadW6692(card
, W_ISTA
);
790 if ((ista
| card
->imask
) == card
->imask
) {
791 /* possible a shared IRQ reqest */
792 spin_unlock(&card
->lock
);
796 pr_debug("%s: ista %02x\n", card
->name
, ista
);
797 ista
&= ~card
->imask
;
798 if (ista
& W_INT_B1_EXI
)
799 W6692B_interrupt(card
, 0);
800 if (ista
& W_INT_B2_EXI
)
801 W6692B_interrupt(card
, 1);
802 if (ista
& W_INT_D_RME
)
804 if (ista
& W_INT_D_RMR
)
805 W6692_empty_Dfifo(card
, W_D_FIFO_THRESH
);
806 if (ista
& W_INT_D_XFR
)
808 if (ista
& W_INT_D_EXI
)
809 handle_statusD(card
);
810 if (ista
& (W_INT_XINT0
| W_INT_XINT1
)) /* XINT0/1 - never */
811 pr_debug("%s: W6692 spurious XINT!\n", card
->name
);
812 /* End IRQ Handler */
813 spin_unlock(&card
->lock
);
818 dbusy_timer_handler(struct timer_list
*t
)
820 struct dchannel
*dch
= from_timer(dch
, t
, timer
);
821 struct w6692_hw
*card
= dch
->hw
;
825 if (test_bit(FLG_BUSY_TIMER
, &dch
->Flags
)) {
826 spin_lock_irqsave(&card
->lock
, flags
);
827 rbch
= ReadW6692(card
, W_D_RBCH
);
828 star
= ReadW6692(card
, W_D_STAR
);
829 pr_debug("%s: D-Channel Busy RBCH %02x STAR %02x\n",
830 card
->name
, rbch
, star
);
831 if (star
& W_D_STAR_XBZ
) /* D-Channel Busy */
832 test_and_set_bit(FLG_L1_BUSY
, &dch
->Flags
);
834 /* discard frame; reset transceiver */
835 test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
);
839 pr_info("%s: W6692 D-Channel Busy no tx_idx\n",
841 /* Transmitter reset */
842 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_XRST
);
844 spin_unlock_irqrestore(&card
->lock
, flags
);
848 static void initW6692(struct w6692_hw
*card
)
852 timer_setup(&card
->dch
.timer
, dbusy_timer_handler
, 0);
853 w6692_mode(&card
->bc
[0], ISDN_P_NONE
);
854 w6692_mode(&card
->bc
[1], ISDN_P_NONE
);
855 WriteW6692(card
, W_D_CTL
, 0x00);
857 WriteW6692(card
, W_D_SAM
, 0xff);
858 WriteW6692(card
, W_D_TAM
, 0xff);
859 WriteW6692(card
, W_D_MODE
, W_D_MODE_RACT
);
860 card
->state
= W_L1CMD_RST
;
861 ph_command(card
, W_L1CMD_RST
);
862 ph_command(card
, W_L1CMD_ECK
);
863 /* enable all IRQ but extern */
865 WriteW6692(card
, W_D_EXIM
, 0x00);
866 WriteW6692B(&card
->bc
[0], W_B_EXIM
, 0);
867 WriteW6692B(&card
->bc
[1], W_B_EXIM
, 0);
868 /* Reset D-chan receiver and transmitter */
869 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RRST
| W_D_CMDR_XRST
);
870 /* Reset B-chan receiver and transmitter */
871 WriteW6692B(&card
->bc
[0], W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
872 WriteW6692B(&card
->bc
[1], W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
873 /* enable peripheral */
874 if (card
->subtype
== W6692_USR
) {
875 /* seems that USR implemented some power control features
876 * Pin 79 is connected to the oscilator circuit so we
877 * have to handle it here
881 WriteW6692(card
, W_PCTL
, card
->pctl
);
882 WriteW6692(card
, W_XDATA
, card
->xdata
);
884 card
->pctl
= W_PCTL_OE5
| W_PCTL_OE4
| W_PCTL_OE2
|
885 W_PCTL_OE1
| W_PCTL_OE0
;
886 card
->xaddr
= 0x00;/* all sw off */
887 if (card
->fmask
& pots
)
888 card
->xdata
|= 0x06; /* POWER UP/ LED OFF / ALAW */
889 if (card
->fmask
& led
)
890 card
->xdata
|= 0x04; /* LED OFF */
891 if ((card
->fmask
& pots
) || (card
->fmask
& led
)) {
892 WriteW6692(card
, W_PCTL
, card
->pctl
);
893 WriteW6692(card
, W_XADDR
, card
->xaddr
);
894 WriteW6692(card
, W_XDATA
, card
->xdata
);
895 val
= ReadW6692(card
, W_XADDR
);
896 if (debug
& DEBUG_HW
)
897 pr_notice("%s: W_XADDR=%02x\n",
904 reset_w6692(struct w6692_hw
*card
)
906 WriteW6692(card
, W_D_CTL
, W_D_CTL_SRST
);
908 WriteW6692(card
, W_D_CTL
, 0);
912 init_card(struct w6692_hw
*card
)
917 spin_lock_irqsave(&card
->lock
, flags
);
919 spin_unlock_irqrestore(&card
->lock
, flags
);
920 if (request_irq(card
->irq
, w6692_irq
, IRQF_SHARED
, card
->name
, card
)) {
921 pr_info("%s: couldn't get interrupt %d\n", card
->name
,
926 spin_lock_irqsave(&card
->lock
, flags
);
929 spin_unlock_irqrestore(&card
->lock
, flags
);
931 msleep_interruptible(10);
932 if (debug
& DEBUG_HW
)
933 pr_notice("%s: IRQ %d count %d\n", card
->name
,
934 card
->irq
, card
->irqcnt
);
936 pr_info("%s: IRQ(%d) getting no IRQs during init %d\n",
937 card
->name
, card
->irq
, 3 - cnt
);
942 free_irq(card
->irq
, card
);
947 w6692_l2l1B(struct mISDNchannel
*ch
, struct sk_buff
*skb
)
949 struct bchannel
*bch
= container_of(ch
, struct bchannel
, ch
);
950 struct w6692_ch
*bc
= container_of(bch
, struct w6692_ch
, bch
);
951 struct w6692_hw
*card
= bch
->hw
;
953 struct mISDNhead
*hh
= mISDN_HEAD_P(skb
);
958 spin_lock_irqsave(&card
->lock
, flags
);
959 ret
= bchannel_senddata(bch
, skb
);
960 if (ret
> 0) { /* direct TX */
962 W6692_fill_Bfifo(bc
);
964 spin_unlock_irqrestore(&card
->lock
, flags
);
966 case PH_ACTIVATE_REQ
:
967 spin_lock_irqsave(&card
->lock
, flags
);
968 if (!test_and_set_bit(FLG_ACTIVE
, &bch
->Flags
))
969 ret
= w6692_mode(bc
, ch
->protocol
);
972 spin_unlock_irqrestore(&card
->lock
, flags
);
974 _queue_data(ch
, PH_ACTIVATE_IND
, MISDN_ID_ANY
, 0,
977 case PH_DEACTIVATE_REQ
:
978 spin_lock_irqsave(&card
->lock
, flags
);
979 mISDN_clear_bchannel(bch
);
980 w6692_mode(bc
, ISDN_P_NONE
);
981 spin_unlock_irqrestore(&card
->lock
, flags
);
982 _queue_data(ch
, PH_DEACTIVATE_IND
, MISDN_ID_ANY
, 0,
987 pr_info("%s: %s unknown prim(%x,%x)\n",
988 card
->name
, __func__
, hh
->prim
, hh
->id
);
997 channel_bctrl(struct bchannel
*bch
, struct mISDN_ctrl_req
*cq
)
999 return mISDN_ctrl_bchannel(bch
, cq
);
1003 open_bchannel(struct w6692_hw
*card
, struct channel_req
*rq
)
1005 struct bchannel
*bch
;
1007 if (rq
->adr
.channel
== 0 || rq
->adr
.channel
> 2)
1009 if (rq
->protocol
== ISDN_P_NONE
)
1011 bch
= &card
->bc
[rq
->adr
.channel
- 1].bch
;
1012 if (test_and_set_bit(FLG_OPEN
, &bch
->Flags
))
1013 return -EBUSY
; /* b-channel can be only open once */
1014 bch
->ch
.protocol
= rq
->protocol
;
1020 channel_ctrl(struct w6692_hw
*card
, struct mISDN_ctrl_req
*cq
)
1025 case MISDN_CTRL_GETOP
:
1026 cq
->op
= MISDN_CTRL_L1_TIMER3
;
1028 case MISDN_CTRL_L1_TIMER3
:
1029 ret
= l1_event(card
->dch
.l1
, HW_TIMER3_VALUE
| (cq
->p1
& 0xff));
1032 pr_info("%s: unknown CTRL OP %x\n", card
->name
, cq
->op
);
1040 w6692_bctrl(struct mISDNchannel
*ch
, u32 cmd
, void *arg
)
1042 struct bchannel
*bch
= container_of(ch
, struct bchannel
, ch
);
1043 struct w6692_ch
*bc
= container_of(bch
, struct w6692_ch
, bch
);
1044 struct w6692_hw
*card
= bch
->hw
;
1048 pr_debug("%s: %s cmd:%x %p\n", card
->name
, __func__
, cmd
, arg
);
1051 test_and_clear_bit(FLG_OPEN
, &bch
->Flags
);
1052 cancel_work_sync(&bch
->workq
);
1053 spin_lock_irqsave(&card
->lock
, flags
);
1054 mISDN_clear_bchannel(bch
);
1055 w6692_mode(bc
, ISDN_P_NONE
);
1056 spin_unlock_irqrestore(&card
->lock
, flags
);
1057 ch
->protocol
= ISDN_P_NONE
;
1059 module_put(THIS_MODULE
);
1062 case CONTROL_CHANNEL
:
1063 ret
= channel_bctrl(bch
, arg
);
1066 pr_info("%s: %s unknown prim(%x)\n",
1067 card
->name
, __func__
, cmd
);
1073 w6692_l2l1D(struct mISDNchannel
*ch
, struct sk_buff
*skb
)
1075 struct mISDNdevice
*dev
= container_of(ch
, struct mISDNdevice
, D
);
1076 struct dchannel
*dch
= container_of(dev
, struct dchannel
, dev
);
1077 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1079 struct mISDNhead
*hh
= mISDN_HEAD_P(skb
);
1085 spin_lock_irqsave(&card
->lock
, flags
);
1086 ret
= dchannel_senddata(dch
, skb
);
1087 if (ret
> 0) { /* direct TX */
1088 id
= hh
->id
; /* skb can be freed */
1089 W6692_fill_Dfifo(card
);
1091 spin_unlock_irqrestore(&card
->lock
, flags
);
1092 queue_ch_frame(ch
, PH_DATA_CNF
, id
, NULL
);
1094 spin_unlock_irqrestore(&card
->lock
, flags
);
1096 case PH_ACTIVATE_REQ
:
1097 ret
= l1_event(dch
->l1
, hh
->prim
);
1099 case PH_DEACTIVATE_REQ
:
1100 test_and_clear_bit(FLG_L2_ACTIVATED
, &dch
->Flags
);
1101 ret
= l1_event(dch
->l1
, hh
->prim
);
1111 w6692_l1callback(struct dchannel
*dch
, u32 cmd
)
1113 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1116 pr_debug("%s: cmd(%x) state(%02x)\n", card
->name
, cmd
, card
->state
);
1119 spin_lock_irqsave(&card
->lock
, flags
);
1120 ph_command(card
, W_L1CMD_AR8
);
1121 spin_unlock_irqrestore(&card
->lock
, flags
);
1124 spin_lock_irqsave(&card
->lock
, flags
);
1125 ph_command(card
, W_L1CMD_AR10
);
1126 spin_unlock_irqrestore(&card
->lock
, flags
);
1129 spin_lock_irqsave(&card
->lock
, flags
);
1130 if (card
->state
!= W_L1IND_DRD
)
1131 ph_command(card
, W_L1CMD_RST
);
1132 ph_command(card
, W_L1CMD_ECK
);
1133 spin_unlock_irqrestore(&card
->lock
, flags
);
1136 skb_queue_purge(&dch
->squeue
);
1138 dev_kfree_skb(dch
->tx_skb
);
1143 dev_kfree_skb(dch
->rx_skb
);
1146 test_and_clear_bit(FLG_TX_BUSY
, &dch
->Flags
);
1147 if (test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
))
1148 del_timer(&dch
->timer
);
1150 case HW_POWERUP_REQ
:
1151 spin_lock_irqsave(&card
->lock
, flags
);
1152 ph_command(card
, W_L1CMD_ECK
);
1153 spin_unlock_irqrestore(&card
->lock
, flags
);
1155 case PH_ACTIVATE_IND
:
1156 test_and_set_bit(FLG_ACTIVE
, &dch
->Flags
);
1157 _queue_data(&dch
->dev
.D
, cmd
, MISDN_ID_ANY
, 0, NULL
,
1160 case PH_DEACTIVATE_IND
:
1161 test_and_clear_bit(FLG_ACTIVE
, &dch
->Flags
);
1162 _queue_data(&dch
->dev
.D
, cmd
, MISDN_ID_ANY
, 0, NULL
,
1166 pr_debug("%s: %s unknown command %x\n", card
->name
,
1174 open_dchannel(struct w6692_hw
*card
, struct channel_req
*rq
, void *caller
)
1176 pr_debug("%s: %s dev(%d) open from %p\n", card
->name
, __func__
,
1177 card
->dch
.dev
.id
, caller
);
1178 if (rq
->protocol
!= ISDN_P_TE_S0
)
1180 if (rq
->adr
.channel
== 1)
1181 /* E-Channel not supported */
1183 rq
->ch
= &card
->dch
.dev
.D
;
1184 rq
->ch
->protocol
= rq
->protocol
;
1185 if (card
->dch
.state
== 7)
1186 _queue_data(rq
->ch
, PH_ACTIVATE_IND
, MISDN_ID_ANY
,
1187 0, NULL
, GFP_KERNEL
);
1192 w6692_dctrl(struct mISDNchannel
*ch
, u32 cmd
, void *arg
)
1194 struct mISDNdevice
*dev
= container_of(ch
, struct mISDNdevice
, D
);
1195 struct dchannel
*dch
= container_of(dev
, struct dchannel
, dev
);
1196 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1197 struct channel_req
*rq
;
1200 pr_debug("%s: DCTRL: %x %p\n", card
->name
, cmd
, arg
);
1204 if (rq
->protocol
== ISDN_P_TE_S0
)
1205 err
= open_dchannel(card
, rq
, __builtin_return_address(0));
1207 err
= open_bchannel(card
, rq
);
1210 if (!try_module_get(THIS_MODULE
))
1211 pr_info("%s: cannot get module\n", card
->name
);
1214 pr_debug("%s: dev(%d) close from %p\n", card
->name
,
1215 dch
->dev
.id
, __builtin_return_address(0));
1216 module_put(THIS_MODULE
);
1218 case CONTROL_CHANNEL
:
1219 err
= channel_ctrl(card
, arg
);
1222 pr_debug("%s: unknown DCTRL command %x\n", card
->name
, cmd
);
1229 setup_w6692(struct w6692_hw
*card
)
1233 if (!request_region(card
->addr
, 256, card
->name
)) {
1234 pr_info("%s: config port %x-%x already in use\n", card
->name
,
1235 card
->addr
, card
->addr
+ 255);
1239 card
->bc
[0].addr
= card
->addr
;
1240 card
->bc
[1].addr
= card
->addr
+ 0x40;
1241 val
= ReadW6692(card
, W_ISTA
);
1242 if (debug
& DEBUG_HW
)
1243 pr_notice("%s ISTA=%02x\n", card
->name
, val
);
1244 val
= ReadW6692(card
, W_IMASK
);
1245 if (debug
& DEBUG_HW
)
1246 pr_notice("%s IMASK=%02x\n", card
->name
, val
);
1247 val
= ReadW6692(card
, W_D_EXIR
);
1248 if (debug
& DEBUG_HW
)
1249 pr_notice("%s D_EXIR=%02x\n", card
->name
, val
);
1250 val
= ReadW6692(card
, W_D_EXIM
);
1251 if (debug
& DEBUG_HW
)
1252 pr_notice("%s D_EXIM=%02x\n", card
->name
, val
);
1253 val
= ReadW6692(card
, W_D_RSTA
);
1254 if (debug
& DEBUG_HW
)
1255 pr_notice("%s D_RSTA=%02x\n", card
->name
, val
);
1260 release_card(struct w6692_hw
*card
)
1264 spin_lock_irqsave(&card
->lock
, flags
);
1265 disable_hwirq(card
);
1266 w6692_mode(&card
->bc
[0], ISDN_P_NONE
);
1267 w6692_mode(&card
->bc
[1], ISDN_P_NONE
);
1268 if ((card
->fmask
& led
) || card
->subtype
== W6692_USR
) {
1269 card
->xdata
|= 0x04; /* LED OFF */
1270 WriteW6692(card
, W_XDATA
, card
->xdata
);
1272 spin_unlock_irqrestore(&card
->lock
, flags
);
1273 free_irq(card
->irq
, card
);
1274 l1_event(card
->dch
.l1
, CLOSE_CHANNEL
);
1275 mISDN_unregister_device(&card
->dch
.dev
);
1276 release_region(card
->addr
, 256);
1277 mISDN_freebchannel(&card
->bc
[1].bch
);
1278 mISDN_freebchannel(&card
->bc
[0].bch
);
1279 mISDN_freedchannel(&card
->dch
);
1280 write_lock_irqsave(&card_lock
, flags
);
1281 list_del(&card
->list
);
1282 write_unlock_irqrestore(&card_lock
, flags
);
1283 pci_disable_device(card
->pdev
);
1284 pci_set_drvdata(card
->pdev
, NULL
);
1289 setup_instance(struct w6692_hw
*card
)
1294 snprintf(card
->name
, MISDN_MAX_IDLEN
- 1, "w6692.%d", w6692_cnt
+ 1);
1295 write_lock_irqsave(&card_lock
, flags
);
1296 list_add_tail(&card
->list
, &Cards
);
1297 write_unlock_irqrestore(&card_lock
, flags
);
1298 card
->fmask
= (1 << w6692_cnt
);
1300 spin_lock_init(&card
->lock
);
1301 mISDN_initdchannel(&card
->dch
, MAX_DFRAME_LEN_L1
, W6692_ph_bh
);
1302 card
->dch
.dev
.Dprotocols
= (1 << ISDN_P_TE_S0
);
1303 card
->dch
.dev
.D
.send
= w6692_l2l1D
;
1304 card
->dch
.dev
.D
.ctrl
= w6692_dctrl
;
1305 card
->dch
.dev
.Bprotocols
= (1 << (ISDN_P_B_RAW
& ISDN_P_B_MASK
)) |
1306 (1 << (ISDN_P_B_HDLC
& ISDN_P_B_MASK
));
1307 card
->dch
.hw
= card
;
1308 card
->dch
.dev
.nrbchan
= 2;
1309 for (i
= 0; i
< 2; i
++) {
1310 mISDN_initbchannel(&card
->bc
[i
].bch
, MAX_DATA_MEM
,
1312 card
->bc
[i
].bch
.hw
= card
;
1313 card
->bc
[i
].bch
.nr
= i
+ 1;
1314 card
->bc
[i
].bch
.ch
.nr
= i
+ 1;
1315 card
->bc
[i
].bch
.ch
.send
= w6692_l2l1B
;
1316 card
->bc
[i
].bch
.ch
.ctrl
= w6692_bctrl
;
1317 set_channelmap(i
+ 1, card
->dch
.dev
.channelmap
);
1318 list_add(&card
->bc
[i
].bch
.ch
.list
, &card
->dch
.dev
.bchannels
);
1320 err
= setup_w6692(card
);
1323 err
= mISDN_register_device(&card
->dch
.dev
, &card
->pdev
->dev
,
1327 err
= init_card(card
);
1330 err
= create_l1(&card
->dch
, w6692_l1callback
);
1333 pr_notice("W6692 %d cards installed\n", w6692_cnt
);
1337 free_irq(card
->irq
, card
);
1339 mISDN_unregister_device(&card
->dch
.dev
);
1341 release_region(card
->addr
, 256);
1343 mISDN_freebchannel(&card
->bc
[1].bch
);
1344 mISDN_freebchannel(&card
->bc
[0].bch
);
1345 mISDN_freedchannel(&card
->dch
);
1346 write_lock_irqsave(&card_lock
, flags
);
1347 list_del(&card
->list
);
1348 write_unlock_irqrestore(&card_lock
, flags
);
1354 w6692_probe(struct pci_dev
*pdev
, const struct pci_device_id
*ent
)
1357 struct w6692_hw
*card
;
1358 struct w6692map
*m
= (struct w6692map
*)ent
->driver_data
;
1360 card
= kzalloc(sizeof(struct w6692_hw
), GFP_KERNEL
);
1362 pr_info("No kmem for w6692 card\n");
1366 card
->subtype
= m
->subtype
;
1367 err
= pci_enable_device(pdev
);
1373 printk(KERN_INFO
"mISDN_w6692: found adapter %s at %s\n",
1374 m
->name
, pci_name(pdev
));
1376 card
->addr
= pci_resource_start(pdev
, 1);
1377 card
->irq
= pdev
->irq
;
1378 pci_set_drvdata(pdev
, card
);
1379 err
= setup_instance(card
);
1381 pci_set_drvdata(pdev
, NULL
);
1386 w6692_remove_pci(struct pci_dev
*pdev
)
1388 struct w6692_hw
*card
= pci_get_drvdata(pdev
);
1394 pr_notice("%s: drvdata already removed\n", __func__
);
1397 static const struct pci_device_id w6692_ids
[] = {
1398 { PCI_VENDOR_ID_DYNALINK
, PCI_DEVICE_ID_DYNALINK_IS64PH
,
1399 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, (ulong
)&w6692_map
[0]},
1400 { PCI_VENDOR_ID_WINBOND2
, PCI_DEVICE_ID_WINBOND2_6692
,
1401 PCI_VENDOR_ID_USR
, PCI_DEVICE_ID_USR_6692
, 0, 0,
1402 (ulong
)&w6692_map
[2]},
1403 { PCI_VENDOR_ID_WINBOND2
, PCI_DEVICE_ID_WINBOND2_6692
,
1404 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, (ulong
)&w6692_map
[1]},
1407 MODULE_DEVICE_TABLE(pci
, w6692_ids
);
1409 static struct pci_driver w6692_driver
= {
1411 .probe
= w6692_probe
,
1412 .remove
= w6692_remove_pci
,
1413 .id_table
= w6692_ids
,
1416 static int __init
w6692_init(void)
1420 pr_notice("Winbond W6692 PCI driver Rev. %s\n", W6692_REV
);
1422 err
= pci_register_driver(&w6692_driver
);
1426 static void __exit
w6692_cleanup(void)
1428 pci_unregister_driver(&w6692_driver
);
1431 module_init(w6692_init
);
1432 module_exit(w6692_cleanup
);