Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189066
b: refs/heads/master
c: 5ae7351
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Mar 24, 2010
1 parent 85a732b commit b6e0883
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8301b91ba0b2d15c86fdf5357efe7c04eb767a6e
refs/heads/master: 5ae73518cb39dd81e641dfa7ce20751c853579e0
40 changes: 14 additions & 26 deletions trunk/drivers/firewire/core-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,44 +180,32 @@ static int fw_unit_match(struct device *dev, struct device_driver *drv)
return 0;
}

static int get_modalias(struct fw_unit *unit, char *buffer, size_t buffer_size)
static void get_modalias_ids(const u32 *directory, int *id)
{
struct fw_device *device = fw_parent_device(unit);
struct fw_csr_iterator ci;

int key, value;
int vendor = 0;
int model = 0;
int specifier_id = 0;
int version = 0;

fw_csr_iterator_init(&ci, &device->config_rom[5]);
fw_csr_iterator_init(&ci, directory);
while (fw_csr_iterator_next(&ci, &key, &value)) {
switch (key) {
case CSR_VENDOR:
vendor = value;
break;
case CSR_MODEL:
model = value;
break;
case CSR_VENDOR: id[0] = value; break;
case CSR_MODEL: id[1] = value; break;
case CSR_SPECIFIER_ID: id[2] = value; break;
case CSR_VERSION: id[3] = value; break;
}
}
}

fw_csr_iterator_init(&ci, unit->directory);
while (fw_csr_iterator_next(&ci, &key, &value)) {
switch (key) {
case CSR_SPECIFIER_ID:
specifier_id = value;
break;
case CSR_VERSION:
version = value;
break;
}
}
static int get_modalias(struct fw_unit *unit, char *buffer, size_t buffer_size)
{
int id[] = {0, 0, 0, 0};

get_modalias_ids(&fw_parent_device(unit)->config_rom[5], id);
get_modalias_ids(unit->directory, id);

return snprintf(buffer, buffer_size,
"ieee1394:ven%08Xmo%08Xsp%08Xver%08X",
vendor, model, specifier_id, version);
id[0], id[1], id[2], id[3]);
}

static int fw_unit_uevent(struct device *dev, struct kobj_uevent_env *env)
Expand Down

0 comments on commit b6e0883

Please sign in to comment.