aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-sbp2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-sbp2.c')
-rw-r--r--drivers/firewire/fw-sbp2.c57
1 files changed, 24 insertions, 33 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index c71c4419d9e8..2bcf51557c72 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -392,20 +392,18 @@ static const struct {
392 } 392 }
393}; 393};
394 394
395static void 395static void free_orb(struct kref *kref)
396free_orb(struct kref *kref)
397{ 396{
398 struct sbp2_orb *orb = container_of(kref, struct sbp2_orb, kref); 397 struct sbp2_orb *orb = container_of(kref, struct sbp2_orb, kref);
399 398
400 kfree(orb); 399 kfree(orb);
401} 400}
402 401
403static void 402static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
404sbp2_status_write(struct fw_card *card, struct fw_request *request, 403 int tcode, int destination, int source,
405 int tcode, int destination, int source, 404 int generation, int speed,
406 int generation, int speed, 405 unsigned long long offset,
407 unsigned long long offset, 406 void *payload, size_t length, void *callback_data)
408 void *payload, size_t length, void *callback_data)
409{ 407{
410 struct sbp2_logical_unit *lu = callback_data; 408 struct sbp2_logical_unit *lu = callback_data;
411 struct sbp2_orb *orb; 409 struct sbp2_orb *orb;
@@ -451,9 +449,8 @@ sbp2_status_write(struct fw_card *card, struct fw_request *request,
451 fw_send_response(card, request, RCODE_COMPLETE); 449 fw_send_response(card, request, RCODE_COMPLETE);
452} 450}
453 451
454static void 452static void complete_transaction(struct fw_card *card, int rcode,
455complete_transaction(struct fw_card *card, int rcode, 453 void *payload, size_t length, void *data)
456 void *payload, size_t length, void *data)
457{ 454{
458 struct sbp2_orb *orb = data; 455 struct sbp2_orb *orb = data;
459 unsigned long flags; 456 unsigned long flags;
@@ -482,9 +479,8 @@ complete_transaction(struct fw_card *card, int rcode,
482 kref_put(&orb->kref, free_orb); 479 kref_put(&orb->kref, free_orb);
483} 480}
484 481
485static void 482static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
486sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu, 483 int node_id, int generation, u64 offset)
487 int node_id, int generation, u64 offset)
488{ 484{
489 struct fw_device *device = fw_device(lu->tgt->unit->device.parent); 485 struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
490 unsigned long flags; 486 unsigned long flags;
@@ -531,8 +527,8 @@ static int sbp2_cancel_orbs(struct sbp2_logical_unit *lu)
531 return retval; 527 return retval;
532} 528}
533 529
534static void 530static void complete_management_orb(struct sbp2_orb *base_orb,
535complete_management_orb(struct sbp2_orb *base_orb, struct sbp2_status *status) 531 struct sbp2_status *status)
536{ 532{
537 struct sbp2_management_orb *orb = 533 struct sbp2_management_orb *orb =
538 container_of(base_orb, struct sbp2_management_orb, base); 534 container_of(base_orb, struct sbp2_management_orb, base);
@@ -542,10 +538,9 @@ complete_management_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
542 complete(&orb->done); 538 complete(&orb->done);
543} 539}
544 540
545static int 541static int sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
546sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id, 542 int generation, int function,
547 int generation, int function, int lun_or_login_id, 543 int lun_or_login_id, void *response)
548 void *response)
549{ 544{
550 struct fw_device *device = fw_device(lu->tgt->unit->device.parent); 545 struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
551 struct sbp2_management_orb *orb; 546 struct sbp2_management_orb *orb;
@@ -652,9 +647,8 @@ static void sbp2_agent_reset(struct sbp2_logical_unit *lu)
652 &d, sizeof(d)); 647 &d, sizeof(d));
653} 648}
654 649
655static void 650static void complete_agent_reset_write_no_wait(struct fw_card *card,
656complete_agent_reset_write_no_wait(struct fw_card *card, int rcode, 651 int rcode, void *payload, size_t length, void *data)
657 void *payload, size_t length, void *data)
658{ 652{
659 kfree(data); 653 kfree(data);
660} 654}
@@ -1299,8 +1293,7 @@ static void sbp2_unmap_scatterlist(struct device *card_device,
1299 sizeof(orb->page_table), DMA_TO_DEVICE); 1293 sizeof(orb->page_table), DMA_TO_DEVICE);
1300} 1294}
1301 1295
1302static unsigned int 1296static unsigned int sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
1303sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
1304{ 1297{
1305 int sam_status; 1298 int sam_status;
1306 1299
@@ -1337,8 +1330,8 @@ sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
1337 } 1330 }
1338} 1331}
1339 1332
1340static void 1333static void complete_command_orb(struct sbp2_orb *base_orb,
1341complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status) 1334 struct sbp2_status *status)
1342{ 1335{
1343 struct sbp2_command_orb *orb = 1336 struct sbp2_command_orb *orb =
1344 container_of(base_orb, struct sbp2_command_orb, base); 1337 container_of(base_orb, struct sbp2_command_orb, base);
@@ -1384,9 +1377,8 @@ complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
1384 orb->done(orb->cmd); 1377 orb->done(orb->cmd);
1385} 1378}
1386 1379
1387static int 1380static int sbp2_map_scatterlist(struct sbp2_command_orb *orb,
1388sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device, 1381 struct fw_device *device, struct sbp2_logical_unit *lu)
1389 struct sbp2_logical_unit *lu)
1390{ 1382{
1391 struct scatterlist *sg = scsi_sglist(orb->cmd); 1383 struct scatterlist *sg = scsi_sglist(orb->cmd);
1392 int i, n; 1384 int i, n;
@@ -1584,9 +1576,8 @@ static int sbp2_scsi_abort(struct scsi_cmnd *cmd)
1584 * This is the concatenation of target port identifier and logical unit 1576 * This is the concatenation of target port identifier and logical unit
1585 * identifier as per SAM-2...SAM-4 annex A. 1577 * identifier as per SAM-2...SAM-4 annex A.
1586 */ 1578 */
1587static ssize_t 1579static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev,
1588sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr, 1580 struct device_attribute *attr, char *buf)
1589 char *buf)
1590{ 1581{
1591 struct scsi_device *sdev = to_scsi_device(dev); 1582 struct scsi_device *sdev = to_scsi_device(dev);
1592 struct sbp2_logical_unit *lu; 1583 struct sbp2_logical_unit *lu;