2 * Driver for the Solos PCI ADSL2+ card, designed to support Linux by
3 * Traverse Technologies -- http://www.traverse.com.au/
4 * Xrio Limited -- http://www.xrio.com/
7 * Copyright © 2008 Traverse Technologies
8 * Copyright © 2008 Intel Corporation
10 * Authors: Nathan Williams <nathan@traverse.com.au>
11 * David Woodhouse <dwmw2@infradead.org>
12 * Treker Chen <treker@xrio.com>
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * version 2, as published by the Free Software Foundation.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
27 #include <linux/interrupt.h>
28 #include <linux/module.h>
29 #include <linux/kernel.h>
30 #include <linux/errno.h>
31 #include <linux/ioport.h>
32 #include <linux/types.h>
33 #include <linux/pci.h>
34 #include <linux/atm.h>
35 #include <linux/atmdev.h>
36 #include <linux/skbuff.h>
37 #include <linux/sysfs.h>
38 #include <linux/device.h>
39 #include <linux/kobject.h>
40 #include <linux/firmware.h>
42 #define VERSION "0.07"
43 #define PTAG "solos-pci"
45 #define CONFIG_RAM_SIZE 128
46 #define FLAGS_ADDR 0x7C
47 #define IRQ_EN_ADDR 0x78
49 #define IRQ_CLEAR 0x70
50 #define WRITE_FLASH 0x6C
52 #define FLASH_BLOCK 0x64
53 #define FLASH_BUSY 0x60
54 #define FPGA_MODE 0x5C
55 #define FLASH_MODE 0x58
57 #define DATA_RAM_SIZE 32768
59 #define FPGA_PAGE 528 /* FPGA flash page size*/
60 #define SOLOS_PAGE 512 /* Solos flash page size*/
61 #define FPGA_BLOCK (FPGA_PAGE * 8) /* FPGA flash block size*/
62 #define SOLOS_BLOCK (SOLOS_PAGE * 8) /* Solos flash block size*/
64 #define RX_BUF(card, nr) ((card->buffers) + (nr)*BUF_SIZE*2)
65 #define TX_BUF(card, nr) ((card->buffers) + (nr)*BUF_SIZE*2 + BUF_SIZE)
68 static int atmdebug = 0;
69 static int firmware_upgrade = 0;
70 static int fpga_upgrade = 0;
85 void __iomem *config_regs;
86 void __iomem *buffers;
89 struct atm_dev *atmdev[4];
90 struct tasklet_struct tlet;
92 spinlock_t tx_queue_lock;
93 spinlock_t cli_queue_lock;
94 struct sk_buff_head tx_queue[4];
95 struct sk_buff_head cli_queue[4];
96 wait_queue_head_t fw_wq;
99 #define SOLOS_CHAN(atmdev) ((int)(unsigned long)(atmdev)->phy_data)
101 MODULE_AUTHOR("Traverse Technologies <support@traverse.com.au>");
102 MODULE_DESCRIPTION("Solos PCI driver");
103 MODULE_VERSION(VERSION);
104 MODULE_LICENSE("GPL");
105 MODULE_PARM_DESC(debug, "Enable Loopback");
106 MODULE_PARM_DESC(atmdebug, "Print ATM data");
107 MODULE_PARM_DESC(firmware_upgrade, "Initiate Solos firmware upgrade");
108 MODULE_PARM_DESC(fpga_upgrade, "Initiate FPGA upgrade");
109 module_param(debug, int, 0444);
110 module_param(atmdebug, int, 0644);
111 module_param(firmware_upgrade, int, 0444);
112 module_param(fpga_upgrade, int, 0444);
116 static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
117 struct atm_vcc *vcc);
118 static int fpga_tx(struct solos_card *);
119 static irqreturn_t solos_irq(int irq, void *dev_id);
120 static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
121 static int list_vccs(int vci);
122 static int atm_init(struct solos_card *);
123 static void atm_remove(struct solos_card *);
124 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
125 static void solos_bh(unsigned long);
126 static int print_buffer(struct sk_buff *buf);
128 static inline void solos_pop(struct atm_vcc *vcc, struct sk_buff *skb)
133 dev_kfree_skb_any(skb);
136 static ssize_t console_show(struct device *dev, struct device_attribute *attr,
139 struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
140 struct solos_card *card = atmdev->dev_data;
143 spin_lock(&card->cli_queue_lock);
144 skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]);
145 spin_unlock(&card->cli_queue_lock);
147 return sprintf(buf, "No data.\n");
149 memcpy(buf, skb->data, skb->len);
150 dev_dbg(&card->dev->dev, "len: %d\n", skb->len);
156 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size)
159 struct pkt_hdr *header;
161 // dev_dbg(&card->dev->dev, "size: %d\n", size);
163 if (size > (BUF_SIZE - sizeof(*header))) {
164 dev_dbg(&card->dev->dev, "Command is too big. Dropping request\n");
167 skb = alloc_skb(size + sizeof(*header), GFP_ATOMIC);
169 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in send_command()\n");
173 header = (void *)skb_put(skb, sizeof(*header));
175 header->size = cpu_to_le16(size);
176 header->vpi = cpu_to_le16(0);
177 header->vci = cpu_to_le16(0);
178 header->type = cpu_to_le16(PKT_COMMAND);
180 memcpy(skb_put(skb, size), buf, size);
182 fpga_queue(card, dev, skb, NULL);
187 static ssize_t console_store(struct device *dev, struct device_attribute *attr,
188 const char *buf, size_t count)
190 struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
191 struct solos_card *card = atmdev->dev_data;
194 err = send_command(card, SOLOS_CHAN(atmdev), buf, count);
199 static DEVICE_ATTR(console, 0644, console_show, console_store);
201 static int flash_upgrade(struct solos_card *card, int chip)
203 const struct firmware *fw;
211 fw_name = "solos-FPGA.bin";
212 blocksize = FPGA_BLOCK;
214 fw_name = "solos-Firmware.bin";
215 blocksize = SOLOS_BLOCK;
218 if (request_firmware(&fw, fw_name, &card->dev->dev))
221 dev_info(&card->dev->dev, "Flash upgrade starting\n");
223 numblocks = fw->size / blocksize;
224 dev_info(&card->dev->dev, "Firmware size: %zd\n", fw->size);
225 dev_info(&card->dev->dev, "Number of blocks: %d\n", numblocks);
227 dev_info(&card->dev->dev, "Changing FPGA to Update mode\n");
228 iowrite32(1, card->config_regs + FPGA_MODE);
229 data32 = ioread32(card->config_regs + FPGA_MODE);
231 /* Set mode to Chip Erase */
232 dev_info(&card->dev->dev, "Set FPGA Flash mode to %s Chip Erase\n",
233 chip?"Solos":"FPGA");
234 iowrite32((chip * 2), card->config_regs + FLASH_MODE);
237 iowrite32(1, card->config_regs + WRITE_FLASH);
238 wait_event(card->fw_wq, !ioread32(card->config_regs + FLASH_BUSY));
240 for (offset = 0; offset < fw->size; offset += blocksize) {
243 /* Clear write flag */
244 iowrite32(0, card->config_regs + WRITE_FLASH);
246 /* Set mode to Block Write */
247 /* dev_info(&card->dev->dev, "Set FPGA Flash mode to Block Write\n"); */
248 iowrite32(((chip * 2) + 1), card->config_regs + FLASH_MODE);
250 /* Copy block to buffer, swapping each 16 bits */
251 for(i = 0; i < blocksize; i += 4) {
252 uint32_t word = swahb32p((uint32_t *)(fw->data + offset + i));
253 iowrite32(word, RX_BUF(card, 3) + i);
256 /* Specify block number and then trigger flash write */
257 iowrite32(offset / blocksize, card->config_regs + FLASH_BLOCK);
258 iowrite32(1, card->config_regs + WRITE_FLASH);
259 wait_event(card->fw_wq, !ioread32(card->config_regs + FLASH_BUSY));
262 release_firmware(fw);
263 iowrite32(0, card->config_regs + WRITE_FLASH);
264 iowrite32(0, card->config_regs + FPGA_MODE);
265 iowrite32(0, card->config_regs + FLASH_MODE);
266 dev_info(&card->dev->dev, "Returning FPGA to Data mode\n");
270 static irqreturn_t solos_irq(int irq, void *dev_id)
272 struct solos_card *card = dev_id;
276 iowrite32(0, card->config_regs + IRQ_CLEAR);
277 //Disable IRQs from FPGA
278 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
281 tasklet_schedule(&card->tlet);
283 wake_up(&card->fw_wq);
285 //Enable IRQs from FPGA
286 iowrite32(1, card->config_regs + IRQ_EN_ADDR);
287 return IRQ_RETVAL(handled);
290 void solos_bh(unsigned long card_arg)
292 struct solos_card *card = (void *)card_arg;
296 uint32_t rx_done = 0;
298 card_flags = ioread32(card->config_regs + FLAGS_ADDR);
300 /* The TX bits are set if the channel is busy; clear if not. We want to
301 invoke fpga_tx() unless _all_ the bits for active channels are set */
302 tx_mask = (1 << card->nr_ports) - 1;
303 if ((card_flags & tx_mask) != tx_mask)
306 for (port = 0; port < card->nr_ports; port++) {
307 if (card_flags & (0x10 << port)) {
308 struct pkt_hdr header;
313 rx_done |= 0x10 << port;
315 memcpy_fromio(&header, RX_BUF(card, port), sizeof(header));
317 size = le16_to_cpu(header.size);
319 skb = alloc_skb(size, GFP_ATOMIC);
322 dev_warn(&card->dev->dev, "Failed to allocate sk_buff for RX\n");
326 memcpy_fromio(skb_put(skb, size),
327 RX_BUF(card, port) + sizeof(header),
331 dev_info(&card->dev->dev, "Received: device %d\n", port);
332 dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
333 size, le16_to_cpu(header.vpi),
334 le16_to_cpu(header.vci));
338 switch (le16_to_cpu(header.type)) {
340 vcc = find_vcc(card->atmdev[port], le16_to_cpu(header.vpi),
341 le16_to_cpu(header.vci));
344 dev_warn(&card->dev->dev, "Received packet for unknown VCI.VPI %d.%d on port %d\n",
345 le16_to_cpu(header.vci), le16_to_cpu(header.vpi),
349 atm_charge(vcc, skb->truesize);
351 atomic_inc(&vcc->stats->rx);
355 default: /* FIXME: Not really, surely? */
356 spin_lock(&card->cli_queue_lock);
357 if (skb_queue_len(&card->cli_queue[port]) > 10) {
359 dev_warn(&card->dev->dev, "Dropping console response on port %d\n",
362 skb_queue_tail(&card->cli_queue[port], skb);
363 spin_unlock(&card->cli_queue_lock);
369 iowrite32(rx_done, card->config_regs + FLAGS_ADDR);
374 static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci)
376 struct hlist_head *head;
377 struct atm_vcc *vcc = NULL;
378 struct hlist_node *node;
381 read_lock(&vcc_sklist_lock);
382 head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
383 sk_for_each(s, node, head) {
385 if (vcc->dev == dev && vcc->vci == vci &&
386 vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE)
391 read_unlock(&vcc_sklist_lock);
395 static int list_vccs(int vci)
397 struct hlist_head *head;
399 struct hlist_node *node;
404 read_lock(&vcc_sklist_lock);
406 head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
407 sk_for_each(s, node, head) {
410 printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
418 sk_for_each(s, node, head) {
421 printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
428 read_unlock(&vcc_sklist_lock);
433 static int popen(struct atm_vcc *vcc)
435 struct solos_card *card = vcc->dev->dev_data;
437 struct pkt_hdr *header;
439 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
440 if (!skb && net_ratelimit()) {
441 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");
444 header = (void *)skb_put(skb, sizeof(*header));
446 header->size = cpu_to_le16(0);
447 header->vpi = cpu_to_le16(vcc->vpi);
448 header->vci = cpu_to_le16(vcc->vci);
449 header->type = cpu_to_le16(PKT_POPEN);
451 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
453 // dev_dbg(&card->dev->dev, "Open for vpi %d and vci %d on interface %d\n", vcc->vpi, vcc->vci, SOLOS_CHAN(vcc->dev));
454 set_bit(ATM_VF_ADDR, &vcc->flags); // accept the vpi / vci
455 set_bit(ATM_VF_READY, &vcc->flags);
459 iowrite32(1, card->config_regs + IRQ_EN_ADDR);
461 opens++; //count open PVCs
466 static void pclose(struct atm_vcc *vcc)
468 struct solos_card *card = vcc->dev->dev_data;
470 struct pkt_hdr *header;
472 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
474 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");
477 header = (void *)skb_put(skb, sizeof(*header));
479 header->size = cpu_to_le16(0);
480 header->vpi = cpu_to_le16(vcc->vpi);
481 header->vci = cpu_to_le16(vcc->vci);
482 header->type = cpu_to_le16(PKT_PCLOSE);
484 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
486 // dev_dbg(&card->dev->dev, "Close for vpi %d and vci %d on interface %d\n", vcc->vpi, vcc->vci, SOLOS_CHAN(vcc->dev));
488 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
490 clear_bit(ATM_VF_ADDR, &vcc->flags);
491 clear_bit(ATM_VF_READY, &vcc->flags);
496 static int print_buffer(struct sk_buff *buf)
503 for (i = 0; i < len; i++){
505 sprintf(msg, "%02X: ", i);
507 sprintf(item,"%02X ",*(buf->data + i));
512 printk(KERN_DEBUG "%s", msg);
518 printk(KERN_DEBUG "%s", msg);
520 printk(KERN_DEBUG "\n");
525 static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
530 *(void **)skb->cb = vcc;
532 spin_lock(&card->tx_queue_lock);
533 old_len = skb_queue_len(&card->tx_queue[port]);
534 skb_queue_tail(&card->tx_queue[port], skb);
535 spin_unlock(&card->tx_queue_lock);
537 /* If TX might need to be started, do so */
542 static int fpga_tx(struct solos_card *card)
545 uint32_t tx_started = 0;
551 spin_lock_irqsave(&card->tx_lock, flags);
553 tx_pending = ioread32(card->config_regs + FLAGS_ADDR);
555 dev_vdbg(&card->dev->dev, "TX Flags are %X\n", tx_pending);
557 for (port = 0; port < card->nr_ports; port++) {
558 if (!(tx_pending & (1 << port))) {
560 spin_lock(&card->tx_queue_lock);
561 skb = skb_dequeue(&card->tx_queue[port]);
562 spin_unlock(&card->tx_queue_lock);
568 dev_info(&card->dev->dev, "Transmitted: port %d\n",
572 memcpy_toio(TX_BUF(card, port), skb->data, skb->len);
574 vcc = *(void **)skb->cb;
577 atomic_inc(&vcc->stats->tx);
580 dev_kfree_skb_irq(skb);
582 tx_started |= 1 << port; //Set TX full flag
586 iowrite32(tx_started, card->config_regs + FLAGS_ADDR);
588 spin_unlock_irqrestore(&card->tx_lock, flags);
592 static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
594 struct solos_card *card = vcc->dev->dev_data;
595 struct sk_buff *skb2 = NULL;
596 struct pkt_hdr *header;
599 //dev_dbg(&card->dev->dev, "psend called.\n");
600 //dev_dbg(&card->dev->dev, "dev,vpi,vci = %d,%d,%d\n",SOLOS_CHAN(vcc->dev),vcc->vpi,vcc->vci);
603 skb2 = atm_alloc_charge(vcc, skb->len, GFP_ATOMIC);
605 memcpy(skb2->data, skb->data, skb->len);
606 skb_put(skb2, skb->len);
607 vcc->push(vcc, skb2);
608 atomic_inc(&vcc->stats->rx);
610 atomic_inc(&vcc->stats->tx);
616 if (pktlen > (BUF_SIZE - sizeof(*header))) {
617 dev_warn(&card->dev->dev, "Length of PDU is too large. Dropping PDU.\n");
622 if (!skb_clone_writable(skb, sizeof(*header))) {
626 if (skb_headroom(skb) < sizeof(*header))
627 expand_by = sizeof(*header) - skb_headroom(skb);
629 ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC);
631 dev_warn(&card->dev->dev, "pskb_expand_head failed.\n");
637 header = (void *)skb_push(skb, sizeof(*header));
639 /* This does _not_ include the size of the header */
640 header->size = cpu_to_le16(pktlen);
641 header->vpi = cpu_to_le16(vcc->vpi);
642 header->vci = cpu_to_le16(vcc->vci);
643 header->type = cpu_to_le16(PKT_DATA);
645 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, vcc);
650 static struct atmdev_ops fpga_ops = {
665 static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
669 uint8_t major_ver, minor_ver;
671 struct solos_card *card;
676 card = kzalloc(sizeof(*card), GFP_KERNEL);
681 init_waitqueue_head(&card->fw_wq);
683 err = pci_enable_device(dev);
685 dev_warn(&dev->dev, "Failed to enable PCI device\n");
689 err = pci_request_regions(dev, "solos");
691 dev_warn(&dev->dev, "Failed to request regions\n");
695 card->config_regs = pci_iomap(dev, 0, CONFIG_RAM_SIZE);
696 if (!card->config_regs) {
697 dev_warn(&dev->dev, "Failed to ioremap config registers\n");
698 goto out_release_regions;
700 card->buffers = pci_iomap(dev, 1, DATA_RAM_SIZE);
701 if (!card->buffers) {
702 dev_warn(&dev->dev, "Failed to ioremap data buffers\n");
703 goto out_unmap_config;
706 // for(i=0;i<64 ;i+=4){
707 // data32=ioread32(card->buffers + i);
708 // dev_dbg(&card->dev->dev, "%08lX\n",(unsigned long)data32);
711 //Fill Config Mem with zeros
712 for(i = 0; i < 128; i += 4)
713 iowrite32(0, card->config_regs + i);
716 iowrite32(0xF0, card->config_regs + FLAGS_ADDR);
718 data32 = ioread32(card->config_regs + FPGA_VER);
719 fpga_ver = (data32 & 0x0000FFFF);
720 major_ver = ((data32 & 0xFF000000) >> 24);
721 minor_ver = ((data32 & 0x00FF0000) >> 16);
722 dev_info(&dev->dev, "Solos FPGA Version %d.%02d svn-%d\n",
723 major_ver, minor_ver, fpga_ver);
725 card->nr_ports = 2; /* FIXME: Detect daughterboard */
727 pci_set_drvdata(dev, card);
729 tasklet_init(&card->tlet, solos_bh, (unsigned long)card);
730 spin_lock_init(&card->tx_lock);
731 spin_lock_init(&card->tx_queue_lock);
732 spin_lock_init(&card->cli_queue_lock);
737 iowrite32(data32,card->config_regs + FLAGS_ADDR);
740 // Fill Buffers with zeros
741 for (i = 0; i < BUF_SIZE * 8; i += 4)
742 iowrite32(0, card->buffers + i);
745 for(i = 0; i < (BUF_SIZE * 1); i += 4)
746 iowrite32(0x12345678, card->buffers + i + (0*BUF_SIZE));
747 for(i = 0; i < (BUF_SIZE * 1); i += 4)
748 iowrite32(0xabcdef98, card->buffers + i + (1*BUF_SIZE));
750 // Read Config Memory
751 printk(KERN_DEBUG "Reading Config MEM\n");
753 for(i = 0; i < 16; i++) {
754 data32=ioread32(card->buffers + i*(BUF_SIZE/2));
755 printk(KERN_ALERT "Addr: %lX Data: %08lX\n",
756 (unsigned long)(addr_start + i*(BUF_SIZE/2)),
757 (unsigned long)data32);
760 //dev_dbg(&card->dev->dev, "Requesting IRQ: %d\n",dev->irq);
761 err = request_irq(dev->irq, solos_irq, IRQF_DISABLED|IRQF_SHARED,
764 dev_dbg(&card->dev->dev, "Failed to request interrupt IRQ: %d\n", dev->irq);
769 iowrite32(1, card->config_regs + IRQ_EN_ADDR);
772 flash_upgrade(card, 0);
774 if (firmware_upgrade)
775 flash_upgrade(card, 1);
777 err = atm_init(card);
784 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
785 free_irq(dev->irq, card);
786 tasklet_kill(&card->tlet);
789 pci_set_drvdata(dev, NULL);
790 pci_iounmap(dev, card->config_regs);
792 pci_iounmap(dev, card->buffers);
794 pci_release_regions(dev);
799 static int atm_init(struct solos_card *card)
805 for (i = 0; i < card->nr_ports; i++) {
806 skb_queue_head_init(&card->tx_queue[i]);
807 skb_queue_head_init(&card->cli_queue[i]);
809 card->atmdev[i] = atm_dev_register("solos-pci", &fpga_ops, -1, NULL);
810 if (!card->atmdev[i]) {
811 dev_err(&card->dev->dev, "Could not register ATM device %d\n", i);
815 if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_console))
816 dev_err(&card->dev->dev, "Could not register console for ATM device %d\n", i);
818 dev_info(&card->dev->dev, "Registered ATM device %d\n", card->atmdev[i]->number);
820 card->atmdev[i]->ci_range.vpi_bits = 8;
821 card->atmdev[i]->ci_range.vci_bits = 16;
822 card->atmdev[i]->dev_data = card;
823 card->atmdev[i]->phy_data = (void *)(unsigned long)i;
828 static void atm_remove(struct solos_card *card)
832 for (i = 0; i < card->nr_ports; i++) {
833 if (card->atmdev[i]) {
834 dev_info(&card->dev->dev, "Unregistering ATM device %d\n", card->atmdev[i]->number);
835 atm_dev_deregister(card->atmdev[i]);
840 static void fpga_remove(struct pci_dev *dev)
842 struct solos_card *card = pci_get_drvdata(dev);
849 dev_vdbg(&dev->dev, "Freeing IRQ\n");
850 // Disable IRQs from FPGA
851 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
852 free_irq(dev->irq, card);
853 tasklet_kill(&card->tlet);
855 // iowrite32(0x01,pciregs);
856 dev_vdbg(&dev->dev, "Unmapping PCI resource\n");
857 pci_iounmap(dev, card->buffers);
858 pci_iounmap(dev, card->config_regs);
860 dev_vdbg(&dev->dev, "Releasing PCI Region\n");
861 pci_release_regions(dev);
862 pci_disable_device(dev);
864 pci_set_drvdata(dev, NULL);
866 // dev_dbg(&card->dev->dev, "fpga_remove\n");
870 static struct pci_device_id fpga_pci_tbl[] __devinitdata = {
871 { 0x10ee, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
875 MODULE_DEVICE_TABLE(pci,fpga_pci_tbl);
877 static struct pci_driver fpga_driver = {
879 .id_table = fpga_pci_tbl,
881 .remove = fpga_remove,
885 static int __init solos_pci_init(void)
887 printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION);
888 return pci_register_driver(&fpga_driver);
891 static void __exit solos_pci_exit(void)
893 pci_unregister_driver(&fpga_driver);
894 printk(KERN_INFO "Solos PCI Driver %s Unloaded\n", VERSION);
897 module_init(solos_pci_init);
898 module_exit(solos_pci_exit);