aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/nodemgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/nodemgr.c')
-rw-r--r--drivers/ieee1394/nodemgr.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 2376b729e876..79ef5fd928ae 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -115,8 +115,14 @@ static int nodemgr_bus_read(struct csr1212_csr *csr, u64 addr, u16 length,
115 return error; 115 return error;
116} 116}
117 117
118#define OUI_FREECOM_TECHNOLOGIES_GMBH 0x0001db
119
118static int nodemgr_get_max_rom(quadlet_t *bus_info_data, void *__ci) 120static int nodemgr_get_max_rom(quadlet_t *bus_info_data, void *__ci)
119{ 121{
122 /* Freecom FireWire Hard Drive firmware bug */
123 if (be32_to_cpu(bus_info_data[3]) >> 8 == OUI_FREECOM_TECHNOLOGIES_GMBH)
124 return 0;
125
120 return (be32_to_cpu(bus_info_data[2]) >> 8) & 0x3; 126 return (be32_to_cpu(bus_info_data[2]) >> 8) & 0x3;
121} 127}
122 128
@@ -826,13 +832,11 @@ static struct node_entry *nodemgr_create_node(octlet_t guid,
826 memcpy(&ne->device, &nodemgr_dev_template_ne, 832 memcpy(&ne->device, &nodemgr_dev_template_ne,
827 sizeof(ne->device)); 833 sizeof(ne->device));
828 ne->device.parent = &host->device; 834 ne->device.parent = &host->device;
829 snprintf(ne->device.bus_id, BUS_ID_SIZE, "%016Lx", 835 dev_set_name(&ne->device, "%016Lx", (unsigned long long)(ne->guid));
830 (unsigned long long)(ne->guid));
831 836
832 ne->node_dev.parent = &ne->device; 837 ne->node_dev.parent = &ne->device;
833 ne->node_dev.class = &nodemgr_ne_class; 838 ne->node_dev.class = &nodemgr_ne_class;
834 snprintf(ne->node_dev.bus_id, BUS_ID_SIZE, "%016Lx", 839 dev_set_name(&ne->node_dev, "%016Lx", (unsigned long long)(ne->guid));
835 (unsigned long long)(ne->guid));
836 840
837 if (device_register(&ne->device)) 841 if (device_register(&ne->device))
838 goto fail_devreg; 842 goto fail_devreg;
@@ -932,13 +936,11 @@ static void nodemgr_register_device(struct node_entry *ne,
932 936
933 ud->device.parent = parent; 937 ud->device.parent = parent;
934 938
935 snprintf(ud->device.bus_id, BUS_ID_SIZE, "%s-%u", 939 dev_set_name(&ud->device, "%s-%u", dev_name(&ne->device), ud->id);
936 ne->device.bus_id, ud->id);
937 940
938 ud->unit_dev.parent = &ud->device; 941 ud->unit_dev.parent = &ud->device;
939 ud->unit_dev.class = &nodemgr_ud_class; 942 ud->unit_dev.class = &nodemgr_ud_class;
940 snprintf(ud->unit_dev.bus_id, BUS_ID_SIZE, "%s-%u", 943 dev_set_name(&ud->unit_dev, "%s-%u", dev_name(&ne->device), ud->id);
941 ne->device.bus_id, ud->id);
942 944
943 if (device_register(&ud->device)) 945 if (device_register(&ud->device))
944 goto fail_devreg; 946 goto fail_devreg;
@@ -953,7 +955,7 @@ static void nodemgr_register_device(struct node_entry *ne,
953fail_classdevreg: 955fail_classdevreg:
954 device_unregister(&ud->device); 956 device_unregister(&ud->device);
955fail_devreg: 957fail_devreg:
956 HPSB_ERR("Failed to create unit %s", ud->device.bus_id); 958 HPSB_ERR("Failed to create unit %s", dev_name(&ud->device));
957} 959}
958 960
959 961
@@ -1689,6 +1691,7 @@ static int nodemgr_host_thread(void *data)
1689 g = get_hpsb_generation(host); 1691 g = get_hpsb_generation(host);
1690 for (i = 0; i < 4 ; i++) { 1692 for (i = 0; i < 4 ; i++) {
1691 msleep_interruptible(63); 1693 msleep_interruptible(63);
1694 try_to_freeze();
1692 if (kthread_should_stop()) 1695 if (kthread_should_stop())
1693 goto exit; 1696 goto exit;
1694 1697
@@ -1729,6 +1732,7 @@ static int nodemgr_host_thread(void *data)
1729 /* Sleep 3 seconds */ 1732 /* Sleep 3 seconds */
1730 for (i = 3000/200; i; i--) { 1733 for (i = 3000/200; i; i--) {
1731 msleep_interruptible(200); 1734 msleep_interruptible(200);
1735 try_to_freeze();
1732 if (kthread_should_stop()) 1736 if (kthread_should_stop())
1733 goto exit; 1737 goto exit;
1734 1738