.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * SBP2 driver (SCSI over IEEE1394) |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License as published by |
---|
8 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
9 | | - * (at your option) any later version. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - * GNU General Public License for more details. |
---|
15 | | - * |
---|
16 | | - * You should have received a copy of the GNU General Public License |
---|
17 | | - * along with this program; if not, write to the Free Software Foundation, |
---|
18 | | - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | 6 | */ |
---|
20 | 7 | |
---|
21 | 8 | /* |
---|
.. | .. |
---|
421 | 408 | void *payload, size_t length, void *callback_data) |
---|
422 | 409 | { |
---|
423 | 410 | struct sbp2_logical_unit *lu = callback_data; |
---|
424 | | - struct sbp2_orb *orb; |
---|
| 411 | + struct sbp2_orb *orb = NULL, *iter; |
---|
425 | 412 | struct sbp2_status status; |
---|
426 | 413 | unsigned long flags; |
---|
427 | 414 | |
---|
.. | .. |
---|
446 | 433 | |
---|
447 | 434 | /* Lookup the orb corresponding to this status write. */ |
---|
448 | 435 | spin_lock_irqsave(&lu->tgt->lock, flags); |
---|
449 | | - list_for_each_entry(orb, &lu->orb_list, link) { |
---|
| 436 | + list_for_each_entry(iter, &lu->orb_list, link) { |
---|
450 | 437 | if (STATUS_GET_ORB_HIGH(status) == 0 && |
---|
451 | | - STATUS_GET_ORB_LOW(status) == orb->request_bus) { |
---|
452 | | - orb->rcode = RCODE_COMPLETE; |
---|
453 | | - list_del(&orb->link); |
---|
| 438 | + STATUS_GET_ORB_LOW(status) == iter->request_bus) { |
---|
| 439 | + iter->rcode = RCODE_COMPLETE; |
---|
| 440 | + list_del(&iter->link); |
---|
| 441 | + orb = iter; |
---|
454 | 442 | break; |
---|
455 | 443 | } |
---|
456 | 444 | } |
---|
457 | 445 | spin_unlock_irqrestore(&lu->tgt->lock, flags); |
---|
458 | 446 | |
---|
459 | | - if (&orb->link != &lu->orb_list) { |
---|
| 447 | + if (orb) { |
---|
460 | 448 | orb->callback(orb, &status); |
---|
461 | 449 | kref_put(&orb->kref, free_orb); /* orb callback reference */ |
---|
462 | 450 | } else { |
---|
.. | .. |
---|
1144 | 1132 | if (device->is_local) |
---|
1145 | 1133 | return -ENODEV; |
---|
1146 | 1134 | |
---|
1147 | | - if (dma_get_max_seg_size(device->card->device) > SBP2_MAX_SEG_SIZE) |
---|
1148 | | - WARN_ON(dma_set_max_seg_size(device->card->device, |
---|
1149 | | - SBP2_MAX_SEG_SIZE)); |
---|
1150 | | - |
---|
1151 | 1135 | shost = scsi_host_alloc(&scsi_driver_template, sizeof(*tgt)); |
---|
1152 | 1136 | if (shost == NULL) |
---|
1153 | 1137 | return -ENOMEM; |
---|
.. | .. |
---|
1610 | 1594 | .eh_abort_handler = sbp2_scsi_abort, |
---|
1611 | 1595 | .this_id = -1, |
---|
1612 | 1596 | .sg_tablesize = SG_ALL, |
---|
1613 | | - .use_clustering = ENABLE_CLUSTERING, |
---|
| 1597 | + .max_segment_size = SBP2_MAX_SEG_SIZE, |
---|
1614 | 1598 | .can_queue = 1, |
---|
1615 | 1599 | .sdev_attrs = sbp2_scsi_sysfs_attrs, |
---|
1616 | 1600 | }; |
---|