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);
114 static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
115 struct atm_vcc *vcc);
116 static int fpga_tx(struct solos_card *);
117 static irqreturn_t solos_irq(int irq, void *dev_id);
118 static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
119 static int list_vccs(int vci);
120 static int atm_init(struct solos_card *);
121 static void atm_remove(struct solos_card *);
122 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
123 static void solos_bh(unsigned long);
124 static int print_buffer(struct sk_buff *buf);
126 static inline void solos_pop(struct atm_vcc *vcc, struct sk_buff *skb)
131 dev_kfree_skb_any(skb);
134 static ssize_t console_show(struct device *dev, struct device_attribute *attr,
137 struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
138 struct solos_card *card = atmdev->dev_data;
141 spin_lock(&card->cli_queue_lock);
142 skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]);
143 spin_unlock(&card->cli_queue_lock);
145 return sprintf(buf, "No data.\n");
147 memcpy(buf, skb->data, skb->len);
148 dev_dbg(&card->dev->dev, "len: %d\n", skb->len);
154 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size)
157 struct pkt_hdr *header;
159 // dev_dbg(&card->dev->dev, "size: %d\n", size);
161 if (size > (BUF_SIZE - sizeof(*header))) {
162 dev_dbg(&card->dev->dev, "Command is too big. Dropping request\n");
165 skb = alloc_skb(size + sizeof(*header), GFP_ATOMIC);
167 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in send_command()\n");
171 header = (void *)skb_put(skb, sizeof(*header));
173 header->size = cpu_to_le16(size);
174 header->vpi = cpu_to_le16(0);
175 header->vci = cpu_to_le16(0);
176 header->type = cpu_to_le16(PKT_COMMAND);
178 memcpy(skb_put(skb, size), buf, size);
180 fpga_queue(card, dev, skb, NULL);
185 static ssize_t console_store(struct device *dev, struct device_attribute *attr,
186 const char *buf, size_t count)
188 struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
189 struct solos_card *card = atmdev->dev_data;
192 err = send_command(card, SOLOS_CHAN(atmdev), buf, count);
197 static DEVICE_ATTR(console, 0644, console_show, console_store);
199 static int flash_upgrade(struct solos_card *card, int chip)
201 const struct firmware *fw;
209 fw_name = "solos-FPGA.bin";
210 blocksize = FPGA_BLOCK;
212 fw_name = "solos-Firmware.bin";
213 blocksize = SOLOS_BLOCK;
216 if (request_firmware(&fw, fw_name, &card->dev->dev))
219 dev_info(&card->dev->dev, "Flash upgrade starting\n");
221 numblocks = fw->size / blocksize;
222 dev_info(&card->dev->dev, "Firmware size: %zd\n", fw->size);
223 dev_info(&card->dev->dev, "Number of blocks: %d\n", numblocks);
225 dev_info(&card->dev->dev, "Changing FPGA to Update mode\n");
226 iowrite32(1, card->config_regs + FPGA_MODE);
227 data32 = ioread32(card->config_regs + FPGA_MODE);
229 /* Set mode to Chip Erase */
230 dev_info(&card->dev->dev, "Set FPGA Flash mode to %s Chip Erase\n",
231 chip?"Solos":"FPGA");
232 iowrite32((chip * 2), card->config_regs + FLASH_MODE);
235 iowrite32(1, card->config_regs + WRITE_FLASH);
236 wait_event(card->fw_wq, !ioread32(card->config_regs + FLASH_BUSY));
238 for (offset = 0; offset < fw->size; offset += blocksize) {
241 /* Clear write flag */
242 iowrite32(0, card->config_regs + WRITE_FLASH);
244 /* Set mode to Block Write */
245 /* dev_info(&card->dev->dev, "Set FPGA Flash mode to Block Write\n"); */
246 iowrite32(((chip * 2) + 1), card->config_regs + FLASH_MODE);
248 /* Copy block to buffer, swapping each 16 bits */
249 for(i = 0; i < blocksize; i += 4) {
250 uint32_t word = swahb32p((uint32_t *)(fw->data + offset + i));
251 iowrite32(word, RX_BUF(card, 3) + i);
254 /* Specify block number and then trigger flash write */
255 iowrite32(offset / blocksize, card->config_regs + FLASH_BLOCK);
256 iowrite32(1, card->config_regs + WRITE_FLASH);
257 wait_event(card->fw_wq, !ioread32(card->config_regs + FLASH_BUSY));
260 release_firmware(fw);
261 iowrite32(0, card->config_regs + WRITE_FLASH);
262 iowrite32(0, card->config_regs + FPGA_MODE);
263 iowrite32(0, card->config_regs + FLASH_MODE);
264 dev_info(&card->dev->dev, "Returning FPGA to Data mode\n");
268 static irqreturn_t solos_irq(int irq, void *dev_id)
270 struct solos_card *card = dev_id;
274 iowrite32(0, card->config_regs + IRQ_CLEAR);
275 //Disable IRQs from FPGA
276 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
279 tasklet_schedule(&card->tlet);
281 wake_up(&card->fw_wq);
283 //Enable IRQs from FPGA
284 iowrite32(1, card->config_regs + IRQ_EN_ADDR);
285 return IRQ_RETVAL(handled);
288 void solos_bh(unsigned long card_arg)
290 struct solos_card *card = (void *)card_arg;
294 uint32_t rx_done = 0;
296 card_flags = ioread32(card->config_regs + FLAGS_ADDR);
298 /* The TX bits are set if the channel is busy; clear if not. We want to
299 invoke fpga_tx() unless _all_ the bits for active channels are set */
300 tx_mask = (1 << card->nr_ports) - 1;
301 if ((card_flags & tx_mask) != tx_mask)
304 for (port = 0; port < card->nr_ports; port++) {
305 if (card_flags & (0x10 << port)) {
306 struct pkt_hdr header;
311 rx_done |= 0x10 << port;
313 memcpy_fromio(&header, RX_BUF(card, port), sizeof(header));
315 size = le16_to_cpu(header.size);
317 skb = alloc_skb(size, GFP_ATOMIC);
320 dev_warn(&card->dev->dev, "Failed to allocate sk_buff for RX\n");
324 memcpy_fromio(skb_put(skb, size),
325 RX_BUF(card, port) + sizeof(header),
329 dev_info(&card->dev->dev, "Received: device %d\n", port);
330 dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
331 size, le16_to_cpu(header.vpi),
332 le16_to_cpu(header.vci));
336 switch (le16_to_cpu(header.type)) {
338 vcc = find_vcc(card->atmdev[port], le16_to_cpu(header.vpi),
339 le16_to_cpu(header.vci));
342 dev_warn(&card->dev->dev, "Received packet for unknown VCI.VPI %d.%d on port %d\n",
343 le16_to_cpu(header.vci), le16_to_cpu(header.vpi),
347 atm_charge(vcc, skb->truesize);
349 atomic_inc(&vcc->stats->rx);
353 default: /* FIXME: Not really, surely? */
354 spin_lock(&card->cli_queue_lock);
355 if (skb_queue_len(&card->cli_queue[port]) > 10) {
357 dev_warn(&card->dev->dev, "Dropping console response on port %d\n",
360 skb_queue_tail(&card->cli_queue[port], skb);
361 spin_unlock(&card->cli_queue_lock);
367 iowrite32(rx_done, card->config_regs + FLAGS_ADDR);
372 static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci)
374 struct hlist_head *head;
375 struct atm_vcc *vcc = NULL;
376 struct hlist_node *node;
379 read_lock(&vcc_sklist_lock);
380 head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
381 sk_for_each(s, node, head) {
383 if (vcc->dev == dev && vcc->vci == vci &&
384 vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE)
389 read_unlock(&vcc_sklist_lock);
393 static int list_vccs(int vci)
395 struct hlist_head *head;
397 struct hlist_node *node;
402 read_lock(&vcc_sklist_lock);
404 head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
405 sk_for_each(s, node, head) {
408 printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
416 sk_for_each(s, node, head) {
419 printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
426 read_unlock(&vcc_sklist_lock);
431 static int popen(struct atm_vcc *vcc)
433 struct solos_card *card = vcc->dev->dev_data;
435 struct pkt_hdr *header;
437 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
438 if (!skb && net_ratelimit()) {
439 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");
442 header = (void *)skb_put(skb, sizeof(*header));
444 header->size = cpu_to_le16(0);
445 header->vpi = cpu_to_le16(vcc->vpi);
446 header->vci = cpu_to_le16(vcc->vci);
447 header->type = cpu_to_le16(PKT_POPEN);
449 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
451 // dev_dbg(&card->dev->dev, "Open for vpi %d and vci %d on interface %d\n", vcc->vpi, vcc->vci, SOLOS_CHAN(vcc->dev));
452 set_bit(ATM_VF_ADDR, &vcc->flags); // accept the vpi / vci
453 set_bit(ATM_VF_READY, &vcc->flags);
460 static void pclose(struct atm_vcc *vcc)
462 struct solos_card *card = vcc->dev->dev_data;
464 struct pkt_hdr *header;
466 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
468 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");
471 header = (void *)skb_put(skb, sizeof(*header));
473 header->size = cpu_to_le16(0);
474 header->vpi = cpu_to_le16(vcc->vpi);
475 header->vci = cpu_to_le16(vcc->vci);
476 header->type = cpu_to_le16(PKT_PCLOSE);
478 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
480 // dev_dbg(&card->dev->dev, "Close for vpi %d and vci %d on interface %d\n", vcc->vpi, vcc->vci, SOLOS_CHAN(vcc->dev));
482 clear_bit(ATM_VF_ADDR, &vcc->flags);
483 clear_bit(ATM_VF_READY, &vcc->flags);
488 static int print_buffer(struct sk_buff *buf)
495 for (i = 0; i < len; i++){
497 sprintf(msg, "%02X: ", i);
499 sprintf(item,"%02X ",*(buf->data + i));
504 printk(KERN_DEBUG "%s", msg);
510 printk(KERN_DEBUG "%s", msg);
512 printk(KERN_DEBUG "\n");
517 static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
522 *(void **)skb->cb = vcc;
524 spin_lock(&card->tx_queue_lock);
525 old_len = skb_queue_len(&card->tx_queue[port]);
526 skb_queue_tail(&card->tx_queue[port], skb);
527 spin_unlock(&card->tx_queue_lock);
529 /* If TX might need to be started, do so */
534 static int fpga_tx(struct solos_card *card)
537 uint32_t tx_started = 0;
543 spin_lock_irqsave(&card->tx_lock, flags);
545 tx_pending = ioread32(card->config_regs + FLAGS_ADDR);
547 dev_vdbg(&card->dev->dev, "TX Flags are %X\n", tx_pending);
549 for (port = 0; port < card->nr_ports; port++) {
550 if (!(tx_pending & (1 << port))) {
552 spin_lock(&card->tx_queue_lock);
553 skb = skb_dequeue(&card->tx_queue[port]);
554 spin_unlock(&card->tx_queue_lock);
560 dev_info(&card->dev->dev, "Transmitted: port %d\n",
564 memcpy_toio(TX_BUF(card, port), skb->data, skb->len);
566 vcc = *(void **)skb->cb;
569 atomic_inc(&vcc->stats->tx);
572 dev_kfree_skb_irq(skb);
574 tx_started |= 1 << port; //Set TX full flag
578 iowrite32(tx_started, card->config_regs + FLAGS_ADDR);
580 spin_unlock_irqrestore(&card->tx_lock, flags);
584 static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
586 struct solos_card *card = vcc->dev->dev_data;
587 struct sk_buff *skb2 = NULL;
588 struct pkt_hdr *header;
591 //dev_dbg(&card->dev->dev, "psend called.\n");
592 //dev_dbg(&card->dev->dev, "dev,vpi,vci = %d,%d,%d\n",SOLOS_CHAN(vcc->dev),vcc->vpi,vcc->vci);
595 skb2 = atm_alloc_charge(vcc, skb->len, GFP_ATOMIC);
597 memcpy(skb2->data, skb->data, skb->len);
598 skb_put(skb2, skb->len);
599 vcc->push(vcc, skb2);
600 atomic_inc(&vcc->stats->rx);
602 atomic_inc(&vcc->stats->tx);
608 if (pktlen > (BUF_SIZE - sizeof(*header))) {
609 dev_warn(&card->dev->dev, "Length of PDU is too large. Dropping PDU.\n");
614 if (!skb_clone_writable(skb, sizeof(*header))) {
618 if (skb_headroom(skb) < sizeof(*header))
619 expand_by = sizeof(*header) - skb_headroom(skb);
621 ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC);
623 dev_warn(&card->dev->dev, "pskb_expand_head failed.\n");
629 header = (void *)skb_push(skb, sizeof(*header));
631 /* This does _not_ include the size of the header */
632 header->size = cpu_to_le16(pktlen);
633 header->vpi = cpu_to_le16(vcc->vpi);
634 header->vci = cpu_to_le16(vcc->vci);
635 header->type = cpu_to_le16(PKT_DATA);
637 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, vcc);
642 static struct atmdev_ops fpga_ops = {
657 static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
661 uint8_t major_ver, minor_ver;
663 struct solos_card *card;
668 card = kzalloc(sizeof(*card), GFP_KERNEL);
673 init_waitqueue_head(&card->fw_wq);
675 err = pci_enable_device(dev);
677 dev_warn(&dev->dev, "Failed to enable PCI device\n");
681 err = pci_request_regions(dev, "solos");
683 dev_warn(&dev->dev, "Failed to request regions\n");
687 card->config_regs = pci_iomap(dev, 0, CONFIG_RAM_SIZE);
688 if (!card->config_regs) {
689 dev_warn(&dev->dev, "Failed to ioremap config registers\n");
690 goto out_release_regions;
692 card->buffers = pci_iomap(dev, 1, DATA_RAM_SIZE);
693 if (!card->buffers) {
694 dev_warn(&dev->dev, "Failed to ioremap data buffers\n");
695 goto out_unmap_config;
698 // for(i=0;i<64 ;i+=4){
699 // data32=ioread32(card->buffers + i);
700 // dev_dbg(&card->dev->dev, "%08lX\n",(unsigned long)data32);
703 //Fill Config Mem with zeros
704 for(i = 0; i < 128; i += 4)
705 iowrite32(0, card->config_regs + i);
708 iowrite32(0xF0, card->config_regs + FLAGS_ADDR);
710 data32 = ioread32(card->config_regs + FPGA_VER);
711 fpga_ver = (data32 & 0x0000FFFF);
712 major_ver = ((data32 & 0xFF000000) >> 24);
713 minor_ver = ((data32 & 0x00FF0000) >> 16);
714 dev_info(&dev->dev, "Solos FPGA Version %d.%02d svn-%d\n",
715 major_ver, minor_ver, fpga_ver);
717 card->nr_ports = 2; /* FIXME: Detect daughterboard */
719 pci_set_drvdata(dev, card);
721 tasklet_init(&card->tlet, solos_bh, (unsigned long)card);
722 spin_lock_init(&card->tx_lock);
723 spin_lock_init(&card->tx_queue_lock);
724 spin_lock_init(&card->cli_queue_lock);
729 iowrite32(data32,card->config_regs + FLAGS_ADDR);
732 // Fill Buffers with zeros
733 for (i = 0; i < BUF_SIZE * 8; i += 4)
734 iowrite32(0, card->buffers + i);
737 for(i = 0; i < (BUF_SIZE * 1); i += 4)
738 iowrite32(0x12345678, card->buffers + i + (0*BUF_SIZE));
739 for(i = 0; i < (BUF_SIZE * 1); i += 4)
740 iowrite32(0xabcdef98, card->buffers + i + (1*BUF_SIZE));
742 // Read Config Memory
743 printk(KERN_DEBUG "Reading Config MEM\n");
745 for(i = 0; i < 16; i++) {
746 data32=ioread32(card->buffers + i*(BUF_SIZE/2));
747 printk(KERN_ALERT "Addr: %lX Data: %08lX\n",
748 (unsigned long)(addr_start + i*(BUF_SIZE/2)),
749 (unsigned long)data32);
752 //dev_dbg(&card->dev->dev, "Requesting IRQ: %d\n",dev->irq);
753 err = request_irq(dev->irq, solos_irq, IRQF_DISABLED|IRQF_SHARED,
756 dev_dbg(&card->dev->dev, "Failed to request interrupt IRQ: %d\n", dev->irq);
761 iowrite32(1, card->config_regs + IRQ_EN_ADDR);
764 flash_upgrade(card, 0);
766 if (firmware_upgrade)
767 flash_upgrade(card, 1);
769 err = atm_init(card);
776 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
777 free_irq(dev->irq, card);
778 tasklet_kill(&card->tlet);
781 pci_set_drvdata(dev, NULL);
782 pci_iounmap(dev, card->config_regs);
784 pci_iounmap(dev, card->buffers);
786 pci_release_regions(dev);
791 static int atm_init(struct solos_card *card)
795 for (i = 0; i < card->nr_ports; i++) {
796 skb_queue_head_init(&card->tx_queue[i]);
797 skb_queue_head_init(&card->cli_queue[i]);
799 card->atmdev[i] = atm_dev_register("solos-pci", &fpga_ops, -1, NULL);
800 if (!card->atmdev[i]) {
801 dev_err(&card->dev->dev, "Could not register ATM device %d\n", i);
805 if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_console))
806 dev_err(&card->dev->dev, "Could not register console for ATM device %d\n", i);
808 dev_info(&card->dev->dev, "Registered ATM device %d\n", card->atmdev[i]->number);
810 card->atmdev[i]->ci_range.vpi_bits = 8;
811 card->atmdev[i]->ci_range.vci_bits = 16;
812 card->atmdev[i]->dev_data = card;
813 card->atmdev[i]->phy_data = (void *)(unsigned long)i;
818 static void atm_remove(struct solos_card *card)
822 for (i = 0; i < card->nr_ports; i++) {
823 if (card->atmdev[i]) {
824 dev_info(&card->dev->dev, "Unregistering ATM device %d\n", card->atmdev[i]->number);
825 atm_dev_deregister(card->atmdev[i]);
830 static void fpga_remove(struct pci_dev *dev)
832 struct solos_card *card = pci_get_drvdata(dev);
839 dev_vdbg(&dev->dev, "Freeing IRQ\n");
840 // Disable IRQs from FPGA
841 iowrite32(0, card->config_regs + IRQ_EN_ADDR);
842 free_irq(dev->irq, card);
843 tasklet_kill(&card->tlet);
845 // iowrite32(0x01,pciregs);
846 dev_vdbg(&dev->dev, "Unmapping PCI resource\n");
847 pci_iounmap(dev, card->buffers);
848 pci_iounmap(dev, card->config_regs);
850 dev_vdbg(&dev->dev, "Releasing PCI Region\n");
851 pci_release_regions(dev);
852 pci_disable_device(dev);
854 pci_set_drvdata(dev, NULL);
856 // dev_dbg(&card->dev->dev, "fpga_remove\n");
860 static struct pci_device_id fpga_pci_tbl[] __devinitdata = {
861 { 0x10ee, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
865 MODULE_DEVICE_TABLE(pci,fpga_pci_tbl);
867 static struct pci_driver fpga_driver = {
869 .id_table = fpga_pci_tbl,
871 .remove = fpga_remove,
875 static int __init solos_pci_init(void)
877 printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION);
878 return pci_register_driver(&fpga_driver);
881 static void __exit solos_pci_exit(void)
883 pci_unregister_driver(&fpga_driver);
884 printk(KERN_INFO "Solos PCI Driver %s Unloaded\n", VERSION);
887 module_init(solos_pci_init);
888 module_exit(solos_pci_exit);