Deleted Added
full compact
scsi_xpt.c (249466) scsi_xpt.c (249468)
1/*-
2 * Implementation of the SCSI Transport
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Implementation of the SCSI Transport
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_xpt.c 249466 2013-04-14 09:28:14Z mav $");
31__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_xpt.c 249468 2013-04-14 09:55:48Z mav $");
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/systm.h>
36#include <sys/types.h>
37#include <sys/malloc.h>
38#include <sys/kernel.h>
39#include <sys/time.h>

--- 1908 unchanged lines hidden (view full) ---

1948 }
1949 }
1950
1951 for (i = low_target; i <= max_target; i++) {
1952 cam_status status;
1953 if (i == initiator_id)
1954 continue;
1955
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/systm.h>
36#include <sys/types.h>
37#include <sys/malloc.h>
38#include <sys/kernel.h>
39#include <sys/time.h>

--- 1908 unchanged lines hidden (view full) ---

1948 }
1949 }
1950
1951 for (i = low_target; i <= max_target; i++) {
1952 cam_status status;
1953 if (i == initiator_id)
1954 continue;
1955
1956 status = xpt_create_path(&path, xpt_periph,
1956 status = xpt_create_path(&path, NULL,
1957 request_ccb->ccb_h.path_id,
1958 i, 0);
1959 if (status != CAM_REQ_CMP) {
1960 printf("scsi_scan_bus: xpt_create_path failed"
1961 " with status %#x, bus scan halted\n",
1962 status);
1963 free(scan_info, M_CAMXPT);
1964 request_ccb->ccb_h.status = status;

--- 184 unchanged lines hidden (view full) ---

2149 xpt_done(request_ccb);
2150 break;
2151 }
2152
2153 if ((scan_info->cpi->hba_misc & PIM_SEQSCAN) == 0) {
2154 xpt_free_ccb(request_ccb);
2155 break;
2156 }
1957 request_ccb->ccb_h.path_id,
1958 i, 0);
1959 if (status != CAM_REQ_CMP) {
1960 printf("scsi_scan_bus: xpt_create_path failed"
1961 " with status %#x, bus scan halted\n",
1962 status);
1963 free(scan_info, M_CAMXPT);
1964 request_ccb->ccb_h.status = status;

--- 184 unchanged lines hidden (view full) ---

2149 xpt_done(request_ccb);
2150 break;
2151 }
2152
2153 if ((scan_info->cpi->hba_misc & PIM_SEQSCAN) == 0) {
2154 xpt_free_ccb(request_ccb);
2155 break;
2156 }
2157 status = xpt_create_path(&path, xpt_periph,
2157 status = xpt_create_path(&path, NULL,
2158 scan_info->request_ccb->ccb_h.path_id,
2159 scan_info->counter, 0);
2160 if (status != CAM_REQ_CMP) {
2161 printf("scsi_scan_bus: xpt_create_path failed"
2162 " with status %#x, bus scan halted\n",
2163 status);
2164 xpt_free_ccb(request_ccb);
2165 xpt_free_ccb((union ccb *)scan_info->cpi);

--- 6 unchanged lines hidden (view full) ---

2172 xpt_setup_ccb(&request_ccb->ccb_h, path,
2173 request_ccb->ccb_h.pinfo.priority);
2174 request_ccb->ccb_h.func_code = XPT_SCAN_LUN;
2175 request_ccb->ccb_h.cbfcnp = scsi_scan_bus;
2176 request_ccb->ccb_h.ppriv_ptr0 = scan_info;
2177 request_ccb->crcn.flags =
2178 scan_info->request_ccb->crcn.flags;
2179 } else {
2158 scan_info->request_ccb->ccb_h.path_id,
2159 scan_info->counter, 0);
2160 if (status != CAM_REQ_CMP) {
2161 printf("scsi_scan_bus: xpt_create_path failed"
2162 " with status %#x, bus scan halted\n",
2163 status);
2164 xpt_free_ccb(request_ccb);
2165 xpt_free_ccb((union ccb *)scan_info->cpi);

--- 6 unchanged lines hidden (view full) ---

2172 xpt_setup_ccb(&request_ccb->ccb_h, path,
2173 request_ccb->ccb_h.pinfo.priority);
2174 request_ccb->ccb_h.func_code = XPT_SCAN_LUN;
2175 request_ccb->ccb_h.cbfcnp = scsi_scan_bus;
2176 request_ccb->ccb_h.ppriv_ptr0 = scan_info;
2177 request_ccb->crcn.flags =
2178 scan_info->request_ccb->crcn.flags;
2179 } else {
2180 status = xpt_create_path(&path, xpt_periph,
2180 status = xpt_create_path(&path, NULL,
2181 path_id, target_id, lun_id);
2182 /*
2183 * Free the old request path- we're done with it. We
2184 * do this *after* creating the new path so that
2185 * we don't remove a target that has our lun list
2186 * in the case that lun 0 is not present.
2187 */
2188 xpt_free_path(oldpath);

--- 56 unchanged lines hidden (view full) ---

2245
2246 if (request_ccb == NULL) {
2247 request_ccb = xpt_alloc_ccb_nowait();
2248 if (request_ccb == NULL) {
2249 xpt_print(path, "scsi_scan_lun: can't allocate CCB, "
2250 "can't continue\n");
2251 return;
2252 }
2181 path_id, target_id, lun_id);
2182 /*
2183 * Free the old request path- we're done with it. We
2184 * do this *after* creating the new path so that
2185 * we don't remove a target that has our lun list
2186 * in the case that lun 0 is not present.
2187 */
2188 xpt_free_path(oldpath);

--- 56 unchanged lines hidden (view full) ---

2245
2246 if (request_ccb == NULL) {
2247 request_ccb = xpt_alloc_ccb_nowait();
2248 if (request_ccb == NULL) {
2249 xpt_print(path, "scsi_scan_lun: can't allocate CCB, "
2250 "can't continue\n");
2251 return;
2252 }
2253 status = xpt_create_path(&new_path, xpt_periph,
2253 status = xpt_create_path(&new_path, NULL,
2254 path->bus->path_id,
2255 path->target->target_id,
2256 path->device->lun_id);
2257 if (status != CAM_REQ_CMP) {
2258 xpt_print(path, "scsi_scan_lun: can't create path, "
2259 "can't continue\n");
2260 xpt_free_ccb(request_ccb);
2261 return;

--- 788 unchanged lines hidden ---
2254 path->bus->path_id,
2255 path->target->target_id,
2256 path->device->lun_id);
2257 if (status != CAM_REQ_CMP) {
2258 xpt_print(path, "scsi_scan_lun: can't create path, "
2259 "can't continue\n");
2260 xpt_free_ccb(request_ccb);
2261 return;

--- 788 unchanged lines hidden ---