blob: 84d2252045c895770315cc93d7c8c2a73bca9fc5 [file] [log] [blame]
Johannes Stezenbach2add87a2005-05-16 21:54:10 -07001/*
2 * This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III
3 *
4 * flexcop-pci.c - covers the PCI part including DMA transfers.
5 *
6 * see flexcop.c for copyright information.
7 */
8
9#define FC_LOG_PREFIX "flexcop-pci"
10#include "flexcop-common.h"
11
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -070012static int enable_pid_filtering = 1;
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070013module_param(enable_pid_filtering, int, 0444);
14MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1");
15
Patrick Boettcher382c5542009-02-23 06:27:16 -030016static int irq_chk_intv = 100;
Patrick Boettcher64221be2005-07-07 17:57:49 -070017module_param(irq_chk_intv, int, 0644);
Patrick Boettcher382c5542009-02-23 06:27:16 -030018MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog.");
Patrick Boettcher64221be2005-07-07 17:57:49 -070019
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070020#ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG
21#define dprintk(level,args...) \
22 do { if ((debug & level)) printk(args); } while (0)
23#define DEBSTATUS ""
24#else
25#define dprintk(level,args...)
26#define DEBSTATUS " (debugging is not enabled)"
27#endif
28
29#define deb_info(args...) dprintk(0x01,args)
30#define deb_reg(args...) dprintk(0x02,args)
31#define deb_ts(args...) dprintk(0x04,args)
32#define deb_irq(args...) dprintk(0x08,args)
Patrick Boettcher64221be2005-07-07 17:57:49 -070033#define deb_chk(args...) dprintk(0x10,args)
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070034
Douglas Schilling Landgrafff699e62008-04-22 14:41:48 -030035static int debug;
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070036module_param(debug, int, 0644);
Patrick Boettcher382c5542009-02-23 06:27:16 -030037MODULE_PARM_DESC(debug,
38 "set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))."
39 DEBSTATUS);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070040
41#define DRIVER_VERSION "0.1"
42#define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver"
43#define DRIVER_AUTHOR "Patrick Boettcher <patrick.boettcher@desy.de>"
44
45struct flexcop_pci {
46 struct pci_dev *pdev;
47
48#define FC_PCI_INIT 0x01
49#define FC_PCI_DMA_INIT 0x02
50 int init_state;
51
52 void __iomem *io_mem;
53 u32 irq;
54/* buffersize (at least for DMA1, need to be % 188 == 0,
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -070055 * this logic is required */
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070056#define FC_DEFAULT_DMA1_BUFSIZE (1280 * 188)
57#define FC_DEFAULT_DMA2_BUFSIZE (10 * 188)
58 struct flexcop_dma dma[2];
59
60 int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */
61 u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -070062 int count;
Patrick Boettcher382c5542009-02-23 06:27:16 -030063 int count_prev;
64 int stream_problem;
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070065
Johannes Stezenbach4853f162005-05-16 21:54:15 -070066 spinlock_t irq_lock;
67
Patrick Boettcher64221be2005-07-07 17:57:49 -070068 unsigned long last_irq;
69
David Howellsc4028952006-11-22 14:57:56 +000070 struct delayed_work irq_check_work;
Patrick Boettcher64221be2005-07-07 17:57:49 -070071
Johannes Stezenbach2add87a2005-05-16 21:54:10 -070072 struct flexcop_device *fc_dev;
73};
74
75static int lastwreg,lastwval,lastrreg,lastrval;
76
77static flexcop_ibi_value flexcop_pci_read_ibi_reg (struct flexcop_device *fc, flexcop_ibi_register r)
78{
79 struct flexcop_pci *fc_pci = fc->bus_specific;
80 flexcop_ibi_value v;
81 v.raw = readl(fc_pci->io_mem + r);
82
83 if (lastrreg != r || lastrval != v.raw) {
84 lastrreg = r; lastrval = v.raw;
85 deb_reg("new rd: %3x: %08x\n",r,v.raw);
86 }
87
88 return v;
89}
90
91static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_register r, flexcop_ibi_value v)
92{
93 struct flexcop_pci *fc_pci = fc->bus_specific;
94
95 if (lastwreg != r || lastwval != v.raw) {
96 lastwreg = r; lastwval = v.raw;
97 deb_reg("new wr: %3x: %08x\n",r,v.raw);
98 }
99
100 writel(v.raw, fc_pci->io_mem + r);
101 return 0;
102}
103
David Howellsc4028952006-11-22 14:57:56 +0000104static void flexcop_pci_irq_check_work(struct work_struct *work)
Patrick Boettcher64221be2005-07-07 17:57:49 -0700105{
David Howellsc4028952006-11-22 14:57:56 +0000106 struct flexcop_pci *fc_pci =
107 container_of(work, struct flexcop_pci, irq_check_work.work);
Patrick Boettcher64221be2005-07-07 17:57:49 -0700108 struct flexcop_device *fc = fc_pci->fc_dev;
109
Patrick Boettcher382c5542009-02-23 06:27:16 -0300110 if (fc->feedcount) {
Patrick Boettcher64221be2005-07-07 17:57:49 -0700111
Patrick Boettcher382c5542009-02-23 06:27:16 -0300112 if (fc_pci->count == fc_pci->count_prev) {
113 deb_chk("no IRQ since the last check\n");
114 if (fc_pci->stream_problem++ == 3) {
115 struct dvb_demux_feed *feed;
Matthias Schwarzotta27e4fd2009-03-10 13:55:14 -0300116 deb_info("flexcop-pci: stream problem, resetting pid filter\n");
Patrick Boettcher64221be2005-07-07 17:57:49 -0700117
Patrick Boettcher382c5542009-02-23 06:27:16 -0300118 spin_lock_irq(&fc->demux.lock);
119 list_for_each_entry(feed, &fc->demux.feed_list,
120 list_head) {
121 flexcop_pid_feed_control(fc, feed, 0);
122 }
123
124 list_for_each_entry(feed, &fc->demux.feed_list,
125 list_head) {
126 flexcop_pid_feed_control(fc, feed, 1);
127 }
128 spin_unlock_irq(&fc->demux.lock);
129
130 fc_pci->stream_problem = 0;
131 }
132 } else {
133 fc_pci->stream_problem = 0;
134 fc_pci->count_prev = fc_pci->count;
135 }
136 }
Patrick Boettcher64221be2005-07-07 17:57:49 -0700137
138 schedule_delayed_work(&fc_pci->irq_check_work,
139 msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
140}
141
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700142/* When PID filtering is turned on, we use the timer IRQ, because small amounts
143 * of data need to be passed to the user space instantly as well. When PID
144 * filtering is turned off, we use the page-change-IRQ */
David Howells7d12e782006-10-05 14:55:46 +0100145static irqreturn_t flexcop_pci_isr(int irq, void *dev_id)
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700146{
147 struct flexcop_pci *fc_pci = dev_id;
148 struct flexcop_device *fc = fc_pci->fc_dev;
Hendrik Borghorst4f210e02007-04-05 14:28:11 -0300149 unsigned long flags;
Patrick Boettcher64221be2005-07-07 17:57:49 -0700150 flexcop_ibi_value v;
Johannes Stezenbach4853f162005-05-16 21:54:15 -0700151 irqreturn_t ret = IRQ_HANDLED;
152
Hendrik Borghorst4f210e02007-04-05 14:28:11 -0300153 spin_lock_irqsave(&fc_pci->irq_lock,flags);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700154
Patrick Boettcher64221be2005-07-07 17:57:49 -0700155 v = fc->read_ibi_reg(fc,irq_20c);
156
157 /* errors */
158 if (v.irq_20c.Data_receiver_error)
159 deb_chk("data receiver error\n");
160 if (v.irq_20c.Continuity_error_flag)
161 deb_chk("Contunuity error flag is set\n");
162 if (v.irq_20c.LLC_SNAP_FLAG_set)
163 deb_chk("LLC_SNAP_FLAG_set is set\n");
164 if (v.irq_20c.Transport_Error)
165 deb_chk("Transport error\n");
166
167 if ((fc_pci->count % 1000) == 0)
168 deb_chk("%d valid irq took place so far\n",fc_pci->count);
169
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700170 if (v.irq_20c.DMA1_IRQ_Status == 1) {
171 if (fc_pci->active_dma1_addr == 0)
172 flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr0,fc_pci->dma[0].size / 188);
173 else
174 flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr1,fc_pci->dma[0].size / 188);
175
176 deb_irq("page change to page: %d\n",!fc_pci->active_dma1_addr);
177 fc_pci->active_dma1_addr = !fc_pci->active_dma1_addr;
178 } else if (v.irq_20c.DMA1_Timer_Status == 1) {
179 /* for the timer IRQ we only can use buffer dmx feeding, because we don't have
180 * complete TS packets when reading from the DMA memory */
181 dma_addr_t cur_addr =
182 fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2;
183 u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0;
184
Randy Dunlap608268b2006-01-23 10:01:59 -0200185 deb_irq("%u irq: %08x cur_addr: %llx: cur_pos: %08x, last_cur_pos: %08x ",
186 jiffies_to_usecs(jiffies - fc_pci->last_irq),
187 v.raw, (unsigned long long)cur_addr, cur_pos,
188 fc_pci->last_dma1_cur_pos);
Patrick Boettcher64221be2005-07-07 17:57:49 -0700189 fc_pci->last_irq = jiffies;
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -0700190
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700191 /* buffer end was reached, restarted from the beginning
192 * pass the data from last_cur_pos to the buffer end to the demux
193 */
194 if (cur_pos < fc_pci->last_dma1_cur_pos) {
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -0700195 deb_irq(" end was reached: passing %d bytes ",(fc_pci->dma[0].size*2 - 1) - fc_pci->last_dma1_cur_pos);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700196 flexcop_pass_dmx_data(fc_pci->fc_dev,
197 fc_pci->dma[0].cpu_addr0 + fc_pci->last_dma1_cur_pos,
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -0700198 (fc_pci->dma[0].size*2) - fc_pci->last_dma1_cur_pos);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700199 fc_pci->last_dma1_cur_pos = 0;
200 }
201
202 if (cur_pos > fc_pci->last_dma1_cur_pos) {
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -0700203 deb_irq(" passing %d bytes ",cur_pos - fc_pci->last_dma1_cur_pos);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700204 flexcop_pass_dmx_data(fc_pci->fc_dev,
205 fc_pci->dma[0].cpu_addr0 + fc_pci->last_dma1_cur_pos,
206 cur_pos - fc_pci->last_dma1_cur_pos);
207 }
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -0700208 deb_irq("\n");
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700209
210 fc_pci->last_dma1_cur_pos = cur_pos;
Patrick Boettcher64221be2005-07-07 17:57:49 -0700211 fc_pci->count++;
212 } else {
213 deb_irq("isr for flexcop called, apparently without reason (%08x)\n",v.raw);
Johannes Stezenbach4853f162005-05-16 21:54:15 -0700214 ret = IRQ_NONE;
Patrick Boettcher64221be2005-07-07 17:57:49 -0700215 }
Johannes Stezenbach4853f162005-05-16 21:54:15 -0700216
Hendrik Borghorst4f210e02007-04-05 14:28:11 -0300217 spin_unlock_irqrestore(&fc_pci->irq_lock,flags);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700218
Johannes Stezenbach4853f162005-05-16 21:54:15 -0700219 return ret;
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700220}
221
222static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff)
223{
224 struct flexcop_pci *fc_pci = fc->bus_specific;
225 if (onoff) {
Patrick Boettcher64221be2005-07-07 17:57:49 -0700226 flexcop_dma_config(fc,&fc_pci->dma[0],FC_DMA_1);
227 flexcop_dma_config(fc,&fc_pci->dma[1],FC_DMA_2);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700228
Patrick Boettcher64221be2005-07-07 17:57:49 -0700229 flexcop_dma_config_timer(fc,FC_DMA_1,0);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700230
Patrick Boettcher64221be2005-07-07 17:57:49 -0700231 flexcop_dma_xfer_control(fc,FC_DMA_1,FC_DMA_SUBADDR_0 | FC_DMA_SUBADDR_1,1);
232 deb_irq("DMA xfer enabled\n");
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700233
Patrick Boettcher64221be2005-07-07 17:57:49 -0700234 fc_pci->last_dma1_cur_pos = 0;
235 flexcop_dma_control_timer_irq(fc,FC_DMA_1,1);
236 deb_irq("IRQ enabled\n");
237
Patrick Boettcher382c5542009-02-23 06:27:16 -0300238 fc_pci->count_prev = fc_pci->count;
239
Patrick Boettcher64221be2005-07-07 17:57:49 -0700240// fc_pci->active_dma1_addr = 0;
241// flexcop_dma_control_size_irq(fc,FC_DMA_1,1);
242
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700243 } else {
Patrick Boettcher64221be2005-07-07 17:57:49 -0700244 flexcop_dma_control_timer_irq(fc,FC_DMA_1,0);
245 deb_irq("IRQ disabled\n");
246
247// flexcop_dma_control_size_irq(fc,FC_DMA_1,0);
248
249 flexcop_dma_xfer_control(fc,FC_DMA_1,FC_DMA_SUBADDR_0 | FC_DMA_SUBADDR_1,0);
250 deb_irq("DMA xfer disabled\n");
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700251 }
252
253 return 0;
254}
255
256static int flexcop_pci_dma_init(struct flexcop_pci *fc_pci)
257{
258 int ret;
259 if ((ret = flexcop_dma_allocate(fc_pci->pdev,&fc_pci->dma[0],FC_DEFAULT_DMA1_BUFSIZE)) != 0)
260 return ret;
261
Trent Piepho83977032006-05-12 20:36:24 -0300262 if ((ret = flexcop_dma_allocate(fc_pci->pdev,&fc_pci->dma[1],FC_DEFAULT_DMA2_BUFSIZE)) != 0) {
263 flexcop_dma_free(&fc_pci->dma[0]);
264 return ret;
265 }
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700266
267 flexcop_sram_set_dest(fc_pci->fc_dev,FC_SRAM_DEST_MEDIA | FC_SRAM_DEST_NET, FC_SRAM_DEST_TARGET_DMA1);
268 flexcop_sram_set_dest(fc_pci->fc_dev,FC_SRAM_DEST_CAO | FC_SRAM_DEST_CAI, FC_SRAM_DEST_TARGET_DMA2);
269
270 fc_pci->init_state |= FC_PCI_DMA_INIT;
Patrick Boettcher64221be2005-07-07 17:57:49 -0700271
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700272 return ret;
273}
274
275static void flexcop_pci_dma_exit(struct flexcop_pci *fc_pci)
276{
277 if (fc_pci->init_state & FC_PCI_DMA_INIT) {
278 flexcop_dma_free(&fc_pci->dma[0]);
279 flexcop_dma_free(&fc_pci->dma[1]);
280 }
281 fc_pci->init_state &= ~FC_PCI_DMA_INIT;
282}
283
284static int flexcop_pci_init(struct flexcop_pci *fc_pci)
285{
286 int ret;
287 u8 card_rev;
288
289 pci_read_config_byte(fc_pci->pdev, PCI_CLASS_REVISION, &card_rev);
290 info("card revision %x", card_rev);
291
292 if ((ret = pci_enable_device(fc_pci->pdev)) != 0)
293 return ret;
294
295 pci_set_master(fc_pci->pdev);
296
297 /* enable interrupts */
298 // pci_write_config_dword(pdev, 0x6c, 0x8000);
299
300 if ((ret = pci_request_regions(fc_pci->pdev, DRIVER_NAME)) != 0)
301 goto err_pci_disable_device;
302
303 fc_pci->io_mem = pci_iomap(fc_pci->pdev, 0, 0x800);
304
305 if (!fc_pci->io_mem) {
306 err("cannot map io memory\n");
307 ret = -EIO;
308 goto err_pci_release_regions;
309 }
310
311 pci_set_drvdata(fc_pci->pdev, fc_pci);
Hendrik Borghorst4f210e02007-04-05 14:28:11 -0300312 spin_lock_init(&fc_pci->irq_lock);
Patrick Boettcher64221be2005-07-07 17:57:49 -0700313 if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr,
Thomas Gleixner8076fe32006-07-01 19:29:37 -0700314 IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700315 goto err_pci_iounmap;
316
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700317 fc_pci->init_state |= FC_PCI_INIT;
Trent Piepho83977032006-05-12 20:36:24 -0300318 return ret;
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700319
320err_pci_iounmap:
321 pci_iounmap(fc_pci->pdev, fc_pci->io_mem);
322 pci_set_drvdata(fc_pci->pdev, NULL);
323err_pci_release_regions:
324 pci_release_regions(fc_pci->pdev);
325err_pci_disable_device:
326 pci_disable_device(fc_pci->pdev);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700327 return ret;
328}
329
330static void flexcop_pci_exit(struct flexcop_pci *fc_pci)
331{
332 if (fc_pci->init_state & FC_PCI_INIT) {
333 free_irq(fc_pci->pdev->irq, fc_pci);
334 pci_iounmap(fc_pci->pdev, fc_pci->io_mem);
335 pci_set_drvdata(fc_pci->pdev, NULL);
336 pci_release_regions(fc_pci->pdev);
337 pci_disable_device(fc_pci->pdev);
338 }
339 fc_pci->init_state &= ~FC_PCI_INIT;
340}
341
342
343static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
344{
345 struct flexcop_device *fc;
346 struct flexcop_pci *fc_pci;
347 int ret = -ENOMEM;
348
349 if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_pci))) == NULL) {
350 err("out of memory\n");
351 return -ENOMEM;
352 }
353
354/* general flexcop init */
355 fc_pci = fc->bus_specific;
356 fc_pci->fc_dev = fc;
357
358 fc->read_ibi_reg = flexcop_pci_read_ibi_reg;
359 fc->write_ibi_reg = flexcop_pci_write_ibi_reg;
360 fc->i2c_request = flexcop_i2c_request;
361 fc->get_mac_addr = flexcop_eeprom_check_mac_addr;
362
363 fc->stream_control = flexcop_pci_stream_control;
364
Johannes Stezenbachc4ee3fd2005-05-16 21:54:15 -0700365 if (enable_pid_filtering)
366 info("will use the HW PID filter.");
367 else
368 info("will pass the complete TS to the demuxer.");
369
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700370 fc->pid_filtering = enable_pid_filtering;
371 fc->bus_type = FC_PCI;
372
373 fc->dev = &pdev->dev;
Johannes Stezenbach59a7ad62005-05-16 21:54:16 -0700374 fc->owner = THIS_MODULE;
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700375
376/* bus specific part */
377 fc_pci->pdev = pdev;
378 if ((ret = flexcop_pci_init(fc_pci)) != 0)
379 goto err_kfree;
380
381/* init flexcop */
382 if ((ret = flexcop_device_initialize(fc)) != 0)
383 goto err_pci_exit;
384
385/* init dma */
386 if ((ret = flexcop_pci_dma_init(fc_pci)) != 0)
387 goto err_fc_exit;
388
David Howellsc4028952006-11-22 14:57:56 +0000389 INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work);
Patrick Boettcher64221be2005-07-07 17:57:49 -0700390
Patrick Boettcher382c5542009-02-23 06:27:16 -0300391 if (irq_chk_intv > 0)
392 schedule_delayed_work(&fc_pci->irq_check_work,
393 msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
394
Trent Piepho83977032006-05-12 20:36:24 -0300395 return ret;
396
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700397err_fc_exit:
398 flexcop_device_exit(fc);
399err_pci_exit:
400 flexcop_pci_exit(fc_pci);
401err_kfree:
402 flexcop_device_kfree(fc);
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700403 return ret;
404}
405
406/* in theory every _exit function should be called exactly two times,
407 * here and in the bail-out-part of the _init-function
408 */
409static void flexcop_pci_remove(struct pci_dev *pdev)
410{
411 struct flexcop_pci *fc_pci = pci_get_drvdata(pdev);
412
Patrick Boettcher382c5542009-02-23 06:27:16 -0300413 if (irq_chk_intv > 0)
414 cancel_delayed_work(&fc_pci->irq_check_work);
415
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700416 flexcop_pci_dma_exit(fc_pci);
417 flexcop_device_exit(fc_pci->fc_dev);
418 flexcop_pci_exit(fc_pci);
419 flexcop_device_kfree(fc_pci->fc_dev);
420}
421
422static struct pci_device_id flexcop_pci_tbl[] = {
423 { PCI_DEVICE(0x13d0, 0x2103) },
Patrick Boettcher64221be2005-07-07 17:57:49 -0700424/* { PCI_DEVICE(0x13d0, 0x2200) }, ? */
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700425 { },
426};
427
428MODULE_DEVICE_TABLE(pci, flexcop_pci_tbl);
429
430static struct pci_driver flexcop_pci_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700431 .name = "b2c2_flexcop_pci",
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700432 .id_table = flexcop_pci_tbl,
Patrick Boettcher64221be2005-07-07 17:57:49 -0700433 .probe = flexcop_pci_probe,
434 .remove = flexcop_pci_remove,
Johannes Stezenbach2add87a2005-05-16 21:54:10 -0700435};
436
437static int __init flexcop_pci_module_init(void)
438{
439 return pci_register_driver(&flexcop_pci_driver);
440}
441
442static void __exit flexcop_pci_module_exit(void)
443{
444 pci_unregister_driver(&flexcop_pci_driver);
445}
446
447module_init(flexcop_pci_module_init);
448module_exit(flexcop_pci_module_exit);
449
450MODULE_AUTHOR(DRIVER_AUTHOR);
451MODULE_DESCRIPTION(DRIVER_NAME);
452MODULE_LICENSE("GPL");