Commit 7abbacd9 authored by Andrey Filippov's avatar Andrey Filippov

fixing exif-related bugs

parent 2b8f9342
......@@ -74,12 +74,17 @@
static const char * const exif393_devs[]={
DEV393_DEVNAME(DEV393_EXIF_TEMPLATE),
DEV393_DEVNAME(DEV393_TIFF_TEMPLATE),
DEV393_DEVNAME(DEV393_EXIF_METADIR),
DEV393_DEVNAME(DEV393_EXIF_TIME),
DEV393_DEVNAME(DEV393_EXIF0),
DEV393_DEVNAME(DEV393_EXIF1),
DEV393_DEVNAME(DEV393_EXIF2),
DEV393_DEVNAME(DEV393_EXIF3),
DEV393_DEVNAME(DEV393_TIFF0),
DEV393_DEVNAME(DEV393_TIFF1),
DEV393_DEVNAME(DEV393_TIFF2),
DEV393_DEVNAME(DEV393_TIFF3),
DEV393_DEVNAME(DEV393_EXIF_META0),
DEV393_DEVNAME(DEV393_EXIF_META1),
DEV393_DEVNAME(DEV393_EXIF_META2),
......@@ -90,12 +95,17 @@ static const int exif393_major = DEV393_MAJOR(DEV393_EXIF_TEMPLATE);
static const int exif393_minor[]={
DEV393_MINOR(DEV393_EXIF_TEMPLATE),
DEV393_MINOR(DEV393_TIFF_TEMPLATE),
DEV393_MINOR(DEV393_EXIF_METADIR),
DEV393_MINOR(DEV393_EXIF_TIME),
DEV393_MINOR(DEV393_EXIF0),
DEV393_MINOR(DEV393_EXIF1),
DEV393_MINOR(DEV393_EXIF2),
DEV393_MINOR(DEV393_EXIF3),
DEV393_MINOR(DEV393_TIFF0),
DEV393_MINOR(DEV393_TIFF1),
DEV393_MINOR(DEV393_TIFF2),
DEV393_MINOR(DEV393_TIFF3),
DEV393_MINOR(DEV393_EXIF_META0),
DEV393_MINOR(DEV393_EXIF_META1),
DEV393_MINOR(DEV393_EXIF_META2),
......@@ -202,6 +212,8 @@ ssize_t minor_max_size(int minor) { //return max file size for different minors
switch (minor) {
case DEV393_MINOR(DEV393_EXIF_TEMPLATE):
return MAX_EXIF_SIZE;
case DEV393_MINOR(DEV393_TIFF_TEMPLATE):
return MAX_EXIF_SIZE;
case DEV393_MINOR(DEV393_EXIF0):
case DEV393_MINOR(DEV393_EXIF1):
case DEV393_MINOR(DEV393_EXIF2):
......@@ -609,7 +621,7 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
switch (p) {
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): // enable/disable
case DEV393_MINOR(DEV393_TIFF_TEMPLATE): // both files offer the same lseek commands
// case DEV393_MINOR(DEV393_TIFF_TEMPLATE): // both files offer the same lseek commands
switch (offset) {
case EXIF_LSEEK_DISABLE:
exif_enable(0);
......@@ -709,7 +721,7 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
int disabled_err=0;
dev_dbg(g_devfp_ptr,"minor=0x%x\n", p);
if ((*off+count)>maxsize) {
if ((*off+count) > maxsize) {
// dev_warn(g_devfp_ptr,"%s:%d: Data (0x%x) does not fit into 0x%x bytes\n",__FILE__,__LINE__, (int) (*off+count), maxsize);
dev_dbg(g_devfp_ptr,"Data (0x%x) does not fit into 0x%x bytes, minor = 0x%x\n",(int) (*off+count), maxsize, p);
return -EOVERFLOW;
......
......@@ -20,15 +20,14 @@
#define <DEVICE_RFEFERENCE> ("<dev path>", "<driver_name>", major, minor,"<permissions>","<b/c>") [optional comment]
* Access to individual fields is provide with the macros defined below, for example:
* DEV393_PATH(DEV393_EXIF_TEMPLATE) returns "/dev/exif_template,
* DEV393_MAJOR(DEV393_EXIF_TEMPLATE) returns 2 */
* DEV393_MAJOR(DEV393_EXIF_TEMPLATE) returns 2
* DO NOT COMMET OUT defines with // ! */
#define DEV393_EXIF_TEMPLATE ("exif_template", "exif_elphel", 125, 2, "0666", "c") ///< write Exif template
#define DEV393_EXIF_METADIR ("exif_metadir", "exif_elphel", 125, 3, "0666", "c") ///< write metadata to Exif header translation (dir_table[MAX_EXIF_FIELDS])
#define DEV393_EXIF_TIME ("exif_time", "exif_elphel", 125, 4, "0666", "c") ///< write today/tomorrow date (YYYY:MM:DD) and number of seconds at today/tomorrow
///< midnight (00:00:00) in seconds from epoch (long, starting from LSB)
#define DEV393_TIFF_TEMPLATE ("tiff_template", "exif_elphel", 125, 5, "0666", "c") ///< write Tiff template
//#define DEV393_TIFF_METADIR ("tiff_metadir", "exif_elphel", 125, 6, "0666", "c") ///< write metadata to Tiff header translation (dir_table[MAX_EXIF_FIELDS])
#define DEV393_EXIF0 ("exif_exif0", "exif_elphel", 125, 16, "0666", "c") ///< sensor port 0: read encoded Exif data (SEEK_END)
#define DEV393_EXIF1 ("exif_exif1", "exif_elphel", 125, 17, "0666", "c") ///< sensor port 1: read encoded Exif data (SEEK_END)
......@@ -46,11 +45,6 @@
#define DEV393_TIFF3 ("tiff_tiff3", "exif_elphel", 125, 27, "0666", "c") ///< sensor port 3: read encoded Tiff data (SEEK_END)
// Meta data common for Exif and Tiff
//#define DEV393_TIFF_META0 ("tiff_meta0", "exif_elphel", 125, 40, "0666", "c") ///< sensor port 0: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META1 ("tiff_meta1", "exif_elphel", 125, 41, "0666", "c") ///< sensor port 1: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META2 ("tiff_meta2", "exif_elphel", 125, 42, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META3 ("tiff_meta3", "exif_elphel", 125, 43, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic
#define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",130,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",130,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment