nidas
v1.2-1520
|
#include <linux/types.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/workqueue.h>
#include <linux/poll.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <asm/io.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include "lamsx.h"
#include <nidas/linux/ver_macros.h>
#include <nidas/linux/Revision.h>
#include <nidas/linux/klog.h>
#include <nidas/linux/isa_bus.h>
#include <nidas/linux/util.h>
Classes | |
struct | bh_data |
struct | LAMS_board |
Macros | |
#define | MAX_LAMS_BOARDS 3 |
#define | IRQF_SHARED SA_SHIRQ |
#define | REPO_REVISION "unknown" |
#define | RAM_CLEAR_OFFSET 0x00 |
#define | PEAK_CLEAR_OFFSET 0x02 |
#define | AVG_LSW_DATA_OFFSET 0x04 |
#define | AVG_MSW_DATA_OFFSET 0x06 |
#define | PEAK_DATA_OFFSET 0x08 |
#define | TAS_BELOW_OFFSET 0x0A |
#define | TAS_ABOVE_OFFSET 0x0C |
#define | IOPORT_REGION_SIZE 16 |
#define | SPECTRAL_POINTS_TO_SKIP 0 |
#define | LAMS_ISR_SAMPLE_QUEUE_SIZE 128 |
#define | LAMS_OUTPUT_SAMPLE_QUEUE_SIZE 32 |
Functions | |
module_param_array (ioports, int, numboards, 0) | |
module_param_array (irqs, int, numirqs, 0) | |
MODULE_AUTHOR ("Gordon Maclean <maclean@ucar.edu>") | |
MODULE_LICENSE ("Dual BSD/GPL") | |
MODULE_DESCRIPTION ("Driver for LAMX card") | |
MODULE_VERSION (REPO_REVISION) | |
static int | setNAvg (struct LAMS_board *brd, int val) |
static void | lams_bottom_half (struct work_struct *work) |
Work queue function that processes the raw samples from the ISR. More... | |
static irqreturn_t | lams_irq_handler (int irq, void *dev_id) |
static int | lams_request_irq (struct LAMS_board *brd) |
static int | lams_remove_irq (struct LAMS_board *brd) |
static int | lams_open (struct inode *inode, struct file *filp) |
static int | lams_release (struct inode *inode, struct file *filp) |
static ssize_t | lams_read (struct file *filp, char __user *buf, size_t count, loff_t *f_pos) |
static unsigned int | lams_poll (struct file *filp, poll_table *wait) |
static long | lams_ioctl (struct file *filp, unsigned int cmd, unsigned long arg) |
static void | lams_cleanup (void) |
static int __init | lams_init (void) |
module_init (lams_init) | |
module_exit (lams_cleanup) | |
Variables | |
static const char * | driver_name = "lamsx" |
static unsigned int | ioports [MAX_LAMS_BOARDS] = { 0x220, 0, 0 } |
static int | numboards = 0 |
static int | irqs [MAX_LAMS_BOARDS] = { 4, 0, 0 } |
static int | numirqs = 0 |
static dev_t | lams_device = MKDEV(0,0) |
static struct class * | lams_class |
static struct LAMS_board * | boards = 0 |
static struct workqueue_struct * | work_queue = 0 |
static struct file_operations | lams_fops |
#define AVG_LSW_DATA_OFFSET 0x04 |
Referenced by lams_init().
#define AVG_MSW_DATA_OFFSET 0x06 |
Referenced by lams_init().
#define IOPORT_REGION_SIZE 16 |
Referenced by lams_cleanup(), and lams_init().
#define IRQF_SHARED SA_SHIRQ |
#define LAMS_ISR_SAMPLE_QUEUE_SIZE 128 |
Referenced by lams_bottom_half(), lams_irq_handler(), and lams_open().
#define LAMS_OUTPUT_SAMPLE_QUEUE_SIZE 32 |
Referenced by lams_bottom_half(), lams_irq_handler(), and lams_open().
#define MAX_LAMS_BOARDS 3 |
Referenced by lams_init().
#define PEAK_CLEAR_OFFSET 0x02 |
Referenced by lams_init().
#define PEAK_DATA_OFFSET 0x08 |
Referenced by lams_init().
#define RAM_CLEAR_OFFSET 0x00 |
Referenced by lams_init().
#define REPO_REVISION "unknown" |
Referenced by lams_init().
#define SPECTRAL_POINTS_TO_SKIP 0 |
Referenced by lams_init().
#define TAS_ABOVE_OFFSET 0x0C |
Referenced by lams_ioctl().
#define TAS_BELOW_OFFSET 0x0A |
Referenced by lams_ioctl().
|
static |
Work queue function that processes the raw samples from the ISR.
References LAMS_board::avg_samples, LAMS_board::avgMask, LAMS_board::avgShift, LAMS_board::bh_data, lams_avg_sample::data, LAMS_board::deviceName, bh_data::hosum, LAMS_board::isr_avg_samples, LAMS_ISR_SAMPLE_QUEUE_SIZE, LAMS_OUTPUT_SAMPLE_QUEUE_SIZE, LAMS_SPECAVG_SAMPLE_TYPE, LAMS_SPECTRA_SIZE, bh_data::losum, lams_status::missedOutSamples, bh_data::nAvg, LAMS_board::nAVG, LAMS_board::read_queue, LAMS_board::status, bh_data::timetag, lams_avg_sample::type, and LAMS_board::worker.
Referenced by lams_init().
|
static |
References LAMS_board::addr, LAMS_board::cdev, LAMS_board::device, IOPORT_REGION_SIZE, LAMS_board::irq, lams_class, lams_device, numboards, and work_queue.
Referenced by lams_init().
|
static |
References LAMS_board::addr, LAMS_board::avg_lsw_data_addr, AVG_LSW_DATA_OFFSET, LAMS_board::avg_msw_data_addr, AVG_MSW_DATA_OFFSET, LAMS_board::cdev, LAMS_board::device, LAMS_board::deviceName, driver_name, err, LAMS_board::ioport, IOPORT_REGION_SIZE, ioports, irqs, lams_bottom_half(), lams_class, lams_cleanup(), lams_device, MAX_LAMS_BOARDS, LAMS_board::nPEAKS, LAMS_board::num, LAMS_board::num_opened, numboards, LAMS_board::peak_clear_addr, PEAK_CLEAR_OFFSET, LAMS_board::peak_data_addr, PEAK_DATA_OFFSET, LAMS_board::ram_clear_addr, RAM_CLEAR_OFFSET, LAMS_board::read_queue, LAMS_board::reglock, REPO_REVISION, setNAvg(), LAMS_board::specPointSkip, SPECTRAL_POINTS_TO_SKIP, work_queue, and LAMS_board::worker.
|
static |
References LAMS_board::addr, err, LAMS_GET_STATUS, LAMS_IOC_MAXNR, LAMS_MAGIC, LAMS_N_AVG, LAMS_N_PEAKS, LAMS_N_SKIP, LAMS_SET_CHN, LAMS_TAS_ABOVE, LAMS_TAS_BELOW, LAMS_board::nAVG, LAMS_board::nPEAKS, numboards, LAMS_board::reglock, setNAvg(), LAMS_board::specPointSkip, LAMS_board::status, TAS_ABOVE_OFFSET, and TAS_BELOW_OFFSET.
|
static |
References LAMS_board::avg_lsw_data_addr, LAMS_board::avg_msw_data_addr, lams_avg_sample::data, lams_peak_sample::data, LAMS_board::isr_avg_samples, LAMS_ISR_SAMPLE_QUEUE_SIZE, LAMS_OUTPUT_SAMPLE_QUEUE_SIZE, LAMS_SPECAVG_SAMPLE_TYPE, LAMS_SPECPEAK_SAMPLE_TYPE, LAMS_SPECTRA_SIZE, lams_status::missedISRSamples, lams_status::missedOutSamples, LAMS_board::nAVG, LAMS_board::nPEAKS, LAMS_board::nPeaks, LAMS_board::peak_clear_addr, LAMS_board::peak_data_addr, LAMS_board::peak_samples, LAMS_board::ram_clear_addr, LAMS_board::read_queue, LAMS_board::reglock, LAMS_board::specPointSkip, LAMS_board::status, lams_avg_sample::type, lams_peak_sample::type, work_queue, and LAMS_board::worker.
Referenced by lams_request_irq().
|
static |
References LAMS_board::addr, alloc_dsm_circ_buf(), LAMS_board::avg_read_state, LAMS_board::avg_samples, LAMS_board::bh_data, LAMS_board::deviceName, LAMS_board::isr_avg_samples, LAMS_ISR_SAMPLE_QUEUE_SIZE, LAMS_OUTPUT_SAMPLE_QUEUE_SIZE, lams_request_irq(), LAMS_board::nPeaks, LAMS_board::num_opened, numboards, LAMS_board::peak_read_state, LAMS_board::peak_samples, SIZEOF_DSM_SAMPLE_HEADER, and LAMS_board::status.
|
static |
|
static |
|
static |
|
static |
References LAMS_board::irq.
Referenced by lams_release().
|
static |
References LAMS_board::deviceName, driver_name, LAMS_board::irq, irqs, lams_irq_handler(), and LAMS_board::num.
Referenced by lams_open().
MODULE_AUTHOR | ( | "Gordon Maclean <maclean@ucar.edu>" | ) |
MODULE_DESCRIPTION | ( | "Driver for LAMX card" | ) |
module_exit | ( | lams_cleanup | ) |
module_init | ( | lams_init | ) |
MODULE_LICENSE | ( | "Dual BSD/GPL" | ) |
MODULE_VERSION | ( | REPO_REVISION | ) |
|
static |
References LAMS_board::avgMask, LAMS_board::avgShift, and LAMS_board::nAVG.
Referenced by lams_init(), and lams_ioctl().
|
static |
|
static |
Referenced by lams_init(), and lams_request_irq().
|
static |
Referenced by lams_init().
|
static |
Referenced by lams_init(), and lams_request_irq().
|
static |
Referenced by lams_cleanup(), and lams_init().
|
static |
Referenced by lams_cleanup(), and lams_init().
|
static |
|
static |
Referenced by lams_cleanup(), lams_init(), lams_ioctl(), lams_open(), and lams_release().
|
static |
|
static |
Referenced by lams_cleanup(), lams_init(), lams_irq_handler(), and lams_release().