[Linux1394-cvslog] rev 528 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dde...@us...> - 2002-07-22 05:10:37
|
Author: ddennedy Date: Mon, 22 Jul 2002 01:10:16 -0400 New Revision: 528 Modified: trunk/dv1394-private.h trunk/dv1394.c Log: make dv1394 work without devfs, correct logic of empty packet insertion per intended meaning of cip_n and cip_d Modified: trunk/dv1394-private.h ============================================================================== --- trunk/dv1394-private.h (original) +++ trunk/dv1394-private.h Mon Jul 22 01:10:27 2002 @@ -602,7 +602,7 @@ calibrated against a Sony DSR-40 DVCAM deck */ #define CIP_N_NTSC 68000000 -#define CIP_D_NTSC 1000000000 +#define CIP_D_NTSC 1068000000 #define CIP_N_PAL 1 #define CIP_D_PAL 16 Modified: trunk/dv1394.c ============================================================================== --- trunk/dv1394.c (original) +++ trunk/dv1394.c Mon Jul 22 01:10:28 2002 @@ -382,10 +382,10 @@ /* is this an empty packet? */ - if(video->cip_accum > video->cip_d) { + if(video->cip_accum > (video->cip_d - video->cip_n)) { empty_packet = 1; payload_size = 8; - video->cip_accum -= video->cip_d; + video->cip_accum -= (video->cip_d - video->cip_n); } else { payload_size = 488; video->cip_accum += video->cip_n; @@ -2764,8 +2764,10 @@ video->id |= mode; else video->id |= 2 + mode; +#ifdef CONFIG_DEVFS_FS if (dv1394_devfs_add_entry(video) < 0) goto err_free; +#endif debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id); @@ -2788,7 +2790,9 @@ (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"), (video->mode == MODE_RECEIVE ? "in" : "out") ); +#ifdef CONFIG_DEVFS_FS dv1394_devfs_del(buf); +#endif #ifdef CONFIG_PROC_FS dv1394_procfs_del(buf); #endif @@ -2825,12 +2829,14 @@ spin_unlock_irqrestore(&dv1394_cards_lock, flags); n = (video->id >> 2); +#ifdef CONFIG_DEVFS_FS snprintf(buf, sizeof(buf), "dv/host%d/NTSC", n); dv1394_devfs_del(buf); snprintf(buf, sizeof(buf), "dv/host%d/PAL", n); dv1394_devfs_del(buf); snprintf(buf, sizeof(buf), "dv/host%d", n); dv1394_devfs_del(buf); +#endif #ifdef CONFIG_PROC_FS snprintf(buf, sizeof(buf), "dv/host%d/NTSC", n); @@ -2867,6 +2873,7 @@ } #endif +#ifdef CONFIG_DEVFS_FS devfs_entry = dv1394_devfs_find("dv"); if (devfs_entry != NULL) { snprintf(buf, sizeof(buf), "host%d", ohci->id); @@ -2874,6 +2881,7 @@ dv1394_devfs_add_dir("NTSC", devfs_entry, NULL); dv1394_devfs_add_dir("PAL", devfs_entry, NULL); } +#endif dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE); dv1394_init(ohci, DV1394_NTSC, MODE_TRANSMIT); @@ -3018,7 +3026,9 @@ { hpsb_unregister_highlevel (hl_handle); ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394); +#ifdef CONFIG_DEVFS_FS dv1394_devfs_del("dv"); +#endif #ifdef CONFIG_PROC_FS dv1394_procfs_del("dv"); #endif @@ -3032,17 +3042,21 @@ return -EIO; } +#ifdef CONFIG_DEVFS_FS if (dv1394_devfs_add_dir("dv", NULL, NULL) < 0) { printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/dv\n"); ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394); return -ENOMEM; } +#endif #ifdef CONFIG_PROC_FS if (dv1394_procfs_add_dir("dv",NULL,NULL) < 0) { printk(KERN_ERR "dv1394: unable to create /proc/bus/ieee1394/dv\n"); ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394); +#ifdef CONFIG_DEVFS_FS dv1394_devfs_del("dv"); +#endif return -ENOMEM; } #endif @@ -3051,7 +3065,9 @@ if (hl_handle == NULL) { printk(KERN_ERR "dv1394: hpsb_register_highlevel failed\n"); ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394); +#ifdef CONFIG_DEVFS_FS dv1394_devfs_del("dv"); +#endif #ifdef CONFIG_PROC_FS dv1394_procfs_del("dv"); #endif |