提交 937f6879 编写于 作者: K Kristian Høgsberg 提交者: Stefan Richter

firewire: Let an fw_descriptor specify a leading immediate key/value pair.

This lets us break out "Juju" as the model name in the config rom.
Signed-off-by: NKristian Høgsberg <krh@redhat.com>
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
上级 65efffa8
...@@ -100,11 +100,12 @@ generate_config_rom (struct fw_card *card, size_t *config_rom_length) ...@@ -100,11 +100,12 @@ generate_config_rom (struct fw_card *card, size_t *config_rom_length)
i = 5; i = 5;
config_rom[i++] = 0; config_rom[i++] = 0;
config_rom[i++] = 0x0c0083c0; /* node capabilities */ config_rom[i++] = 0x0c0083c0; /* node capabilities */
config_rom[i++] = 0x03d00d1e; /* vendor id */
j = i + descriptor_count; j = i + descriptor_count;
/* Generate root directory entries for descriptors. */ /* Generate root directory entries for descriptors. */
list_for_each_entry (desc, &descriptor_list, link) { list_for_each_entry (desc, &descriptor_list, link) {
if (desc->immediate > 0)
config_rom[i++] = desc->immediate;
config_rom[i] = desc->key | (j - i); config_rom[i] = desc->key | (j - i);
i++; i++;
j += desc->length; j += desc->length;
...@@ -165,6 +166,8 @@ fw_core_add_descriptor (struct fw_descriptor *desc) ...@@ -165,6 +166,8 @@ fw_core_add_descriptor (struct fw_descriptor *desc)
list_add_tail (&desc->link, &descriptor_list); list_add_tail (&desc->link, &descriptor_list);
descriptor_count++; descriptor_count++;
if (desc->immediate > 0)
descriptor_count++;
update_config_roms(); update_config_roms();
up_write(&fw_bus_type.subsys.rwsem); up_write(&fw_bus_type.subsys.rwsem);
...@@ -180,6 +183,8 @@ fw_core_remove_descriptor (struct fw_descriptor *desc) ...@@ -180,6 +183,8 @@ fw_core_remove_descriptor (struct fw_descriptor *desc)
list_del(&desc->link); list_del(&desc->link);
descriptor_count--; descriptor_count--;
if (desc->immediate > 0)
descriptor_count--;
update_config_roms(); update_config_roms();
up_write(&fw_bus_type.subsys.rwsem); up_write(&fw_bus_type.subsys.rwsem);
......
...@@ -720,23 +720,37 @@ MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); ...@@ -720,23 +720,37 @@ MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
MODULE_DESCRIPTION("Core IEEE1394 transaction logic"); MODULE_DESCRIPTION("Core IEEE1394 transaction logic");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static const u32 vendor_textual_descriptor_data[] = { static const u32 vendor_textual_descriptor[] = {
/* textual descriptor leaf () */ /* textual descriptor leaf () */
0x00080000, 0x00060000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x4c696e75, /* L i n u */ 0x4c696e75, /* L i n u */
0x78204669, /* x F i */ 0x78204669, /* x F i */
0x72657769, /* r e w i */ 0x72657769, /* r e w i */
0x72652028, /* r e ( */ 0x72650000, /* r e */
0x4a554a55, /* J U J U */
0x29000000, /* ) */
}; };
static struct fw_descriptor vendor_textual_descriptor = { static const u32 model_textual_descriptor[] = {
.length = ARRAY_SIZE(vendor_textual_descriptor_data), /* model descriptor leaf () */
0x00030000,
0x00000000,
0x00000000,
0x4a756a75, /* J u j u */
};
static struct fw_descriptor vendor_id_descriptor = {
.length = ARRAY_SIZE(vendor_textual_descriptor),
.immediate = 0x03d00d1e,
.key = 0x81000000, .key = 0x81000000,
.data = vendor_textual_descriptor_data, .data = vendor_textual_descriptor,
};
static struct fw_descriptor model_id_descriptor = {
.length = ARRAY_SIZE(model_textual_descriptor),
.immediate = 0x17000001,
.key = 0x81000000,
.data = model_textual_descriptor,
}; };
static int __init fw_core_init(void) static int __init fw_core_init(void)
...@@ -748,7 +762,9 @@ static int __init fw_core_init(void) ...@@ -748,7 +762,9 @@ static int __init fw_core_init(void)
return retval; return retval;
/* Add the vendor textual descriptor. */ /* Add the vendor textual descriptor. */
retval = fw_core_add_descriptor(&vendor_textual_descriptor); retval = fw_core_add_descriptor(&vendor_id_descriptor);
BUG_ON(retval < 0);
retval = fw_core_add_descriptor(&model_id_descriptor);
BUG_ON(retval < 0); BUG_ON(retval < 0);
return 0; return 0;
......
...@@ -164,6 +164,7 @@ struct fw_request; ...@@ -164,6 +164,7 @@ struct fw_request;
struct fw_descriptor { struct fw_descriptor {
struct list_head link; struct list_head link;
size_t length; size_t length;
u32 immediate;
u32 key; u32 key;
const u32 *data; const u32 *data;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册