aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-03-07 12:12:36 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:03:05 -0500
commit937f687969f77bfeee5efd71cadfa6f1a813665e (patch)
treeb9b691299676369ffb1882ba668fa89e9675312b /drivers/firewire
parent65efffa8f0cd86a199bf19ede5c91552d35c5a38 (diff)
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: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-card.c7
-rw-r--r--drivers/firewire/fw-transaction.c34
-rw-r--r--drivers/firewire/fw-transaction.h1
3 files changed, 32 insertions, 10 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 3f8661a52acc..8d7c12164bb3 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -100,11 +100,12 @@ generate_config_rom (struct fw_card *card, size_t *config_rom_length)
100 i = 5; 100 i = 5;
101 config_rom[i++] = 0; 101 config_rom[i++] = 0;
102 config_rom[i++] = 0x0c0083c0; /* node capabilities */ 102 config_rom[i++] = 0x0c0083c0; /* node capabilities */
103 config_rom[i++] = 0x03d00d1e; /* vendor id */
104 j = i + descriptor_count; 103 j = i + descriptor_count;
105 104
106 /* Generate root directory entries for descriptors. */ 105 /* Generate root directory entries for descriptors. */
107 list_for_each_entry (desc, &descriptor_list, link) { 106 list_for_each_entry (desc, &descriptor_list, link) {
107 if (desc->immediate > 0)
108 config_rom[i++] = desc->immediate;
108 config_rom[i] = desc->key | (j - i); 109 config_rom[i] = desc->key | (j - i);
109 i++; 110 i++;
110 j += desc->length; 111 j += desc->length;
@@ -165,6 +166,8 @@ fw_core_add_descriptor (struct fw_descriptor *desc)
165 166
166 list_add_tail (&desc->link, &descriptor_list); 167 list_add_tail (&desc->link, &descriptor_list);
167 descriptor_count++; 168 descriptor_count++;
169 if (desc->immediate > 0)
170 descriptor_count++;
168 update_config_roms(); 171 update_config_roms();
169 172
170 up_write(&fw_bus_type.subsys.rwsem); 173 up_write(&fw_bus_type.subsys.rwsem);
@@ -180,6 +183,8 @@ fw_core_remove_descriptor (struct fw_descriptor *desc)
180 183
181 list_del(&desc->link); 184 list_del(&desc->link);
182 descriptor_count--; 185 descriptor_count--;
186 if (desc->immediate > 0)
187 descriptor_count--;
183 update_config_roms(); 188 update_config_roms();
184 189
185 up_write(&fw_bus_type.subsys.rwsem); 190 up_write(&fw_bus_type.subsys.rwsem);
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index abc37fa52492..8e2b94557390 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -720,23 +720,37 @@ MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
720MODULE_DESCRIPTION("Core IEEE1394 transaction logic"); 720MODULE_DESCRIPTION("Core IEEE1394 transaction logic");
721MODULE_LICENSE("GPL"); 721MODULE_LICENSE("GPL");
722 722
723static const u32 vendor_textual_descriptor_data[] = { 723static const u32 vendor_textual_descriptor[] = {
724 /* textual descriptor leaf () */ 724 /* textual descriptor leaf () */
725 0x00080000, 725 0x00060000,
726 0x00000000, 726 0x00000000,
727 0x00000000, 727 0x00000000,
728 0x4c696e75, /* L i n u */ 728 0x4c696e75, /* L i n u */
729 0x78204669, /* x F i */ 729 0x78204669, /* x F i */
730 0x72657769, /* r e w i */ 730 0x72657769, /* r e w i */
731 0x72652028, /* r e ( */ 731 0x72650000, /* r e */
732 0x4a554a55, /* J U J U */
733 0x29000000, /* ) */
734}; 732};
735 733
736static struct fw_descriptor vendor_textual_descriptor = { 734static const u32 model_textual_descriptor[] = {
737 .length = ARRAY_SIZE(vendor_textual_descriptor_data), 735 /* model descriptor leaf () */
736 0x00030000,
737 0x00000000,
738 0x00000000,
739 0x4a756a75, /* J u j u */
740};
741
742static struct fw_descriptor vendor_id_descriptor = {
743 .length = ARRAY_SIZE(vendor_textual_descriptor),
744 .immediate = 0x03d00d1e,
738 .key = 0x81000000, 745 .key = 0x81000000,
739 .data = vendor_textual_descriptor_data, 746 .data = vendor_textual_descriptor,
747};
748
749static struct fw_descriptor model_id_descriptor = {
750 .length = ARRAY_SIZE(model_textual_descriptor),
751 .immediate = 0x17000001,
752 .key = 0x81000000,
753 .data = model_textual_descriptor,
740}; 754};
741 755
742static int __init fw_core_init(void) 756static int __init fw_core_init(void)
@@ -748,7 +762,9 @@ static int __init fw_core_init(void)
748 return retval; 762 return retval;
749 763
750 /* Add the vendor textual descriptor. */ 764 /* Add the vendor textual descriptor. */
751 retval = fw_core_add_descriptor(&vendor_textual_descriptor); 765 retval = fw_core_add_descriptor(&vendor_id_descriptor);
766 BUG_ON(retval < 0);
767 retval = fw_core_add_descriptor(&model_id_descriptor);
752 BUG_ON(retval < 0); 768 BUG_ON(retval < 0);
753 769
754 return 0; 770 return 0;
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index cbea845dc40a..552e9af081e9 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -164,6 +164,7 @@ struct fw_request;
164struct fw_descriptor { 164struct fw_descriptor {
165 struct list_head link; 165 struct list_head link;
166 size_t length; 166 size_t length;
167 u32 immediate;
167 u32 key; 168 u32 key;
168 const u32 *data; 169 const u32 *data;
169}; 170};