aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/dv1394.c6
-rw-r--r--drivers/ieee1394/ieee1394_core.c8
-rw-r--r--drivers/ieee1394/ieee1394_core.h3
-rw-r--r--drivers/ieee1394/nodemgr.c27
-rw-r--r--drivers/ieee1394/raw1394.c10
-rw-r--r--drivers/ieee1394/sbp2.c156
-rw-r--r--drivers/ieee1394/sbp2.h4
-rw-r--r--drivers/ieee1394/video1394.c4
8 files changed, 49 insertions, 169 deletions
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index 68c7a5f07842..4538b0235ca3 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -2343,8 +2343,8 @@ static void dv1394_remove_host (struct hpsb_host *host)
2343 dv1394_un_init(video); 2343 dv1394_un_init(video);
2344 } while (video != NULL); 2344 } while (video != NULL);
2345 2345
2346 class_simple_device_remove(MKDEV( 2346 class_device_destroy(hpsb_protocol_class,
2347 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2))); 2347 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)));
2348 devfs_remove("ieee1394/dv/host%d/NTSC", id); 2348 devfs_remove("ieee1394/dv/host%d/NTSC", id);
2349 devfs_remove("ieee1394/dv/host%d/PAL", id); 2349 devfs_remove("ieee1394/dv/host%d/PAL", id);
2350 devfs_remove("ieee1394/dv/host%d", id); 2350 devfs_remove("ieee1394/dv/host%d", id);
@@ -2361,7 +2361,7 @@ static void dv1394_add_host (struct hpsb_host *host)
2361 2361
2362 ohci = (struct ti_ohci *)host->hostdata; 2362 ohci = (struct ti_ohci *)host->hostdata;
2363 2363
2364 class_simple_device_add(hpsb_protocol_class, MKDEV( 2364 class_device_create(hpsb_protocol_class, MKDEV(
2365 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)), 2365 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)),
2366 NULL, "dv1394-%d", id); 2366 NULL, "dv1394-%d", id);
2367 devfs_mk_dir("ieee1394/dv/host%d", id); 2367 devfs_mk_dir("ieee1394/dv/host%d", id);
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index a294e45c77cd..2d9a9b74e687 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -67,7 +67,7 @@ MODULE_LICENSE("GPL");
67 67
68/* Some globals used */ 68/* Some globals used */
69const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" }; 69const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" };
70struct class_simple *hpsb_protocol_class; 70struct class *hpsb_protocol_class;
71 71
72#ifdef CONFIG_IEEE1394_VERBOSEDEBUG 72#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
73static void dump_packet(const char *text, quadlet_t *data, int size) 73static void dump_packet(const char *text, quadlet_t *data, int size)
@@ -1121,7 +1121,7 @@ static int __init ieee1394_init(void)
1121 if (ret < 0) 1121 if (ret < 0)
1122 goto release_all_bus; 1122 goto release_all_bus;
1123 1123
1124 hpsb_protocol_class = class_simple_create(THIS_MODULE, "ieee1394_protocol"); 1124 hpsb_protocol_class = class_create(THIS_MODULE, "ieee1394_protocol");
1125 if (IS_ERR(hpsb_protocol_class)) { 1125 if (IS_ERR(hpsb_protocol_class)) {
1126 ret = PTR_ERR(hpsb_protocol_class); 1126 ret = PTR_ERR(hpsb_protocol_class);
1127 goto release_class_host; 1127 goto release_class_host;
@@ -1159,7 +1159,7 @@ static int __init ieee1394_init(void)
1159cleanup_csr: 1159cleanup_csr:
1160 cleanup_csr(); 1160 cleanup_csr();
1161release_class_protocol: 1161release_class_protocol:
1162 class_simple_destroy(hpsb_protocol_class); 1162 class_destroy(hpsb_protocol_class);
1163release_class_host: 1163release_class_host:
1164 class_unregister(&hpsb_host_class); 1164 class_unregister(&hpsb_host_class);
1165release_all_bus: 1165release_all_bus:
@@ -1189,7 +1189,7 @@ static void __exit ieee1394_cleanup(void)
1189 1189
1190 cleanup_csr(); 1190 cleanup_csr();
1191 1191
1192 class_simple_destroy(hpsb_protocol_class); 1192 class_destroy(hpsb_protocol_class);
1193 class_unregister(&hpsb_host_class); 1193 class_unregister(&hpsb_host_class);
1194 for (i = 0; fw_bus_attrs[i]; i++) 1194 for (i = 0; fw_bus_attrs[i]; i++)
1195 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]); 1195 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
diff --git a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h
index c4b4408e2e05..73bd8efd2b6c 100644
--- a/drivers/ieee1394/ieee1394_core.h
+++ b/drivers/ieee1394/ieee1394_core.h
@@ -223,6 +223,7 @@ extern int hpsb_disable_irm;
223/* Our sysfs bus entry */ 223/* Our sysfs bus entry */
224extern struct bus_type ieee1394_bus_type; 224extern struct bus_type ieee1394_bus_type;
225extern struct class hpsb_host_class; 225extern struct class hpsb_host_class;
226extern struct class_simple *hpsb_protocol_class; 226extern struct class *hpsb_protocol_class;
227 227
228#endif /* _IEEE1394_CORE_H */ 228#endif /* _IEEE1394_CORE_H */
229
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 83e66ed97ab5..32abb6dda888 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -220,7 +220,7 @@ struct device nodemgr_dev_template_host = {
220 220
221 221
222#define fw_attr(class, class_type, field, type, format_string) \ 222#define fw_attr(class, class_type, field, type, format_string) \
223static ssize_t fw_show_##class##_##field (struct device *dev, char *buf)\ 223static ssize_t fw_show_##class##_##field (struct device *dev, struct device_attribute *attr, char *buf)\
224{ \ 224{ \
225 class_type *class; \ 225 class_type *class; \
226 class = container_of(dev, class_type, device); \ 226 class = container_of(dev, class_type, device); \
@@ -232,7 +232,7 @@ static struct device_attribute dev_attr_##class##_##field = { \
232}; 232};
233 233
234#define fw_attr_td(class, class_type, td_kv) \ 234#define fw_attr_td(class, class_type, td_kv) \
235static ssize_t fw_show_##class##_##td_kv (struct device *dev, char *buf)\ 235static ssize_t fw_show_##class##_##td_kv (struct device *dev, struct device_attribute *attr, char *buf)\
236{ \ 236{ \
237 int len; \ 237 int len; \
238 class_type *class = container_of(dev, class_type, device); \ 238 class_type *class = container_of(dev, class_type, device); \
@@ -265,7 +265,7 @@ static struct driver_attribute driver_attr_drv_##field = { \
265}; 265};
266 266
267 267
268static ssize_t fw_show_ne_bus_options(struct device *dev, char *buf) 268static ssize_t fw_show_ne_bus_options(struct device *dev, struct device_attribute *attr, char *buf)
269{ 269{
270 struct node_entry *ne = container_of(dev, struct node_entry, device); 270 struct node_entry *ne = container_of(dev, struct node_entry, device);
271 271
@@ -281,7 +281,7 @@ static ssize_t fw_show_ne_bus_options(struct device *dev, char *buf)
281static DEVICE_ATTR(bus_options,S_IRUGO,fw_show_ne_bus_options,NULL); 281static DEVICE_ATTR(bus_options,S_IRUGO,fw_show_ne_bus_options,NULL);
282 282
283 283
284static ssize_t fw_show_ne_tlabels_free(struct device *dev, char *buf) 284static ssize_t fw_show_ne_tlabels_free(struct device *dev, struct device_attribute *attr, char *buf)
285{ 285{
286 struct node_entry *ne = container_of(dev, struct node_entry, device); 286 struct node_entry *ne = container_of(dev, struct node_entry, device);
287 return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1); 287 return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1);
@@ -289,7 +289,7 @@ static ssize_t fw_show_ne_tlabels_free(struct device *dev, char *buf)
289static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_show_ne_tlabels_free,NULL); 289static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_show_ne_tlabels_free,NULL);
290 290
291 291
292static ssize_t fw_show_ne_tlabels_allocations(struct device *dev, char *buf) 292static ssize_t fw_show_ne_tlabels_allocations(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct node_entry *ne = container_of(dev, struct node_entry, device); 294 struct node_entry *ne = container_of(dev, struct node_entry, device);
295 return sprintf(buf, "%u\n", ne->tpool->allocations); 295 return sprintf(buf, "%u\n", ne->tpool->allocations);
@@ -297,7 +297,7 @@ static ssize_t fw_show_ne_tlabels_allocations(struct device *dev, char *buf)
297static DEVICE_ATTR(tlabels_allocations,S_IRUGO,fw_show_ne_tlabels_allocations,NULL); 297static DEVICE_ATTR(tlabels_allocations,S_IRUGO,fw_show_ne_tlabels_allocations,NULL);
298 298
299 299
300static ssize_t fw_show_ne_tlabels_mask(struct device *dev, char *buf) 300static ssize_t fw_show_ne_tlabels_mask(struct device *dev, struct device_attribute *attr, char *buf)
301{ 301{
302 struct node_entry *ne = container_of(dev, struct node_entry, device); 302 struct node_entry *ne = container_of(dev, struct node_entry, device);
303#if (BITS_PER_LONG <= 32) 303#if (BITS_PER_LONG <= 32)
@@ -309,7 +309,7 @@ static ssize_t fw_show_ne_tlabels_mask(struct device *dev, char *buf)
309static DEVICE_ATTR(tlabels_mask, S_IRUGO, fw_show_ne_tlabels_mask, NULL); 309static DEVICE_ATTR(tlabels_mask, S_IRUGO, fw_show_ne_tlabels_mask, NULL);
310 310
311 311
312static ssize_t fw_set_ignore_driver(struct device *dev, const char *buf, size_t count) 312static ssize_t fw_set_ignore_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
313{ 313{
314 struct unit_directory *ud = container_of(dev, struct unit_directory, device); 314 struct unit_directory *ud = container_of(dev, struct unit_directory, device);
315 int state = simple_strtoul(buf, NULL, 10); 315 int state = simple_strtoul(buf, NULL, 10);
@@ -324,7 +324,7 @@ static ssize_t fw_set_ignore_driver(struct device *dev, const char *buf, size_t
324 324
325 return count; 325 return count;
326} 326}
327static ssize_t fw_get_ignore_driver(struct device *dev, char *buf) 327static ssize_t fw_get_ignore_driver(struct device *dev, struct device_attribute *attr, char *buf)
328{ 328{
329 struct unit_directory *ud = container_of(dev, struct unit_directory, device); 329 struct unit_directory *ud = container_of(dev, struct unit_directory, device);
330 330
@@ -695,14 +695,15 @@ static void nodemgr_remove_ne(struct node_entry *ne)
695 put_device(dev); 695 put_device(dev);
696} 696}
697 697
698static int __nodemgr_remove_host_dev(struct device *dev, void *data)
699{
700 nodemgr_remove_ne(container_of(dev, struct node_entry, device));
701 return 0;
702}
698 703
699static void nodemgr_remove_host_dev(struct device *dev) 704static void nodemgr_remove_host_dev(struct device *dev)
700{ 705{
701 struct device *ne_dev, *next; 706 device_for_each_child(dev, NULL, __nodemgr_remove_host_dev);
702
703 list_for_each_entry_safe(ne_dev, next, &dev->children, node)
704 nodemgr_remove_ne(container_of(ne_dev, struct node_entry, device));
705
706 sysfs_remove_link(&dev->kobj, "irm_id"); 707 sysfs_remove_link(&dev->kobj, "irm_id");
707 sysfs_remove_link(&dev->kobj, "busmgr_id"); 708 sysfs_remove_link(&dev->kobj, "busmgr_id");
708 sysfs_remove_link(&dev->kobj, "host_id"); 709 sysfs_remove_link(&dev->kobj, "host_id");
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 6a08a8982ea8..7419af450bd1 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -2901,7 +2901,7 @@ static int __init init_raw1394(void)
2901 2901
2902 hpsb_register_highlevel(&raw1394_highlevel); 2902 hpsb_register_highlevel(&raw1394_highlevel);
2903 2903
2904 if (IS_ERR(class_simple_device_add(hpsb_protocol_class, MKDEV( 2904 if (IS_ERR(class_device_create(hpsb_protocol_class, MKDEV(
2905 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), 2905 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16),
2906 NULL, RAW1394_DEVICE_NAME))) { 2906 NULL, RAW1394_DEVICE_NAME))) {
2907 ret = -EFAULT; 2907 ret = -EFAULT;
@@ -2934,8 +2934,8 @@ static int __init init_raw1394(void)
2934 2934
2935out_dev: 2935out_dev:
2936 devfs_remove(RAW1394_DEVICE_NAME); 2936 devfs_remove(RAW1394_DEVICE_NAME);
2937 class_simple_device_remove(MKDEV( 2937 class_device_destroy(hpsb_protocol_class,
2938 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 2938 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16));
2939out_unreg: 2939out_unreg:
2940 hpsb_unregister_highlevel(&raw1394_highlevel); 2940 hpsb_unregister_highlevel(&raw1394_highlevel);
2941out: 2941out:
@@ -2944,8 +2944,8 @@ out:
2944 2944
2945static void __exit cleanup_raw1394(void) 2945static void __exit cleanup_raw1394(void)
2946{ 2946{
2947 class_simple_device_remove(MKDEV( 2947 class_device_destroy(hpsb_protocol_class,
2948 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 2948 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16));
2949 cdev_del(&raw1394_cdev); 2949 cdev_del(&raw1394_cdev);
2950 devfs_remove(RAW1394_DEVICE_NAME); 2950 devfs_remove(RAW1394_DEVICE_NAME);
2951 hpsb_unregister_highlevel(&raw1394_highlevel); 2951 hpsb_unregister_highlevel(&raw1394_highlevel);
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 00c7b958361a..32368f3428ec 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -745,7 +745,8 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
745 list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids); 745 list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids);
746 746
747 /* Register our host with the SCSI stack. */ 747 /* Register our host with the SCSI stack. */
748 scsi_host = scsi_host_alloc(&scsi_driver_template, 0); 748 scsi_host = scsi_host_alloc(&scsi_driver_template,
749 sizeof (unsigned long));
749 if (!scsi_host) { 750 if (!scsi_host) {
750 SBP2_ERR("failed to register scsi host"); 751 SBP2_ERR("failed to register scsi host");
751 goto failed_alloc; 752 goto failed_alloc;
@@ -1070,7 +1071,7 @@ static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_
1070static __inline__ int sbp2_command_conversion_device_type(u8 device_type) 1071static __inline__ int sbp2_command_conversion_device_type(u8 device_type)
1071{ 1072{
1072 return (((device_type == TYPE_DISK) || 1073 return (((device_type == TYPE_DISK) ||
1073 (device_type == TYPE_SDAD) || 1074 (device_type == TYPE_RBC) ||
1074 (device_type == TYPE_ROM)) ? 1:0); 1075 (device_type == TYPE_ROM)) ? 1:0);
1075} 1076}
1076 1077
@@ -2111,102 +2112,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
2111 */ 2112 */
2112static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd) 2113static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd)
2113{ 2114{
2114 unchar new_cmd[16];
2115 u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
2116
2117 SBP2_DEBUG("sbp2_check_sbp2_command");
2118
2119 switch (*cmd) {
2120
2121 case READ_6:
2122
2123 if (sbp2_command_conversion_device_type(device_type)) {
2124
2125 SBP2_DEBUG("Convert READ_6 to READ_10");
2126
2127 /*
2128 * Need to turn read_6 into read_10
2129 */
2130 new_cmd[0] = 0x28;
2131 new_cmd[1] = (cmd[1] & 0xe0);
2132 new_cmd[2] = 0x0;
2133 new_cmd[3] = (cmd[1] & 0x1f);
2134 new_cmd[4] = cmd[2];
2135 new_cmd[5] = cmd[3];
2136 new_cmd[6] = 0x0;
2137 new_cmd[7] = 0x0;
2138 new_cmd[8] = cmd[4];
2139 new_cmd[9] = cmd[5];
2140
2141 memcpy(cmd, new_cmd, 10);
2142
2143 }
2144
2145 break;
2146
2147 case WRITE_6:
2148
2149 if (sbp2_command_conversion_device_type(device_type)) {
2150
2151 SBP2_DEBUG("Convert WRITE_6 to WRITE_10");
2152
2153 /*
2154 * Need to turn write_6 into write_10
2155 */
2156 new_cmd[0] = 0x2a;
2157 new_cmd[1] = (cmd[1] & 0xe0);
2158 new_cmd[2] = 0x0;
2159 new_cmd[3] = (cmd[1] & 0x1f);
2160 new_cmd[4] = cmd[2];
2161 new_cmd[5] = cmd[3];
2162 new_cmd[6] = 0x0;
2163 new_cmd[7] = 0x0;
2164 new_cmd[8] = cmd[4];
2165 new_cmd[9] = cmd[5];
2166
2167 memcpy(cmd, new_cmd, 10);
2168
2169 }
2170
2171 break;
2172
2173 case MODE_SENSE:
2174
2175 if (sbp2_command_conversion_device_type(device_type)) {
2176
2177 SBP2_DEBUG("Convert MODE_SENSE_6 to MODE_SENSE_10");
2178
2179 /*
2180 * Need to turn mode_sense_6 into mode_sense_10
2181 */
2182 new_cmd[0] = 0x5a;
2183 new_cmd[1] = cmd[1];
2184 new_cmd[2] = cmd[2];
2185 new_cmd[3] = 0x0;
2186 new_cmd[4] = 0x0;
2187 new_cmd[5] = 0x0;
2188 new_cmd[6] = 0x0;
2189 new_cmd[7] = 0x0;
2190 new_cmd[8] = cmd[4];
2191 new_cmd[9] = cmd[5];
2192
2193 memcpy(cmd, new_cmd, 10);
2194
2195 }
2196
2197 break;
2198
2199 case MODE_SELECT:
2200
2201 /*
2202 * TODO. Probably need to change mode select to 10 byte version
2203 */
2204
2205 default:
2206 break;
2207 }
2208
2209 return;
2210} 2115}
2211 2116
2212/* 2117/*
@@ -2247,7 +2152,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
2247 struct scsi_cmnd *SCpnt) 2152 struct scsi_cmnd *SCpnt)
2248{ 2153{
2249 u8 *scsi_buf = SCpnt->request_buffer; 2154 u8 *scsi_buf = SCpnt->request_buffer;
2250 u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
2251 2155
2252 SBP2_DEBUG("sbp2_check_sbp2_response"); 2156 SBP2_DEBUG("sbp2_check_sbp2_response");
2253 2157
@@ -2272,14 +2176,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
2272 } 2176 }
2273 2177
2274 /* 2178 /*
2275 * Check for Simple Direct Access Device and change it to TYPE_DISK
2276 */
2277 if ((scsi_buf[0] & 0x1f) == TYPE_SDAD) {
2278 SBP2_DEBUG("Changing TYPE_SDAD to TYPE_DISK");
2279 scsi_buf[0] &= 0xe0;
2280 }
2281
2282 /*
2283 * Fix ansi revision and response data format 2179 * Fix ansi revision and response data format
2284 */ 2180 */
2285 scsi_buf[2] |= 2; 2181 scsi_buf[2] |= 2;
@@ -2287,27 +2183,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
2287 2183
2288 break; 2184 break;
2289 2185
2290 case MODE_SENSE:
2291
2292 if (sbp2_command_conversion_device_type(device_type)) {
2293
2294 SBP2_DEBUG("Modify mode sense response (10 byte version)");
2295
2296 scsi_buf[0] = scsi_buf[1]; /* Mode data length */
2297 scsi_buf[1] = scsi_buf[2]; /* Medium type */
2298 scsi_buf[2] = scsi_buf[3]; /* Device specific parameter */
2299 scsi_buf[3] = scsi_buf[7]; /* Block descriptor length */
2300 memcpy(scsi_buf + 4, scsi_buf + 8, scsi_buf[0]);
2301 }
2302
2303 break;
2304
2305 case MODE_SELECT:
2306
2307 /*
2308 * TODO. Probably need to change mode select to 10 byte version
2309 */
2310
2311 default: 2186 default:
2312 break; 2187 break;
2313 } 2188 }
@@ -2579,8 +2454,6 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
2579 u32 scsi_status, struct scsi_cmnd *SCpnt, 2454 u32 scsi_status, struct scsi_cmnd *SCpnt,
2580 void (*done)(struct scsi_cmnd *)) 2455 void (*done)(struct scsi_cmnd *))
2581{ 2456{
2582 unsigned long flags;
2583
2584 SBP2_DEBUG("sbp2scsi_complete_command"); 2457 SBP2_DEBUG("sbp2scsi_complete_command");
2585 2458
2586 /* 2459 /*
@@ -2679,18 +2552,15 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
2679 /* 2552 /*
2680 * Tell scsi stack that we're done with this command 2553 * Tell scsi stack that we're done with this command
2681 */ 2554 */
2682 spin_lock_irqsave(scsi_id->scsi_host->host_lock,flags);
2683 done (SCpnt); 2555 done (SCpnt);
2684 spin_unlock_irqrestore(scsi_id->scsi_host->host_lock,flags);
2685
2686 return;
2687} 2556}
2688 2557
2689 2558
2690static int sbp2scsi_slave_configure (struct scsi_device *sdev) 2559static int sbp2scsi_slave_configure (struct scsi_device *sdev)
2691{ 2560{
2692 blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); 2561 blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
2693 2562 sdev->use_10_for_rw = 1;
2563 sdev->use_10_for_ms = 1;
2694 return 0; 2564 return 0;
2695} 2565}
2696 2566
@@ -2746,7 +2616,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt)
2746/* 2616/*
2747 * Called by scsi stack when something has really gone wrong. 2617 * Called by scsi stack when something has really gone wrong.
2748 */ 2618 */
2749static int sbp2scsi_reset(struct scsi_cmnd *SCpnt) 2619static int __sbp2scsi_reset(struct scsi_cmnd *SCpnt)
2750{ 2620{
2751 struct scsi_id_instance_data *scsi_id = 2621 struct scsi_id_instance_data *scsi_id =
2752 (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; 2622 (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0];
@@ -2761,12 +2631,24 @@ static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
2761 return(SUCCESS); 2631 return(SUCCESS);
2762} 2632}
2763 2633
2634static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
2635{
2636 unsigned long flags;
2637 int rc;
2638
2639 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
2640 rc = __sbp2scsi_reset(SCpnt);
2641 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
2642
2643 return rc;
2644}
2645
2764static const char *sbp2scsi_info (struct Scsi_Host *host) 2646static const char *sbp2scsi_info (struct Scsi_Host *host)
2765{ 2647{
2766 return "SCSI emulation for IEEE-1394 SBP-2 Devices"; 2648 return "SCSI emulation for IEEE-1394 SBP-2 Devices";
2767} 2649}
2768 2650
2769static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, char *buf) 2651static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr, char *buf)
2770{ 2652{
2771 struct scsi_device *sdev; 2653 struct scsi_device *sdev;
2772 struct scsi_id_instance_data *scsi_id; 2654 struct scsi_id_instance_data *scsi_id;
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index a84b039a05b9..cd425be74841 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -266,10 +266,6 @@ struct sbp2_status_block {
266#define SBP2_MAX_UDS_PER_NODE 16 /* Maximum scsi devices per node */ 266#define SBP2_MAX_UDS_PER_NODE 16 /* Maximum scsi devices per node */
267#define SBP2_MAX_SECTORS 255 /* Max sectors supported */ 267#define SBP2_MAX_SECTORS 255 /* Max sectors supported */
268 268
269#ifndef TYPE_SDAD
270#define TYPE_SDAD 0x0e /* simplified direct access device */
271#endif
272
273/* 269/*
274 * SCSI direction table... 270 * SCSI direction table...
275 * (now used as a back-up in case the direction passed down from above is "unknown") 271 * (now used as a back-up in case the direction passed down from above is "unknown")
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index d68c4658f2fc..06759b36afea 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -1370,7 +1370,7 @@ static void video1394_add_host (struct hpsb_host *host)
1370 hpsb_set_hostinfo_key(&video1394_highlevel, host, ohci->host->id); 1370 hpsb_set_hostinfo_key(&video1394_highlevel, host, ohci->host->id);
1371 1371
1372 minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id; 1372 minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id;
1373 class_simple_device_add(hpsb_protocol_class, MKDEV( 1373 class_device_create(hpsb_protocol_class, MKDEV(
1374 IEEE1394_MAJOR, minor), 1374 IEEE1394_MAJOR, minor),
1375 NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1375 NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
1376 devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor), 1376 devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor),
@@ -1384,7 +1384,7 @@ static void video1394_remove_host (struct hpsb_host *host)
1384 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host); 1384 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host);
1385 1385
1386 if (ohci) { 1386 if (ohci) {
1387 class_simple_device_remove(MKDEV(IEEE1394_MAJOR, 1387 class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR,
1388 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id)); 1388 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id));
1389 devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1389 devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
1390 } 1390 }