2010-12-11 13:19:49 -06:00
|
|
|
/*
|
2010-12-14 16:55:31 -06:00
|
|
|
* skypopen.h -- definitions for the char module
|
2010-12-11 13:19:49 -06:00
|
|
|
*
|
|
|
|
* Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet
|
|
|
|
* Copyright (C) 2001 O'Reilly & Associates
|
|
|
|
*
|
|
|
|
* The source code in this file can be freely used, adapted,
|
|
|
|
* and redistributed in source or binary form, so long as an
|
|
|
|
* acknowledgment appears in derived source files. The citation
|
|
|
|
* should list that the code comes from the book "Linux Device
|
|
|
|
* Drivers" by Alessandro Rubini and Jonathan Corbet, published
|
|
|
|
* by O'Reilly & Associates. No warranty is attached;
|
|
|
|
* we cannot take responsibility for errors or fitness for use.
|
|
|
|
*
|
2010-12-14 16:55:31 -06:00
|
|
|
* $Id: skypopen.h,v 1.15 2004/11/04 17:51:18 rubini Exp $
|
2010-12-11 13:19:49 -06:00
|
|
|
*/
|
|
|
|
|
2010-12-14 16:55:31 -06:00
|
|
|
#ifndef _SKYPOPEN_H_
|
|
|
|
#define _SKYPOPEN_H_
|
2010-12-11 13:19:49 -06:00
|
|
|
|
|
|
|
#include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */
|
|
|
|
|
2010-12-17 08:44:20 -06:00
|
|
|
#define SKYPOPEN_BLK 960
|
|
|
|
#define SKYPOPEN_SLEEP 10
|
|
|
|
|
|
|
|
#define CENTOS
|
|
|
|
|
2010-12-14 16:55:31 -06:00
|
|
|
#ifndef SKYPOPEN_MAJOR
|
|
|
|
#define SKYPOPEN_MAJOR 14 /* dynamic major by default */
|
2010-12-11 13:19:49 -06:00
|
|
|
#endif
|
|
|
|
|
2010-12-14 16:55:31 -06:00
|
|
|
#ifndef SKYPOPEN_NR_DEVS
|
|
|
|
#define SKYPOPEN_NR_DEVS 1 /* skypopen0 through skypopen3 */
|
2010-12-11 13:19:49 -06:00
|
|
|
#endif
|
|
|
|
|
2010-12-17 08:44:20 -06:00
|
|
|
#define WANT_HRTIMER
|
2010-12-14 16:55:31 -06:00
|
|
|
struct skypopen_dev {
|
2010-12-11 13:19:49 -06:00
|
|
|
struct cdev cdev; /* Char device structure */
|
|
|
|
wait_queue_head_t inq; /* read and write queues */
|
|
|
|
wait_queue_head_t outq; /* read and write queues */
|
2010-12-17 08:44:20 -06:00
|
|
|
#ifndef WANT_HRTIMER
|
2010-12-11 13:19:49 -06:00
|
|
|
struct timer_list timer_inq;
|
|
|
|
struct timer_list timer_outq;
|
2010-12-17 08:44:20 -06:00
|
|
|
#else// WANT_HRTIMER
|
|
|
|
struct hrtimer timer_inq;
|
|
|
|
struct hrtimer timer_outq;
|
|
|
|
#endif// WANT_HRTIMER
|
2010-12-14 16:55:31 -06:00
|
|
|
int timer_inq_started;
|
|
|
|
int timer_outq_started;
|
2010-12-11 13:19:49 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The different configurable parameters
|
|
|
|
*/
|
2010-12-14 16:55:31 -06:00
|
|
|
extern int skypopen_major; /* main.c */
|
|
|
|
extern int skypopen_nr_devs;
|
2010-12-11 13:19:49 -06:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Prototypes for shared functions
|
|
|
|
*/
|
|
|
|
|
2010-12-17 08:44:20 -06:00
|
|
|
//ssize_t skypopen_read(struct file *filp, char __user *buf, size_t count,
|
|
|
|
//loff_t *f_pos);
|
|
|
|
//ssize_t skypopen_write(struct file *filp, const char __user *buf, size_t count,
|
|
|
|
//loff_t *f_pos);
|
|
|
|
//int skypopen_ioctl(struct inode *inode, struct file *filp,
|
|
|
|
//unsigned int cmd, unsigned long arg);
|
2010-12-11 13:19:49 -06:00
|
|
|
|
2010-12-14 16:55:31 -06:00
|
|
|
#endif /* _SKYPOPEN_H_ */
|