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/module.h>
25 #include <linux/pci.h>
26 #include <linux/delay.h>
27 #include <linux/mISDNhw.h>
30 #define W6692_REV "2.0"
32 #define DBUSY_TIMER_VALUE 80
40 /* private data in the PCI devices list */
46 static const struct w6692map w6692_map
[] =
48 {W6692_ASUS
, "Dynalink/AsusCom IS64PH"},
49 {W6692_WINBOND
, "Winbond W6692"},
50 {W6692_USR
, "USR W6692"}
53 #ifndef PCI_VENDOR_ID_USR
54 #define PCI_VENDOR_ID_USR 0x16ec
55 #define PCI_DEVICE_ID_USR_6692 0x3409
61 struct timer_list timer
;
66 struct list_head list
;
68 char name
[MISDN_MAX_IDLEN
];
72 u32 fmask
; /* feature mask - bit set per card nr */
74 spinlock_t lock
; /* hw lock */
80 struct w6692_ch bc
[2];
85 static LIST_HEAD(Cards
);
86 static DEFINE_RWLOCK(card_lock
); /* protect Cards */
94 _set_debug(struct w6692_hw
*card
)
96 card
->dch
.debug
= debug
;
97 card
->bc
[0].bch
.debug
= debug
;
98 card
->bc
[1].bch
.debug
= debug
;
102 set_debug(const char *val
, struct kernel_param
*kp
)
105 struct w6692_hw
*card
;
107 ret
= param_set_uint(val
, kp
);
109 read_lock(&card_lock
);
110 list_for_each_entry(card
, &Cards
, list
)
112 read_unlock(&card_lock
);
117 MODULE_AUTHOR("Karsten Keil");
118 MODULE_LICENSE("GPL v2");
119 MODULE_VERSION(W6692_REV
);
120 module_param_call(debug
, set_debug
, param_get_uint
, &debug
, S_IRUGO
| S_IWUSR
);
121 MODULE_PARM_DESC(debug
, "W6692 debug mask");
122 module_param(led
, uint
, S_IRUGO
| S_IWUSR
);
123 MODULE_PARM_DESC(led
, "W6692 LED support bitmask (one bit per card)");
124 module_param(pots
, uint
, S_IRUGO
| S_IWUSR
);
125 MODULE_PARM_DESC(pots
, "W6692 POTS support bitmask (one bit per card)");
128 ReadW6692(struct w6692_hw
*card
, u8 offset
)
130 return inb(card
->addr
+ offset
);
134 WriteW6692(struct w6692_hw
*card
, u8 offset
, u8 value
)
136 outb(value
, card
->addr
+ offset
);
140 ReadW6692B(struct w6692_ch
*bc
, u8 offset
)
142 return inb(bc
->addr
+ offset
);
146 WriteW6692B(struct w6692_ch
*bc
, u8 offset
, u8 value
)
148 outb(value
, bc
->addr
+ offset
);
152 enable_hwirq(struct w6692_hw
*card
)
154 WriteW6692(card
, W_IMASK
, card
->imask
);
158 disable_hwirq(struct w6692_hw
*card
)
160 WriteW6692(card
, W_IMASK
, 0xff);
163 static const char *W6692Ver
[] = {"V00", "V01", "V10", "V11"};
166 W6692Version(struct w6692_hw
*card
)
170 val
= ReadW6692(card
, W_D_RBCH
);
171 pr_notice("%s: Winbond W6692 version: %s\n", card
->name
,
172 W6692Ver
[(val
>> 6) & 3]);
176 w6692_led_handler(struct w6692_hw
*card
, int on
)
178 if ((!(card
->fmask
& led
)) || card
->subtype
== W6692_USR
)
181 card
->xdata
&= 0xfb; /* LED ON */
182 WriteW6692(card
, W_XDATA
, card
->xdata
);
184 card
->xdata
|= 0x04; /* LED OFF */
185 WriteW6692(card
, W_XDATA
, card
->xdata
);
190 ph_command(struct w6692_hw
*card
, u8 cmd
)
192 pr_debug("%s: ph_command %x\n", card
->name
, cmd
);
193 WriteW6692(card
, W_CIX
, cmd
);
197 W6692_new_ph(struct w6692_hw
*card
)
199 if (card
->state
== W_L1CMD_RST
)
200 ph_command(card
, W_L1CMD_DRC
);
201 schedule_event(&card
->dch
, FLG_PHCHANGE
);
205 W6692_ph_bh(struct dchannel
*dch
)
207 struct w6692_hw
*card
= dch
->hw
;
209 switch (card
->state
) {
212 l1_event(dch
->l1
, HW_RESET_IND
);
216 l1_event(dch
->l1
, HW_DEACT_CNF
);
220 l1_event(dch
->l1
, HW_DEACT_IND
);
224 l1_event(dch
->l1
, HW_POWERUP_IND
);
227 if (dch
->state
<= 5) {
229 l1_event(dch
->l1
, ANYSIGNAL
);
232 l1_event(dch
->l1
, LOSTFRAMING
);
237 l1_event(dch
->l1
, INFO2
);
241 l1_event(dch
->l1
, INFO4_P8
);
245 l1_event(dch
->l1
, INFO4_P10
);
248 pr_debug("%s: TE unknown state %02x dch state %02x\n",
249 card
->name
, card
->state
, dch
->state
);
252 pr_debug("%s: TE newstate %02x\n", card
->name
, dch
->state
);
256 W6692_empty_Dfifo(struct w6692_hw
*card
, int count
)
258 struct dchannel
*dch
= &card
->dch
;
261 pr_debug("%s: empty_Dfifo %d\n", card
->name
, count
);
263 dch
->rx_skb
= mI_alloc_skb(card
->dch
.maxlen
, GFP_ATOMIC
);
265 pr_info("%s: D receive out of memory\n", card
->name
);
266 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
270 if ((dch
->rx_skb
->len
+ count
) >= dch
->maxlen
) {
271 pr_debug("%s: empty_Dfifo overrun %d\n", card
->name
,
272 dch
->rx_skb
->len
+ count
);
273 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
276 ptr
= skb_put(dch
->rx_skb
, count
);
277 insb(card
->addr
+ W_D_RFIFO
, ptr
, count
);
278 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
);
279 if (debug
& DEBUG_HW_DFIFO
) {
280 snprintf(card
->log
, 63, "D-recv %s %d ",
282 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
287 W6692_fill_Dfifo(struct w6692_hw
*card
)
289 struct dchannel
*dch
= &card
->dch
;
292 u8 cmd
= W_D_CMDR_XMS
;
294 pr_debug("%s: fill_Dfifo\n", card
->name
);
297 count
= dch
->tx_skb
->len
- dch
->tx_idx
;
300 if (count
> W_D_FIFO_THRESH
)
301 count
= W_D_FIFO_THRESH
;
304 ptr
= dch
->tx_skb
->data
+ dch
->tx_idx
;
305 dch
->tx_idx
+= count
;
306 outsb(card
->addr
+ W_D_XFIFO
, ptr
, count
);
307 WriteW6692(card
, W_D_CMDR
, cmd
);
308 if (test_and_set_bit(FLG_BUSY_TIMER
, &dch
->Flags
)) {
309 pr_debug("%s: fill_Dfifo dbusytimer running\n", card
->name
);
310 del_timer(&dch
->timer
);
312 init_timer(&dch
->timer
);
313 dch
->timer
.expires
= jiffies
+ ((DBUSY_TIMER_VALUE
* HZ
)/1000);
314 add_timer(&dch
->timer
);
315 if (debug
& DEBUG_HW_DFIFO
) {
316 snprintf(card
->log
, 63, "D-send %s %d ",
318 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
323 d_retransmit(struct w6692_hw
*card
)
325 struct dchannel
*dch
= &card
->dch
;
327 if (test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
))
328 del_timer(&dch
->timer
);
330 if (test_and_clear_bit(FLG_L1_BUSY
, &dch
->Flags
))
331 dchannel_sched_event(dch
, D_CLEARBUSY
);
333 if (test_bit(FLG_TX_BUSY
, &dch
->Flags
)) {
336 W6692_fill_Dfifo(card
);
337 } else if (dch
->tx_skb
) { /* should not happen */
338 pr_info("%s: %s without TX_BUSY\n", card
->name
, __func__
);
339 test_and_set_bit(FLG_TX_BUSY
, &dch
->Flags
);
341 W6692_fill_Dfifo(card
);
343 pr_info("%s: XDU no TX_BUSY\n", card
->name
);
344 if (get_next_dframe(dch
))
345 W6692_fill_Dfifo(card
);
350 handle_rxD(struct w6692_hw
*card
) {
354 stat
= ReadW6692(card
, W_D_RSTA
);
355 if (stat
& (W_D_RSTA_RDOV
| W_D_RSTA_CRCE
| W_D_RSTA_RMB
)) {
356 if (stat
& W_D_RSTA_RDOV
) {
357 pr_debug("%s: D-channel RDOV\n", card
->name
);
358 #ifdef ERROR_STATISTIC
362 if (stat
& W_D_RSTA_CRCE
) {
363 pr_debug("%s: D-channel CRC error\n", card
->name
);
364 #ifdef ERROR_STATISTIC
368 if (stat
& W_D_RSTA_RMB
) {
369 pr_debug("%s: D-channel ABORT\n", card
->name
);
370 #ifdef ERROR_STATISTIC
374 if (card
->dch
.rx_skb
)
375 dev_kfree_skb(card
->dch
.rx_skb
);
376 card
->dch
.rx_skb
= NULL
;
377 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RACK
| W_D_CMDR_RRST
);
379 count
= ReadW6692(card
, W_D_RBCL
) & (W_D_FIFO_THRESH
- 1);
381 count
= W_D_FIFO_THRESH
;
382 W6692_empty_Dfifo(card
, count
);
383 recv_Dchannel(&card
->dch
);
388 handle_txD(struct w6692_hw
*card
) {
389 if (test_and_clear_bit(FLG_BUSY_TIMER
, &card
->dch
.Flags
))
390 del_timer(&card
->dch
.timer
);
391 if (card
->dch
.tx_skb
&& card
->dch
.tx_idx
< card
->dch
.tx_skb
->len
) {
392 W6692_fill_Dfifo(card
);
394 if (card
->dch
.tx_skb
)
395 dev_kfree_skb(card
->dch
.tx_skb
);
396 if (get_next_dframe(&card
->dch
))
397 W6692_fill_Dfifo(card
);
402 handle_statusD(struct w6692_hw
*card
)
404 struct dchannel
*dch
= &card
->dch
;
407 exval
= ReadW6692(card
, W_D_EXIR
);
409 pr_debug("%s: D_EXIR %02x\n", card
->name
, exval
);
410 if (exval
& (W_D_EXI_XDUN
| W_D_EXI_XCOL
)) {
411 /* Transmit underrun/collision */
412 pr_debug("%s: D-channel underrun/collision\n", card
->name
);
413 #ifdef ERROR_STATISTIC
418 if (exval
& W_D_EXI_RDOV
) { /* RDOV */
419 pr_debug("%s: D-channel RDOV\n", card
->name
);
420 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RRST
);
422 if (exval
& W_D_EXI_TIN2
) /* TIN2 - never */
423 pr_debug("%s: spurious TIN2 interrupt\n", card
->name
);
424 if (exval
& W_D_EXI_MOC
) { /* MOC - not supported */
425 v1
= ReadW6692(card
, W_MOSR
);
426 pr_debug("%s: spurious MOC interrupt MOSR %02x\n",
429 if (exval
& W_D_EXI_ISC
) { /* ISC - Level1 change */
430 cir
= ReadW6692(card
, W_CIR
);
431 pr_debug("%s: ISC CIR %02X\n", card
->name
, cir
);
432 if (cir
& W_CIR_ICC
) {
433 v1
= cir
& W_CIR_COD_MASK
;
434 pr_debug("%s: ph_state_change %x -> %x\n", card
->name
,
437 if (card
->fmask
& led
) {
441 w6692_led_handler(card
, 1);
444 w6692_led_handler(card
, 0);
450 if (cir
& W_CIR_SCC
) {
451 v1
= ReadW6692(card
, W_SQR
);
452 pr_debug("%s: SCC SQR %02X\n", card
->name
, v1
);
455 if (exval
& W_D_EXI_WEXP
)
456 pr_debug("%s: spurious WEXP interrupt!\n", card
->name
);
457 if (exval
& W_D_EXI_TEXP
)
458 pr_debug("%s: spurious TEXP interrupt!\n", card
->name
);
462 W6692_empty_Bfifo(struct w6692_ch
*wch
, int count
)
464 struct w6692_hw
*card
= wch
->bch
.hw
;
467 pr_debug("%s: empty_Bfifo %d\n", card
->name
, count
);
468 if (unlikely(wch
->bch
.state
== ISDN_P_NONE
)) {
469 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card
->name
);
470 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
472 skb_trim(wch
->bch
.rx_skb
, 0);
475 if (!wch
->bch
.rx_skb
) {
476 wch
->bch
.rx_skb
= mI_alloc_skb(wch
->bch
.maxlen
, GFP_ATOMIC
);
477 if (unlikely(!wch
->bch
.rx_skb
)) {
478 pr_info("%s: B receive out of memory\n", card
->name
);
479 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
484 if (wch
->bch
.rx_skb
->len
+ count
> wch
->bch
.maxlen
) {
485 pr_debug("%s: empty_Bfifo incoming packet too large\n",
487 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
488 skb_trim(wch
->bch
.rx_skb
, 0);
491 ptr
= skb_put(wch
->bch
.rx_skb
, count
);
492 insb(wch
->addr
+ W_B_RFIFO
, ptr
, count
);
493 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
| W_B_CMDR_RACT
);
494 if (debug
& DEBUG_HW_DFIFO
) {
495 snprintf(card
->log
, 63, "B%1d-recv %s %d ",
496 wch
->bch
.nr
, card
->name
, count
);
497 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
502 W6692_fill_Bfifo(struct w6692_ch
*wch
)
504 struct w6692_hw
*card
= wch
->bch
.hw
;
506 u8
*ptr
, cmd
= W_B_CMDR_RACT
| W_B_CMDR_XMS
;
508 pr_debug("%s: fill Bfifo\n", card
->name
);
509 if (!wch
->bch
.tx_skb
)
511 count
= wch
->bch
.tx_skb
->len
- wch
->bch
.tx_idx
;
514 ptr
= wch
->bch
.tx_skb
->data
+ wch
->bch
.tx_idx
;
515 if (count
> W_B_FIFO_THRESH
)
516 count
= W_B_FIFO_THRESH
;
517 else if (test_bit(FLG_HDLC
, &wch
->bch
.Flags
))
520 pr_debug("%s: fill Bfifo%d/%d\n", card
->name
,
521 count
, wch
->bch
.tx_idx
);
522 wch
->bch
.tx_idx
+= count
;
523 outsb(wch
->addr
+ W_B_XFIFO
, ptr
, count
);
524 WriteW6692B(wch
, W_B_CMDR
, cmd
);
525 if (debug
& DEBUG_HW_DFIFO
) {
526 snprintf(card
->log
, 63, "B%1d-send %s %d ",
527 wch
->bch
.nr
, card
->name
, count
);
528 print_hex_dump_bytes(card
->log
, DUMP_PREFIX_OFFSET
, ptr
, count
);
534 setvolume(struct w6692_ch
*wch
, int mic
, struct sk_buff
*skb
)
536 struct w6692_hw
*card
= wch
->bch
.hw
;
537 u16
*vol
= (u16
*)skb
->data
;
540 if ((!(card
->fmask
& pots
)) ||
541 !test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
556 WriteW6692(card
, W_XADDR
, card
->xaddr
);
561 enable_pots(struct w6692_ch
*wch
)
563 struct w6692_hw
*card
= wch
->bch
.hw
;
565 if ((!(card
->fmask
& pots
)) ||
566 !test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
568 wch
->b_mode
|= W_B_MODE_EPCM
| W_B_MODE_BSW0
;
569 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
570 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
571 card
->pctl
|= ((wch
->bch
.nr
& 2) ? W_PCTL_PCX
: 0);
572 WriteW6692(card
, W_PCTL
, card
->pctl
);
578 disable_pots(struct w6692_ch
*wch
)
580 struct w6692_hw
*card
= wch
->bch
.hw
;
582 if (!(card
->fmask
& pots
))
584 wch
->b_mode
&= ~(W_B_MODE_EPCM
| W_B_MODE_BSW0
);
585 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
586 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
592 w6692_mode(struct w6692_ch
*wch
, u32 pr
)
594 struct w6692_hw
*card
;
597 pr_debug("%s: B%d protocol %x-->%x\n", card
->name
,
598 wch
->bch
.nr
, wch
->bch
.state
, pr
);
601 if ((card
->fmask
& pots
) && (wch
->b_mode
& W_B_MODE_EPCM
))
604 mISDN_clear_bchannel(&wch
->bch
);
605 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
606 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
607 test_and_clear_bit(FLG_HDLC
, &wch
->bch
.Flags
);
608 test_and_clear_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
);
611 wch
->b_mode
= W_B_MODE_MMS
;
612 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
613 WriteW6692B(wch
, W_B_EXIM
, 0);
614 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_RACT
|
616 test_and_set_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
);
619 wch
->b_mode
= W_B_MODE_ITF
;
620 WriteW6692B(wch
, W_B_MODE
, wch
->b_mode
);
621 WriteW6692B(wch
, W_B_ADM1
, 0xff);
622 WriteW6692B(wch
, W_B_ADM2
, 0xff);
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_HDLC
, &wch
->bch
.Flags
);
629 pr_info("%s: protocol %x not known\n", card
->name
, pr
);
637 send_next(struct w6692_ch
*wch
)
639 if (wch
->bch
.tx_skb
&& wch
->bch
.tx_idx
< wch
->bch
.tx_skb
->len
)
640 W6692_fill_Bfifo(wch
);
642 if (wch
->bch
.tx_skb
) {
643 /* send confirm, on trans, free on hdlc. */
644 if (test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
645 confirm_Bsend(&wch
->bch
);
646 dev_kfree_skb(wch
->bch
.tx_skb
);
648 if (get_next_bframe(&wch
->bch
))
649 W6692_fill_Bfifo(wch
);
654 W6692B_interrupt(struct w6692_hw
*card
, int ch
)
656 struct w6692_ch
*wch
= &card
->bc
[ch
];
660 stat
= ReadW6692B(wch
, W_B_EXIR
);
661 pr_debug("%s: B%d EXIR %02x\n", card
->name
, wch
->bch
.nr
, stat
);
662 if (stat
& W_B_EXI_RME
) {
663 star
= ReadW6692B(wch
, W_B_STAR
);
664 if (star
& (W_B_STAR_RDOV
| W_B_STAR_CRCE
| W_B_STAR_RMB
)) {
665 if ((star
& W_B_STAR_RDOV
) &&
666 test_bit(FLG_ACTIVE
, &wch
->bch
.Flags
)) {
667 pr_debug("%s: B%d RDOV proto=%x\n", card
->name
,
668 wch
->bch
.nr
, wch
->bch
.state
);
669 #ifdef ERROR_STATISTIC
673 if (test_bit(FLG_HDLC
, &wch
->bch
.Flags
)) {
674 if (star
& W_B_STAR_CRCE
) {
675 pr_debug("%s: B%d CRC error\n",
676 card
->name
, wch
->bch
.nr
);
677 #ifdef ERROR_STATISTIC
681 if (star
& W_B_STAR_RMB
) {
682 pr_debug("%s: B%d message abort\n",
683 card
->name
, wch
->bch
.nr
);
684 #ifdef ERROR_STATISTIC
689 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
690 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
692 skb_trim(wch
->bch
.rx_skb
, 0);
694 count
= ReadW6692B(wch
, W_B_RBCL
) &
695 (W_B_FIFO_THRESH
- 1);
697 count
= W_B_FIFO_THRESH
;
698 W6692_empty_Bfifo(wch
, count
);
699 recv_Bchannel(&wch
->bch
, 0);
702 if (stat
& W_B_EXI_RMR
) {
703 if (!(stat
& W_B_EXI_RME
))
704 star
= ReadW6692B(wch
, W_B_STAR
);
705 if (star
& W_B_STAR_RDOV
) {
706 pr_debug("%s: B%d RDOV proto=%x\n", card
->name
,
707 wch
->bch
.nr
, wch
->bch
.state
);
708 #ifdef ERROR_STATISTIC
711 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
712 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
714 W6692_empty_Bfifo(wch
, W_B_FIFO_THRESH
);
715 if (test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
) &&
716 wch
->bch
.rx_skb
&& (wch
->bch
.rx_skb
->len
> 0))
717 recv_Bchannel(&wch
->bch
, 0);
720 if (stat
& W_B_EXI_RDOV
) {
721 /* only if it is not handled yet */
722 if (!(star
& W_B_STAR_RDOV
)) {
723 pr_debug("%s: B%d RDOV IRQ proto=%x\n", card
->name
,
724 wch
->bch
.nr
, wch
->bch
.state
);
725 #ifdef ERROR_STATISTIC
728 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_RACK
|
729 W_B_CMDR_RRST
| W_B_CMDR_RACT
);
732 if (stat
& W_B_EXI_XFR
) {
733 if (!(stat
& (W_B_EXI_RME
| W_B_EXI_RMR
))) {
734 star
= ReadW6692B(wch
, W_B_STAR
);
735 pr_debug("%s: B%d star %02x\n", card
->name
,
738 if (star
& W_B_STAR_XDOW
) {
739 pr_debug("%s: B%d XDOW proto=%x\n", card
->name
,
740 wch
->bch
.nr
, wch
->bch
.state
);
741 #ifdef ERROR_STATISTIC
744 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_XRST
|
747 if (wch
->bch
.tx_skb
) {
748 if (!test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
753 if (stat
& W_B_EXI_XDUN
)
754 return; /* handle XDOW only once */
756 if (stat
& W_B_EXI_XDUN
) {
757 pr_debug("%s: B%d XDUN proto=%x\n", card
->name
,
758 wch
->bch
.nr
, wch
->bch
.state
);
759 #ifdef ERROR_STATISTIC
762 WriteW6692B(wch
, W_B_CMDR
, W_B_CMDR_XRST
| W_B_CMDR_RACT
);
764 if (wch
->bch
.tx_skb
) {
765 if (!test_bit(FLG_TRANSPARENT
, &wch
->bch
.Flags
))
773 w6692_irq(int intno
, void *dev_id
)
775 struct w6692_hw
*card
= dev_id
;
778 spin_lock(&card
->lock
);
779 ista
= ReadW6692(card
, W_ISTA
);
780 if ((ista
| card
->imask
) == card
->imask
) {
781 /* possible a shared IRQ reqest */
782 spin_unlock(&card
->lock
);
786 pr_debug("%s: ista %02x\n", card
->name
, ista
);
787 ista
&= ~card
->imask
;
788 if (ista
& W_INT_B1_EXI
)
789 W6692B_interrupt(card
, 0);
790 if (ista
& W_INT_B2_EXI
)
791 W6692B_interrupt(card
, 1);
792 if (ista
& W_INT_D_RME
)
794 if (ista
& W_INT_D_RMR
)
795 W6692_empty_Dfifo(card
, W_D_FIFO_THRESH
);
796 if (ista
& W_INT_D_XFR
)
798 if (ista
& W_INT_D_EXI
)
799 handle_statusD(card
);
800 if (ista
& (W_INT_XINT0
| W_INT_XINT1
)) /* XINT0/1 - never */
801 pr_debug("%s: W6692 spurious XINT!\n", card
->name
);
802 /* End IRQ Handler */
803 spin_unlock(&card
->lock
);
808 dbusy_timer_handler(struct dchannel
*dch
)
810 struct w6692_hw
*card
= dch
->hw
;
814 if (test_bit(FLG_BUSY_TIMER
, &dch
->Flags
)) {
815 spin_lock_irqsave(&card
->lock
, flags
);
816 rbch
= ReadW6692(card
, W_D_RBCH
);
817 star
= ReadW6692(card
, W_D_STAR
);
818 pr_debug("%s: D-Channel Busy RBCH %02x STAR %02x\n",
819 card
->name
, rbch
, star
);
820 if (star
& W_D_STAR_XBZ
) /* D-Channel Busy */
821 test_and_set_bit(FLG_L1_BUSY
, &dch
->Flags
);
823 /* discard frame; reset transceiver */
824 test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
);
828 pr_info("%s: W6692 D-Channel Busy no tx_idx\n",
830 /* Transmitter reset */
831 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_XRST
);
833 spin_unlock_irqrestore(&card
->lock
, flags
);
837 void initW6692(struct w6692_hw
*card
)
841 card
->dch
.timer
.function
= (void *)dbusy_timer_handler
;
842 card
->dch
.timer
.data
= (u_long
)&card
->dch
;
843 init_timer(&card
->dch
.timer
);
844 w6692_mode(&card
->bc
[0], ISDN_P_NONE
);
845 w6692_mode(&card
->bc
[1], ISDN_P_NONE
);
846 WriteW6692(card
, W_D_CTL
, 0x00);
848 WriteW6692(card
, W_D_SAM
, 0xff);
849 WriteW6692(card
, W_D_TAM
, 0xff);
850 WriteW6692(card
, W_D_MODE
, W_D_MODE_RACT
);
851 card
->state
= W_L1CMD_RST
;
852 ph_command(card
, W_L1CMD_RST
);
853 ph_command(card
, W_L1CMD_ECK
);
854 /* enable all IRQ but extern */
856 WriteW6692(card
, W_D_EXIM
, 0x00);
857 WriteW6692B(&card
->bc
[0], W_B_EXIM
, 0);
858 WriteW6692B(&card
->bc
[1], W_B_EXIM
, 0);
859 /* Reset D-chan receiver and transmitter */
860 WriteW6692(card
, W_D_CMDR
, W_D_CMDR_RRST
| W_D_CMDR_XRST
);
861 /* Reset B-chan receiver and transmitter */
862 WriteW6692B(&card
->bc
[0], W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
863 WriteW6692B(&card
->bc
[1], W_B_CMDR
, W_B_CMDR_RRST
| W_B_CMDR_XRST
);
864 /* enable peripheral */
865 if (card
->subtype
== W6692_USR
) {
866 /* seems that USR implemented some power control features
867 * Pin 79 is connected to the oscilator circuit so we
868 * have to handle it here
872 WriteW6692(card
, W_PCTL
, card
->pctl
);
873 WriteW6692(card
, W_XDATA
, card
->xdata
);
875 card
->pctl
= W_PCTL_OE5
| W_PCTL_OE4
| W_PCTL_OE2
|
876 W_PCTL_OE1
| W_PCTL_OE0
;
877 card
->xaddr
= 0x00;/* all sw off */
878 if (card
->fmask
& pots
)
879 card
->xdata
|= 0x06; /* POWER UP/ LED OFF / ALAW */
880 if (card
->fmask
& led
)
881 card
->xdata
|= 0x04; /* LED OFF */
882 if ((card
->fmask
& pots
) || (card
->fmask
& led
)) {
883 WriteW6692(card
, W_PCTL
, card
->pctl
);
884 WriteW6692(card
, W_XADDR
, card
->xaddr
);
885 WriteW6692(card
, W_XDATA
, card
->xdata
);
886 val
= ReadW6692(card
, W_XADDR
);
887 if (debug
& DEBUG_HW
)
888 pr_notice("%s: W_XADDR=%02x\n",
895 reset_w6692(struct w6692_hw
*card
)
897 WriteW6692(card
, W_D_CTL
, W_D_CTL_SRST
);
899 WriteW6692(card
, W_D_CTL
, 0);
903 init_card(struct w6692_hw
*card
)
908 spin_lock_irqsave(&card
->lock
, flags
);
910 spin_unlock_irqrestore(&card
->lock
, flags
);
911 if (request_irq(card
->irq
, w6692_irq
, IRQF_SHARED
, card
->name
, card
)) {
912 pr_info("%s: couldn't get interrupt %d\n", card
->name
,
917 spin_lock_irqsave(&card
->lock
, flags
);
920 spin_unlock_irqrestore(&card
->lock
, flags
);
922 msleep_interruptible(10);
923 if (debug
& DEBUG_HW
)
924 pr_notice("%s: IRQ %d count %d\n", card
->name
,
925 card
->irq
, card
->irqcnt
);
927 pr_info("%s: IRQ(%d) getting no IRQs during init %d\n",
928 card
->name
, card
->irq
, 3 - cnt
);
933 free_irq(card
->irq
, card
);
938 w6692_l2l1B(struct mISDNchannel
*ch
, struct sk_buff
*skb
)
940 struct bchannel
*bch
= container_of(ch
, struct bchannel
, ch
);
941 struct w6692_ch
*bc
= container_of(bch
, struct w6692_ch
, bch
);
942 struct w6692_hw
*card
= bch
->hw
;
944 struct mISDNhead
*hh
= mISDN_HEAD_P(skb
);
950 spin_lock_irqsave(&card
->lock
, flags
);
951 ret
= bchannel_senddata(bch
, skb
);
952 if (ret
> 0) { /* direct TX */
953 id
= hh
->id
; /* skb can be freed */
955 W6692_fill_Bfifo(bc
);
956 spin_unlock_irqrestore(&card
->lock
, flags
);
957 if (!test_bit(FLG_TRANSPARENT
, &bch
->Flags
))
958 queue_ch_frame(ch
, PH_DATA_CNF
, id
, NULL
);
960 spin_unlock_irqrestore(&card
->lock
, flags
);
962 case PH_ACTIVATE_REQ
:
963 spin_lock_irqsave(&card
->lock
, flags
);
964 if (!test_and_set_bit(FLG_ACTIVE
, &bch
->Flags
))
965 ret
= w6692_mode(bc
, ch
->protocol
);
968 spin_unlock_irqrestore(&card
->lock
, flags
);
970 _queue_data(ch
, PH_ACTIVATE_IND
, MISDN_ID_ANY
, 0,
973 case PH_DEACTIVATE_REQ
:
974 spin_lock_irqsave(&card
->lock
, flags
);
975 mISDN_clear_bchannel(bch
);
976 w6692_mode(bc
, ISDN_P_NONE
);
977 spin_unlock_irqrestore(&card
->lock
, flags
);
978 _queue_data(ch
, PH_DEACTIVATE_IND
, MISDN_ID_ANY
, 0,
983 pr_info("%s: %s unknown prim(%x,%x)\n",
984 card
->name
, __func__
, hh
->prim
, hh
->id
);
993 channel_bctrl(struct bchannel
*bch
, struct mISDN_ctrl_req
*cq
)
998 case MISDN_CTRL_GETOP
:
1001 /* Nothing implemented yet */
1002 case MISDN_CTRL_FILL_EMPTY
:
1004 pr_info("%s: unknown Op %x\n", __func__
, cq
->op
);
1012 open_bchannel(struct w6692_hw
*card
, struct channel_req
*rq
)
1014 struct bchannel
*bch
;
1016 if (rq
->adr
.channel
> 2)
1018 if (rq
->protocol
== ISDN_P_NONE
)
1020 bch
= &card
->bc
[rq
->adr
.channel
- 1].bch
;
1021 if (test_and_set_bit(FLG_OPEN
, &bch
->Flags
))
1022 return -EBUSY
; /* b-channel can be only open once */
1023 test_and_clear_bit(FLG_FILLEMPTY
, &bch
->Flags
);
1024 bch
->ch
.protocol
= rq
->protocol
;
1030 channel_ctrl(struct w6692_hw
*card
, struct mISDN_ctrl_req
*cq
)
1035 case MISDN_CTRL_GETOP
:
1039 pr_info("%s: unknown CTRL OP %x\n", card
->name
, cq
->op
);
1047 w6692_bctrl(struct mISDNchannel
*ch
, u32 cmd
, void *arg
)
1049 struct bchannel
*bch
= container_of(ch
, struct bchannel
, ch
);
1050 struct w6692_ch
*bc
= container_of(bch
, struct w6692_ch
, bch
);
1051 struct w6692_hw
*card
= bch
->hw
;
1055 pr_debug("%s: %s cmd:%x %p\n", card
->name
, __func__
, cmd
, arg
);
1058 test_and_clear_bit(FLG_OPEN
, &bch
->Flags
);
1059 if (test_bit(FLG_ACTIVE
, &bch
->Flags
)) {
1060 spin_lock_irqsave(&card
->lock
, flags
);
1061 mISDN_freebchannel(bch
);
1062 w6692_mode(bc
, ISDN_P_NONE
);
1063 spin_unlock_irqrestore(&card
->lock
, flags
);
1065 skb_queue_purge(&bch
->rqueue
);
1068 ch
->protocol
= ISDN_P_NONE
;
1070 module_put(THIS_MODULE
);
1073 case CONTROL_CHANNEL
:
1074 ret
= channel_bctrl(bch
, arg
);
1077 pr_info("%s: %s unknown prim(%x)\n",
1078 card
->name
, __func__
, cmd
);
1084 w6692_l2l1D(struct mISDNchannel
*ch
, struct sk_buff
*skb
)
1086 struct mISDNdevice
*dev
= container_of(ch
, struct mISDNdevice
, D
);
1087 struct dchannel
*dch
= container_of(dev
, struct dchannel
, dev
);
1088 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1090 struct mISDNhead
*hh
= mISDN_HEAD_P(skb
);
1096 spin_lock_irqsave(&card
->lock
, flags
);
1097 ret
= dchannel_senddata(dch
, skb
);
1098 if (ret
> 0) { /* direct TX */
1099 id
= hh
->id
; /* skb can be freed */
1100 W6692_fill_Dfifo(card
);
1102 spin_unlock_irqrestore(&card
->lock
, flags
);
1103 queue_ch_frame(ch
, PH_DATA_CNF
, id
, NULL
);
1105 spin_unlock_irqrestore(&card
->lock
, flags
);
1107 case PH_ACTIVATE_REQ
:
1108 ret
= l1_event(dch
->l1
, hh
->prim
);
1110 case PH_DEACTIVATE_REQ
:
1111 test_and_clear_bit(FLG_L2_ACTIVATED
, &dch
->Flags
);
1112 ret
= l1_event(dch
->l1
, hh
->prim
);
1122 w6692_l1callback(struct dchannel
*dch
, u32 cmd
)
1124 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1127 pr_debug("%s: cmd(%x) state(%02x)\n", card
->name
, cmd
, card
->state
);
1130 spin_lock_irqsave(&card
->lock
, flags
);
1131 ph_command(card
, W_L1CMD_AR8
);
1132 spin_unlock_irqrestore(&card
->lock
, flags
);
1135 spin_lock_irqsave(&card
->lock
, flags
);
1136 ph_command(card
, W_L1CMD_AR10
);
1137 spin_unlock_irqrestore(&card
->lock
, flags
);
1140 spin_lock_irqsave(&card
->lock
, flags
);
1141 if (card
->state
!= W_L1IND_DRD
)
1142 ph_command(card
, W_L1CMD_RST
);
1143 ph_command(card
, W_L1CMD_ECK
);
1144 spin_unlock_irqrestore(&card
->lock
, flags
);
1147 skb_queue_purge(&dch
->squeue
);
1149 dev_kfree_skb(dch
->tx_skb
);
1154 dev_kfree_skb(dch
->rx_skb
);
1157 test_and_clear_bit(FLG_TX_BUSY
, &dch
->Flags
);
1158 if (test_and_clear_bit(FLG_BUSY_TIMER
, &dch
->Flags
))
1159 del_timer(&dch
->timer
);
1161 case HW_POWERUP_REQ
:
1162 spin_lock_irqsave(&card
->lock
, flags
);
1163 ph_command(card
, W_L1CMD_ECK
);
1164 spin_unlock_irqrestore(&card
->lock
, flags
);
1166 case PH_ACTIVATE_IND
:
1167 test_and_set_bit(FLG_ACTIVE
, &dch
->Flags
);
1168 _queue_data(&dch
->dev
.D
, cmd
, MISDN_ID_ANY
, 0, NULL
,
1171 case PH_DEACTIVATE_IND
:
1172 test_and_clear_bit(FLG_ACTIVE
, &dch
->Flags
);
1173 _queue_data(&dch
->dev
.D
, cmd
, MISDN_ID_ANY
, 0, NULL
,
1177 pr_debug("%s: %s unknown command %x\n", card
->name
,
1185 open_dchannel(struct w6692_hw
*card
, struct channel_req
*rq
)
1187 pr_debug("%s: %s dev(%d) open from %p\n", card
->name
, __func__
,
1188 card
->dch
.dev
.id
, __builtin_return_address(1));
1189 if (rq
->protocol
!= ISDN_P_TE_S0
)
1191 if (rq
->adr
.channel
== 1)
1192 /* E-Channel not supported */
1194 rq
->ch
= &card
->dch
.dev
.D
;
1195 rq
->ch
->protocol
= rq
->protocol
;
1196 if (card
->dch
.state
== 7)
1197 _queue_data(rq
->ch
, PH_ACTIVATE_IND
, MISDN_ID_ANY
,
1198 0, NULL
, GFP_KERNEL
);
1203 w6692_dctrl(struct mISDNchannel
*ch
, u32 cmd
, void *arg
)
1205 struct mISDNdevice
*dev
= container_of(ch
, struct mISDNdevice
, D
);
1206 struct dchannel
*dch
= container_of(dev
, struct dchannel
, dev
);
1207 struct w6692_hw
*card
= container_of(dch
, struct w6692_hw
, dch
);
1208 struct channel_req
*rq
;
1211 pr_debug("%s: DCTRL: %x %p\n", card
->name
, cmd
, arg
);
1215 if (rq
->protocol
== ISDN_P_TE_S0
)
1216 err
= open_dchannel(card
, rq
);
1218 err
= open_bchannel(card
, rq
);
1221 if (!try_module_get(THIS_MODULE
))
1222 pr_info("%s: cannot get module\n", card
->name
);
1225 pr_debug("%s: dev(%d) close from %p\n", card
->name
,
1226 dch
->dev
.id
, __builtin_return_address(0));
1227 module_put(THIS_MODULE
);
1229 case CONTROL_CHANNEL
:
1230 err
= channel_ctrl(card
, arg
);
1233 pr_debug("%s: unknown DCTRL command %x\n", card
->name
, cmd
);
1240 setup_w6692(struct w6692_hw
*card
)
1244 if (!request_region(card
->addr
, 256, card
->name
)) {
1245 pr_info("%s: config port %x-%x already in use\n", card
->name
,
1246 card
->addr
, card
->addr
+ 255);
1250 card
->bc
[0].addr
= card
->addr
;
1251 card
->bc
[1].addr
= card
->addr
+ 0x40;
1252 val
= ReadW6692(card
, W_ISTA
);
1253 if (debug
& DEBUG_HW
)
1254 pr_notice("%s ISTA=%02x\n", card
->name
, val
);
1255 val
= ReadW6692(card
, W_IMASK
);
1256 if (debug
& DEBUG_HW
)
1257 pr_notice("%s IMASK=%02x\n", card
->name
, val
);
1258 val
= ReadW6692(card
, W_D_EXIR
);
1259 if (debug
& DEBUG_HW
)
1260 pr_notice("%s D_EXIR=%02x\n", card
->name
, val
);
1261 val
= ReadW6692(card
, W_D_EXIM
);
1262 if (debug
& DEBUG_HW
)
1263 pr_notice("%s D_EXIM=%02x\n", card
->name
, val
);
1264 val
= ReadW6692(card
, W_D_RSTA
);
1265 if (debug
& DEBUG_HW
)
1266 pr_notice("%s D_RSTA=%02x\n", card
->name
, val
);
1271 release_card(struct w6692_hw
*card
)
1275 spin_lock_irqsave(&card
->lock
, flags
);
1276 disable_hwirq(card
);
1277 w6692_mode(&card
->bc
[0], ISDN_P_NONE
);
1278 w6692_mode(&card
->bc
[1], ISDN_P_NONE
);
1279 if ((card
->fmask
& led
) || card
->subtype
== W6692_USR
) {
1280 card
->xdata
|= 0x04; /* LED OFF */
1281 WriteW6692(card
, W_XDATA
, card
->xdata
);
1283 spin_unlock_irqrestore(&card
->lock
, flags
);
1284 free_irq(card
->irq
, card
);
1285 l1_event(card
->dch
.l1
, CLOSE_CHANNEL
);
1286 mISDN_unregister_device(&card
->dch
.dev
);
1287 release_region(card
->addr
, 256);
1288 mISDN_freebchannel(&card
->bc
[1].bch
);
1289 mISDN_freebchannel(&card
->bc
[0].bch
);
1290 mISDN_freedchannel(&card
->dch
);
1291 write_lock_irqsave(&card_lock
, flags
);
1292 list_del(&card
->list
);
1293 write_unlock_irqrestore(&card_lock
, flags
);
1294 pci_disable_device(card
->pdev
);
1295 pci_set_drvdata(card
->pdev
, NULL
);
1300 setup_instance(struct w6692_hw
*card
)
1305 snprintf(card
->name
, MISDN_MAX_IDLEN
- 1, "w6692.%d", w6692_cnt
+ 1);
1306 write_lock_irqsave(&card_lock
, flags
);
1307 list_add_tail(&card
->list
, &Cards
);
1308 write_unlock_irqrestore(&card_lock
, flags
);
1309 card
->fmask
= (1 << w6692_cnt
);
1311 spin_lock_init(&card
->lock
);
1312 mISDN_initdchannel(&card
->dch
, MAX_DFRAME_LEN_L1
, W6692_ph_bh
);
1313 card
->dch
.dev
.Dprotocols
= (1 << ISDN_P_TE_S0
);
1314 card
->dch
.dev
.D
.send
= w6692_l2l1D
;
1315 card
->dch
.dev
.D
.ctrl
= w6692_dctrl
;
1316 card
->dch
.dev
.Bprotocols
= (1 << (ISDN_P_B_RAW
& ISDN_P_B_MASK
)) |
1317 (1 << (ISDN_P_B_HDLC
& ISDN_P_B_MASK
));
1318 card
->dch
.hw
= card
;
1319 card
->dch
.dev
.nrbchan
= 2;
1320 for (i
= 0; i
< 2; i
++) {
1321 mISDN_initbchannel(&card
->bc
[i
].bch
, MAX_DATA_MEM
);
1322 card
->bc
[i
].bch
.hw
= card
;
1323 card
->bc
[i
].bch
.nr
= i
+ 1;
1324 card
->bc
[i
].bch
.ch
.nr
= i
+ 1;
1325 card
->bc
[i
].bch
.ch
.send
= w6692_l2l1B
;
1326 card
->bc
[i
].bch
.ch
.ctrl
= w6692_bctrl
;
1327 set_channelmap(i
+ 1, card
->dch
.dev
.channelmap
);
1328 list_add(&card
->bc
[i
].bch
.ch
.list
, &card
->dch
.dev
.bchannels
);
1330 err
= setup_w6692(card
);
1333 err
= mISDN_register_device(&card
->dch
.dev
, &card
->pdev
->dev
,
1337 err
= init_card(card
);
1340 err
= create_l1(&card
->dch
, w6692_l1callback
);
1343 pr_notice("W6692 %d cards installed\n", w6692_cnt
);
1347 free_irq(card
->irq
, card
);
1349 mISDN_unregister_device(&card
->dch
.dev
);
1351 release_region(card
->addr
, 256);
1353 mISDN_freebchannel(&card
->bc
[1].bch
);
1354 mISDN_freebchannel(&card
->bc
[0].bch
);
1355 mISDN_freedchannel(&card
->dch
);
1356 write_lock_irqsave(&card_lock
, flags
);
1357 list_del(&card
->list
);
1358 write_unlock_irqrestore(&card_lock
, flags
);
1363 static int __devinit
1364 w6692_probe(struct pci_dev
*pdev
, const struct pci_device_id
*ent
)
1367 struct w6692_hw
*card
;
1368 struct w6692map
*m
= (struct w6692map
*)ent
->driver_data
;
1370 card
= kzalloc(sizeof(struct w6692_hw
), GFP_KERNEL
);
1372 pr_info("No kmem for w6692 card\n");
1376 card
->subtype
= m
->subtype
;
1377 err
= pci_enable_device(pdev
);
1383 printk(KERN_INFO
"mISDN_w6692: found adapter %s at %s\n",
1384 m
->name
, pci_name(pdev
));
1386 card
->addr
= pci_resource_start(pdev
, 1);
1387 card
->irq
= pdev
->irq
;
1388 pci_set_drvdata(pdev
, card
);
1389 err
= setup_instance(card
);
1391 pci_set_drvdata(pdev
, NULL
);
1395 static void __devexit
1396 w6692_remove_pci(struct pci_dev
*pdev
)
1398 struct w6692_hw
*card
= pci_get_drvdata(pdev
);
1404 pr_notice("%s: drvdata allready removed\n", __func__
);
1407 static struct pci_device_id w6692_ids
[] = {
1408 { PCI_VENDOR_ID_DYNALINK
, PCI_DEVICE_ID_DYNALINK_IS64PH
,
1409 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, (ulong
)&w6692_map
[0]},
1410 { PCI_VENDOR_ID_WINBOND2
, PCI_DEVICE_ID_WINBOND2_6692
,
1411 PCI_VENDOR_ID_USR
, PCI_DEVICE_ID_USR_6692
, 0, 0,
1412 (ulong
)&w6692_map
[2]},
1413 { PCI_VENDOR_ID_WINBOND2
, PCI_DEVICE_ID_WINBOND2_6692
,
1414 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, (ulong
)&w6692_map
[1]},
1417 MODULE_DEVICE_TABLE(pci
, w6692_ids
);
1419 static struct pci_driver w6692_driver
= {
1421 .probe
= w6692_probe
,
1422 .remove
= __devexit_p(w6692_remove_pci
),
1423 .id_table
= w6692_ids
,
1426 static int __init
w6692_init(void)
1430 pr_notice("Winbond W6692 PCI driver Rev. %s\n", W6692_REV
);
1432 err
= pci_register_driver(&w6692_driver
);
1436 static void __exit
w6692_cleanup(void)
1438 pci_unregister_driver(&w6692_driver
);
1441 module_init(w6692_init
);
1442 module_exit(w6692_cleanup
);