#define PCI_DAQ_SIZE 4096
#define PCI_DAQ_SIZE_660X 8192
-struct mite_struct *mite_devices;
-EXPORT_SYMBOL(mite_devices);
-
#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
struct mite_struct *mite_alloc(struct pci_dev *pcidev)
}
EXPORT_SYMBOL(mite_alloc);
-static void mite_init(void)
-{
- struct pci_dev *pcidev = NULL;
- struct mite_struct *mite;
-
- for_each_pci_dev(pcidev) {
- if (pcidev->vendor == PCI_VENDOR_ID_NI) {
- mite = mite_alloc(pcidev);
- if (!mite) {
- pr_err("allocation failed\n");
- pci_dev_put(pcidev);
- return;
- }
- pci_dev_get(pcidev);
- mite->next = mite_devices;
- mite_devices = mite;
- }
- }
-}
-
static void dump_chip_signature(u32 csigr_bits)
{
pr_info("version = %i, type = %i, mite mode = %i, interface mode = %i\n",
}
mite->fifo_size = mite_fifo_size(mite, 0);
dev_info(&mite->pcidev->dev, "fifo size is %i.\n", mite->fifo_size);
- mite->used = 1;
-
return 0;
}
EXPORT_SYMBOL(mite_setup2);
}
EXPORT_SYMBOL(mite_setup);
-static void mite_cleanup(void)
-{
- struct mite_struct *mite, *next;
-
- for (mite = mite_devices; mite; mite = next) {
- pci_dev_put(mite->pcidev);
- next = mite->next;
- mite_free(mite);
- }
-}
-
void mite_unsetup(struct mite_struct *mite)
{
/* unsigned long offset, start, length; */
comedi_pci_disable(mite->pcidev);
mite->mite_phys_addr = 0;
}
-
- mite->used = 0;
}
EXPORT_SYMBOL(mite_unsetup);
-void mite_list_devices(void)
-{
- struct mite_struct *mite, *next;
-
- pr_info("Available NI device IDs:\n");
- if (mite_devices)
- for (mite = mite_devices; mite; mite = next) {
- next = mite->next;
- pr_info("0x%04x%s\n", mite_device_id(mite),
- mite->used ? " (used)" : "");
- }
-}
-EXPORT_SYMBOL(mite_list_devices);
-
struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite)
{
struct mite_dma_descriptor_ring *ring =
#ifdef MODULE
int __init init_module(void)
{
- mite_init();
- mite_list_devices();
-
return 0;
}
void __exit cleanup_module(void)
{
- mite_cleanup();
}
#endif
};
struct mite_struct {
- struct mite_struct *next;
- int used;
-
struct pci_dev *pcidev;
resource_size_t mite_phys_addr;
void __iomem *mite_io_addr;
resource_size_t daq_phys_addr;
void __iomem *daq_io_addr;
-
struct mite_channel channels[MAX_MITE_DMA_CHANNELS];
short channel_allocated[MAX_MITE_DMA_CHANNELS];
int num_channels;
spinlock_t lock;
};
-extern struct mite_struct *mite_devices;
-
struct mite_struct *mite_alloc(struct pci_dev *pcidev);
static inline void mite_free(struct mite_struct *mite)
int mite_setup(struct mite_struct *mite);
int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1);
void mite_unsetup(struct mite_struct *mite);
-void mite_list_devices(void);
struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite);
void mite_free_ring(struct mite_dma_descriptor_ring *ring);
struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,