Deleted Added
full compact
ctl_tpc_local.c (278037) ctl_tpc_local.c (278625)
1/*-
2 * Copyright (c) 2014 Alexander Motin <mav@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Silicon Graphics International Corp.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Alexander Motin <mav@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Silicon Graphics International Corp.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_tpc_local.c 278037 2015-02-01 21:50:28Z mav $");
29__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_tpc_local.c 278625 2015-02-12 15:46:44Z mav $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/types.h>
35#include <sys/lock.h>
36#include <sys/module.h>
37#include <sys/mutex.h>

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

304tpcl_done(union ctl_io *io)
305{
306
307 tpc_done(io);
308}
309
310uint64_t
311tpcl_resolve(struct ctl_softc *softc, int init_port,
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/types.h>
35#include <sys/lock.h>
36#include <sys/module.h>
37#include <sys/mutex.h>

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

304tpcl_done(union ctl_io *io)
305{
306
307 tpc_done(io);
308}
309
310uint64_t
311tpcl_resolve(struct ctl_softc *softc, int init_port,
312 struct scsi_ec_cscd *cscd, uint32_t *ss)
312 struct scsi_ec_cscd *cscd, uint32_t *ss, uint32_t *ps, uint32_t *pso)
313{
314 struct scsi_ec_cscd_id *cscdid;
315 struct ctl_port *port;
316 struct ctl_lun *lun;
317 uint64_t lunid = UINT64_MAX;
318
319 if (cscd->type_code != EC_CSCD_ID)
320 return (lunid);

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

332 if (lun->lun_devid == NULL)
333 continue;
334 if (scsi_devid_match(lun->lun_devid->data,
335 lun->lun_devid->len, &cscdid->codeset,
336 cscdid->length + 4) == 0) {
337 lunid = lun->lun;
338 if (ss && lun->be_lun)
339 *ss = lun->be_lun->blocksize;
313{
314 struct scsi_ec_cscd_id *cscdid;
315 struct ctl_port *port;
316 struct ctl_lun *lun;
317 uint64_t lunid = UINT64_MAX;
318
319 if (cscd->type_code != EC_CSCD_ID)
320 return (lunid);

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

332 if (lun->lun_devid == NULL)
333 continue;
334 if (scsi_devid_match(lun->lun_devid->data,
335 lun->lun_devid->len, &cscdid->codeset,
336 cscdid->length + 4) == 0) {
337 lunid = lun->lun;
338 if (ss && lun->be_lun)
339 *ss = lun->be_lun->blocksize;
340 if (ps && lun->be_lun)
341 *ps = lun->be_lun->blocksize <<
342 lun->be_lun->pblockexp;
343 if (pso && lun->be_lun)
344 *pso = lun->be_lun->blocksize *
345 lun->be_lun->pblockoff;
340 break;
341 }
342 }
343 mtx_unlock(&softc->ctl_lock);
344 return (lunid);
345};
346
347union ctl_io *

--- 20 unchanged lines hidden ---
346 break;
347 }
348 }
349 mtx_unlock(&softc->ctl_lock);
350 return (lunid);
351};
352
353union ctl_io *

--- 20 unchanged lines hidden ---