Re: (no subject)
Brought to you by:
aeb,
bencollins
From: Dan D. <da...@de...> - 2003-05-06 21:33:23
|
See the code in libavc1394 CVS at http://sf.net/projects/libavc1394/ under the librom1394 directory and the accompanying example program. It uses the raw1394 functions to get and set the config ROM image, but it shows adding a unit directory like what you are looking for. On Tue, 2003-05-06 at 04:52, Pieter Willems wrote: > Hello, > > I would like to make some changes to the config rom for my my FireWire > application. I Found that the definition of it is located in the > ohci1394.c file in the function ohci_init_config_rom(). > I used it to change the textual descriptor of the root directory and the > vendor ID. I also added a Module Hw Version with it. > But I still have a few problems. > > -I would like to create a unit directory with 2 leaves. It would > have to look a little like this: > > -- unit directory > |_ Unit spec ID = myname (0xmyvalue) > |_ Unit Sw Version = 0xmyvalue > > I don't realy know how to do this. Do you have any ideas? This is the > code of my ohci_init_config_rom() so far: > > static void ohci_init_config_rom(struct ti_ohci *ohci) > { > struct config_rom_ptr cr; > > memset(&cr, 0, sizeof(cr)); > memset(ohci->csr_config_rom_cpu, 0, sizeof > (ohci->csr_config_rom_cpu)); > > cr.data = ohci->csr_config_rom_cpu; > > /* Bus info block */ > cf_unit_begin(&cr, 0); > cf_put_1quad(&cr, reg_read(ohci, OHCI1394_BusID)); > cf_put_1quad(&cr, reg_read(ohci, OHCI1394_BusOptions)); > cf_put_1quad(&cr, reg_read(ohci, OHCI1394_GUIDHi)); > cf_put_1quad(&cr, reg_read(ohci, OHCI1394_GUIDLo)); > cf_unit_end(&cr); > > DBGMSG(ohci->id, "GUID: %08x:%08x", reg_read(ohci, > OHCI1394_GUIDHi), > reg_read(ohci, OHCI1394_GUIDLo)); > > /* IEEE P1212 suggests the initial ROM header CRC should only > * cover the header itself (and not the entire ROM). Since we do > * this, then we can make our bus_info_len the same as the CRC > * length. */ > ohci->csr_config_rom_cpu[0] |= cpu_to_be32( > (be32_to_cpu(ohci->csr_config_rom_cpu[0]) & 0x00ff0000) > << 8); > reg_write(ohci, OHCI1394_ConfigROMhdr, > be32_to_cpu(ohci->csr_config_rom_cpu[0])); > > /* Root directory */ > cf_unit_begin(&cr, 1); > /* Vendor ID */ > cf_put_keyval(&cr, 0x03, 0x00094B); > cf_put_refer(&cr, 0x81, 2); /* Textual description > unit */ > cf_put_keyval(&cr, 0x0c, 0x0083c0); /* Node capabilities */ > /* NOTE: Add other unit referers here, and append at bottom */ > //cf_put_keyval(&cr, 0x04, 0x991029); > //cf_put_keyval(&cr, 0x0A, 0x00094B); > cf_put_keyval(&cr, 0x0B, 0x000802); > cf_unit_end(&cr); > > /* Textual description - "Linux 1394" */ > cf_unit_begin(&cr, 2); > cf_put_keyval(&cr, 0, 0); > cf_put_1quad(&cr, 0); > cf_put_str(&cr, "FillFactory NV"); > cf_unit_end(&cr); > > ohci->csr_config_rom_length = cr.data - > ohci->csr_config_rom_cpu; } > > Thanks already! > > Pieter > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > mailing list Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux1394-user |