Thread: [Linux1394-cvslog] rev 814 - branches/linux-2.4
Brought to you by:
aeb,
bencollins
From: SVN U. <dde...@li...> - 2003-03-06 01:20:49
|
Author: ddennedy Date: 2003-03-05 20:19:53 -0500 (Wed, 05 Mar 2003) New Revision: 814 Modified: branches/linux-2.4/dv1394.c branches/linux-2.4/ieee1394_hotplug.h branches/linux-2.4/nodemgr.c branches/linux-2.4/raw1394.c branches/linux-2.4/video1394.c branches/linux-2.4/video1394.h Log: hotplugging for AV/C and Digital Camera Modified: branches/linux-2.4/ieee1394_hotplug.h ============================================================================== --- branches/linux-2.4/ieee1394_hotplug.h (original) +++ branches/linux-2.4/ieee1394_hotplug.h 2003-03-05 20:19:54.000000000 -0500 @@ -9,6 +9,14 @@ #define IEEE1394_MATCH_SPECIFIER_ID 0x0004 #define IEEE1394_MATCH_VERSION 0x0008 +/* + * Unit spec id and sw version entry for some protocols + */ +#define AVC_UNIT_SPEC_ID_ENTRY 0x0000A02D +#define AVC_SW_VERSION_ENTRY 0x00010001 +#define CAMERA_UNIT_SPEC_ID_ENTRY 0x0000A02D +#define CAMERA_SW_VERSION_ENTRY 0x00000100 + struct ieee1394_device_id { u32 match_flags; u32 vendor_id; Modified: branches/linux-2.4/raw1394.c ============================================================================== --- branches/linux-2.4/raw1394.c (original) +++ branches/linux-2.4/raw1394.c 2003-03-05 20:19:54.000000000 -0500 @@ -48,6 +48,7 @@ #include "highlevel.h" #include "iso.h" #include "ieee1394_transactions.h" +#include "ieee1394_hotplug.h" #include "raw1394.h" #include "raw1394-private.h" @@ -2484,6 +2485,66 @@ return 0; } +/*** HOTPLUG STUFF **********************************************************/ +/* + * Export information about protocols/devices supported by this driver. + */ +static struct ieee1394_device_id raw1394_id_table[] = { + { + .match_flags =IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff + }, + { + .match_flags =IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION, + .specifier_id = CAMERA_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = CAMERA_SW_VERSION_ENTRY & 0xffffff + }, + { } +}; + +static int raw1394_probe(struct unit_directory *ud); +static void raw1394_disconnect(struct unit_directory *ud); +static void raw1394_update(struct unit_directory *ud); + +static struct hpsb_protocol_driver raw1394_AVC_driver = { + .name = "raw1394 AV/C Driver", + .id_table = raw1394_id_table, + .probe = raw1394_probe, + .disconnect = raw1394_disconnect, + .update = raw1394_update +}; + +static struct hpsb_protocol_driver raw1394_CAMERA_driver = { + .name = "raw1394 Digital Camera Driver", + .id_table = raw1394_id_table, + .probe = raw1394_probe, + .disconnect = raw1394_disconnect, + .update = raw1394_update +}; + +MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table); + +static int raw1394_probe(struct unit_directory *ud) +{ + /* we should do an AV/C transaction to get a valid subunit, but since + Tape Recorder Player subunit is nearly the only thing on the market.... + */ + return 0; +} + +static void raw1394_disconnect(struct unit_directory *ud) +{ +} + +static void raw1394_update(struct unit_directory *ud) +{ +} + +/******************************************************************************/ + static struct hpsb_highlevel_ops hl_ops = { .add_host = add_host, .remove_host = remove_host, @@ -2526,6 +2587,8 @@ return -EBUSY; } printk(KERN_INFO "raw1394: /dev/%s device initialized\n", RAW1394_DEVICE_NAME); + hpsb_register_protocol(&raw1394_AVC_driver); + hpsb_register_protocol(&raw1394_CAMERA_driver); return 0; } Modified: branches/linux-2.4/nodemgr.c ============================================================================== --- branches/linux-2.4/nodemgr.c (original) +++ branches/linux-2.4/nodemgr.c 2003-03-05 20:19:54.000000000 -0500 @@ -890,6 +890,9 @@ /* * Right now registration always succeeds, but maybe we should * detect clashes in protocols handled by other drivers. + * DRD> No because multiple drivers are needed to handle certain devices. + * For example, a DV camera is an IEC 61883 device (dv1394) and AV/C (raw1394). + * This will become less an issue with libiec61883 using raw1394. */ return 0; Modified: branches/linux-2.4/video1394.c ============================================================================== --- branches/linux-2.4/video1394.c (original) +++ branches/linux-2.4/video1394.c 2003-03-05 20:19:55.000000000 -0500 @@ -52,6 +52,7 @@ #include "highlevel.h" #include "video1394.h" #include "dma.h" +#include "ieee1394_hotplug.h" #include "ohci1394.h" @@ -1241,6 +1242,50 @@ return 0; } +/*** HOTPLUG STUFF **********************************************************/ +/* + * Export information about protocols/devices supported by this driver. + */ +static struct ieee1394_device_id video1394_id_table[] = { + { + .match_flags =IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION, + .specifier_id = CAMERA_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = CAMERA_SW_VERSION_ENTRY & 0xffffff + }, + { } +}; + +static int video1394_probe(struct unit_directory *ud); +static void video1394_disconnect(struct unit_directory *ud); +static void video1394_update(struct unit_directory *ud); + +static struct hpsb_protocol_driver video1394_driver = { + .name = "1394 Digital Camera Driver", + .id_table = video1394_id_table, + .probe = video1394_probe, + .disconnect = video1394_disconnect, + .update = video1394_update +}; + +MODULE_DEVICE_TABLE(ieee1394, video1394_id_table); + +static int video1394_probe(struct unit_directory *ud) +{ + return 0; +} + +static void video1394_disconnect(struct unit_directory *ud) +{ + /* hmmm... unlisten? */ +} + +static void video1394_update(struct unit_directory *ud) +{ +} + +/******************************************************************************/ + static struct file_operations video1394_fops= { .owner = THIS_MODULE, @@ -1281,6 +1326,7 @@ S_IFCHR | S_IRUSR | S_IWUSR, &video1394_fops, NULL); + hpsb_register_protocol(&video1394_driver); return 0; } Modified: branches/linux-2.4/dv1394.c ============================================================================== --- branches/linux-2.4/dv1394.c (original) +++ branches/linux-2.4/dv1394.c 2003-03-05 20:19:55.000000000 -0500 @@ -117,6 +117,7 @@ #include "hosts.h" #include "ieee1394_core.h" #include "highlevel.h" +#include "ieee1394_hotplug.h" #include "dv1394.h" #include "dv1394-private.h" @@ -2564,6 +2565,53 @@ } #endif /* CONFIG_DEVFS_FS */ + +/*** HOTPLUG STUFF **********************************************************/ +/* + * Export information about protocols/devices supported by this driver. + */ +static struct ieee1394_device_id dv1394_id_table[] = { + { + .match_flags =IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff + }, + { } +}; + +static int dv1394_probe(struct unit_directory *ud); +static void dv1394_disconnect(struct unit_directory *ud); +static void dv1394_update(struct unit_directory *ud); + +static struct hpsb_protocol_driver dv1394_driver = { + .name = "DV/1394 Driver", + .id_table = dv1394_id_table, + .probe = dv1394_probe, + .disconnect = dv1394_disconnect, + .update = dv1394_update +}; + +MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table); + +static int dv1394_probe(struct unit_directory *ud) +{ + /* we should do an AV/C transaction to get a valid subunit, but since + Tape Recorder Player subunit is nearly the only thing on the market.... + */ + return 0; +} + +static void dv1394_disconnect(struct unit_directory *ud) +{ + /* hmmm... shutdown? */ +} + +static void dv1394_update(struct unit_directory *ud) +{ + /* research integration with dv1394_host_reset */ +} + /*** IEEE1394 HPSB CALLBACKS ***********************************************/ static int dv1394_init(struct ti_ohci *ohci, enum pal_or_ntsc format, enum modes mode) @@ -2642,6 +2690,8 @@ goto err_free; #endif + hpsb_register_protocol(&dv1394_driver); + debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id); return 0; Modified: branches/linux-2.4/video1394.h ============================================================================== --- branches/linux-2.4/video1394.h (original) +++ branches/linux-2.4/video1394.h 2003-03-05 20:19:55.000000000 -0500 @@ -75,5 +75,4 @@ struct timeval filltime; /* time of buffer full */ }; - #endif |