#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/autoconf.h>
#include <linux/vmalloc.h>
#include <asm/system.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/delay.h>
#include <asm/uaccess.h>
#include <asm/elphel/driver_numbers.h>
#include <asm/elphel/c313a.h>
#include <asm/elphel/exifa.h>
#include "fpgactrl.h"
#include "exif353.h"
Include dependency graph for exif353.c:
Go to the source code of this file.
Data Structures | |
struct | exif_time_t |
struct | exif_datetime_t |
Defines | |
#define | D(x) |
#define | X3X3_EXIF_DRIVER_NAME "Elphel (R) model 353 Exif device driver" |
Functions | |
static int | exif_open (struct inode *inode, struct file *filp) |
++++++++++++++++++++++++++++++++++++ open() ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
static int | exif_release (struct inode *inode, struct file *filp) |
++++++++++++++++++++++++++++++++++++ release() ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
static loff_t | exif_lseek (struct file *file, loff_t offset, int orig) |
++++++++++++++++++++++++++++++++++++ lseek() ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
static ssize_t | exif_write (struct file *file, const char *buf, size_t count, loff_t *off) |
++++++++++++++++++++++++++++++++++++ write() ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
static ssize_t | exif_read (struct file *file, char *buf, size_t count, loff_t *off) |
++++++++++++++++++++++++++++++++++++ read() ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
static int __init | exif_init (void) |
++++++++++++++++++++++++++++++++++++ _init() ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
ssize_t | minor_file_size (int minor) |
ssize_t | minor_max_size (int minor) |
void | exif_invalidate (void) |
int | exif_rebuild (int frames) |
int | exif_enable (int en) |
int | dir_find_tag (unsigned long tag) |
void | write_meta_raw_irq (char *data, int offset, int len) |
find location of the tag field in meta page using long tag (Exif tag and tag group) | |
int | write_meta_irq (char *data, int *indx, unsigned long ltag, int len) |
void | putlong_meta_raw_irq (unsigned long data, int offset) |
int | putlong_meta_irq (unsigned long data, int *indx, unsigned long ltag) |
void | write_meta_raw (char *data, int offset, int len) |
int | write_meta (char *data, int *indx, unsigned long ltag, int len) |
void | putlong_meta_raw (unsigned long data, int offset) |
int | putlong_meta (unsigned long data, int *indx, unsigned long ltag) |
char * | encode_time (unsigned long sec, unsigned long usec) |
int | store_meta (void) |
module_init (exif_init) | |
MODULE_LICENSE ("GPL") | |
MODULE_AUTHOR ("Andrey Filippov <andrey@elphel.com>.") | |
MODULE_DESCRIPTION (X3X3_EXIF_DRIVER_NAME) | |
Variables | |
static struct exif_dir_table_t | dir_table [MAX_EXIF_FIELDS] |
static int | exif_fields = 0 |
static int | exif_template_size = 0 |
static int | exif_meta_size = 0 |
static int | exif_wp = 1 |
static char | exif_template [MAX_EXIF_SIZE] |
static int | exif_enabled = 0 |
static int | exif_valid = 0 |
static char * | meta_buffer = NULL |
static struct exif_time_t | exif_time |
static struct exif_datetime_t | now_datetime |
static struct file_operations | exif_fops |
#define D | ( | x | ) |
******************************************************************************** ! FILE NAME : exif353.c ! DESCRIPTION: Drivers for Exif manipulation ! Copyright (C) 2008 Elphel, Inc. ! -----------------------------------------------------------------------------** ! ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** !
int dir_find_tag | ( | unsigned long | tag | ) |
Definition at line 213 of file exif353.c.
References dir_table, exif_fields, and src.
Referenced by exif_lseek().
char* encode_time | ( | unsigned long | sec, | |
unsigned long | usec | |||
) |
Definition at line 337 of file exif353.c.
References d, D, exif_datetime_t::datetime, exif_time, memcpy(), now_datetime, printk, s, exif_datetime_t::subsec, exif_time_t::today_date, exif_time_t::today_sec, and exif_time_t::tomorrow_date.
Referenced by updateIRQ_Exif().
int exif_enable | ( | int | en | ) |
Definition at line 201 of file exif353.c.
References exif_enabled, exif_rebuild(), exif_valid, and MAX_EXIF_FRAMES.
Referenced by exif_lseek(), and listener_loop().
static int __init exif_init | ( | void | ) | [static] |
++++++++++++++++++++++++++++++++++++ _init() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Definition at line 664 of file exif353.c.
References exif_fops, KERN_ERR, printk, X3X3_EXIF_DRIVER_NAME, and X3X3_EXIF_MAJOR.
void exif_invalidate | ( | void | ) |
Definition at line 165 of file exif353.c.
References exif_enabled, and exif_valid.
Referenced by exif_lseek(), and exif_write().
static loff_t exif_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) | [static] |
++++++++++++++++++++++++++++++++++++ lseek() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
overload
Definition at line 455 of file exif353.c.
References dir_find_tag(), exif_enable(), exif_invalidate(), EXIF_LSEEK_DISABLE, EXIF_LSEEK_INVALIDATE, EXIF_LSEEK_REBUILD, EXIF_LSEEK_TODAY_DATE, EXIF_LSEEK_TODAY_SEC, EXIF_LSEEK_TOMORROW_DATE, EXIF_LSEEK_TOMORROW_SEC, exif_rebuild(), exif_template_size, exif_time, fp, int, MAX_EXIF_FRAMES, minor_file_size(), minor_max_size(), SEEK_CUR, SEEK_END, SEEK_SET, exif_time_t::today_date, exif_time_t::today_sec, exif_time_t::tomorrow_date, exif_time_t::tomorrow_sec, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
static int exif_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) | [static] |
++++++++++++++++++++++++++++++++++++ open() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Definition at line 409 of file exif353.c.
References D, minor_file_size(), pd, printk, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
static ssize_t exif_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) | [static] |
++++++++++++++++++++++++++++++++++++ read() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Or is it possible to disable IRQ while copy_from_user()?
Definition at line 596 of file exif353.c.
References D, dir_table, dst, exif_enabled, exif_fields, exif_meta_size, exif_template, exif_template_size, exif_time, int, exif_dir_table_t::len, MAX_EXIF_SIZE, memcpy(), meta_buffer, minor_file_size(), printk, src, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
int exif_rebuild | ( | int | frames | ) |
Definition at line 171 of file exif353.c.
References dir_table, exif_enabled, exif_fields, exif_meta_size, exif_valid, exif_wp, MAX_EXIF_FRAMES, MAX_EXIF_SIZE, memset(), meta_buffer, printk, and src.
Referenced by exif_enable(), and exif_lseek().
static int exif_release | ( | struct inode * | inode, | |
struct file * | filp | |||
) | [static] |
++++++++++++++++++++++++++++++++++++ release() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Definition at line 430 of file exif353.c.
References D, minor_file_size(), pd, printk, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
static ssize_t exif_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) | [static] |
++++++++++++++++++++++++++++++++++++ write() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
Or is it possible to disable IRQ while copy_from_user()?
Definition at line 544 of file exif353.c.
References D, dir_table, exif_enabled, exif_fields, exif_invalidate(), exif_template, exif_template_size, exif_time, flags, int, local_irq_restore, local_irq_save, MAX_EXIF_SIZE, memcpy(), meta_buffer, minor_max_size(), printk, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
ssize_t minor_file_size | ( | int | minor | ) |
Definition at line 145 of file exif353.c.
References exif_enabled, exif_fields, exif_meta_size, exif_template_size, MAX_EXIF_FRAMES, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
Referenced by exif_lseek(), exif_open(), exif_read(), and exif_release().
ssize_t minor_max_size | ( | int | minor | ) |
Definition at line 155 of file exif353.c.
References MAX_EXIF_FIELDS, MAX_EXIF_FRAMES, MAX_EXIF_SIZE, X3X3_EXIF_EXIF, X3X3_EXIF_META, X3X3_EXIF_METADIR, X3X3_EXIF_TEMPLATE, and X3X3_EXIF_TIME.
Referenced by exif_lseek(), and exif_write().
MODULE_AUTHOR | ( | "Andrey Filippov <andrey@elphel.com>." | ) |
MODULE_DESCRIPTION | ( | X3X3_EXIF_DRIVER_NAME | ) |
module_init | ( | exif_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
int putlong_meta | ( | unsigned long | data, | |
int * | indx, | |||
unsigned long | ltag | |||
) |
Definition at line 299 of file exif353.c.
References dir_table, exif_enabled, exif_fields, flags, local_irq_restore, local_irq_save, memcpy(), meta_buffer, src, and exif_dir_table_t::src.
int putlong_meta_irq | ( | unsigned long | data, | |
int * | indx, | |||
unsigned long | ltag | |||
) | [inline] |
Definition at line 245 of file exif353.c.
References dir_table, exif_enabled, exif_fields, memcpy(), meta_buffer, src, and exif_dir_table_t::src.
Referenced by updateIRQ_Exif().
void putlong_meta_raw | ( | unsigned long | data, | |
int | offset | |||
) |
Definition at line 288 of file exif353.c.
References exif_enabled, flags, local_irq_restore, local_irq_save, memcpy(), and meta_buffer.
void putlong_meta_raw_irq | ( | unsigned long | data, | |
int | offset | |||
) | [inline] |
int store_meta | ( | void | ) |
Definition at line 398 of file exif353.c.
References exif_enabled, exif_meta_size, exif_wp, MAX_EXIF_FRAMES, memcpy(), and meta_buffer.
Referenced by updateIRQ_Exif().
int write_meta | ( | char * | data, | |
int * | indx, | |||
unsigned long | ltag, | |||
int | len | |||
) |
Definition at line 270 of file exif353.c.
References dir_table, exif_enabled, exif_fields, flags, local_irq_restore, local_irq_save, memcpy(), meta_buffer, src, and exif_dir_table_t::src.
int write_meta_irq | ( | char * | data, | |
int * | indx, | |||
unsigned long | ltag, | |||
int | len | |||
) | [inline] |
Definition at line 224 of file exif353.c.
References dir_table, exif_enabled, exif_fields, memcpy(), meta_buffer, src, and exif_dir_table_t::src.
Referenced by updateIRQ_Exif().
void write_meta_raw | ( | char * | data, | |
int | offset, | |||
int | len | |||
) |
Definition at line 261 of file exif353.c.
References exif_enabled, flags, local_irq_restore, local_irq_save, memcpy(), and meta_buffer.
void write_meta_raw_irq | ( | char * | data, | |
int | offset, | |||
int | len | |||
) | [inline] |
find location of the tag field in meta page using long tag (Exif tag and tag group)
Definition at line 220 of file exif353.c.
References exif_enabled, memcpy(), and meta_buffer.
struct exif_dir_table_t dir_table[MAX_EXIF_FIELDS] [static] |
Definition at line 104 of file exif353.c.
Referenced by dir_find_tag(), exif_read(), exif_rebuild(), exif_write(), putlong_meta(), putlong_meta_irq(), write_meta(), and write_meta_irq().
int exif_enabled = 0 [static] |
Definition at line 111 of file exif353.c.
Referenced by exif_enable(), exif_invalidate(), exif_read(), exif_rebuild(), exif_write(), minor_file_size(), putlong_meta(), putlong_meta_irq(), putlong_meta_raw(), putlong_meta_raw_irq(), store_meta(), write_meta(), write_meta_irq(), write_meta_raw(), and write_meta_raw_irq().
int exif_fields = 0 [static] |
Definition at line 105 of file exif353.c.
Referenced by dir_find_tag(), exif_read(), exif_rebuild(), exif_write(), minor_file_size(), putlong_meta(), putlong_meta_irq(), write_meta(), and write_meta_irq().
struct file_operations exif_fops [static] |
Initial value:
{ owner: THIS_MODULE, open: exif_open, release: exif_release, read: exif_read, write: exif_write, llseek: exif_lseek }
Definition at line 137 of file exif353.c.
Referenced by exif_init().
int exif_meta_size = 0 [static] |
Definition at line 107 of file exif353.c.
Referenced by exif_read(), exif_rebuild(), minor_file_size(), and store_meta().
char exif_template[MAX_EXIF_SIZE] [static] |
int exif_template_size = 0 [static] |
Definition at line 106 of file exif353.c.
Referenced by exif_lseek(), exif_read(), exif_write(), and minor_file_size().
struct exif_time_t exif_time [static] |
Referenced by encode_time(), exif_lseek(), exif_read(), and exif_write().
int exif_valid = 0 [static] |
Definition at line 112 of file exif353.c.
Referenced by exif_enable(), exif_invalidate(), and exif_rebuild().
int exif_wp = 1 [static] |
char* meta_buffer = NULL [static] |
Definition at line 114 of file exif353.c.
Referenced by exif_read(), exif_rebuild(), exif_write(), putlong_meta(), putlong_meta_irq(), putlong_meta_raw(), putlong_meta_raw_irq(), store_meta(), write_meta(), write_meta_irq(), write_meta_raw(), and write_meta_raw_irq().
struct exif_datetime_t now_datetime [static] |
Referenced by encode_time().