________________________________________________________
Manufacturer | Model | Custom ID | Status
-----------------+----------------+-----------+---------
-MediaForte | MV300 | 0 | Untested
+MediaForte | MV300 | 0 | Working
D-Link | DSB-C300 | 3 | Working
+Puretek | PT-6007 | 5 | Untested
Creative Labs | WebCam 3 | 21 | Working
Lifeview | RoboCam | 100 | Untested
AverMedia | InterCam Elite | 102 | Working
-MediaForte | MV300 | 112 | Untested
+MediaForte | MV300 | 112 | Working
--------------------------------------------------------
Any camera using the OV511 and the OV7610 CCD should work with this driver. The
make
make install
-Now you should be able to run xawtv. Right click for the options dialog.
+Now you should be able to run xawtv. Right click for the options dialog. If
+you get a scrambled image it is likely that you made a mistake in Xawtv.ad.
+Try setting the size to 320x240 if all else fails.
WORKING FEATURES:
o Color streaming/capture at 640x480 and 320x240
VERSION = 2
PATCHLEVEL = 3
-SUBLEVEL = 42
+SUBLEVEL = 43
EXTRAVERSION =
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
static struct file_operations mtrr_fops =
{
- NULL, /* Seek */
- mtrr_read, /* Read */
- mtrr_write, /* Write */
- NULL, /* Readdir */
- NULL, /* Poll */
- mtrr_ioctl, /* IOctl */
- NULL, /* MMAP */
- NULL, /* Open */
- NULL, /* Flush */
- mtrr_close, /* Release */
- NULL, /* Fsync */
- NULL, /* Fasync */
- NULL, /* Lock */
+ read: mtrr_read,
+ write: mtrr_write,
+ ioctl: mtrr_ioctl,
+ release: mtrr_close,
};
static struct inode_operations proc_mtrr_inode_operations = {
}
struct file_operations atari_joystick_fops = {
- NULL, /* joystick_seek */
- read_joystick,
- write_joystick,
- NULL, /* joystick_readdir */
- joystick_poll,
- NULL, /* joystick_ioctl */
- NULL, /* joystick_mmap */
- open_joystick,
- NULL, /* flush */
- release_joystick
+ read: read_joystick,
+ write: write_joystick,
+ poll: joystick_poll,
+ open: open_joystick,
+ release: release_joystick,
};
int __init atari_joystick_init(void)
*/
static struct file_operations rtc_fops = {
- NULL,
- NULL,
- NULL, /* No write */
- NULL, /* No readdir */
- NULL,
- rtc_ioctl,
- NULL, /* No mmap */
- rtc_open,
- NULL, /* flush */
- rtc_release
+ ioctl: rtc_ioctl,
+ open: rtc_open,
+ release: rtc_release,
};
static struct miscdevice rtc_dev=
}
static struct file_operations adb_fops = {
- adb_lseek,
- adb_read,
- adb_write,
- NULL, /* no readdir */
- NULL, /* no poll yet */
- NULL, /* no ioctl yet */
- NULL, /* no mmap */
- adb_open,
- NULL, /* flush */
- adb_release
+ llseek: adb_lseek,
+ read: adb_read,
+ write: adb_write,
+ open: adb_open,
+ release: adb_release,
};
int adbdev_register(int subtype, struct file_operations *fops)
}
static struct file_operations adb_fops = {
- adb_lseek,
- adb_read,
- adb_write,
- NULL, /* no readdir */
- NULL, /* no select */
- NULL, /* no ioctl */
- NULL, /* no mmap */
- adb_open,
- NULL, /* flush */
- adb_release
+ llseek: adb_lseek,
+ read: adb_read,
+ write: adb_write,
+ open: adb_open,
+ release: adb_release,
};
static struct miscdevice adb_dev = {
*/
static struct file_operations rtc_fops = {
- NULL,
- NULL,
- NULL, /* No write */
- NULL, /* No readdir */
- NULL,
- rtc_ioctl,
- NULL, /* No mmap */
- rtc_open,
- NULL, /* flush */
- rtc_release
+ ioctl: rtc_ioctl,
+ open: rtc_open,
+ release: rtc_release,
};
static struct miscdevice rtc_dev=
extern unsigned long pte_errors;
static struct file_operations ppc_htab_operations = {
- ppc_htab_lseek, /* lseek */
- ppc_htab_read, /* read */
- ppc_htab_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ llseek: ppc_htab_lseek,
+ read: ppc_htab_read,
+ write: ppc_htab_write,
};
/*
static unsigned int (*sock_poll)(struct file *, poll_table *);
static struct file_operations socksys_file_ops = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
+ /* Currently empty */
};
static int socksys_open(struct inode * inode, struct file * filp)
}
static struct file_operations socksys_fops = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- socksys_open, /* open */
- NULL, /* flush */
- socksys_release,/* release */
+ open: socksys_open,
+ release: socksys_release,
};
int __init
#include <asm/byteorder.h>
#include <math.h>
#include <linux/vmalloc.h>
-#include <linux/time.h>
#include "iphase.h"
#include "suni.h"
#define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))
static struct timer_list slm_timer = { NULL, NULL, 0, 0, slm_test_ready };
static struct file_operations slm_fops = {
- NULL, /* lseek - default */
- slm_read, /* read - status reading */
- slm_write, /* write - printing data write */
- NULL, /* readdir - bad */
- NULL, /* poll */
- slm_ioctl, /* ioctl */
- NULL, /* mmap */
- slm_open, /* open */
- NULL, /* flush */
- slm_release, /* release */
- NULL /* fsync */
+ read: slm_read,
+ write: slm_write,
+ ioctl: slm_ioctl,
+ open: slm_open,
+ release: slm_release,
};
* Our character device supporting functions, passed to register_chrdev.
*/
static struct file_operations idetape_fops = {
- NULL, /* lseek - default */
- idetape_chrdev_read, /* read */
- idetape_chrdev_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll */
- idetape_chrdev_ioctl, /* ioctl */
- NULL, /* mmap */
- idetape_chrdev_open, /* open */
- NULL, /* flush */
- idetape_chrdev_release, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: idetape_chrdev_read,
+ write: idetape_chrdev_write,
+ ioctl: idetape_chrdev_ioctl,
+ open: idetape_chrdev_open,
+ release: idetape_chrdev_release,
};
/*
/* kernel glue structures */
static struct file_operations pg_fops = {
- NULL, /* lseek - default */
- pg_read, /* read */
- pg_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select */
- NULL, /* ioctl */
- NULL, /* mmap */
- pg_open, /* open */
- NULL, /* flush */
- pg_release, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: pg_read,
+ write: pg_write,
+ open: pg_open,
+ release: pg_release,
};
void pg_init_units( void )
/* kernel glue structures */
static struct file_operations pt_fops = {
- NULL, /* lseek - default */
- pt_read, /* read */
- pt_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select */
- pt_ioctl, /* ioctl */
- NULL, /* mmap */
- pt_open, /* open */
- NULL, /* flush */
- pt_release, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: pt_read,
+ write: pt_write,
+ ioctl: pt_ioctl,
+ open: pt_open,
+ release: pt_release,
};
void pt_init_units( void )
static struct file_operations initrd_fops = {
- NULL, /* lseek */
- initrd_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- initrd_release, /* release */
- NULL /* fsync */
+ read: initrd_read,
+ release: initrd_release,
};
#endif
static struct file_operations acq_fops = {
- NULL,
- acq_read,
- acq_write,
- NULL, /* No Readdir */
- NULL, /* No Select */
- acq_ioctl,
- NULL, /* No mmap */
- acq_open,
- NULL, /* flush */
- acq_close
+ read: acq_read,
+ write: acq_write,
+ ioctl: acq_ioctl,
+ open: acq_open,
+ release: acq_close,
};
static struct miscdevice acq_miscdev=
static struct file_operations agp_fops =
{
- agp_lseek,
- agp_read,
- agp_write,
- NULL,
- NULL,
- agp_ioctl,
- agp_mmap,
- agp_open,
- NULL,
- agp_release
+ llseek: agp_lseek,
+ read: agp_read,
+ write: agp_write,
+ ioctl: agp_ioctl,
+ mmap: agp_mmap,
+ open: agp_open,
+ release: agp_release,
};
static struct miscdevice agp_miscdev =
static void ac_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
struct file_operations ac_fops={
- ac_llseek, /* llseek */
- ac_read, /* read */
- ac_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- ac_ioctl, /* ioctl */
- NULL, /* mmap */
- ac_open, /* open */
- NULL, /* flush */
- ac_release, /* release */
- NULL /* fsync */
+ llseek: ac_llseek,
+ read: ac_read,
+ write: ac_write,
+ ioctl: ac_ioctl,
+ open: ac_open,
+ release: ac_release,
};
struct miscdevice ac_miscdev={
struct file_operations busmouse_fops=
{
- NULL, /* busmouse_seek */
- busmouse_read,
- busmouse_write,
- NULL, /* busmouse_readdir */
- busmouse_poll,
- NULL, /* busmouse_ioctl */
- NULL, /* busmouse_mmap */
- busmouse_open,
- NULL, /* busmouse_flush */
- busmouse_release,
- NULL,
- busmouse_fasync,
+ read: busmouse_read,
+ write: busmouse_write,
+ poll: busmouse_poll,
+ open: busmouse_open,
+ release: busmouse_release,
+ fasync: busmouse_fasync,
};
int
}
static struct file_operations dsp56k_fops = {
- NULL, /* no special dsp56k_lseek */
- dsp56k_read,
- dsp56k_write,
- NULL, /* no special dsp56k_readdir */
- NULL, /* dsp56k_poll? */
- dsp56k_ioctl,
- NULL, /* no special dsp56k_mmap */
- dsp56k_open,
- NULL, /* flush */
- dsp56k_release,
- NULL, /* no special dsp56k_fsync */
- NULL, /* no special dsp56k_fasync */
+ read: dsp56k_read,
+ write: dsp56k_write,
+ ioctl: dsp56k_ioctl,
+ open: dsp56k_open,
+ release: dsp56k_release,
};
static struct file_operations dtlk_fops =
{
- NULL, /* lseek */
- dtlk_read,
- dtlk_write,
- NULL, /* readdir */
- dtlk_poll,
- dtlk_ioctl,
- NULL, /* mmap */
- dtlk_open,
- NULL, /* flush */
- dtlk_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ read: dtlk_read,
+ write: dtlk_write,
+ poll: dtlk_poll,
+ ioctl: dtlk_ioctl,
+ open: dtlk_open,
+ release: dtlk_release,
};
/* local prototypes */
static struct file_operations zft_cdev =
{
- NULL, /* llseek */
- zft_read, /* read */
- zft_write, /* write */
- NULL, /* readdir */
- NULL, /* select */
- zft_ioctl, /* ioctl */
- zft_mmap, /* mmap */
- zft_open, /* open */
- NULL, /* flush */
- zft_close, /* release */
- NULL, /* fsync */
+ read: zft_read,
+ write: zft_write,
+ ioctl: zft_ioctl,
+ mmap: zft_mmap,
+ open: zft_open,
+ release: zft_close,
};
/* Open floppy tape device
/* This is the driver descriptor for the ip2ipl device, which is used to
* download the loadware to the boards.
*/
-static struct file_operations
-ip2_ipl = {
- NULL,
- ip2_ipl_read,
- ip2_ipl_write,
- NULL,
- NULL,
- ip2_ipl_ioctl,
- NULL,
- ip2_ipl_open,
+static struct file_operations ip2_ipl = {
+ read: ip2_ipl_read,
+ write: ip2_ipl_write,
+ ioctl: ip2_ipl_ioctl,
+ open: ip2_ipl_open,
};
static long irq_counter = 0;
*/
static struct file_operations ISILoad_fops = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* select */
- ISILoad_ioctl,
- NULL, /* mmap */
- ISILoad_open,
- NULL, /* flush */
- ISILoad_release,
- NULL, /* fsync */
- NULL, /* fasync */
+ ioctl: ISILoad_ioctl,
+ open: ISILoad_open,
+ release: ISILoad_release,
};
struct miscdevice isiloader_device = {
* board. This is also a very useful debugging tool.
*/
static struct file_operations stli_fsiomem = {
- NULL, /* llseek */
- stli_memread, /* read */
- stli_memwrite, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- stli_memioctl, /* ioctl */
- NULL, /* mmap */
- stli_memopen, /* open */
- NULL, /* flush */
- stli_memclose, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ read: stli_memread,
+ write: stli_memwrite,
+ ioctl: stli_memioctl,
+ open: stli_memopen,
+ release: stli_memclose,
};
/*****************************************************************************/
#endif /* IEEE 1284 support */
static struct file_operations lp_fops = {
- lp_lseek,
+ write: lp_write,
+ ioctl: lp_ioctl,
+ open: lp_open,
+ release: lp_release,
#ifdef CONFIG_PARPORT_1284
- lp_read,
-#else
- NULL,
-#endif
- lp_write,
- NULL, /* lp_readdir */
-#ifdef CONFIG_PARPORT_1284
- lp_poll,
-#else
- NULL,
+ read: lp_read,
+ poll: lp_poll,
#endif
- lp_ioctl,
- NULL, /* lp_mmap */
- lp_open,
- NULL, /* flush */
- lp_release
};
/* --- support for console on the line printer ----------------- */
#define open_kmem open_mem
static struct file_operations mem_fops = {
- memory_lseek,
- read_mem,
- write_mem,
- NULL, /* mem_readdir */
- NULL, /* mem_poll */
- NULL, /* mem_ioctl */
- mmap_mem,
- open_mem,
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ llseek: memory_lseek,
+ read: read_mem,
+ write: write_mem,
+ mmap: mmap_mem,
+ open: open_mem,
};
static struct file_operations kmem_fops = {
- memory_lseek,
- read_kmem,
- write_kmem,
- NULL, /* kmem_readdir */
- NULL, /* kmem_poll */
- NULL, /* kmem_ioctl */
- mmap_kmem,
- open_kmem,
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ llseek: memory_lseek,
+ read: read_kmem,
+ write: write_kmem,
+ mmap: mmap_kmem,
+ open: open_kmem,
};
static struct file_operations null_fops = {
- null_lseek,
- read_null,
- write_null,
- NULL, /* null_readdir */
- NULL, /* null_poll */
- NULL, /* null_ioctl */
- NULL, /* null_mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ llseek: null_lseek,
+ read: read_null,
+ write: write_null,
};
#if !defined(CONFIG_PPC) && !defined(__mc68000__)
static struct file_operations port_fops = {
- memory_lseek,
- read_port,
- write_port,
- NULL, /* port_readdir */
- NULL, /* port_poll */
- NULL, /* port_ioctl */
- NULL, /* port_mmap */
- open_port,
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ llseek: memory_lseek,
+ read: read_port,
+ write: write_port,
+ open: open_port,
};
#endif
static struct file_operations zero_fops = {
- zero_lseek,
- read_zero,
- write_zero,
- NULL, /* zero_readdir */
- NULL, /* zero_poll */
- NULL, /* zero_ioctl */
- mmap_zero,
- NULL, /* no special open code */
- NULL, /* flush */
- NULL /* no special release code */
+ llseek: zero_lseek,
+ read: read_zero,
+ write: write_zero,
+ mmap: mmap_zero,
};
static struct file_operations full_fops = {
- full_lseek,
- read_full,
- write_full,
- NULL, /* full_readdir */
- NULL, /* full_poll */
- NULL, /* full_ioctl */
- NULL, /* full_mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL /* no special release code */
+ llseek: full_lseek,
+ read: read_full,
+ write: write_full,
};
static int memory_open(struct inode * inode, struct file * filp)
}
static struct file_operations memory_fops = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- memory_open, /* just a selector for the real open */
- NULL, /* flush */
- NULL, /* release */
- NULL /* fsync */
+ open: memory_open, /* just a selector for the real open */
};
int __init chr_dev_init(void)
}
static struct file_operations misc_fops = {
- NULL, /* seek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- misc_open,
- NULL, /* flush */
- NULL /* release */
+ open: misc_open,
};
int misc_register(struct miscdevice * misc)
static struct file_operations mixcomwd_fops=
{
- NULL, /* Seek */
- NULL, /* Read */
- mixcomwd_write, /* Write */
- NULL, /* Readdir */
- NULL, /* Select */
- mixcomwd_ioctl, /* Ioctl */
- NULL, /* MMap */
- mixcomwd_open,
- NULL, /* flush */
- mixcomwd_release,
- NULL,
- NULL /* Fasync */
+ write: mixcomwd_write,
+ ioctl: mixcomwd_ioctl,
+ open: mixcomwd_open,
+ release: mixcomwd_release,
};
static struct miscdevice mixcomwd_miscdev=
}
static struct file_operations msp3400c_mixer_fops = {
- msp3400c_mixer_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- msp3400c_mixer_ioctl,
- NULL, /* mmap */
- msp3400c_mixer_open,
- NULL,
- msp3400c_mixer_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: msp3400c_mixer_llseek,
+ ioctl: msp3400c_mixer_ioctl,
+ open: msp3400c_mixer_open,
+ release: msp3400c_mixer_release,
};
#endif
#endif /* CONFIG_PROC_FS */
static struct file_operations nvram_fops = {
- nvram_llseek,
- nvram_read,
- nvram_write,
- NULL, /* No readdir */
- NULL, /* No poll */
- nvram_ioctl,
- NULL, /* No mmap */
- nvram_open,
- NULL, /* flush */
- nvram_release
+ llseek: nvram_llseek,
+ read: nvram_read,
+ write: nvram_write,
+ ioctl: nvram_ioctl,
+ open: nvram_open,
+ release: nvram_release,
};
static struct miscdevice nvram_dev = {
static struct file_operations pad_fops = {
- NULL, /* pad_seek */
- read_pad,
- write_pad,
- NULL, /* pad_readdir */
- pad_poll,
- pad_ioctl,
- NULL, /* pad_mmap */
- open_pad,
- NULL, /* flush */
- close_pad,
- NULL, /* fsync */
- fasync_pad,
- NULL /* lock */
+ read: read_pad,
+ write: write_pad,
+ poll: pad_poll,
+ ioctl: pad_ioctl,
+ open: open_pad,
+ release: close_pad,
+ fasync: fasync_pad,
};
}
struct file_operations psaux_fops = {
- NULL, /* seek */
- read_aux,
- write_aux,
- NULL, /* readdir */
- aux_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- open_aux,
- NULL, /* flush */
- release_aux,
- NULL,
- fasync_aux,
+ read: read_aux,
+ write: write_aux,
+ poll: aux_poll,
+ open: open_aux,
+ release: release_aux,
+ fasync: fasync_aux,
};
/*
}
static struct file_operations pcwd_fops = {
- NULL, /* Seek */
- pcwd_read, /* Read */
- pcwd_write, /* Write */
- NULL, /* Readdir */
- NULL, /* Poll */
- pcwd_ioctl, /* IOctl */
- NULL, /* MMAP */
- pcwd_open, /* Open */
- NULL, /* flush */
- pcwd_close, /* Release */
- NULL, /* Fsync */
- NULL, /* Fasync */
- NULL, /* Lock */
+ read: pcwd_read,
+ write: pcwd_write,
+ ioctl: pcwd_ioctl,
+ open: pcwd_open,
+ release: pcwd_close,
};
static struct miscdevice pcwd_miscdev = {
}
static struct file_operations pp_fops = {
- pp_lseek,
- pp_read,
- pp_write,
- NULL, /* pp_readdir */
- pp_poll,
- pp_ioctl,
- NULL, /* pp_mmap */
- pp_open,
- NULL, /* pp_flush */
- pp_release
+ llseek: pp_lseek,
+ read: pp_read,
+ write: pp_write,
+ poll: pp_poll,
+ ioctl: pp_ioctl,
+ open: pp_open,
+ release: pp_release,
};
static int __init ppdev_init (void)
}
struct file_operations qp_fops = {
- NULL, /* seek */
- read_qp,
- write_qp,
- NULL, /* readdir */
- poll_qp,
- NULL, /* ioctl */
- NULL, /* mmap */
- open_qp,
- NULL, /* flush */
- release_qp,
- NULL,
- fasync_qp,
+ read: read_qp,
+ write: write_qp,
+ poll: poll_qp,
+ open: open_qp,
+ release: release_qp,
+ fasync: fasync_qp,
};
/*
}
struct file_operations random_fops = {
- NULL, /* random_lseek */
- random_read,
- random_write,
- NULL, /* random_readdir */
- random_poll, /* random_poll */
- random_ioctl,
- NULL, /* random_mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL /* no special release code */
+ read: random_read,
+ write: random_write,
+ poll: random_poll,
+ ioctl: random_ioctl,
};
struct file_operations urandom_fops = {
- NULL, /* unrandom_lseek */
- urandom_read,
- random_write,
- NULL, /* urandom_readdir */
- NULL, /* urandom_poll */
- random_ioctl,
- NULL, /* urandom_mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL /* no special release code */
+ read: urandom_read,
+ write: random_write,
+ ioctl: random_ioctl,
};
/***************************************************************
static struct file_operations raw_fops = {
- NULL, /* llseek */
- raw_read, /* read */
- raw_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- raw_open, /* open */
- NULL, /* flush */
- raw_release, /* release */
- NULL /* fsync */
+ read: raw_read,
+ write: raw_write,
+ open: raw_open,
+ release: raw_release,
};
static struct file_operations raw_ctl_fops = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- raw_ctl_ioctl, /* ioctl */
- NULL, /* mmap */
- raw_open, /* open */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ ioctl: raw_ctl_ioctl,
+ open: raw_open,
};
void __init raw_init(void)
static struct file_operations softdog_fops=
{
- NULL, /* Seek */
- NULL, /* Read */
- softdog_write, /* Write */
- NULL, /* Readdir */
- NULL, /* Select */
- softdog_ioctl, /* Ioctl */
- NULL, /* MMap */
- softdog_open,
- NULL, /* flush */
- softdog_release,
- NULL,
- NULL /* Fasync */
+ write: softdog_write,
+ ioctl: softdog_ioctl,
+ open: softdog_open,
+ release: softdog_release,
};
static struct miscdevice softdog_miscdev=
* to get at port stats - only not using the port device itself.
*/
static struct file_operations stl_fsiomem = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- stl_memioctl, /* ioctl */
- NULL, /* mmap */
- stl_memopen, /* open */
- NULL, /* flush */
- stl_memclose, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ ioctl: stl_memioctl,
+ open: stl_memopen,
+ release: stl_memclose,
};
/*****************************************************************************/
*/
static struct file_operations sx_fw_fops = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* select */
- sx_fw_ioctl,
- NULL, /* mmap */
- sx_fw_open,
-#ifndef TWO_ZERO
- NULL, /* flush */
-#endif
- sx_fw_release,
- NULL, /* fsync */
- NULL, /* fasync */
+ ioctl: sx_fw_ioctl,
+ open: sx_fw_open,
+ release: sx_fw_release,
};
struct miscdevice sx_fw_device = {
/* These are (most) of the interface functions: */
static struct file_operations qic02_tape_fops = {
- qic02_tape_lseek, /* not allowed */
- qic02_tape_read, /* read */
- qic02_tape_write, /* write */
- NULL, /* readdir not allowed */
- NULL, /* poll ??? */
- qic02_tape_ioctl, /* ioctl */
- NULL, /* mmap not allowed */
- qic02_tape_open, /* open */
- NULL, /* flush */
- qic02_tape_release, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ llseek: qic02_tape_lseek, /* not allowed */
+ read: qic02_tape_read,
+ write: qic02_tape_write,
+ ioctl: qic02_tape_ioctl,
+ open: qic02_tape_open,
+ release: qic02_tape_release,
};
}
static struct file_operations tty_fops = {
- tty_lseek,
- tty_read,
- tty_write,
- NULL, /* tty_readdir */
- tty_poll,
- tty_ioctl,
- NULL, /* tty_mmap */
- tty_open,
- NULL, /* flush */
- tty_release,
- NULL, /* tty_fsync */
- tty_fasync
+ llseek: tty_lseek,
+ read: tty_read,
+ write: tty_write,
+ poll: tty_poll,
+ ioctl: tty_ioctl,
+ open: tty_open,
+ release: tty_release,
+ fasync: tty_fasync,
};
static struct file_operations hung_up_tty_fops = {
- tty_lseek,
- hung_up_tty_read,
- hung_up_tty_write,
- NULL, /* hung_up_tty_readdir */
- hung_up_tty_poll,
- hung_up_tty_ioctl,
- NULL, /* hung_up_tty_mmap */
- NULL, /* hung_up_tty_open */
- NULL, /* flush */
- tty_release, /* hung_up_tty_release */
- NULL, /* hung_up_tty_fsync */
- NULL /* hung_up_tty_fasync */
+ llseek: tty_lseek,
+ read: hung_up_tty_read,
+ write: hung_up_tty_write,
+ poll: hung_up_tty_poll,
+ ioctl: hung_up_tty_ioctl,
+ release: tty_release,
};
/*
}
static struct file_operations vcs_fops = {
- vcs_lseek, /* lseek */
- vcs_read, /* read */
- vcs_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- vcs_open, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL /* fsync */
+ llseek: vcs_lseek,
+ read: vcs_read,
+ write: vcs_write,
+ open: vcs_open,
};
int __init vcs_init(void)
static struct file_operations video_fops=
{
- video_lseek,
- video_read,
- video_write,
- NULL, /* readdir */
-#if LINUX_VERSION_CODE >= 0x020100
- video_poll, /* poll */
-#else
- NULL,
-#endif
- video_ioctl,
- video_mmap,
- video_open,
-#if LINUX_VERSION_CODE >= 0x020100
- NULL, /* flush */
+ llseek: video_lseek,
+ read: video_read,
+ write: video_write,
+ ioctl: video_ioctl,
+ mmap: video_mmap,
+ open: video_open,
+ release: video_release,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+ poll: video_poll,
#endif
- video_release
};
/*
static struct file_operations wdt_fops = {
- wdt_llseek,
- wdt_read,
- wdt_write,
- NULL, /* No Readdir */
- NULL, /* No Select */
- wdt_ioctl,
- NULL, /* No mmap */
- wdt_open,
- NULL, /* flush */
- wdt_release
+ llseek: wdt_llseek,
+ read: wdt_read,
+ write: wdt_write,
+ ioctl: wdt_ioctl,
+ open: wdt_open,
+ release: wdt_release,
};
static struct miscdevice wdt_miscdev=
/* To implement the dynamic /proc/bus/i2c-? files, we need our own
implementation of the read hook */
static struct file_operations i2cproc_operations = {
- NULL,
- i2cproc_bus_read,
+ read: i2cproc_bus_read,
};
static struct inode_operations i2cproc_inode_operations = {
static int i2cdev_cleanup(void);
static struct file_operations i2cdev_fops = {
- i2cdev_lseek,
- i2cdev_read,
- i2cdev_write,
- NULL, /* i2cdev_readdir */
- NULL, /* i2cdev_select */
- i2cdev_ioctl,
- NULL, /* i2cdev_mmap */
- i2cdev_open,
- NULL, /* i2cdev_flush */
- i2cdev_release,
+ llseek: i2cdev_lseek,
+ read: i2cdev_read,
+ write: i2cdev_write,
+ ioctl: i2cdev_ioctl,
+ open: i2cdev_open,
+ release: i2cdev_release,
};
#define I2CDEV_ADAPS_MAX I2C_ADAP_MAX
static struct file_operations config_fops =
{
- cfg_llseek,
- cfg_read,
- cfg_write,
- NULL,
- NULL /*cfg_poll*/,
- cfg_ioctl,
- NULL, /* No mmap */
- cfg_open,
- NULL, /* No flush */
- cfg_release,
- NULL,
- cfg_fasync
+ llseek: cfg_llseek,
+ read: cfg_read,
+ write: cfg_write,
+ ioctl: cfg_ioctl,
+ open: cfg_open,
+ release: cfg_release,
+ fasync: cfg_fasync,
};
static struct miscdevice i2o_miscdev = {
static struct file_operations aux_ops = {
- /* FIXME: should have custom llseek with bounds checking*/
- read: mem_read,
- write: mem_write,
- poll: aux_poll,
- open: mem_open,
- release: mem_release
+ /* FIXME: should have custom llseek with bounds checking */
+ read: mem_read,
+ write: mem_write,
+ poll: aux_poll,
+ open: mem_open,
+ release: mem_release,
};
static struct file_operations capi_fops =
{
- capi_llseek,
- capi_read,
- capi_write,
- NULL, /* capi_readdir */
- capi_poll,
- capi_ioctl,
- NULL, /* capi_mmap */
- capi_open,
- NULL, /* capi_flush */
- capi_release,
- NULL, /* capi_fsync */
- NULL, /* capi_fasync */
+ llseek: capi_llseek,
+ read: capi_read,
+ write: capi_write,
+ poll: capi_poll,
+ ioctl: capi_ioctl,
+ open: capi_open,
+ release: capi_release,
};
/* -------- /proc functions ----------------------------------- */
static struct file_operations isdn_fops =
{
- isdn_divert_lseek,
- isdn_divert_read,
- isdn_divert_write,
- NULL, /* isdn_readdir */
- isdn_divert_poll, /* isdn_poll */
- isdn_divert_ioctl, /* isdn_ioctl */
- NULL, /* isdn_mmap */
- isdn_divert_open,
- NULL, /* flush */
- isdn_divert_close,
- NULL /* fsync */
+ llseek: isdn_divert_lseek,
+ read: isdn_divert_read,
+ write: isdn_divert_write,
+ poll: isdn_divert_poll,
+ ioctl: isdn_divert_ioctl,
+ open: isdn_divert_open,
+ release: isdn_divert_close,
};
struct inode_operations divert_file_inode_operations = {
static struct file_operations isdn_fops =
{
- isdn_lseek,
- isdn_read,
- isdn_write,
- NULL, /* isdn_readdir */
- isdn_poll, /* isdn_poll */
- isdn_ioctl, /* isdn_ioctl */
- NULL, /* isdn_mmap */
- isdn_open,
- NULL, /* flush */
- isdn_close,
- NULL /* fsync */
+ llseek: isdn_lseek,
+ read: isdn_read,
+ write: isdn_write,
+ poll: isdn_poll,
+ ioctl: isdn_ioctl,
+ open: isdn_open,
+ release: isdn_close,
};
char *
}
static struct file_operations adb_fops = {
- adb_lseek,
- adb_read,
- adb_write,
- NULL, /* no readdir */
- NULL, /* no poll yet */
- NULL, /* no ioctl yet */
- NULL, /* no mmap */
- adb_open,
- NULL, /* flush */
- adb_release
+ llseek: adb_lseek,
+ read: adb_read,
+ write: adb_write,
+ open: adb_open,
+ release: adb_release,
};
void adbdev_init()
}
struct file_operations nvram_fops = {
- nvram_llseek,
- read_nvram,
- write_nvram,
- NULL, /* nvram_readdir */
- NULL, /* nvram_select */
- NULL, /* nvram_ioctl */
- NULL, /* nvram_mmap */
- nvram_open,
- NULL, /* flush */
- nvram_release,
- NULL /* fsync */
+ llseek: nvram_llseek,
+ read: read_nvram,
+ write: write_nvram,
+ open: nvram_open,
+ release: nvram_release,
};
static struct miscdevice nvram_dev = {
}
static struct file_operations pmu_device_fops = {
- NULL, /* no seek */
- pmu_read,
- pmu_write,
- NULL, /* no readdir */
- pmu_fpoll,
- pmu_ioctl,
- NULL, /* no mmap */
- pmu_open,
- NULL, /* flush */
- pmu_release,
+ read: pmu_read,
+ write: pmu_write,
+ poll: pmu_fpoll,
+ ioctl: pmu_ioctl,
+ open: pmu_open,
+ release: pmu_release,
};
static struct miscdevice pmu_device = {
{
struct descriptor *last_cmd = sp->last_cmd;
sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
- clear_suspend(last_cmd);
+ last_cmd->cmd_status &= cpu_to_le32(~(CmdSuspend | CmdIntr));
}
if (sp->cur_tx - sp->dirty_tx >= TX_QUEUE_LIMIT)
sp->tx_full = 1;
}
static struct file_operations ppp_device_fops = {
- NULL, /* seek */
- ppp_read,
- ppp_write,
- NULL, /* readdir */
- ppp_poll,
- ppp_ioctl,
- NULL, /* mmap */
- ppp_open,
- NULL, /* flush */
- ppp_release
+ read: ppp_read,
+ write: ppp_write,
+ poll: ppp_poll,
+ ioctl: ppp_ioctl,
+ open: ppp_open,
+ release: ppp_release
};
#define PPP_MAJOR 108
#endif
static struct file_operations cosa_fops = {
- cosa_lseek,
- cosa_read,
- cosa_write,
- NULL, /* readdir */
- cosa_poll,
- cosa_chardev_ioctl,
- NULL, /* mmap */
- cosa_open,
- NULL, /* flush */
- cosa_release,
- NULL, /* fsync */
+ llseek: cosa_lseek,
+ read: cosa_read,
+ write: cosa_write,
+ poll: cosa_poll,
+ ioctl: cosa_chardev_ioctl,
+ open: cosa_open,
+ release: cosa_release,
#ifdef COSA_FASYNC_WORKING
- cosa_fasync,
-#else
- NULL,
+ fasync: cosa_fasync,
#endif
- NULL /* lock */
};
/* Ioctls */
/*====================================================================*/
static struct file_operations ds_fops = {
- open: ds_open,
- release: ds_release,
- ioctl: ds_ioctl,
- read: ds_read,
- write: ds_write,
- poll: ds_poll
+ open: ds_open,
+ release: ds_release,
+ ioctl: ds_ioctl,
+ read: ds_read,
+ write: ds_write,
+ poll: ds_poll,
};
EXPORT_SYMBOL(register_pccard_driver);
static struct file_operations isapnp_info_entry_operations =
{
- isapnp_info_entry_lseek, /* lseek */
- isapnp_info_entry_read, /* read */
- isapnp_info_entry_write, /* write */
- NULL, /* readdir */
- isapnp_info_entry_poll, /* poll */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- isapnp_info_entry_open, /* open */
- NULL, /* flush */
- isapnp_info_entry_release, /* release */
- NULL, /* can't fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: isapnp_info_entry_lseek,
+ read: isapnp_info_entry_read,
+ write: isapnp_info_entry_write,
+ poll: isapnp_info_entry_poll,
+ open: isapnp_info_entry_open,
+ release: isapnp_info_entry_release,
};
static struct inode_operations isapnp_info_entry_inode_operations =
static struct file_operations isapnp_proc_bus_file_operations =
{
- isapnp_proc_bus_lseek, /* lseek */
- isapnp_proc_bus_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* can't fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: isapnp_proc_bus_lseek,
+ read: isapnp_proc_bus_read,
};
static struct inode_operations isapnp_proc_bus_inode_operations =
#endif
static struct file_operations sparcaudioctl_fops = {
- NULL,
- NULL,
- NULL,
- NULL, /* sparcaudio_readdir */
- sparcaudio_select,
- sparcaudio_ioctl,
- NULL, /* sparcaudio_mmap */
- NULL,
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
- NULL, /* sparcaudio_flush */
-#endif
- sparcaudioctl_release,
+ poll: sparcaudio_select,
+ ioctl: sparcaudio_ioctl,
+ release: sparcaudioctl_release,
};
static int sparcaudio_open(struct inode * inode, struct file * file)
#endif
static struct file_operations sparcaudio_fops = {
- sparcaudio_lseek,
- sparcaudio_read,
- sparcaudio_write,
- NULL, /* sparcaudio_readdir */
- sparcaudio_select,
- sparcaudio_ioctl,
- NULL, /* sparcaudio_mmap */
- sparcaudio_open,
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
- NULL, /* sparcaudio_flush */
-#endif
- sparcaudio_release
+ llseek: sparcaudio_lseek,
+ read: sparcaudio_read,
+ write: sparcaudio_write,
+ poll: sparcaudio_select,
+ ioctl: sparcaudio_ioctl,
+ open: sparcaudio_open,
+ release: sparcaudio_release,
};
#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
}
static struct file_operations bpp_fops = {
- NULL, /* bpp_lseek */
- bpp_read,
- bpp_write,
- NULL, /* bpp_readdir */
- NULL, /* bpp_select */
- bpp_ioctl,
- NULL, /* bpp_mmap */
- bpp_open,
- NULL, /* flush */
- bpp_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ read: bpp_read,
+ write: bpp_write,
+ ioctl: bpp_ioctl,
+ open: bpp_open,
+ release: bpp_release,
};
#if defined(__i386__)
}
static struct file_operations envctrl_fops = {
- envctrl_llseek,
- envctrl_read,
- envctrl_write,
- NULL, /* readdir */
- NULL, /* poll */
- envctrl_ioctl,
- NULL, /* mmap */
- envctrl_open,
- NULL, /* flush */
- envctrl_release
+ llseek: envctrl_llseek,
+ read: envctrl_read,
+ write: envctrl_write,
+ ioctl: envctrl_ioctl,
+ open: envctrl_open,
+ release: envctrl_release,
};
static struct miscdevice envctrl_dev = {
}
static struct file_operations flash_fops = {
- flash_llseek,
- flash_read,
- NULL, /* no write to the Flash, use mmap
- * and play flash dependent tricks.
- */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- flash_mmap,
- flash_open,
- NULL, /* flush */
- flash_release
+ /* no write to the Flash, use mmap
+ * and play flash dependent tricks.
+ */
+ llseek: flash_llseek,
+ read: flash_read,
+ ioctl: flash_mmap,
+ mmap: flash_open,
+ flush: flash_release,
};
static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
}
static struct file_operations jsf_fops = {
- jsf_lseek,
- jsf_read,
- jsf_write,
- NULL, /* readdir */
- NULL, /* poll */
- jsf_ioctl,
- jsf_mmap,
- jsf_open,
- NULL, /* flush */
- jsf_release,
- NULL /* fsync */
+ llseek: jsf_lseek,
+ read: jsf_read,
+ write: jsf_write,
+ ioctl: jsf_ioctl,
+ mmap: jsf_mmap,
+ open: jsf_open,
+ release: jsf_release,
};
static struct miscdevice jsf_dev = { JSF_MINOR, "jsflash", &jsf_fops };
}
static struct file_operations openprom_fops = {
- openprom_lseek,
- NULL, /* openprom_read */
- NULL, /* openprom_write */
- NULL, /* openprom_readdir */
- NULL, /* openprom_poll */
- openprom_ioctl,
- NULL, /* openprom_mmap */
- openprom_open,
- NULL, /* flush */
- openprom_release
+ llseek: openprom_lseek,
+ ioctl: openprom_ioctl,
+ open: openprom_open,
+ release: openprom_release,
};
static struct miscdevice openprom_dev = {
}
struct file_operations psaux_fops = {
- NULL, /* seek */
- aux_read,
- aux_write,
- NULL, /* readdir */
- aux_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- aux_open,
- NULL, /* flush */
- aux_release,
- NULL,
- aux_fasync,
+ read: aux_read,
+ write: aux_write,
+ poll: aux_poll,
+ open: aux_open,
+ release: aux_release,
+ fasync: aux_fasync,
};
static int aux_no_open(struct inode *inode, struct file *file)
}
struct file_operations psaux_no_fops = {
- NULL, /* seek */
- NULL,
- NULL,
- NULL, /* readdir */
- NULL,
- NULL, /* ioctl */
- NULL, /* mmap */
- aux_no_open,
+ open: aux_no_open,
};
static struct miscdevice psaux_mouse = {
}
static struct file_operations rtc_fops = {
- rtc_lseek,
- NULL, /* rtc_read */
- NULL, /* rtc_write */
- NULL, /* rtc_readdir */
- NULL, /* rtc_poll */
- rtc_ioctl,
- NULL, /* rtc_mmap */
- rtc_open,
- NULL, /* flush */
- rtc_release
+ llseek: rtc_lseek,
+ ioctl: rtc_ioctl,
+ open: rtc_open,
+ release: rtc_release,
};
static struct miscdevice rtc_dev = { RTC_MINOR, "rtc", &rtc_fops };
return 0;
}
-static struct
-file_operations kbd_fops =
+static struct file_operations kbd_fops =
{
- NULL, /* seek */
- kbd_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- kbd_poll, /* poll */
- kbd_ioctl, /* ioctl */
- NULL, /* mmap */
- kbd_open, /* open */
- NULL, /* flush */
- kbd_close, /* close */
- NULL, /* fsync */
- kbd_fasync, /* fasync */
+ read: kbd_read,
+ poll: kbd_poll,
+ ioctl: kbd_ioctl,
+ open: kbd_open,
+ release: kbd_close,
+ fasync: kbd_fasync,
};
void __init keyboard_zsinit(void (*put_char)(unsigned char))
}
struct file_operations sun_mouse_fops = {
- NULL,
- sun_mouse_read,
- sun_mouse_write,
- NULL,
- sun_mouse_poll,
- sun_mouse_ioctl,
- NULL,
- sun_mouse_open,
- NULL, /* flush */
- sun_mouse_close,
- NULL,
- sun_mouse_fasync,
+ read: sun_mouse_read,
+ write: sun_mouse_write,
+ poll: sun_mouse_poll,
+ ioctl: sun_mouse_ioctl,
+ open: sun_mouse_open,
+ release: sun_mouse_close,
+ fasync: sun_mouse_fasync,
};
static struct miscdevice sun_mouse_mouse = {
}
static struct file_operations uctrl_fops = {
- uctrl_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- uctrl_ioctl,
- NULL, /* mmap */
- uctrl_open,
- NULL, /* flush */
- uctrl_release
+ llseek: uctrl_llseek,
+ ioctl: uctrl_ioctl,
+ open: uctrl_open,
+ release: uctrl_release,
};
static struct miscdevice uctrl_dev = {
}
static struct file_operations vfc_fops = {
- vfc_lseek, /* vfc_lseek */
- NULL, /* vfc_write */
- NULL, /* vfc_read */
- NULL, /* vfc_readdir */
- NULL, /* vfc_select */
- vfc_ioctl,
- vfc_mmap,
- vfc_open,
- NULL, /* flush */
- vfc_release,
+ llseek: vfc_lseek,
+ ioctl: vfc_ioctl,
+ mmap: vfc_mmap,
+ open: vfc_open,
+ release: vfc_release,
};
static int vfc_probe(void)
}
static struct file_operations sg_fops = {
- NULL, /* lseek */
- sg_read, /* read */
- sg_write, /* write */
- NULL, /* readdir */
- sg_poll, /* poll */
- sg_ioctl, /* ioctl */
- NULL, /* mmap */
- sg_open, /* open */
- NULL, /* flush */
- sg_release, /* release, was formerly sg_close */
- NULL, /* fsync */
- sg_fasync, /* fasync */
- NULL, /* lock */
+ read: sg_read,
+ write: sg_write,
+ poll: sg_poll,
+ ioctl: sg_ioctl,
+ open: sg_open,
+ release: sg_release,
+ fasync: sg_fasync,
};
static struct file_operations st_fops =
{
- NULL, /* lseek - default */
- st_read, /* read - general block-dev read */
- st_write, /* write - general block-dev write */
- NULL, /* readdir - bad */
- NULL, /* select */
- st_ioctl, /* ioctl */
- NULL, /* mmap */
- scsi_tape_open, /* open */
- scsi_tape_flush, /* flush */
- scsi_tape_close, /* release */
- NULL /* fsync */
+ read: st_read,
+ write: st_write,
+ ioctl: st_ioctl,
+ open: scsi_tape_open,
+ flush: scsi_tape_flush,
+ release: scsi_tape_close,
};
static int st_attach(Scsi_Device * SDp)
*/
static struct file_operations ds1286_fops = {
- ds1286_llseek,
- ds1286_read,
- NULL, /* No write */
- NULL, /* No readdir */
- ds1286_poll,
- ds1286_ioctl,
- NULL, /* No mmap */
- ds1286_open,
- NULL,
- ds1286_release
+ llseek: ds1286_llseek,
+ read: ds1286_read,
+ poll: ds1286_poll,
+ ioctl: ds1286_ioctl,
+ open: ds1286_open,
+ release: ds1286_release,
};
static struct miscdevice ds1286_dev=
#endif
struct file_operations sgi_graphics_fops = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- sgi_graphics_ioctl, /* ioctl */
- sgi_graphics_mmap, /* mmap */
- sgi_graphics_open, /* open */
- NULL, /* flush */
- sgi_graphics_close, /* release */
- NULL, /* fsync */
- NULL /* lock */
+ ioctl: sgi_graphics_ioctl,
+ mmap: sgi_graphics_mmap,
+ open: sgi_graphics_open,
+ release: sgi_graphics_close,
};
/* /dev/graphics */
}
-static struct
-file_operations shmiq_fops =
+static struct file_operations shmiq_fops =
{
- NULL, /* seek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- shmiq_qcntl_poll, /* poll */
- shmiq_qcntl_ioctl, /* ioctl */
- shmiq_qcntl_mmap, /* mmap */
- shmiq_qcntl_open, /* open */
- NULL, /* flush */
- shmiq_qcntl_close, /* close */
- NULL, /* fsync */
- shmiq_qcntl_fasync, /* fasync */
+ poll: shmiq_qcntl_poll,
+ ioctl: shmiq_qcntl_ioctl,
+ mmap: shmiq_qcntl_mmap,
+ open: shmiq_qcntl_open,
+ release: shmiq_qcntl_close,
+ fasync: shmiq_qcntl_fasync,
};
void
}
struct file_operations sgi_gfx_fops = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- sgi_gfx_ioctl, /* ioctl */
- NULL, /* mmap */
- sgi_gfx_open, /* open */
- NULL, /* flush */
- sgi_gfx_close, /* release */
- NULL, /* fsync */
- NULL /* lock */
+ ioctl: sgi_gfx_ioctl,
+ open: sgi_gfx_open,
+ release: sgi_gfx_close,
};
static struct miscdevice dev_gfx = {
}
struct file_operations sgi_keyb_fops = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- sgi_keyb_ioctl, /* ioctl */
- NULL, /* mmap */
- sgi_keyb_open, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL /* lock */
+ ioctl: sgi_keyb_ioctl,
+ open: sgi_keyb_open,
};
static struct miscdevice dev_input_keyboard = {
}
struct file_operations sgi_mouse_fops = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- sgi_mouse_ioctl, /* ioctl */
- NULL, /* mmap */
- sgi_mouse_open, /* open */
- NULL, /* flush */
- sgi_mouse_close, /* release */
- NULL, /* fsync */
- NULL /* lock */
+ ioctl: sgi_mouse_ioctl,
+ open: sgi_mouse_open,
+ release: sgi_mouse_close,
};
/* /dev/input/mouse */
}
struct file_operations sgi_usemaclone_fops = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- sgi_usemaclone_poll, /* poll */
- sgi_usemaclone_ioctl, /* ioctl */
- NULL, /* mmap */
- sgi_usemaclone_open, /* open */
- NULL, /* flush */
- sgi_usemaclone_release, /* release */
- NULL, /* fsync */
- NULL /* lock */
+ poll: sgi_usemaclone_poll,
+ ioctl: sgi_usemaclone_ioctl,
+ open: sgi_usemaclone_open,
+ release: sgi_usemaclone_release,
};
static struct miscdevice dev_usemaclone = {
}
static /*const*/ struct file_operations cm_mixer_fops = {
- &cm_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &cm_ioctl_mixdev,
- NULL, /* mmap */
- &cm_open_mixdev,
- NULL, /* flush */
- &cm_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: cm_llseek,
+ ioctl: cm_ioctl_mixdev,
+ open: cm_open_mixdev,
+ release: cm_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations cm_audio_fops = {
- &cm_llseek,
- &cm_read,
- &cm_write,
- NULL, /* readdir */
- &cm_poll,
- &cm_ioctl,
- &cm_mmap,
- &cm_open,
- NULL, /* flush */
- &cm_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: cm_llseek,
+ read: cm_read,
+ write: cm_write,
+ poll: cm_poll,
+ ioctl: cm_ioctl,
+ mmap: cm_mmap,
+ open: cm_open,
+ release: cm_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations cm_midi_fops = {
- &cm_llseek,
- &cm_midi_read,
- &cm_midi_write,
- NULL, /* readdir */
- &cm_midi_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- &cm_midi_open,
- NULL, /* flush */
- &cm_midi_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: cm_llseek,
+ read: cm_midi_read,
+ write: cm_midi_write,
+ poll: cm_midi_poll,
+ open: cm_midi_open,
+ release: cm_midi_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations cm_dmfm_fops = {
- &cm_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &cm_dmfm_ioctl,
- NULL, /* mmap */
- &cm_dmfm_open,
- NULL, /* flush */
- &cm_dmfm_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: cm_llseek,
+ ioctl: cm_dmfm_ioctl,
+ open: cm_dmfm_open,
+ release: cm_dmfm_release,
};
/* --------------------------------------------------------------------- */
static struct file_operations mixer_fops =
{
- sound_lseek,
- NULL, /* mixer_read */
- NULL, /* mixer_write */
- NULL, /* mixer_readdir */
- NULL, /* mixer_poll */
- mixer_ioctl,
- NULL, /* mixer_mmap */
- mixer_open,
- NULL, /* flush */
- mixer_release,
+ llseek: sound_lseek,
+ ioctl: mixer_ioctl,
+ open: mixer_open,
+ release: mixer_release,
};
static struct file_operations sq_fops =
{
- sound_lseek,
+ llseek: sound_lseek,
+ write: sq_write,
+ ioctl: sq_ioctl,
+ open: sq_open,
+ release: sq_release,
#ifdef CONFIG_PPC
- sq_read, /* sq_read */
-#else
- NULL, /* sq_read */
+ read: sq_read, /* sq_read */
#endif
- sq_write,
- NULL, /* sq_readdir */
- NULL, /* sq_poll */
- sq_ioctl,
- NULL, /* sq_mmap */
- sq_open,
- NULL, /* flush */
- sq_release,
};
static struct file_operations state_fops =
{
- sound_lseek,
- state_read,
- NULL, /* state_write */
- NULL, /* state_readdir */
- NULL, /* state_poll */
- NULL, /* state_ioctl */
- NULL, /* state_mmap */
- state_open,
- NULL, /* flush */
- state_release,
+ llseek: sound_lseek,
+ read: state_read,
+ open: state_open,
+ release: state_release,
};
}
static /*const*/ struct file_operations es1370_mixer_fops = {
- &es1370_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &es1370_ioctl_mixdev,
- NULL, /* mmap */
- &es1370_open_mixdev,
- NULL, /* flush */
- &es1370_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1370_llseek,
+ ioctl: es1370_ioctl_mixdev,
+ open: es1370_open_mixdev,
+ release: es1370_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1370_audio_fops = {
- &es1370_llseek,
- &es1370_read,
- &es1370_write,
- NULL, /* readdir */
- &es1370_poll,
- &es1370_ioctl,
- &es1370_mmap,
- &es1370_open,
- NULL, /* flush */
- &es1370_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1370_llseek,
+ read: es1370_read,
+ write: es1370_write,
+ poll: es1370_poll,
+ ioctl: es1370_ioctl,
+ mmap: es1370_mmap,
+ open: es1370_open,
+ release: es1370_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1370_dac_fops = {
- &es1370_llseek,
- NULL, /* read */
- &es1370_write_dac,
- NULL, /* readdir */
- &es1370_poll_dac,
- &es1370_ioctl_dac,
- &es1370_mmap_dac,
- &es1370_open_dac,
- NULL, /* flush */
- &es1370_release_dac,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1370_llseek,
+ write: es1370_write_dac,
+ poll: es1370_poll_dac,
+ ioctl: es1370_ioctl_dac,
+ mmap: es1370_mmap_dac,
+ open: es1370_open_dac,
+ release: es1370_release_dac,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1370_midi_fops = {
- &es1370_llseek,
- &es1370_midi_read,
- &es1370_midi_write,
- NULL, /* readdir */
- &es1370_midi_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- &es1370_midi_open,
- NULL, /* flush */
- &es1370_midi_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1370_llseek,
+ read: es1370_midi_read,
+ write: es1370_midi_write,
+ poll: es1370_midi_poll,
+ open: es1370_midi_open,
+ release: es1370_midi_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1371_mixer_fops = {
- &es1371_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &es1371_ioctl_mixdev,
- NULL, /* mmap */
- &es1371_open_mixdev,
- NULL, /* flush */
- &es1371_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1371_llseek,
+ ioctl: es1371_ioctl_mixdev,
+ open: es1371_open_mixdev,
+ release: es1371_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1371_audio_fops = {
- &es1371_llseek,
- &es1371_read,
- &es1371_write,
- NULL, /* readdir */
- &es1371_poll,
- &es1371_ioctl,
- &es1371_mmap,
- &es1371_open,
- NULL, /* flush */
- &es1371_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1371_llseek,
+ read: es1371_read,
+ write: es1371_write,
+ poll: es1371_poll,
+ ioctl: es1371_ioctl,
+ mmap: es1371_mmap,
+ open: es1371_open,
+ release: es1371_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1371_dac_fops = {
- &es1371_llseek,
- NULL, /* read */
- &es1371_write_dac,
- NULL, /* readdir */
- &es1371_poll_dac,
- &es1371_ioctl_dac,
- &es1371_mmap_dac,
- &es1371_open_dac,
- NULL, /* flush */
- &es1371_release_dac,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1371_llseek,
+ write: es1371_write_dac,
+ poll: es1371_poll_dac,
+ ioctl: es1371_ioctl_dac,
+ mmap: es1371_mmap_dac,
+ open: es1371_open_dac,
+ release: es1371_release_dac,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations es1371_midi_fops = {
- &es1371_llseek,
- &es1371_midi_read,
- &es1371_midi_write,
- NULL, /* readdir */
- &es1371_midi_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- &es1371_midi_open,
- NULL, /* flush */
- &es1371_midi_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: es1371_llseek,
+ read: es1371_midi_read,
+ write: es1371_midi_write,
+ poll: es1371_midi_poll,
+ open: es1371_midi_open,
+ release: es1371_midi_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations solo1_mixer_fops = {
- &solo1_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &solo1_ioctl_mixdev,
- NULL, /* mmap */
- &solo1_open_mixdev,
- NULL, /* flush */
- &solo1_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: solo1_llseek,
+ ioctl: solo1_ioctl_mixdev,
+ open: solo1_open_mixdev,
+ release: solo1_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations solo1_audio_fops = {
- &solo1_llseek,
- &solo1_read,
- &solo1_write,
- NULL, /* readdir */
- &solo1_poll,
- &solo1_ioctl,
- &solo1_mmap,
- &solo1_open,
- NULL, /* flush */
- &solo1_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: solo1_llseek,
+ read: solo1_read,
+ write: solo1_write,
+ poll: solo1_poll,
+ ioctl: solo1_ioctl,
+ mmap: solo1_mmap,
+ open: solo1_open,
+ release: solo1_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations solo1_midi_fops = {
- &solo1_llseek,
- &solo1_midi_read,
- &solo1_midi_write,
- NULL, /* readdir */
- &solo1_midi_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- &solo1_midi_open,
- NULL, /* flush */
- &solo1_midi_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: solo1_llseek,
+ read: solo1_midi_read,
+ write: solo1_midi_write,
+ poll: solo1_midi_poll,
+ open: solo1_midi_open,
+ release: solo1_midi_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations solo1_dmfm_fops = {
- &solo1_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &solo1_dmfm_ioctl,
- NULL, /* mmap */
- &solo1_dmfm_open,
- NULL, /* flush */
- &solo1_dmfm_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: solo1_llseek,
+ ioctl: solo1_dmfm_ioctl,
+ open: solo1_dmfm_open,
+ release: solo1_dmfm_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations ess_mixer_fops = {
- &ess_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &ess_ioctl_mixdev,
- NULL, /* mmap */
- &ess_open_mixdev,
- NULL, /* flush */
- &ess_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: ess_llseek,
+ ioctl: ess_ioctl_mixdev,
+ open: ess_open_mixdev,
+ release: ess_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static struct file_operations ess_audio_fops = {
- &ess_llseek,
- &ess_read,
- &ess_write,
- NULL, /* readdir */
- &ess_poll,
- &ess_ioctl,
- &ess_mmap,
- &ess_open,
- NULL, /* flush */
- &ess_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: ess_llseek,
+ read: ess_read,
+ write: ess_write,
+ poll: ess_poll,
+ ioctl: ess_ioctl,
+ mmap: ess_mmap,
+ open: ess_open,
+ release: ess_release,
};
static int
}
static struct file_operations dev_fileops = {
- NULL, /* llseek */
- dev_read, /* read */
- dev_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- dev_ioctl, /* ioctl */
- NULL, /* mmap */
- dev_open, /* open */
-#ifndef LINUX20
- NULL, /* flush */
-#endif
- dev_release, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: dev_read,
+ write: dev_write,
+ ioctl: dev_ioctl,
+ open: dev_open,
+ release: dev_release,
};
static int reset_dsp(void)
}
static /*const*/ struct file_operations sv_mixer_fops = {
- &sv_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &sv_ioctl_mixdev,
- NULL, /* mmap */
- &sv_open_mixdev,
- NULL, /* flush */
- &sv_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: sv_llseek,
+ ioctl: sv_ioctl_mixdev,
+ open: sv_open_mixdev,
+ release: sv_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations sv_audio_fops = {
- &sv_llseek,
- &sv_read,
- &sv_write,
- NULL, /* readdir */
- &sv_poll,
- &sv_ioctl,
- &sv_mmap,
- &sv_open,
- NULL, /* flush */
- &sv_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: sv_llseek,
+ read: sv_read,
+ write: sv_write,
+ poll: sv_poll,
+ ioctl: sv_ioctl,
+ mmap: sv_mmap,
+ open: sv_open,
+ release: sv_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations sv_midi_fops = {
- &sv_llseek,
- &sv_midi_read,
- &sv_midi_write,
- NULL, /* readdir */
- &sv_midi_poll,
- NULL, /* ioctl */
- NULL, /* mmap */
- &sv_midi_open,
- NULL, /* flush */
- &sv_midi_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: sv_llseek,
+ read: sv_midi_read,
+ write: sv_midi_write,
+ poll: sv_midi_poll,
+ open: sv_midi_open,
+ release: sv_midi_release,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations sv_dmfm_fops = {
- &sv_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &sv_dmfm_ioctl,
- NULL, /* mmap */
- &sv_dmfm_open,
- NULL, /* flush */
- &sv_dmfm_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: sv_llseek,
+ ioctl: sv_dmfm_ioctl,
+ open: sv_dmfm_open,
+ release: sv_dmfm_release,
};
/* --------------------------------------------------------------------- */
struct file_operations oss_sound_fops =
{
- sound_lseek,
- sound_read,
- sound_write,
- NULL, /* sound_readdir */
- sound_poll,
- sound_ioctl,
- sound_mmap,
- sound_open,
- NULL, /* flush */
- sound_release
+ llseek: sound_lseek,
+ read: sound_read,
+ write: sound_write,
+ poll: sound_poll,
+ ioctl: sound_ioctl,
+ mmap: sound_mmap,
+ open: sound_open,
+ release: sound_release,
};
/*
}
static /*const*/ struct file_operations trident_audio_fops = {
- &trident_llseek,
- &trident_read,
- &trident_write,
- NULL, /* readdir */
- &trident_poll,
- &trident_ioctl,
- &trident_mmap,
- &trident_open,
- NULL, /* flush */
- &trident_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: trident_llseek,
+ read: trident_read,
+ write: trident_write,
+ poll: trident_poll,
+ ioctl: trident_ioctl,
+ mmap: trident_mmap,
+ open: trident_open,
+ release: trident_release,
};
/* trident specific AC97 functions */
}
static /*const*/ struct file_operations trident_mixer_fops = {
- &trident_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &trident_ioctl_mixdev,
- NULL, /* mmap */
- &trident_open_mixdev,
- NULL, /* flush */
- &trident_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: trident_llseek,
+ ioctl: trident_ioctl_mixdev,
+ open: trident_open_mixdev,
+ release: trident_release_mixdev,
};
/* AC97 codec initialisation. */
}
static struct file_operations vwsnd_audio_fops = {
- &vwsnd_audio_llseek,
- &vwsnd_audio_read,
- &vwsnd_audio_write,
- NULL, /* readdir */
- &vwsnd_audio_poll,
- &vwsnd_audio_ioctl,
- &vwsnd_audio_mmap,
- &vwsnd_audio_open,
- NULL, /* flush */
- &vwsnd_audio_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: vwsnd_audio_llseek,
+ read: vwsnd_audio_read,
+ write: vwsnd_audio_write,
+ poll: vwsnd_audio_poll,
+ ioctl: vwsnd_audio_ioctl,
+ mmap: vwsnd_audio_mmap,
+ open: vwsnd_audio_open,
+ release: vwsnd_audio_release,
};
/*****************************************************************************/
}
static struct file_operations vwsnd_mixer_fops = {
- &vwsnd_mixer_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &vwsnd_mixer_ioctl,
- NULL, /* mmap */
- &vwsnd_mixer_open,
- NULL, /* flush */
- &vwsnd_mixer_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: vwsnd_mixer_llseek,
+ ioctl: vwsnd_mixer_ioctl,
+ open: vwsnd_mixer_open,
+ release: vwsnd_mixer_release,
};
/*****************************************************************************/
}
static /*const*/ struct file_operations wavefront_fops = {
- &wavefront_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &wavefront_ioctl,
- NULL, /* mmap */
- &wavefront_open,
- NULL, /* flush */
- &wavefront_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: wavefront_llseek,
+ ioctl: wavefront_ioctl,
+ open: wavefront_open,
+ release: wavefront_release,
};
\f
struct file_operations ixj_fops =
{
- NULL, /* ixj_lseek */
- ixj_enhanced_read,
- ixj_enhanced_write,
- NULL, /* ixj_readdir */
- ixj_poll,
- ixj_ioctl,
- NULL, /* ixj_mmap */
-// ixj_open,
- NULL, /* ixj_open */
- NULL, /* ixj_flush */
- ixj_release,
- NULL, /* ixj_fsync */
- ixj_fasync, /* ixj_fasync */
- NULL /* lock */
+ read: ixj_enhanced_read,
+ write: ixj_enhanced_write,
+ poll: ixj_poll,
+ ioctl: ixj_ioctl,
+ release: ixj_release,
+ fasync: ixj_fasync,
};
static int ixj_linetest(int board)
static struct file_operations phone_fops =
{
- NULL,
- NULL,
- NULL,
- NULL, /* readdir */
- NULL,
- NULL,
- NULL,
- phone_open,
- NULL, /* flush */
- NULL
+ open: phone_open,
};
/*
if (!ACM_READY(acm)) return;
+ if (urb->status)
+ dbg("nonzero read bulk status received: %d", urb->status);
+
if (!urb->status & !acm->throttle) {
for (i = 0; i < urb->actual_length && !acm->throttle; i++)
tty_insert_flip_char(tty, data[i], 0);
tty_flip_buffer_push(tty);
- } else
- dbg("nonzero read bulk status received: %d", urb->status);
+ }
- if (!acm->throttle) {
- urb->actual_length = 0;
- if (usb_submit_urb(urb))
- dbg("failed resubmitting read urb");
- } else {
+ if (acm->throttle) {
memmove(data, data + i, urb->actual_length - i);
urb->actual_length -= i;
+ return;
}
+
+ urb->actual_length = 0;
+
+ if (usb_submit_urb(urb))
+ dbg("failed resubmitting read urb");
}
static void acm_write_bulk(struct urb *urb)
}
static /*const*/ struct file_operations usb_mixer_fops = {
- &usb_audio_llseek,
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- &usb_audio_ioctl_mixdev,
- NULL, /* mmap */
- &usb_audio_open_mixdev,
- NULL, /* flush */
- &usb_audio_release_mixdev,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: usb_audio_llseek,
+ ioctl: usb_audio_ioctl_mixdev,
+ open: usb_audio_open_mixdev,
+ release: usb_audio_release_mixdev,
};
/* --------------------------------------------------------------------- */
}
static /*const*/ struct file_operations usb_audio_fops = {
- &usb_audio_llseek,
- &usb_audio_read,
- &usb_audio_write,
- NULL, /* readdir */
- &usb_audio_poll,
- &usb_audio_ioctl,
- &usb_audio_mmap,
- &usb_audio_open,
- NULL, /* flush */
- &usb_audio_release,
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: usb_audio_llseek,
+ read: usb_audio_read,
+ write: usb_audio_write,
+ poll: usb_audio_poll,
+ ioctl: usb_audio_ioctl,
+ mmap: usb_audio_mmap,
+ open: usb_audio_open,
+ release: usb_audio_release,
};
/* --------------------------------------------------------------------- */
pbulk_transfer_t pbulk;
int ret = 0;
int version = DABUSB_VERSION;
- DECLARE_WAITQUEUE (wait, current);
dbg("dabusb_ioctl");
static struct file_operations dabusb_fops =
{
- dabusb_llseek,
- dabusb_read,
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- dabusb_ioctl,
- NULL, /* mmap */
- dabusb_open,
- NULL, /* flush */
- dabusb_release,
- NULL, /* fsync */
- NULL, /* fasync */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38)
- NULL, /* check_media_change */
- NULL, /* revalidate */
-#endif
- NULL /* lock */
+ llseek: dabusb_llseek,
+ read: dabusb_read,
+ ioctl: dabusb_ioctl,
+ open: dabusb_open,
+ release: dabusb_release,
};
static int dabusb_find_struct (void)
* index = parent's connector number;
* count = device count at this level
*/
- /* If this is the root hub, display the bandwidth information but not the descriptors */
+ /* If this is the root hub, display the bandwidth information */
if (level == 0)
start += sprintf(start, format_bandwidth, bus->bandwidth_allocated,
FRAME_TIME_MAX_USECS_ALLOC,
(100 * bus->bandwidth_allocated + FRAME_TIME_MAX_USECS_ALLOC / 2) / FRAME_TIME_MAX_USECS_ALLOC,
bus->bandwidth_int_reqs, bus->bandwidth_isoc_reqs);
- else
- start = usb_dump_desc(start, end, usbdev);
+ start = usb_dump_desc(start, end, usbdev);
if (start > end)
return start + sprintf(start, "(truncated)\n");
/* Now look at all of this device's children. */
}
struct file_operations usbdevfs_devices_fops = {
- usb_device_lseek, /* lseek */
- usb_device_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- usb_device_poll, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- usb_device_open, /* open */
- NULL, /* flush */
- usb_device_release, /* release */
- NULL /* fsync */
+ llseek: usb_device_lseek,
+ read: usb_device_read,
+ poll: usb_device_poll,
+ open: usb_device_open,
+ release: usb_device_release,
};
}
static struct file_operations usbdevfs_device_file_operations = {
- usbdev_lseek, /* lseek */
- usbdev_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- usbdev_poll, /* poll */
- usbdev_ioctl, /* ioctl */
- NULL, /* mmap */
- usbdev_open, /* open */
- NULL, /* flush */
- usbdev_release, /* release */
- NULL /* fsync */
+ llseek: usbdev_lseek,
+ read: usbdev_read,
+ poll: usbdev_poll,
+ ioctl: usbdev_ioctl,
+ open: usbdev_open,
+ release: usbdev_release,
};
struct inode_operations usbdevfs_device_inode_operations = {
}
struct file_operations usbdevfs_drivers_fops = {
- usb_driver_lseek, /* lseek */
- usb_driver_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL /* fsync */
+ llseek: usb_driver_lseek,
+ read: usb_driver_read,
};
}
static struct file_operations usbdevfs_root_file_operations = {
- readdir: usbdevfs_root_readdir
+ readdir: usbdevfs_root_readdir,
};
static struct inode_operations usbdevfs_root_inode_operations = {
default_file_ops: &usbdevfs_root_file_operations,
- lookup: usbdevfs_root_lookup
+ lookup: usbdevfs_root_lookup,
};
static struct file_operations usbdevfs_bus_file_operations = {
- readdir: usbdevfs_bus_readdir
+ readdir: usbdevfs_bus_readdir,
};
static struct inode_operations usbdevfs_bus_inode_operations = {
default_file_ops: &usbdevfs_bus_file_operations,
- lookup: usbdevfs_bus_lookup
+ lookup: usbdevfs_bus_lookup,
};
static void usbdevfs_read_inode(struct inode *inode)
/*
* OmniVision OV511 Camera-to-USB Bridge Driver
- * Copyright 1999/2000 Mark W. McClelland
+ * Copyright (c) 1999/2000 Mark W. McClelland
+ * Many improvements by Bret Wallach
*
* Based on the Linux CPiA driver.
*
* DEBUG - Debugging code.
* FIXME - Something that is broken or needs improvement.
*
- * Version: 1.06
+ * Version: 1.07
*
* Please see the file: linux/Documentation/usb/ov511.txt
* and the website at: http://people.delphi.com/mmcclelland/linux/
#include <linux/wrapper.h>
#include <linux/module.h>
#include <linux/spinlock.h>
-
+#include <linux/time.h>
#include <asm/io.h>
#include "usb.h"
/* Video Size 640 x 480 x 3 bytes for RGB */
#define MAX_FRAME_SIZE (640 * 480 * 3)
+#define MAX_DATA_SIZE (MAX_FRAME_SIZE + sizeof(struct timeval))
-// FIXME - Force CIF to make some apps happy for the moment. Should find a
-// better way to do this.
+// FIXME - Should find a better way to do this.
#define DEFAULT_WIDTH 640
#define DEFAULT_HEIGHT 480
0, (__u16)reg, &value, 1, HZ);
#if 0
- PDEBUG("reg write: 0x%02X:0x%02X", reg, value);
+ PDEBUG("reg write: 0x%02X:0x%02X, 0x%x", reg, value, rc);
#endif
return rc;
if((rc&2) == 0) /* Ack? */
break;
-
+#if 0
/* I2C abort */
ov511_reg_write(dev, OV511_REG_I2C_CONTROL, 0x10);
-
+#endif
if (--retries < 0) return -1;
}
return (value);
}
+
+// This version doesn't always work
+#if 0
+ /* returns: negative is error, pos or zero is data */
+ int ov511_i2c_read(struct usb_device *dev, unsigned char reg)
+ {
+ int rc, value;
+
+ /* Select camera register */
+ rc = ov511_reg_write(dev, OV511_REG_I2C_SUB_ADDRESS_2_BYTE, reg);
+ if (rc < 0) return rc;
+
+
+ /* Initiate 2-byte write cycle */
+ rc = ov511_reg_write(dev, OV511_REG_I2C_CONTROL, 0x03);
+ if (rc < 0) return rc;
+
+
+ /* Initiate 2-byte read cycle */
+ rc = ov511_reg_write(dev, OV511_REG_I2C_CONTROL, 0x05);
+ if (rc < 0) return rc;
+
+ value = ov511_reg_read(dev, OV511_REG_I2C_DATA_PORT);
+ #if 0
+ PDEBUG("i2c read: 0x%02X:0x%02X", reg, value);
+ #endif
+
+ return (value);
+ }
+#endif
+
+static int ov511_write_regvals(struct usb_device *dev,
+ struct ov511_regvals * pRegvals)
+{
+ int ret;
+ while(pRegvals->bus != OV511_DONE_BUS) {
+ if (pRegvals->bus == OV511_REG_BUS) {
+ if ((ret = ov511_reg_write(dev, pRegvals->reg,
+ pRegvals->val)) < 0)
+ return ret;
+ } else if (pRegvals->bus == OV511_I2C_BUS) {
+ if ((ret = ov511_i2c_write(dev, pRegvals->reg,
+ pRegvals->val)) < 0)
+ return ret;
+ } else {
+ err("Bad regval array");
+ }
+ pRegvals++;
+ }
+ return 0;
+}
+
#if 0
static void ov511_dump_i2c_range( struct usb_device *dev, int reg1, int regn)
{
}
#endif
-int ov511_i2c_reset(struct usb_device *dev)
-{
- int rc;
-
- PDEBUG("Reset 7610");
- rc = ov511_i2c_write(dev, 0x12, 0x80);
- if (rc < 0)
- err("i2c reset: command failed");
-
- return rc;
-}
-
int ov511_reset(struct usb_device *dev, unsigned char reset_type)
{
int rc;
static inline int ov7610_set_picture(struct usb_ov511 *ov511,
struct video_picture *p)
{
+ int ret;
+
+ /* Stop the camera */
+ if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x3d) < 0) {
+ err("reset: command failed");
+ return -EIO;
+ }
+
+ if((ret = ov511_i2c_read(ov511->dev, OV7610_REG_COM_B)) < 0)
+ return -EIO;
+#if 0
+ if(ov511_i2c_write(ov511->dev, OV7610_REG_COM_B, ret & 0xfe) < 0)
+ return -EIO;
+#endif
+
if(ov511_i2c_write(ov511->dev, OV7610_REG_SAT, p->colour >> 8) < 0)
return -EIO;
if(ov511_i2c_write(ov511->dev, OV7610_REG_BRT, p->brightness >> 8) < 0)
return -EIO;
+ /* Restart the camera */
+ if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x0) < 0) {
+ err("reset: command failed");
+ return -EIO;
+ }
+
return 0;
}
{
int ret;
+ /* Stop the camera */
+ if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x3d) < 0) {
+ err("reset: command failed");
+ return -EIO;
+ }
+
if((ret = ov511_i2c_read(ov511->dev, OV7610_REG_SAT)) < 0) return -EIO;
p->colour = ret << 8;
p->depth = 24;
p->palette = VIDEO_PALETTE_RGB24;
+ /* Restart the camera */
+ if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x0) < 0) {
+ err("reset: command failed");
+ return -EIO;
+ }
+
return 0;
}
static int ov511_mode_init_regs(struct usb_ov511 *ov511,
- int width, int height, int mode)
+ int width, int height, int mode, int sub_flag)
{
int rc = 0;
struct usb_device *dev = ov511->dev;
#if 0
- PDEBUG("ov511_mode_init_regs(ov511, %d, %d, %d)", width, height, mode);
+ PDEBUG("ov511_mode_init_regs(ov511, %d, %d, %d, %d)",
+ width, height, mode, sub_flag);
#endif
- ov511_set_packet_size(ov511, 0);
- /* Set mode consistent registers */
- ov511_i2c_write(dev, 0x0f, 0x03);
- ov511_i2c_write(dev, 0x10, 0xff);
- ov511_i2c_write(dev, 0x13, 0x01);
- ov511_i2c_write(dev, 0x16, 0x06);
- ov511_i2c_write(dev, 0x20, 0x1c);
- ov511_i2c_write(dev, 0x24, 0x2e); /* 10 */
- ov511_i2c_write(dev, 0x25, 0x7c); /* 8a */
- ov511_i2c_write(dev, 0x26, 0x00); /* was 0x70 */
- ov511_i2c_write(dev, 0x28, 0x24); /* 24 */
- ov511_i2c_write(dev, 0x2b, 0xac);
- ov511_i2c_write(dev, 0x2c, 0xfe);
- ov511_i2c_write(dev, 0x2d, 0x93);
- ov511_i2c_write(dev, 0x34, 0x8b);
+// ov511_set_packet_size(ov511, 0);
+ if (ov511_reg_write(dev, OV511_REG_SYSTEM_RESET, 0x3d) < 0) {
+ err("reset: command failed");
+ return -EIO;
+ }
+
+ if (mode == VIDEO_PALETTE_GREY) {
+ ov511_reg_write(dev, 0x16, 0);
+ ov511_i2c_write(dev, 0xe, 0x44);
+ ov511_i2c_write(dev, 0x13, 0x21);
+ } else {
+ ov511_reg_write(dev, 0x16, 1);
+ ov511_i2c_write(dev, 0xe, 0x4);
+ ov511_i2c_write(dev, 0x13, 0x1);
+ }
if (width == 640 && height == 480) {
- ov511_reg_write(dev, 0x12, 0x4f);
- ov511_reg_write(dev, 0x13, 0x3d);
+ if (sub_flag) {
+ ov511_i2c_write(ov511->dev, 0x17, 0x38+(ov511->subx>>2));
+ ov511_i2c_write(ov511->dev, 0x18,
+ 0x3a+((ov511->subx+ov511->subw)>>2));
+ ov511_i2c_write(ov511->dev, 0x19, 0x5+(ov511->suby>>1));
+ ov511_i2c_write(ov511->dev, 0x1a,
+ 0x5+((ov511->suby+ov511->subh)>>1));
+ ov511_reg_write(ov511->dev, 0x12, (ov511->subw>>3)-1);
+ ov511_reg_write(ov511->dev, 0x13, (ov511->subh>>3)-1);
+ ov511_i2c_write(dev, 0x11, 0x01);
+ } else {
+ ov511_i2c_write(ov511->dev, 0x17, 0x38);
+ ov511_i2c_write(ov511->dev, 0x18, 0x3a + (640>>2));
+ ov511_i2c_write(ov511->dev, 0x19, 0x5);
+ ov511_i2c_write(ov511->dev, 0x1c, + (480>>1));
+ ov511_reg_write(dev, 0x12, 0x4f);
+ ov511_reg_write(dev, 0x13, 0x3d);
+ if (mode == VIDEO_PALETTE_GREY) {
+ ov511_i2c_write(dev, 0x11, 4); /* check */
+ } else {
+ ov511_i2c_write(dev, 0x11, 6); /* check */
+ }
+ }
+
ov511_reg_write(dev, 0x14, 0x00);
ov511_reg_write(dev, 0x15, 0x00);
ov511_reg_write(dev, 0x18, 0x03);
- ov511_i2c_write(dev, 0x11, 0x01);
ov511_i2c_write(dev, 0x12, 0x24);
ov511_i2c_write(dev, 0x14, 0x04);
ov511_i2c_write(dev, 0x35, 0x9e);
ov511_reg_write(dev, 0x15, 0x00);
ov511_reg_write(dev, 0x18, 0x03);
- ov511_i2c_write(dev, 0x11, 0x00);
+ if (mode == VIDEO_PALETTE_GREY) {
+ ov511_i2c_write(dev, 0x11, 1); /* check */
+ } else {
+ ov511_i2c_write(dev, 0x11, 1); /* check */
+ }
+
ov511_i2c_write(dev, 0x12, 0x04);
ov511_i2c_write(dev, 0x14, 0x24);
ov511_i2c_write(dev, 0x35, 0x1e);
err("Unknown mode (%d, %d): %d", width, height, mode);
rc = -EINVAL;
}
- ov511_set_packet_size(ov511, 993);
+
+// ov511_set_packet_size(ov511, 993);
+
+ if (ov511_reg_write(dev, OV511_REG_SYSTEM_RESET, 0x00) < 0) {
+ PDEBUG("reset: command failed");
+ return -EIO;
+ }
return rc;
}
#define HDIV 8
#define WDIV (256/HDIV)
-static void ov511_parse_data(unsigned char * pIn0,
- unsigned char * pOut0,
- int iWidth,
- int iSegment)
-
+
+static void ov511_parse_data_rgb24(unsigned char * pIn0,
+ unsigned char * pOut0,
+ int iOutY,
+ int iOutUV,
+ int iHalf,
+ int iWidth)
+
{
#ifndef OV511_DUMPPIX
int k, l, m;
unsigned char * pIn;
unsigned char * pOut, * pOut1;
- int iHalf = (iSegment / (iWidth / 32)) & 1;
- int iY = iSegment / (iWidth / WDIV);
- int jY = iSegment - iY * (iWidth / WDIV);
- int iOutY = (iY*HDIV*iWidth + jY*WDIV) * 3;
- int iUV = iSegment / (iWidth / WDIV * 2);
- int jUV = iSegment - iUV * (iWidth / WDIV * 2);
- int iOutUV = (iUV*HDIV*2*iWidth + jUV*WDIV/2) * 3;
-
/* Just copy the Y's if in the first stripe */
if (!iHalf) {
pIn = pIn0 + 128;
#else
/* Just dump pix data straight out for debug */
int i;
- pOut0 += iSegment * 384;
+ pOut0 += iSegmentY * 384;
for(i=0; i<384; i++) {
*pOut0++ = *pIn0++;
}
#endif
}
+/***************************************************************
+
+For 640x480 RAW BW images, data shows up in 1200 256 byte segments.
+The segments represent 4 squares of 8x8 pixels as
+follows:
+
+ 0 1 ... 7 64 65 ... 71 ... 192 193 ... 199
+ 8 9 ... 15 72 73 ... 79 200 201 ... 207
+ ... ... ...
+ 56 57 ... 63 120 121 127 248 249 ... 255
+
+****************************************************************/
+static void ov511_parse_data_grey(unsigned char * pIn0,
+ unsigned char * pOut0,
+ int iOutY,
+ int iWidth)
+
+{
+ int k, l, m;
+ unsigned char * pIn;
+ unsigned char * pOut, * pOut1;
+
+ pIn = pIn0;
+ pOut = pOut0 + iOutY;
+ for(k=0; k<4; k++) {
+ pOut1 = pOut;
+ for(l=0; l<8; l++) {
+ for(m=0; m<8; m++) {
+ *pOut1++ = *pIn++;
+ }
+ pOut1 += iWidth - 8;
+ }
+ pOut += 8;
+ }
+}
+
static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb)
{
unsigned char *cdata;
int n = urb->iso_frame_desc[i].actual_length;
int st = urb->iso_frame_desc[i].status;
urb->iso_frame_desc[i].actual_length = 0;
- urb->iso_frame_desc[i].status = 0;
+ urb->iso_frame_desc[i].status = 0;
cdata = urb->transfer_buffer + urb->iso_frame_desc[i].offset;
aPackNum[i] = n ? cdata[992] : -1;
if (!n || ov511->curframe == -1) continue;
+
if (st)
PDEBUG("data error: [%d] len=%d, status=%d", i, n, st);
cdata[4] | cdata[5] | cdata[6] | cdata[7]) == 0 &&
(cdata[8] & 8) && (cdata[8] & 0x80)) {
+ struct timeval *ts;
+ ts = (struct timeval *)(frame->data + MAX_FRAME_SIZE);
+ do_gettimeofday(ts);
#if 0
- PDEBUG("Found Frame End!, packnum = %d", (int)(cdata[992]));
- PDEBUG("Current frame = %d", ov511->curframe);
+ PDEBUG("Frame End, curframe = %d, packnum=%d, hw=%d, vw=%d",
+ ov511->curframe, (int)(cdata[992]),
+ (int)(cdata[9]), (int)(cdata[10]));
#endif
if (frame->scanstate == STATE_LINES) {
int iFrameNext;
+ frame->grabstate = FRAME_DONE;
if (waitqueue_active(&frame->wq)) {
+ frame->grabstate = FRAME_DONE;
+ wake_up_interruptible(&frame->wq);
+ }
+ /* If next frame is ready or grabbing, point to it */
+ iFrameNext = (ov511->curframe + 1) % OV511_NUMFRAMES;
+ if (ov511->frame[iFrameNext].grabstate== FRAME_READY ||
+ ov511->frame[iFrameNext].grabstate== FRAME_GRABBING) {
+ ov511->curframe = iFrameNext;
+ ov511->frame[iFrameNext].scanstate = STATE_SCANNING;
+ } else {
#if 0
- PDEBUG("About to wake up waiting processes");
-#endif
- frame->grabstate = FRAME_DONE;
- wake_up_interruptible(&frame->wq);
- }
- /* If next frame is ready or grabbing, point to it */
- iFrameNext = (ov511->curframe + 1) % OV511_NUMFRAMES;
- if (ov511->frame[iFrameNext].grabstate== FRAME_READY ||
- ov511->frame[iFrameNext].grabstate== FRAME_GRABBING) {
- ov511->curframe = iFrameNext;
- frame->scanstate = STATE_SCANNING;
- } else {
-#if 0
- PDEBUG("Frame not ready? state = %d",
- ov511->frame[iFrameNext].grabstate);
+ PDEBUG("Frame not ready? state = %d",
+ ov511->frame[iFrameNext].grabstate);
#endif
- ov511->curframe = -1;
- }
+ ov511->curframe = -1;
+ }
}
}
cdata[4] | cdata[5] | cdata[6] | cdata[7]) == 0 &&
(cdata[8] & 8)) {
#if 0
- PDEBUG("ov511: Found Frame Start!, packnum = %d", (int)(cdata[992]));
- PDEBUG("ov511: Frame Header Byte = 0x%x", (int)(cdata[8]));
+ PDEBUG("ov511: Found Frame Start!, framenum = %d",
+ ov511->curframe);
#endif
frame->scanstate = STATE_LINES;
frame->segment = 0;
if (frame->segment) {
pData = ov511->scratch;
iPix = - ov511->scratchlen;
- memmove(pData + ov511->scratchlen, cdata, iPix+384);
- } else {
+ memmove(pData + ov511->scratchlen, cdata,
+ iPix+frame->segsize);
+ } else {
pData = &cdata[iPix = 9];
- }
+ }
/* Parse the segments */
- while(iPix <= 992 - 384 &&
+ while(iPix <= 992 - frame->segsize &&
frame->segment < frame->width * frame->height / 256) {
- ov511_parse_data(pData, frame->data,
- frame->width,
- frame->segment);
+ int iSegY;
+ int iSegUV;
+ int iY, jY, iUV, jUV;
+ int iOutY, iOutUV;
+ unsigned char * pOut;
+
+ iSegY = iSegUV = frame->segment;
+ pOut = frame->data;
+
frame->segment++;
- iPix += 384;
+ iPix += frame->segsize;
+
+ if (frame->sub_flag) {
+ int iSeg1;
+ iSeg1 = iSegY / (ov511->subw / 32);
+ iSeg1 *= frame->width / 32;
+ iSegY = iSeg1 + (iSegY % (ov511->subw / 32));
+ if (iSegY >= frame->width * ov511->subh / 256)
+ break;
+
+ iSeg1 = iSegUV / (ov511->subw / 16);
+ iSeg1 *= frame->width / 16;
+ iSegUV = iSeg1 + (iSegUV % (ov511->subw / 16));
+
+ pOut += (ov511->subx +
+ ov511->suby * frame->width) * frame->depth;
+ }
+
+ iY = iSegY / (frame->width / WDIV);
+ jY = iSegY - iY * (frame->width / WDIV);
+ iOutY = (iY*HDIV*frame->width + jY*WDIV) * frame->depth;
+ iUV = iSegUV / (frame->width / WDIV * 2);
+ jUV = iSegUV - iUV * (frame->width / WDIV * 2);
+ iOutUV = (iUV*HDIV*2*frame->width + jUV*WDIV/2) * frame->depth;
+
+ if (frame->format == VIDEO_PALETTE_GREY) {
+ ov511_parse_data_grey(pData, pOut, iOutY, frame->width);
+ } else if (frame->format == VIDEO_PALETTE_RGB24) {
+ ov511_parse_data_rgb24(pData, pOut, iOutY, iOutUV, iY & 1,
+ frame->width);
+ }
pData = &cdata[iPix];
- }
+ }
/* Save extra data for next time */
if (frame->segment < frame->width * frame->height / 256) {
- memmove(ov511->scratch, pData, 992 - iPix);
ov511->scratchlen = 992 - iPix;
+ if (ov511->scratchlen < frame->segsize) {
+ memmove(ov511->scratch, pData, ov511->scratchlen);
+ } else {
+ ov511->scratchlen = 0;
+ }
}
}
}
int len;
struct usb_ov511 *ov511 = urb->context;
struct ov511_sbuf *sbuf;
- int i;
+
+ if (!ov511->dev)
+ return;
if (!ov511->streaming) {
PDEBUG("hmmm... not streaming, but got interrupt\n");
sbuf = &ov511->sbuf[ov511->cursbuf];
/* Copy the data received into our scratch buffer */
- if (ov511->curframe >= 0) {
+ if (ov511->curframe >= 0)
len = ov511_move_data(ov511, urb);
- }
-
- for (i = 0; i < FRAMES_PER_DESC; i++) {
- sbuf->urb->iso_frame_desc[i].status = 0;
- sbuf->urb->iso_frame_desc[i].actual_length = 0;
- }
+ else if (waitqueue_active(&ov511->wq))
+ wake_up_interruptible(&ov511->wq);
/* Move to the next sbuf */
ov511->cursbuf = (ov511->cursbuf + 1) % OV511_NUMSBUF;
static int ov511_init_isoc(struct usb_ov511 *ov511)
{
- struct usb_device *dev = ov511->dev;
urb_t *urb;
int fx, err;
return -ENOMEM;
}
ov511->sbuf[0].urb = urb;
- urb->dev = dev;
+ urb->dev = ov511->dev;
urb->context = ov511;
- urb->pipe = usb_rcvisocpipe(dev, OV511_ENDPOINT_ADDRESS);
+ urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
urb->transfer_flags = USB_ISO_ASAP;
urb->transfer_buffer = ov511->sbuf[0].data;
urb->complete = ov511_isoc_irq;
return -ENOMEM;
}
ov511->sbuf[1].urb = urb;
- urb->dev = dev;
+ urb->dev = ov511->dev;
urb->context = ov511;
- urb->pipe = usb_rcvisocpipe(dev, OV511_ENDPOINT_ADDRESS);
+ urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
urb->transfer_flags = USB_ISO_ASAP;
urb->transfer_buffer = ov511->sbuf[1].data;
urb->complete = ov511_isoc_irq;
err = usb_submit_urb(ov511->sbuf[0].urb);
if (err)
- err("ov511_init_isoc: usb_run_isoc(0) ret %d", err);
+ err("ov511_init_isoc: usb_submit_urb(0) ret %d", err);
err = usb_submit_urb(ov511->sbuf[1].urb);
if (err)
- err("ov511_init_isoc: usb_run_isoc(1) ret %d", err);
+ err("ov511_init_isoc: usb_submit_urb(1) ret %d", err);
ov511->streaming = 1;
static void ov511_stop_isoc(struct usb_ov511 *ov511)
{
- if (!ov511->streaming)
+ if (!ov511->streaming || !ov511->dev)
return;
ov511_set_packet_size(ov511, 0);
-
- /* Unschedule all of the iso td's */
- usb_unlink_urb(ov511->sbuf[1].urb);
- usb_unlink_urb(ov511->sbuf[0].urb);
ov511->streaming = 0;
- /* Delete them all */
- usb_free_urb(ov511->sbuf[1].urb);
- usb_free_urb(ov511->sbuf[0].urb);
+ /* Unschedule all of the iso td's */
+ if (ov511->sbuf[1].urb) {
+ ov511->sbuf[1].urb->next = NULL;
+ usb_unlink_urb(ov511->sbuf[1].urb);
+ usb_free_urb(ov511->sbuf[1].urb);
+ ov511->sbuf[1].urb = NULL;
+ }
+ if (ov511->sbuf[0].urb) {
+ ov511->sbuf[0].urb->next = NULL;
+ usb_unlink_urb(ov511->sbuf[0].urb);
+ usb_free_urb(ov511->sbuf[0].urb);
+ ov511->sbuf[0].urb = NULL;
+ }
}
static int ov511_new_frame(struct usb_ov511 *ov511, int framenum)
{
+#if 1
struct ov511_frame *frame;
int width, height;
+ if (!ov511->dev)
+ return -1;
+
/* If we're not grabbing a frame right now and the other frame is */
/* ready to be grabbed into, then use it instead */
if (ov511->curframe == -1) {
if (height > DEFAULT_HEIGHT)
height = DEFAULT_HEIGHT;
height = (height / 4) * 4; /* Multiple of 4 */
-
+
// /* We want a fresh frame every 30 we get */
// ov511->compress = (ov511->compress + 1) % 30;
+#endif
return 0;
}
-
/* Video 4 Linux API */
static int ov511_open(struct video_device *dev, int flags)
{
struct usb_ov511 *ov511 = (struct usb_ov511 *)dev;
PDEBUG("ov511_open");
-
+
down(&ov511->lock);
if (ov511->user)
goto out_unlock;
-
+
ov511->frame[0].grabstate = FRAME_UNUSED;
ov511->frame[1].grabstate = FRAME_UNUSED;
err = -ENOMEM;
-
- /* Allocate memory for the frame buffers */
- ov511->fbuf = rvmalloc(2 * MAX_FRAME_SIZE);
+
+ /* Allocate memory for the frame buffers */
+ ov511->fbuf = rvmalloc(2 * MAX_DATA_SIZE);
if (!ov511->fbuf)
goto open_err_ret;
ov511->frame[0].data = ov511->fbuf;
- ov511->frame[1].data = ov511->fbuf + MAX_FRAME_SIZE;
+ ov511->frame[1].data = ov511->fbuf + MAX_DATA_SIZE;
+ ov511->sub_flag = 0;
PDEBUG("frame [0] @ %p", ov511->frame[0].data);
PDEBUG("frame [1] @ %p", ov511->frame[1].data);
open_err_on1:
kfree (ov511->sbuf[0].data);
open_err_on0:
- rvfree(ov511->fbuf, 2 * MAX_FRAME_SIZE);
+ rvfree(ov511->fbuf, 2 * MAX_DATA_SIZE);
open_err_ret:
return err;
out_unlock:
ov511_stop_isoc(ov511);
- rvfree(ov511->fbuf, 2 * MAX_FRAME_SIZE);
+ rvfree(ov511->fbuf, 2 * MAX_DATA_SIZE);
kfree(ov511->sbuf[1].data);
kfree(ov511->sbuf[0].data);
up(&ov511->lock);
+
+ if (!ov511->dev) {
+ video_unregister_device(&ov511->vdev);
+ kfree(ov511);
+ }
}
static int ov511_init_done(struct video_device *dev)
return -EINVAL;
}
-// FIXME - Needs much work!!!
static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
{
struct usb_ov511 *ov511 = (struct usb_ov511 *)vdev;
#if 0
PDEBUG("IOCtl: 0x%X", cmd);
#endif
+
+ if (!ov511->dev)
+ return -EIO;
+
switch (cmd) {
case VIDIOCGCAP:
{
b.audios = 0;
b.maxwidth = DEFAULT_WIDTH;
b.maxheight = DEFAULT_HEIGHT;
- b.minwidth = 8;
- b.minheight = 4;
+ b.minwidth = 32;
+ b.minheight = 16;
if (copy_to_user(arg, &b, sizeof(b)))
return -EFAULT;
return 0;
}
+ case VIDIOCGCAPTURE:
+ {
+ int vf;
+ if (copy_from_user(&vf, arg, sizeof(vf)))
+ return -EFAULT;
+ ov511->sub_flag = vf;
+ return 0;
+ }
+ case VIDIOCSCAPTURE:
+ {
+ struct video_capture vc;
+
+ if (copy_from_user(&vc, arg, sizeof(vc)))
+ return -EFAULT;
+ if (vc.flags)
+ return -EINVAL;
+ if (vc.decimation)
+ return -EINVAL;
+ vc.x /= 4;
+ vc.x *= 4;
+ vc.y /= 2;
+ vc.y *= 2;
+ vc.width /= 32;
+ vc.width *= 32;
+ if (vc.width == 0) vc.width = 32;
+ vc.height /= 16;
+ vc.height *= 16;
+ if (vc.height == 0) vc.height = 16;
+
+ ov511->subx = vc.x;
+ ov511->suby = vc.y;
+ ov511->subw = vc.width;
+ ov511->subh = vc.height;
+
+ return 0;
+ }
case VIDIOCSWIN:
{
struct video_window vw;
struct video_mbuf vm;
memset(&vm, 0, sizeof(vm));
- vm.size = MAX_FRAME_SIZE * 2;
+ vm.size = 2 * MAX_DATA_SIZE;
vm.frames = 2;
vm.offsets[0] = 0;
- vm.offsets[1] = MAX_FRAME_SIZE;
+ vm.offsets[1] = MAX_FRAME_SIZE + sizeof (struct timeval);
if (copy_to_user((void *)arg, (void *)&vm, sizeof(vm)))
return -EFAULT;
vm.frame, vm.width, vm.height, vm.format);
#endif
- if (vm.format != VIDEO_PALETTE_RGB24)
+ if (vm.format != VIDEO_PALETTE_RGB24 &&
+ vm.format != VIDEO_PALETTE_GREY)
return -EINVAL;
if ((vm.frame != 0) && (vm.frame != 1))
/* Don't compress if the size changed */
if ((ov511->frame[vm.frame].width != vm.width) ||
- (ov511->frame[vm.frame].height != vm.height)) {
- ov511->compress = 0;
+ (ov511->frame[vm.frame].height != vm.height) ||
+ (ov511->frame[vm.frame].format != vm.format) ||
+ (ov511->frame[vm.frame].sub_flag !=
+ ov511->sub_flag)) {
+ /* If we're collecting previous frame wait
+ before changing modes */
+ interruptible_sleep_on(&ov511->wq);
+ if (signal_pending(current)) return -EINTR;
ov511_mode_init_regs(ov511,
- vm.width, vm.height, 0);
-#if 0
- PDEBUG("ov511: Setting frame %d to (%d, %d) : %d",
- vm.frame, vm.width, vm.height, 0);
-#endif
+ vm.width, vm.height,
+ vm.format, ov511->sub_flag);
}
ov511->frame[vm.frame].width = vm.width;
ov511->frame[vm.frame].height = vm.height;
+ ov511->frame[vm.frame].format = vm.format;
+ ov511->frame[vm.frame].sub_flag = ov511->sub_flag;
+ ov511->frame[vm.frame].segsize =
+ vm.format == VIDEO_PALETTE_RGB24 ? 384 : 256;
+ ov511->frame[vm.frame].depth =
+ vm.format == VIDEO_PALETTE_RGB24 ? 3 : 1;
/* Mark it as ready */
ov511->frame[vm.frame].grabstate = FRAME_READY;
return -EFAULT;
#if 0
- PDEBUG("syncing to frame %d", frame);
+ PDEBUG("syncing to frame %d, grabstate = %d", frame,
+ ov511->frame[frame].grabstate);
#endif
switch (ov511->frame[frame].grabstate) {
case FRAME_UNUSED:
case FRAME_GRABBING:
case FRAME_ERROR:
redo:
+ if (!ov511->dev)
+ return -EIO;
+
do {
#if 0
init_waitqueue_head(&ov511->frame[frame].wq);
if (!dev || !buf)
return -EFAULT;
+ if (!ov511->dev)
+ return -EIO;
+
/* See if a frame is completed, then use it. */
if (ov511->frame[0].grabstate >= FRAME_DONE) /* _DONE or _ERROR */
frmx = 0;
frame = &ov511->frame[frmx];
restart:
+ if (!ov511->dev)
+ return -EIO;
+
while (frame->grabstate == FRAME_GRABBING) {
interruptible_sleep_on(&ov511->frame[frmx].wq);
if (signal_pending(current))
unsigned long start = (unsigned long)adr;
unsigned long page, pos;
+ if (!ov511->dev)
+ return -EIO;
+
PDEBUG("mmap: %ld (%lX) bytes", size, size);
- if (size > (((2 * MAX_FRAME_SIZE) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
+ if (size > (((2 * MAX_DATA_SIZE) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
return -EINVAL;
pos = (unsigned long)ov511->fbuf;
return 0;
}
-// FIXME - needs V4L ID to be assigned
static struct video_device ov511_template = {
"OV511 USB Camera",
VID_TYPE_CAPTURE,
- VID_HARDWARE_CPIA, /* FIXME */
+ VID_HARDWARE_OV511,
ov511_open,
ov511_close,
ov511_read,
if(ov511_reg_write(dev, OV511_REG_I2C_SLAVE_ID_READ,
OV7610_I2C_READ_ID) < 0)
return -1;
-
- /* Reset the camera chip */
- if (ov511_i2c_reset(dev) < 0)
- return -1;
-#if 0
- if(usb_ov511_reg_write(dev, OV511_REG_I2C_CLOCK_PRESCALER,
- OV511_I2C_CLOCK_PRESCALER))
- return -1;
-#endif
-
if (ov511_reset(dev, OV511_RESET_NOREGS) < 0)
return -1;
+ if (ov511_i2c_write(dev, 0x12, 0x80) < 0) return -1;
+ schedule_timeout (1 + 150 * HZ / 1000);
+
/* Dummy read to sync I2C */
if(ov511_i2c_read(dev, 0x00) < 0)
return -1;
-
-
+
if((ov511_i2c_read(dev, OV7610_REG_ID_HIGH) != 0x7F) ||
(ov511_i2c_read(dev, OV7610_REG_ID_LOW) != 0xA2)) {
err("Failed to read OV7610 ID. You might not have an OV7610,");
static int ov511_configure(struct usb_ov511 *ov511)
{
struct usb_device *dev = ov511->dev;
+ int rc;
+
+ static struct ov511_regvals aRegvalsInit[] =
+ {{OV511_REG_BUS, OV511_REG_SYSTEM_RESET, 0x7f},
+ {OV511_REG_BUS, OV511_REG_SYSTEM_INIT, 0x01},
+ {OV511_REG_BUS, OV511_REG_SYSTEM_RESET, 0x7f},
+ {OV511_REG_BUS, OV511_REG_SYSTEM_INIT, 0x01},
+ {OV511_REG_BUS, OV511_REG_SYSTEM_RESET, 0x3f},
+ {OV511_REG_BUS, OV511_REG_SYSTEM_INIT, 0x01},
+ {OV511_REG_BUS, OV511_REG_SYSTEM_RESET, 0x3d},
+ {OV511_DONE_BUS, 0x0, 0x00},
+ };
+ static struct ov511_regvals aRegvalsNorm[] =
+ {{OV511_REG_BUS, 0x20, 1},
+#if 1
+ {OV511_REG_BUS, 0x52, 0x02},
+ {OV511_REG_BUS, 0x52, 0x00},
+ {OV511_REG_BUS, 0x31, 0x1f}, /* 0f */
+ {OV511_REG_BUS, 0x70, 0x3f},
+ {OV511_REG_BUS, 0x71, 0x3f},
+ {OV511_REG_BUS, 0x72, 0x01},
+ {OV511_REG_BUS, 0x73, 0x01},
+ {OV511_REG_BUS, 0x74, 0x01},
+ {OV511_REG_BUS, 0x75, 0x01},
+ {OV511_REG_BUS, 0x76, 0x01},
+ {OV511_REG_BUS, 0x77, 0x01},
+ {OV511_REG_BUS, 0x78, 0x06},
+ {OV511_REG_BUS, 0x79, 0x03},
+
+
+ {OV511_I2C_BUS, 0x10, 0xff},
+ {OV511_I2C_BUS, 0x16, 0x06},
+ {OV511_I2C_BUS, 0x28, 0x24}, /* 24 */
+ {OV511_I2C_BUS, 0x2b, 0xac},
+ {OV511_I2C_BUS, 0x5, 0x00},
+ {OV511_I2C_BUS, 0x6, 0x00},
+#if 0
+#endif
+ {OV511_I2C_BUS, 0x12, 0x00},
+ {OV511_I2C_BUS, 0x13, 0x00},
+ {OV511_I2C_BUS, 0x38, 0x81},
+ {OV511_I2C_BUS, 0x28, 0x24}, /* 0c */
+ {OV511_I2C_BUS, 0x05, 0x00},
+ {OV511_I2C_BUS, 0x0f, 0x05},
+ {OV511_I2C_BUS, 0x15, 0x01},
+ {OV511_I2C_BUS, 0x20, 0x1c},
+ {OV511_I2C_BUS, 0x23, 0x2a},
+ {OV511_I2C_BUS, 0x24, 0x10},
+ {OV511_I2C_BUS, 0x25, 0x8a},
+ {OV511_I2C_BUS, 0x26, 0x90},
+ {OV511_I2C_BUS, 0x27, 0xc2},
+ {OV511_I2C_BUS, 0x29, 0x03}, /* 91 */
+ {OV511_I2C_BUS, 0x2a, 0x04},
+ {OV511_I2C_BUS, 0x2c, 0xfe},
+ {OV511_I2C_BUS, 0x2d, 0x93}, /* d7 */
+ {OV511_I2C_BUS, 0x30, 0x71},
+ {OV511_I2C_BUS, 0x31, 0x60},
+ {OV511_I2C_BUS, 0x32, 0x26},
+ {OV511_I2C_BUS, 0x33, 0x20},
+ {OV511_I2C_BUS, 0x34, 0x48},
+ {OV511_I2C_BUS, 0x12, 0x24},
+ {OV511_I2C_BUS, 0x13, 0x01},
+ {OV511_I2C_BUS, 0x11, 0x01},
+ {OV511_I2C_BUS, 0x0c, 0x24},
+ {OV511_I2C_BUS, 0x0d, 0x24},
+#endif
+ {OV511_DONE_BUS, 0x0, 0x00},
+ };
/* Set altsetting 0 */
if (usb_set_interface(dev, ov511->iface, 0) < 0) {
init_waitqueue_head(&ov511->frame[0].wq);
init_waitqueue_head(&ov511->frame[1].wq);
+ init_waitqueue_head(&ov511->wq);
if (video_register_device(&ov511->vdev, VFL_TYPE_GRABBER) == -1) {
err("video_register_device failed");
return -EBUSY;
}
- /* Reset in case driver was unloaded and reloaded without unplug */
- if (ov511_reset(dev, OV511_RESET_ALL) < 0)
- goto error;
-
- /* Initialize system */
- if (ov511_reg_write(dev, OV511_REG_SYSTEM_INIT, 0x01) < 0) {
- err("enable system: command failed");
- goto error;
- }
-
- /* This seems to be necessary */
- if (ov511_reset(dev, OV511_RESET_ALL) < 0)
- goto error;
+ if ((rc = ov511_write_regvals(dev, aRegvalsInit)))
+ return rc;
if(ov7610_configure(dev) < 0) {
err("failed to configure OV7610");
ov511->frame[1].bytes_read = 0;
/* Initialize to DEFAULT_WIDTH, DEFAULT_HEIGHT, YUV4:2:0 */
- ov511_mode_init_regs(ov511, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0);
+ if ((rc = ov511_write_regvals(dev, aRegvalsNorm))) return rc;
+ if ((rc = ov511_mode_init_regs(ov511, DEFAULT_WIDTH, DEFAULT_HEIGHT,
+ VIDEO_PALETTE_RGB24, 0)) < 0) return rc;
+
return 0;
case 3:
printk("ov511: Camera is a D-Link DSB-C300\n");
break;
+ case 5:
+ printk("ov511: Camera is a Puretek PT-6007\n");
+ break;
case 21:
printk("ov511: Camera is a Creative Labs WebCam 3\n");
break;
struct usb_ov511 *ov511 = (struct usb_ov511 *) ptr;
- video_unregister_device(&ov511->vdev);
+// video_unregister_device(&ov511->vdev);
+
+ /* We don't want people trying to open up the device */
+ if (!ov511->user)
+ video_unregister_device(&ov511->vdev);
usb_driver_release_interface(&ov511_driver,
&ov511->dev->actconfig->interface[ov511->iface]);
+ ov511->dev = NULL;
+ ov511->frame[0].grabstate = FRAME_ERROR;
+ ov511->frame[1].grabstate = FRAME_ERROR;
+ ov511->curframe = -1;
+
+ /* This will cause the process to request another frame */
+ if (waitqueue_active(&ov511->frame[0].wq))
+ wake_up_interruptible(&ov511->frame[0].wq);
+ if (waitqueue_active(&ov511->frame[1].wq))
+ wake_up_interruptible(&ov511->frame[1].wq);
+ if (waitqueue_active(&ov511->wq))
+ wake_up_interruptible(&ov511->wq);
+
+ ov511->streaming = 0;
+
+ /* Unschedule all of the iso td's */
+ if (ov511->sbuf[1].urb) {
+ ov511->sbuf[1].urb->next = NULL;
+ usb_unlink_urb(ov511->sbuf[1].urb);
+ usb_free_urb(ov511->sbuf[1].urb);
+ ov511->sbuf[1].urb = NULL;
+ }
+ if (ov511->sbuf[0].urb) {
+ ov511->sbuf[0].urb->next = NULL;
+ usb_unlink_urb(ov511->sbuf[0].urb);
+ usb_free_urb(ov511->sbuf[0].urb);
+ ov511->sbuf[0].urb = NULL;
+ }
+
/* Free the memory */
- kfree(ov511); ov511 = NULL;
+ if (!ov511->user) {
+ kfree(ov511);
+ ov511 = NULL;
+ }
}
static struct usb_driver ov511_driver = {
/* Prototypes */
int usb_ov511_reg_read(struct usb_device *dev, unsigned char reg);
-int usb_ov511_reg_write(struct usb_device *dev, unsigned char reg, unsigned char value);
+int usb_ov511_reg_write(struct usb_device *dev,
+ unsigned char reg,
+ unsigned char value);
enum {
STATE_LINES, /* Parsing lines */
};
-struct ov511_frame_header {
- // FIXME - nothing here yet
-};
-
struct usb_device;
struct ov511_sbuf {
FRAME_ERROR, /* Something bad happened while processing */
};
+struct ov511_regvals {
+ enum {
+ OV511_DONE_BUS,
+ OV511_REG_BUS,
+ OV511_I2C_BUS,
+ } bus;
+ unsigned char reg;
+ unsigned char val;
+};
+
struct ov511_frame {
char *data; /* Frame buffer */
- struct ov511_frame_header header; /* Header from stream */
-
+ int depth; /* Bytes per pixel */
int width; /* Width application is expecting */
int height; /* Height */
int hdrwidth; /* Width the frame actually is */
int hdrheight; /* Height */
+ int sub_flag; /* Sub-capture mode for this frame? */
+ int format; /* Format for this frame */
+ int segsize; /* How big is each segment from the camera? */
+
volatile int grabstate; /* State of grabbing */
int scanstate; /* State of scanning */
char *fbuf; /* Videodev buffer area */
+ int sub_flag; /* Pix Array subcapture on flag */
+ int subx; /* Pix Array subcapture x offset */
+ int suby; /* Pix Array subcapture y offset */
+ int subw; /* Pix Array subcapture width */
+ int subh; /* Pix Array subcapture height */
+
int curframe; /* Current receiving sbuf */
struct ov511_frame frame[OV511_NUMFRAMES];
/* Scratch space from the Isochronous pipe */
unsigned char scratch[SCRATCH_BUF_SIZE];
int scratchlen;
+
+ wait_queue_head_t wq; /* Processes waiting */
};
#endif
static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
{
- DECLARE_WAITQUEUE(wait, current);
struct usblp *usblp = file->private_data;
int retval, timeout, writecount = 0;
static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
{
struct usblp *usblp = file->private_data;
- DECLARE_WAITQUEUE(wait, current);
if (!usblp->bidir)
return -EINVAL;
write: usblp_write,
open: usblp_open,
release: usblp_release,
- poll: usblp_poll
+ poll: usblp_poll,
};
static struct usb_driver usblp_driver = {
static struct
file_operations usb_scanner_fops = {
- NULL, /* seek */
- read_scanner,
- write_scanner,
- NULL, /* readdir */
- NULL, /* poll */
- ioctl_scanner,
- NULL, /* mmap */
- open_scanner,
- NULL, /* flush */
- close_scanner,
- NULL,
- NULL, /* fasync */
+ read: read_scanner,
+ write: write_scanner,
+ ioctl: ioctl_scanner,
+ open: open_scanner,
+ release: close_scanner,
};
static struct
}
static struct file_operations usb_fops = {
- NULL, /* seek */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- usb_open,
- NULL, /* flush */
- NULL /* release */
+ open: usb_open,
};
int usb_major_init(void)
}
static struct file_operations fb_fops = {
- NULL, /* lseek */
- fb_read, /* read */
- fb_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- fb_ioctl, /* ioctl */
- fb_mmap, /* mmap */
- fb_open, /* open */
- NULL, /* flush */
- fb_release, /* release */
- NULL /* fsync */
+ read: fb_read,
+ write: fb_write,
+ ioctl: fb_ioctl,
+ mmap: fb_mmap,
+ open: fb_open,
+ release: fb_release,
};
int
}
static struct file_operations proc_bus_zorro_operations = {
- proc_bus_zorro_lseek,
- proc_bus_zorro_read,
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ llseek: proc_bus_zorro_lseek,
+ read: proc_bus_zorro_read,
};
static struct inode_operations proc_bus_zorro_inode_operations = {
}
static struct file_operations adfs_dir_operations = {
- NULL, /* lseek - default */
- adfs_dir_no_read, /* read */
- NULL, /* write - bad */
- adfs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync, /* fsync */
- NULL, /* fasync */
+ read: adfs_dir_no_read,
+ readdir: adfs_readdir,
+ fsync: file_fsync,
};
static int
* the adfs filesystem.
*/
static struct file_operations adfs_file_operations = {
- NULL, /* lseek */
- generic_file_read, /* read */
+ read: generic_file_read,
+ mmap: generic_file_mmap,
+ fsync: file_fsync,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
- adfs_file_write, /* write */
-#else
- NULL,
+ write: adfs_file_write,
#endif
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- generic_file_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- file_fsync, /* fsync */
- NULL, /* fasync */
};
struct inode_operations adfs_file_inode_operations = {
static ssize_t affs_dir_read(struct file *, char *, size_t, loff_t *);
static struct file_operations affs_dir_operations = {
- NULL, /* lseek - default */
- affs_dir_read, /* read */
- NULL, /* write - bad */
- affs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync /* default fsync */
+ read: affs_dir_read,
+ readdir: affs_readdir,
+ fsync: file_fsync,
};
/*
static int alloc_ext_cache(struct inode *inode);
static struct file_operations affs_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- affs_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* no special open */
- NULL, /* flush */
- NULL, /* release */
- file_fsync, /* brute force, but works */
- NULL, /* fasync */
- NULL /* lock */
+ read: generic_file_read,
+ write: affs_file_write,
+ mmap: generic_file_mmap,
+ fsync: file_fsync,
};
struct inode_operations affs_file_inode_operations = {
};
static struct file_operations affs_file_operations_ofs = {
- NULL, /* lseek - default */
- affs_file_read_ofs, /* read */
- affs_file_write_ofs, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open */
- NULL, /* flush */
- NULL, /* release */
- file_fsync, /* brute force, but works */
- NULL, /* fasync */
- NULL /* lock */
+ read: affs_file_read_ofs,
+ write: affs_file_write_ofs,
+ fsync: file_fsync,
};
struct inode_operations affs_file_inode_operations_ofs = {
}
static struct file_operations autofs_dir_operations = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- autofs_dir_readdir, /* readdir */
+ readdir: autofs_dir_readdir,
};
struct inode_operations autofs_dir_inode_operations = {
static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
static struct file_operations autofs_root_operations = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- autofs_root_readdir, /* readdir */
- NULL, /* poll */
- autofs_root_ioctl, /* ioctl */
+ readdir: autofs_root_readdir,
+ ioctl: autofs_root_ioctl,
};
struct inode_operations autofs_root_inode_operations = {
static struct file_operations bad_file_ops =
{
- EIO_ERROR, /* lseek */
- EIO_ERROR, /* read */
- EIO_ERROR, /* write */
- EIO_ERROR, /* readdir */
- EIO_ERROR, /* select */
- EIO_ERROR, /* ioctl */
- EIO_ERROR, /* mmap */
- EIO_ERROR, /* open */
- EIO_ERROR, /* flush */
- EIO_ERROR, /* release */
- EIO_ERROR, /* fsync */
- EIO_ERROR, /* fasync */
- EIO_ERROR, /* lock */
+ llseek: EIO_ERROR,
+ read: EIO_ERROR,
+ write: EIO_ERROR,
+ readdir: EIO_ERROR,
+ poll: EIO_ERROR,
+ ioctl: EIO_ERROR,
+ mmap: EIO_ERROR,
+ open: EIO_ERROR,
+ flush: EIO_ERROR,
+ release: EIO_ERROR,
+ fsync: EIO_ERROR,
+ fasync: EIO_ERROR,
+ lock: EIO_ERROR,
};
struct inode_operations bad_inode_ops =
}
static struct file_operations bfs_dir_operations = {
- llseek: NULL,
read: bfs_dir_read,
- write: NULL,
readdir: bfs_readdir,
- poll: NULL,
- ioctl: NULL,
- mmap: NULL,
- open: NULL,
- flush: NULL,
- release: NULL,
fsync: file_fsync,
- fasync: NULL,
};
extern void dump_imap(const char *, struct super_block *);
}
static struct file_operations bfs_file_operations = {
- llseek: NULL,
read: generic_file_read,
write: bfs_file_write,
- readdir: NULL,
- poll: NULL,
- ioctl: NULL,
mmap: generic_file_mmap,
- open: NULL,
- flush: NULL,
- release: NULL,
- fsync: NULL,
- fasync: NULL,
};
static int bfs_move_block(unsigned long from, unsigned long to, kdev_t dev)
struct inode * inode = dentry->d_inode;
struct super_block * sb;
kdev_t dev;
+ int ret;
+ lock_kernel();
/* sync the inode to buffers */
write_inode_now(inode);
/* .. finally sync the buffers to disk */
dev = inode->i_dev;
- return sync_buffers(dev, 1);
+ ret = sync_buffers(dev, 1);
+ unlock_kernel();
+ return ret;
}
asmlinkage long sys_fsync(unsigned int fd)
struct inode * inode;
int err;
- lock_kernel();
err = -EBADF;
file = fget(fd);
if (!file)
out_putf:
fput(file);
out:
- unlock_kernel();
return err;
}
struct inode * inode;
int err;
- lock_kernel();
err = -EBADF;
file = fget(fd);
if (!file)
out_putf:
fput(file);
out:
- unlock_kernel();
return err;
}
};
struct file_operations coda_dir_operations = {
- NULL, /* lseek */
- NULL, /* read -- bad */
- NULL, /* write */
- coda_readdir, /* readdir */
- NULL, /* select */
- NULL, /* ioctl */
- NULL, /* mmap */
- coda_open, /* open */
- NULL,
- coda_release, /* release */
- coda_fsync, /* fsync */
+ readdir: coda_readdir,
+ open: coda_open,
+ release: coda_release,
+ fsync: coda_fsync,
};
};
struct file_operations coda_file_operations = {
- NULL, /* lseek - default should work for coda */
- coda_file_read, /* read */
- coda_file_write, /* write */
- NULL, /* readdir */
- NULL, /* select - default */
- NULL, /* ioctl */
- coda_file_mmap, /* mmap */
- coda_open, /* open */
- NULL,
- coda_release, /* release */
- coda_fsync, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ read: coda_file_read,
+ write: coda_file_write,
+ mmap: coda_file_mmap,
+ open: coda_open,
+ release: coda_release,
+ fsync: coda_fsync,
};
/* File file operations */
S_ISLNK(coda_inode->i_mode)))
return -EINVAL;
+ lock_kernel();
cnp = ITOC(coda_inode);
CHECK_CNODE(cnp);
cont_inode = cnp->c_ovp;
if ( cont_inode == NULL ) {
printk("coda_file_write: cached inode is 0!\n");
+ unlock_kernel();
return -1;
}
up(&cont_inode->i_sem);
coda_restore_codafile(coda_inode, coda_file, cont_inode, &cont_file);
+ unlock_kernel();
return result;
}
/*
};
struct file_operations coda_ioctl_operations = {
- NULL, /* lseek - default should work for coda */
- NULL, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* select - default */
- coda_pioctl, /* ioctl */
- NULL, /* mmap */
- coda_ioctl_open, /* open */
- NULL,
- coda_ioctl_release, /* release */
- NULL, /* fsync */
+ ioctl: coda_pioctl,
+ open: coda_ioctl_open,
+ release: coda_ioctl_release,
};
/* the coda pioctl inode ops */
static struct file_operations coda_psdev_fops = {
- NULL, /* llseek */
- coda_psdev_read, /* read */
- coda_psdev_write, /* write */
- NULL, /* coda_psdev_readdir */
- coda_psdev_poll, /* poll */
- NULL, /* ioctl */
- NULL, /* coda_psdev_mmap */
- coda_psdev_open, /* open */
- NULL,
- coda_psdev_release, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ read: coda_psdev_read,
+ write: coda_psdev_write,
+ poll: coda_psdev_poll,
+ open: coda_psdev_open,
+ release: coda_psdev_release,
};
* A regular file can be read and mmap'ed.
*/
static struct file_operations cramfs_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- NULL, /* write - bad */
- NULL, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl */
- generic_file_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: generic_file_read,
+ mmap: generic_file_mmap,
};
/*
* A directory can only readdir
*/
static struct file_operations cramfs_directory_operations = {
- NULL, /* lseek - default */
- NULL, /* read */
- NULL, /* write - bad */
- cramfs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ readdir: cramfs_readdir,
};
static struct inode_operations cramfs_file_inode_operations = {
* depending on the special file...
*/
static struct file_operations def_chr_fops = {
- open: chrdev_open
+ open: chrdev_open,
};
static struct inode_operations chrdev_inode_operations = {
static int devpts_revalidate(struct dentry *, int);
static struct file_operations devpts_root_operations = {
- NULL, /* llseek */
- NULL, /* read */
- NULL, /* write */
- devpts_root_readdir, /* readdir */
+ readdir: devpts_root_readdir,
};
struct inode_operations devpts_root_inode_operations = {
static int efs_readdir(struct file *, void *, filldir_t);
static struct file_operations efs_dir_operations = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- efs_readdir, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ readdir: efs_readdir,
};
extern int efs_get_block(struct inode *, long, struct buffer_head *, int);
}
static struct file_operations efs_file_operations = {
- NULL, /* lseek */
- generic_file_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- generic_file_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: generic_file_read,
+ mmap: generic_file_mmap,
};
struct inode_operations efs_file_inode_operations = {
static int ext2_readdir(struct file *, void *, filldir_t);
static struct file_operations ext2_dir_operations = {
- NULL, /* lseek - default */
- ext2_dir_read, /* read */
- NULL, /* write - bad */
- ext2_readdir, /* readdir */
- NULL, /* poll - default */
- ext2_ioctl, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- ext2_sync_file, /* fsync */
- NULL, /* fasync */
+ read: ext2_dir_read,
+ readdir: ext2_readdir,
+ ioctl: ext2_ioctl,
+ fsync: ext2_sync_file,
};
/*
* the ext2 filesystem.
*/
static struct file_operations ext2_file_operations = {
- ext2_file_lseek, /* lseek */
- generic_file_read, /* read */
- ext2_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- ext2_ioctl, /* ioctl */
- generic_file_mmap, /* mmap */
- ext2_open_file,
- NULL, /* flush */
- ext2_release_file, /* release */
- ext2_sync_file, /* fsync */
- NULL, /* fasync */
+ llseek: ext2_file_lseek,
+ read: generic_file_read,
+ write: ext2_file_write,
+ ioctl: ext2_ioctl,
+ mmap: generic_file_mmap,
+ open: ext2_open_file,
+ release: ext2_release_file,
+ fsync: ext2_sync_file,
};
struct inode_operations ext2_file_inode_operations = {
#include <linux/fs.h>
#include <linux/locks.h>
-
-
+#include <linux/smp_lock.h>
#define blocksize (EXT2_BLOCK_SIZE(inode->i_sb))
int wait, err = 0;
struct inode *inode = dentry->d_inode;
+ lock_kernel();
if (S_ISLNK(inode->i_mode) && !(inode->i_blocks))
/*
* Don't sync fast links!
}
skip:
err |= ext2_sync_inode (inode);
+ unlock_kernel();
return err ? -EIO : 0;
}
}
struct file_operations fat_dir_operations = {
- NULL, /* lseek - default */
- fat_dir_read, /* read */
- NULL, /* write - bad */
- fat_readdir, /* readdir */
- NULL, /* select v2.0.x/poll v2.1.x - default */
- fat_dir_ioctl, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync /* fsync */
+ read: fat_dir_read,
+ readdir: fat_readdir,
+ ioctl: fat_dir_ioctl,
+ fsync: file_fsync,
};
/*
#define Printk(x) printk x
static struct file_operations fat_file_operations = {
- NULL, /* lseek - default */
- fat_file_read, /* read */
- fat_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select v2.0.x/poll v2.1.x - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* no special open is needed */
- NULL, /* flush */
- NULL, /* release */
- file_fsync /* fsync */
+ read: fat_file_read,
+ write: fat_file_write,
+ mmap: generic_file_mmap,
+ fsync: file_fsync,
};
struct inode_operations fat_file_inode_operations = {
* depending on the access mode of the file...
*/
static struct file_operations def_fifo_fops = {
- open: fifo_open, /* will set read or write pipe_fops */
+ open: fifo_open, /* will set read or write pipe_fops */
};
struct inode_operations fifo_inode_operations = {
#define DOT_ROOTINFO (&hfs_cap_reserved2[0])
static struct file_operations hfs_cap_dir_operations = {
- NULL, /* lseek - default */
- hfs_dir_read, /* read - invalid */
- NULL, /* write - bad */
- cap_readdir, /* readdir */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- NULL, /* mmap - none */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync, /* fsync - default */
- NULL, /* fasync - default */
+ read: hfs_dir_read,
+ readdir: cap_readdir,
+ fsync: file_fsync,
};
struct inode_operations hfs_cap_ndir_inode_operations = {
#define PCNT_ROOTINFO (&hfs_dbl_reserved2[1])
static struct file_operations hfs_dbl_dir_operations = {
- NULL, /* lseek - default */
- hfs_dir_read, /* read - invalid */
- NULL, /* write - bad */
- dbl_readdir, /* readdir */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- NULL, /* mmap - none */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync, /* fsync - default */
- NULL, /* fasync - default */
+ read: hfs_dir_read,
+ readdir: dbl_readdir,
+ fsync: file_fsync,
};
struct inode_operations hfs_dbl_dir_inode_operations = {
#define ROOTINFO (&hfs_nat_reserved2[0])
static struct file_operations hfs_nat_dir_operations = {
- NULL, /* lseek - default */
- hfs_dir_read, /* read - invalid */
- NULL, /* write - bad */
- nat_readdir, /* readdir */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- NULL, /* mmap - none */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync, /* fsync - default */
- NULL, /* fasync - default */
- NULL /* lock - none */
+ read: hfs_dir_read,
+ readdir: nat_readdir,
+ fsync: file_fsync,
};
struct inode_operations hfs_nat_ndir_inode_operations = {
/*================ Global variables ================*/
static struct file_operations hfs_file_operations = {
- NULL, /* lseek - default */
- hfs_file_read, /* read */
- hfs_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- file_fsync, /* fsync - default */
- NULL, /* fasync - default */
- NULL /* lock - none */
+ read: hfs_file_read,
+ write: hfs_file_write,
+ mmap: generic_file_mmap,
+ fsync: file_fsync,
};
struct inode_operations hfs_file_inode_operations = {
/*================ Global variables ================*/
static struct file_operations hfs_cap_info_operations = {
- NULL, /* lseek - default */
- cap_info_read, /* read */
- cap_info_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- NULL, /* mmap - not yet */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync, /* fsync - default */
- NULL, /* fasync - default */
- NULL /* lock - none */
+ read: cap_info_read,
+ write: cap_info_write,
+ fsync: file_fsync,
};
struct inode_operations hfs_cap_info_inode_operations = {
/*================ Global variables ================*/
static struct file_operations hfs_hdr_operations = {
- NULL, /* lseek - default */
- hdr_read, /* read */
- hdr_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- NULL, /* mmap - XXX: not yet */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync, /* fsync - default */
- NULL, /* fasync - default */
- NULL /* lock - none */
+ read: hdr_read,
+ write: hdr_write,
+ fsync: file_fsync,
};
struct inode_operations hfs_hdr_inode_operations = {
static const struct file_operations hpfs_file_ops =
{
- NULL, /* lseek - default */
- generic_file_read, /* read */
- hpfs_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- hpfs_open, /* open */
- NULL, /* flush */
- hpfs_file_release, /* release */
- hpfs_file_fsync, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ read: generic_file_read,
+ write: hpfs_file_write,
+ mmap: generic_file_mmap,
+ open: hpfs_open,
+ release: hpfs_file_release,
+ fsync: hpfs_file_fsync,
};
static const struct inode_operations hpfs_file_iops =
static const struct file_operations hpfs_dir_ops =
{
- hpfs_dir_lseek, /* lseek */
- hpfs_dir_read, /* read */
- NULL, /* write - bad */
- hpfs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- hpfs_open, /* open */
- NULL, /* flush */
- hpfs_dir_release, /* no special release code */
- hpfs_file_fsync, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
+ llseek: hpfs_dir_lseek,
+ read: hpfs_dir_read,
+ readdir: hpfs_readdir,
+ open: hpfs_open,
+ release: hpfs_dir_release,
+ fsync: hpfs_file_fsync,
};
static const struct inode_operations hpfs_dir_iops =
static struct file_operations isofs_dir_operations =
{
- NULL, /* lseek - default */
- NULL, /* read */
- NULL, /* write - bad */
- isofs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ readdir: isofs_readdir,
};
/*
* the isofs filesystem.
*/
static struct file_operations isofs_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- NULL, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* no special open is needed */
- NULL, /* flush */
- NULL, /* release */
- NULL /* fsync */
+ read: generic_file_read,
+ mmap: generic_file_mmap,
};
struct inode_operations isofs_file_inode_operations = {
static int minix_readdir(struct file *, void *, filldir_t);
static struct file_operations minix_dir_operations = {
- NULL, /* lseek - default */
- minix_dir_read, /* read */
- NULL, /* write - bad */
- minix_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync /* default fsync */
+ read: minix_dir_read,
+ readdir: minix_readdir,
+ fsync: file_fsync,
};
/*
* the minix filesystem.
*/
static struct file_operations minix_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- minix_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* no special open is needed */
- NULL, /* flush */
- NULL, /* release */
- minix_sync_file, /* fsync */
- NULL, /* fasync */
+ read: generic_file_read,
+ write: minix_file_write,
+ mmap: generic_file_mmap,
+ fsync: minix_sync_file,
};
struct inode_operations minix_file_inode_operations = {
{
int wait, err = 0;
- if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
- S_ISLNK(inode->i_mode)))
- return -EINVAL;
-
+ lock_kernel();
for (wait=0; wait<=1; wait++)
{
err |= V1_sync_direct(inode, wait);
err |= V1_sync_dindirect(inode, inode->u.minix_i.u.i1_data + 8, wait);
}
err |= minix_sync_inode (inode);
+ unlock_kernel();
return (err < 0) ? -EIO : 0;
}
{
int wait, err = 0;
- if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
- S_ISLNK(inode->i_mode)))
- return -EINVAL;
-
+ lock_kernel();
for (wait=0; wait<=1; wait++)
{
err |= V2_sync_direct(inode, wait);
(unsigned long *) inode->u.minix_i.u.i2_data + 9, wait);
}
err |= minix_sync_inode (inode);
+ unlock_kernel();
return (err < 0) ? -EIO : 0;
}
{
struct inode *inode = dentry->d_inode;
+ if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
+ S_ISLNK(inode->i_mode)))
+ return -EINVAL;
+
if (INODE_VERSION(inode) == MINIX_V1)
return V1_minix_sync_file(inode, file);
else
static struct file_operations ncp_dir_operations =
{
- NULL, /* lseek - default */
- ncp_dir_read, /* read - bad */
- NULL, /* write - bad */
- ncp_readdir, /* readdir */
- NULL, /* poll - default */
- ncp_ioctl, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ read: ncp_dir_read,
+ readdir: ncp_readdir,
+ ioctl: ncp_ioctl,
};
struct inode_operations ncp_dir_inode_operations =
static struct file_operations ncp_file_operations =
{
- NULL, /* lseek - default */
- ncp_file_read, /* read */
- ncp_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- ncp_ioctl, /* ioctl */
- ncp_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- ncp_fsync, /* fsync */
+ read: ncp_file_read,
+ write: ncp_file_write,
+ ioctl: ncp_ioctl,
+ mmap: ncp_mmap,
+ fsync: ncp_fsync,
};
struct inode_operations ncp_file_inode_operations =
struct inode *, struct dentry *);
static struct file_operations nfs_dir_operations = {
- NULL, /* lseek - default */
- nfs_dir_read, /* read - bad */
- NULL, /* write - bad */
- nfs_readdir, /* readdir */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- nfs_open, /* open */
- NULL, /* flush */
- nfs_release, /* release */
- NULL /* fsync */
+ read: nfs_dir_read,
+ readdir: nfs_readdir,
+ open: nfs_open,
+ release: nfs_release,
};
struct inode_operations nfs_dir_inode_operations = {
static int nfs_fsync(struct file *, struct dentry *dentry);
static struct file_operations nfs_file_operations = {
- NULL, /* lseek - default */
- nfs_file_read, /* read */
- nfs_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select - default */
- NULL, /* ioctl - default */
- nfs_file_mmap, /* mmap */
- nfs_open, /* open */
- nfs_file_flush, /* flush */
- nfs_release, /* release */
- nfs_fsync, /* fsync */
- NULL, /* fasync */
- nfs_lock, /* lock */
+ read: nfs_file_read,
+ write: nfs_file_write,
+ mmap: nfs_file_mmap,
+ open: nfs_open,
+ flush: nfs_file_flush,
+ release: nfs_release,
+ fsync: nfs_fsync,
+ lock: nfs_lock,
};
struct inode_operations nfs_file_inode_operations = {
dfprintk(VFS, "nfs: fsync(%x/%ld)\n", inode->i_dev, inode->i_ino);
+ lock_kernel();
status = nfs_wb_file(inode, file);
if (!status) {
status = file->f_error;
file->f_error = 0;
}
+ unlock_kernel();
return status;
}
}
static struct file_operations ntfs_file_operations_nommap = {
- NULL, /* lseek */
- ntfs_read,
+ read: ntfs_read,
#ifdef CONFIG_NTFS_RW
- ntfs_write,
-#else
- NULL,
+ write: ntfs_write,
#endif
- NULL, /* readdir */
- NULL, /* select */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
};
static struct inode_operations ntfs_inode_operations_nobmap = {
}
static struct file_operations ntfs_file_operations = {
- NULL, /* lseek */
- ntfs_read,
+ read: ntfs_read,
+ mmap: generic_file_mmap,
#ifdef CONFIG_NTFS_RW
- ntfs_write,
-#else
- NULL,
+ write: ntfs_write,
#endif
- NULL, /* readdir */
- NULL, /* select */
- NULL, /* ioctl */
- generic_file_mmap,
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
- NULL, /* lock */
};
static struct inode_operations ntfs_inode_operations = {
};
static struct file_operations ntfs_dir_operations = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- ntfs_readdir, /* readdir */
+ readdir: ntfs_readdir,
};
static struct inode_operations ntfs_dir_inode_operations = {
}
static struct file_operations openpromfs_prop_ops = {
- NULL, /* lseek - default */
- property_read, /* read */
- property_write, /* write - bad */
- NULL, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- property_release, /* no special release code */
- NULL /* can't fsync */
+ read: property_read,
+ write: property_write,
+ release: property_release,
};
static struct inode_operations openpromfs_prop_inode_ops = {
};
static struct file_operations openpromfs_nodenum_ops = {
- NULL, /* lseek - default */
- nodenum_read, /* read */
- NULL, /* write - bad */
- NULL, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ read: nodenum_read,
};
static struct inode_operations openpromfs_nodenum_inode_ops = {
};
static struct file_operations openprom_alias_operations = {
- NULL, /* lseek - default */
- NULL, /* read - bad */
- NULL, /* write - bad */
- openpromfs_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ readdir: openpromfs_readdir,
};
static struct inode_operations openprom_alias_inode_operations = {
static struct file_operations openprom_operations = {
- NULL, /* lseek - default */
- NULL, /* read - bad */
- NULL, /* write - bad */
- openpromfs_readdir, /* readdir */
+ readdir: openpromfs_readdir,
};
static struct inode_operations openprom_inode_operations = {
* are also used in linux/fs/fifo.c to do operations on FIFOs.
*/
struct file_operations connecting_fifo_fops = {
- pipe_lseek,
- connect_read,
- bad_pipe_w,
- NULL, /* no readdir */
- connect_poll,
- pipe_ioctl,
- NULL, /* no mmap on pipes.. surprise */
- pipe_read_open,
- NULL, /* flush */
- pipe_read_release,
- NULL
+ llseek: pipe_lseek,
+ read: connect_read,
+ write: bad_pipe_w,
+ poll: connect_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_read_open,
+ release: pipe_read_release,
};
struct file_operations read_fifo_fops = {
- pipe_lseek,
- pipe_read,
- bad_pipe_w,
- NULL, /* no readdir */
- fifo_poll,
- pipe_ioctl,
- NULL, /* no mmap on pipes.. surprise */
- pipe_read_open,
- NULL, /* flush */
- pipe_read_release,
- NULL
+ llseek: pipe_lseek,
+ read: pipe_read,
+ write: bad_pipe_w,
+ poll: fifo_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_read_open,
+ release: pipe_read_release,
};
struct file_operations write_fifo_fops = {
- pipe_lseek,
- bad_pipe_r,
- pipe_write,
- NULL, /* no readdir */
- fifo_poll,
- pipe_ioctl,
- NULL, /* mmap */
- pipe_write_open,
- NULL, /* flush */
- pipe_write_release,
- NULL
+ llseek: pipe_lseek,
+ read: bad_pipe_r,
+ write: pipe_write,
+ poll: fifo_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_write_open,
+ release: pipe_write_release,
};
struct file_operations rdwr_fifo_fops = {
- pipe_lseek,
- pipe_read,
- pipe_write,
- NULL, /* no readdir */
- fifo_poll,
- pipe_ioctl,
- NULL, /* mmap */
- pipe_rdwr_open,
- NULL, /* flush */
- pipe_rdwr_release,
- NULL
+ llseek: pipe_lseek,
+ read: pipe_read,
+ write: pipe_write,
+ poll: fifo_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_rdwr_open,
+ release: pipe_rdwr_release,
};
struct file_operations read_pipe_fops = {
- pipe_lseek,
- pipe_read,
- bad_pipe_w,
- NULL, /* no readdir */
- pipe_poll,
- pipe_ioctl,
- NULL, /* no mmap on pipes.. surprise */
- pipe_read_open,
- NULL, /* flush */
- pipe_read_release,
- NULL
+ llseek: pipe_lseek,
+ read: pipe_read,
+ write: bad_pipe_w,
+ poll: pipe_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_read_open,
+ release: pipe_read_release,
};
struct file_operations write_pipe_fops = {
- pipe_lseek,
- bad_pipe_r,
- pipe_write,
- NULL, /* no readdir */
- pipe_poll,
- pipe_ioctl,
- NULL, /* mmap */
- pipe_write_open,
- NULL, /* flush */
- pipe_write_release,
- NULL
+ llseek: pipe_lseek,
+ read: bad_pipe_r,
+ write: pipe_write,
+ poll: pipe_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_write_open,
+ release: pipe_write_release,
};
struct file_operations rdwr_pipe_fops = {
- pipe_lseek,
- pipe_read,
- pipe_write,
- NULL, /* no readdir */
- pipe_poll,
- pipe_ioctl,
- NULL, /* mmap */
- pipe_rdwr_open,
- NULL, /* flush */
- pipe_rdwr_release,
- NULL
+ llseek: pipe_lseek,
+ read: pipe_read,
+ write: pipe_write,
+ poll: pipe_poll,
+ ioctl: pipe_ioctl,
+ open: pipe_rdwr_open,
+ release: pipe_rdwr_release,
};
static struct inode * get_pipe_inode(void)
}
static struct file_operations proc_maps_operations = {
- NULL, /* array_lseek */
- pid_maps_read,
+ read: pid_maps_read,
};
struct inode_operations proc_maps_inode_operations = {
}
static struct file_operations proc_info_file_operations = {
- NULL, /* lseek */
- proc_info_read, /* read */
+ read: proc_info_read,
};
static struct inode_operations proc_info_inode_operations = {
}
static struct file_operations proc_mem_operations = {
- NULL, /* lseek - default */
- mem_read,
- mem_write,
+ read: mem_read,
+ write: mem_write,
};
static struct inode_operations proc_mem_inode_operations = {
}
static struct file_operations proc_fd_operations = {
- NULL, /* lseek - default */
- proc_dir_read, /* read - bad */
- NULL, /* write - bad */
- proc_readfd, /* readdir */
+ read: proc_dir_read, /* read - bad */
+ readdir: proc_readfd, /* readdir */
};
/*
}
static struct file_operations proc_base_operations = {
- NULL, /* lseek - default */
- proc_dir_read, /* read - bad */
- NULL, /* write - bad */
- proc_base_readdir, /* readdir */
+ read: proc_dir_read, /* read - bad */
+ readdir: proc_base_readdir, /* readdir */
};
static struct inode_operations proc_base_inode_operations = {
}
static struct file_operations proc_file_operations = {
- proc_file_lseek, /* lseek */
- proc_file_read, /* read */
- proc_file_write, /* write */
+ llseek: proc_file_lseek,
+ read: proc_file_read,
+ write: proc_file_write,
};
static struct inode_operations proc_file_inode_operations = {
* the /proc directory.
*/
static struct file_operations proc_dir_operations = {
- NULL, /* lseek - default */
- NULL, /* read - bad */
- NULL, /* write - bad */
- proc_readdir, /* readdir */
+ readdir: proc_readdir,
};
/*
static ssize_t read_kcore(struct file *, char *, size_t, loff_t *);
static struct file_operations proc_kcore_operations = {
- NULL, /* lseek */
- read_kcore,
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- open_kcore
+ read: read_kcore,
+ open: open_kcore,
};
struct inode_operations proc_kcore_inode_operations = {
static struct file_operations proc_kmsg_operations = {
- NULL, /* kmsg_lseek */
- kmsg_read,
- NULL, /* kmsg_write */
- NULL, /* kmsg_readdir */
- kmsg_poll, /* kmsg_poll */
- NULL, /* kmsg_ioctl */
- NULL, /* mmap */
- kmsg_open,
- NULL, /* flush */
- kmsg_release,
- NULL /* can't fsync */
+ read: kmsg_read,
+ poll: kmsg_poll,
+ open: kmsg_open,
+ release: kmsg_release,
};
struct inode_operations proc_kmsg_inode_operations = {
}
static struct file_operations proc_profile_operations = {
- NULL, /* lseek */
- read_profile,
- write_profile,
+ read: read_profile,
+ write: write_profile,
};
static struct inode_operations proc_profile_inode_operations = {
* directory handling functions for that..
*/
static struct file_operations proc_root_operations = {
- NULL, /* lseek - default */
- NULL, /* read - bad */
- NULL, /* write - bad */
- proc_root_readdir, /* readdir */
+ readdir: proc_root_readdir,
};
/*
S_ISLNK(inode->i_mode)))
return -EINVAL;
+ lock_kernel();
for (wait = 0; wait <= 1; wait++) {
err |= sync_direct(inode, wait);
}
err |= qnx4_sync_inode(inode);
+ unlock_kernel();
return (err < 0) ? -EIO : 0;
}
/* Mapping from our types to the kernel */
static struct file_operations romfs_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- NULL, /* write - bad */
- NULL, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl */
- generic_file_mmap, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ read: generic_file_read,
+ mmap: generic_file_mmap,
};
static struct inode_operations romfs_file_inode_operations = {
};
static struct file_operations romfs_dir_operations = {
- NULL, /* lseek - default */
- NULL, /* read */
- NULL, /* write - bad */
- romfs_readdir, /* readdir */
+ readdir: romfs_readdir,
};
/* Merged dir/symlink op table. readdir/lookup/readlink/follow_link
static struct file_operations smb_dir_operations =
{
- NULL, /* lseek - default */
- smb_dir_read, /* read - bad */
- NULL, /* write - bad */
- smb_readdir, /* readdir */
- NULL, /* poll - default */
- smb_ioctl, /* ioctl */
- NULL, /* mmap */
- smb_dir_open, /* open(struct inode *, struct file *) */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ read: smb_dir_read,
+ readdir: smb_readdir,
+ ioctl: smb_ioctl,
+ open: smb_dir_open,
};
struct inode_operations smb_dir_inode_operations =
static struct file_operations smb_file_operations =
{
- NULL, /* lseek - default */
- smb_file_read, /* read */
- smb_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- smb_ioctl, /* ioctl */
- smb_file_mmap, /* mmap(struct file*, struct vm_area_struct*) */
- smb_file_open, /* open(struct inode*, struct file*) */
- NULL, /* flush */
- smb_file_release, /* release(struct inode*, struct file*) */
- smb_fsync, /* fsync(struct file*, struct dentry*) */
- NULL, /* fasync(struct file*, int) */
- NULL /* lock(struct file*, int, struct file_lock*) */
+ read: smb_file_read,
+ write: smb_file_write,
+ ioctl: smb_ioctl,
+ mmap: smb_file_mmap,
+ open: smb_file_open,
+ release: smb_file_release,
+ fsync: smb_fsync,
};
struct inode_operations smb_file_inode_operations =
static int sysv_readdir(struct file *, void *, filldir_t);
static struct file_operations sysv_dir_operations = {
- NULL, /* lseek - default */
- sysv_dir_read, /* read */
- NULL, /* write - bad */
- sysv_readdir, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- file_fsync /* default fsync */
+ read: sysv_dir_read,
+ readdir: sysv_readdir,
+ fsync: file_fsync,
};
/*
* the coh filesystem.
*/
static struct file_operations sysv_file_operations = {
- NULL, /* lseek - default */
- generic_file_read, /* read */
- sysv_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* no special open is needed */
- NULL, /* flush */
- NULL, /* release */
- sysv_sync_file, /* fsync */
- NULL, /* fasync */
+ read: generic_file_read,
+ write: sysv_file_write,
+ mmap: generic_file_mmap,
+ fsync: sysv_sync_file,
};
struct inode_operations sysv_file_inode_operations = {
S_ISLNK(inode->i_mode)))
return -EINVAL;
+ lock_kernel();
for (wait=0; wait<=1; wait++) {
err |= sync_direct(inode, wait);
err |= sync_indirect(inode, inode->u.sysv_i.i_data+10, 0, wait);
err |= sync_tindirect(inode, inode->u.sysv_i.i_data+12, 0, wait);
}
err |= sysv_sync_inode (inode);
+ unlock_kernel();
return (err < 0) ? -EIO : 0;
}
/* readdir and lookup functions */
static struct file_operations udf_dir_operations = {
- NULL, /* lllseek */
- NULL, /* read */
- NULL, /* write */
- udf_readdir, /* readdir */
- NULL, /* poll */
- udf_ioctl, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- udf_sync_file, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ readdir: udf_readdir,
+ ioctl: udf_ioctl,
+ fsync: udf_sync_file,
};
struct inode_operations udf_dir_inode_operations = {
}
static struct file_operations udf_file_operations = {
- udf_file_llseek, /* llseek */
- generic_file_read, /* read */
- udf_file_write, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- udf_ioctl, /* ioctl */
- generic_file_mmap, /* mmap */
- udf_open_file, /* open */
- NULL, /* flush */
- udf_release_file, /* release */
- udf_sync_file, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ llseek: udf_file_llseek,
+ read: generic_file_read,
+ write: udf_file_write,
+ ioctl: udf_ioctl,
+ mmap: generic_file_mmap,
+ open: udf_open_file,
+ release: udf_release_file,
+ fsync: udf_sync_file,
};
struct inode_operations udf_file_inode_operations = {
};
static struct file_operations udf_file_operations_adinicb = {
- udf_file_llseek, /* llseek */
- generic_file_read, /* read */
- udf_file_write_adinicb, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- udf_ioctl, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- udf_release_file, /* release */
- udf_sync_file_adinicb, /* fsync */
- NULL, /* fasync */
- NULL /* lock */
+ llseek: udf_file_llseek,
+ read: generic_file_read,
+ write: udf_file_write_adinicb,
+ ioctl: udf_ioctl,
+ release: udf_release_file,
+ fsync: udf_sync_file_adinicb,
};
struct inode_operations udf_file_inode_operations_adinicb = {
int wait, err = 0;
struct inode *inode = dentry->d_inode;
+ lock_kernel();
if (S_ISLNK(inode->i_mode) && !(inode->i_blocks))
{
/*
}
skip:
err |= udf_sync_inode (inode);
+ unlock_kernel();
return err ? -EIO : 0;
}
int udf_sync_file_adinicb(struct file * file, struct dentry *dentry)
{
- return udf_sync_inode(dentry->d_inode) ? -EIO : 0;
+ int ret;
+
+ lock_kernel();
+ ret = udf_sync_inode(dentry->d_inode) ? -EIO : 0;
+ unlock_kernel();
+ return ret;
}
}
static struct file_operations ufs_dir_operations = {
- NULL, /* lseek */
- NULL, /* read */
- NULL, /* write */
- ufs_readdir, /* readdir */
- NULL, /* select */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* open */
- NULL, /* flush */
- NULL, /* release */
- file_fsync, /* fsync */
- NULL, /* fasync */
+ readdir: ufs_readdir,
+ fsync: file_fsync,
};
struct inode_operations ufs_dir_inode_operations = {
* the ufs filesystem.
*/
static struct file_operations ufs_file_operations = {
- ufs_file_lseek, /* lseek */
- generic_file_read, /* read */
- ufs_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* poll - default */
- NULL, /* ioctl */
- generic_file_mmap, /* mmap */
- NULL, /* no special open is needed */
- NULL, /* flush */
- ufs_release_file, /* release */
- NULL, /* fsync */
- NULL, /* fasync */
+ llseek: ufs_file_lseek,
+ read: generic_file_read,
+ write: ufs_file_write,
+ mmap: generic_file_mmap,
+ release: ufs_release_file,
};
struct inode_operations ufs_file_inode_operations = {
static struct file_operations umsdos_dir_operations =
{
- NULL, /* lseek - default */
- dummy_dir_read, /* read */
- NULL, /* write - bad */
- UMSDOS_readdir, /* readdir */
- NULL, /* poll - default */
- UMSDOS_ioctl_dir, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ read: dummy_dir_read,
+ readdir: UMSDOS_readdir,
+ ioctl: UMSDOS_ioctl_dir,
};
struct inode_operations umsdos_dir_inode_operations =
*/
static struct file_operations umsdos_rdir_operations =
{
- NULL, /* lseek - default */
- dummy_dir_read, /* read */
- NULL, /* write - bad */
- UMSDOS_rreaddir, /* readdir */
- NULL, /* poll - default */
- UMSDOS_ioctl_dir, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* fsync */
+ read: dummy_dir_read,
+ readdir: UMSDOS_rreaddir,
+ ioctl: UMSDOS_ioctl_dir,
};
struct inode_operations umsdos_rdir_inode_operations =
typedef struct { unsigned long long pte; } pte_t;
typedef struct { unsigned long long pmd; } pmd_t;
typedef struct { unsigned long long pgd; } pgd_t;
+#define PTE_MASK (~(unsigned long long) (PAGE_SIZE-1))
#else
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pgd; } pgd_t;
+#define PTE_MASK PAGE_MASK
#endif
typedef struct { unsigned long pgprot; } pgprot_t;
#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
-#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
+#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
#include <linux/time.h> /* struct timeval */
#include <linux/net.h>
#include <linux/skbuff.h> /* struct sk_buff */
-#include <linux/atm.h>
#include <linux/uio.h>
#include <net/sock.h>
#include <asm/atomic.h>
#include <linux/types.h>
#include <asm/bitops.h>
#include <linux/module.h>
-#include <linux/mm.h>
#include <linux/hdreg.h>
#include <linux/sysctl.h>
-#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/smp_lock.h>
#include <linux/delay.h>
vsprintf(buf, fmt, args);
va_end(args);
printk(KERN_EMERG "Kernel panic: %s\n",buf);
- if (current == init_tasks[0])
- printk(KERN_EMERG "In swapper task - not syncing\n");
- else if (in_interrupt())
+ if (in_interrupt())
printk(KERN_EMERG "In interrupt handler - not syncing\n");
+ else if (!current->pid)
+ printk(KERN_EMERG "In idle task - not syncing\n");
else
sys_sync();
struct file_operations proc_sys_file_operations =
{
- NULL, /* lseek */
- proc_readsys, /* read */
- proc_writesys, /* write */
- NULL, /* readdir */
- NULL, /* poll */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* no special flush code */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ read: proc_readsys,
+ write: proc_writesys,
};
struct inode_operations proc_sys_inode_operations =
* Define allowed FILE OPERATIONS
*/
static struct file_operations mpc_file_operations = {
- NULL, /* lseek */
- proc_mpc_read, /* read */
- proc_mpc_write, /* write */
+ read: proc_mpc_read,
+ write: proc_mpc_write,
};
/*
loff_t *pos);
static struct file_operations proc_dev_atm_operations = {
- NULL, /* lseek */
- proc_dev_atm_read, /* read */
+ read: proc_dev_atm_read,
};
static struct file_operations proc_spec_atm_operations = {
- NULL, /* lseek */
- proc_spec_atm_read, /* read */
+ read: proc_spec_atm_read,
};
static struct inode_operations proc_dev_atm_inode_operations = {
static u_int irda_poll(struct file *file, poll_table *wait);
static struct file_operations irda_fops = {
- NULL, /* seek */
- irda_read, /* read */
- irda_write, /* write */
- NULL, /* readdir */
- irda_poll, /* poll */
- irda_ioctl, /* ioctl */
- NULL, /* mmap */
- irda_open,
- NULL,
- irda_close,
- NULL,
- NULL, /* fasync */
+ read: irda_read,
+ write: irda_write,
+ poll: irda_poll,
+ ioctl: irda_ioctl,
+ open: irda_open,
+ release: irda_close,
};
/* IrTTP */
static struct file_operations netlink_fops = {
- netlink_lseek,
- netlink_read,
- netlink_write,
- NULL, /* netlink_readdir */
- netlink_poll,
- netlink_ioctl,
- NULL, /* netlink_mmap */
- netlink_open,
- NULL, /* flush */
- netlink_release
+ llseek: netlink_lseek,
+ read: netlink_read,
+ write: netlink_write,
+ poll: netlink_poll,
+ ioctl: netlink_ioctl,
+ open: netlink_open,
+ release: netlink_release,
};
int __init init_netlink(void)
*/
static struct file_operations socket_file_ops = {
- sock_lseek,
- sock_read,
- sock_write,
- NULL, /* readdir */
- sock_poll,
- sock_ioctl,
- sock_mmap,
- sock_no_open, /* special open code to disallow open via /proc */
- NULL, /* flush */
- sock_close,
- NULL, /* no fsync */
- sock_fasync
+ llseek: sock_lseek,
+ read: sock_read,
+ write: sock_write,
+ poll: sock_poll,
+ ioctl: sock_ioctl,
+ mmap: sock_mmap,
+ open: sock_no_open, /* special open code to disallow open via /proc */
+ release: sock_close,
+ fasync: sock_fasync
};
/*
*/
static struct file_operations router_fops =
{
- NULL, /* lseek */
- router_proc_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* select */
- NULL, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ read: router_proc_read,
};
static struct inode_operations router_inode =
static struct file_operations wandev_fops =
{
- NULL, /* lseek */
- router_proc_read, /* read */
- NULL, /* write */
- NULL, /* readdir */
- NULL, /* select */
- wanrouter_ioctl, /* ioctl */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ read: router_proc_read,
+ ioctl: wanrouter_ioctl,
};
static struct inode_operations wandev_inode =