Deleted Added
full compact
isc_cam.c (254657) isc_cam.c (257381)
1/*-
2 * Copyright (c) 2005-2010 Daniel Braniss <danny@cs.huji.ac.il>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27/*
28 | $Id: isc_cam.c 998 2009-12-20 10:32:45Z danny $
29 */
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005-2010 Daniel Braniss <danny@cs.huji.ac.il>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27/*
28 | $Id: isc_cam.c 998 2009-12-20 10:32:45Z danny $
29 */
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/iscsi_initiator/isc_cam.c 254657 2013-08-22 14:02:34Z trasz $");
31__FBSDID("$FreeBSD: head/sys/dev/iscsi_initiator/isc_cam.c 257381 2013-10-30 14:04:47Z nwhitehorn $");
32
33#include "opt_iscsi_initiator.h"
34
35#include <sys/param.h>
36#include <sys/kernel.h>
37#include <sys/callout.h>
38#if __FreeBSD_version >= 700000
39#include <sys/lock.h>

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

58
59static void
60_inq(struct cam_sim *sim, union ccb *ccb)
61{
62 struct ccb_pathinq *cpi = &ccb->cpi;
63 isc_session_t *sp = cam_sim_softc(sim);
64
65 debug_called(8);
32
33#include "opt_iscsi_initiator.h"
34
35#include <sys/param.h>
36#include <sys/kernel.h>
37#include <sys/callout.h>
38#if __FreeBSD_version >= 700000
39#include <sys/lock.h>

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

58
59static void
60_inq(struct cam_sim *sim, union ccb *ccb)
61{
62 struct ccb_pathinq *cpi = &ccb->cpi;
63 isc_session_t *sp = cam_sim_softc(sim);
64
65 debug_called(8);
66 debug(3, "sid=%d target=%d lun=%d", sp->sid, ccb->ccb_h.target_id, ccb->ccb_h.target_lun);
66 debug(3, "sid=%d target=%d lun=%jx", sp->sid, ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun);
67
68 cpi->version_num = 1; /* XXX??? */
69 cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE | PI_WIDE_32;
70 cpi->target_sprt = 0;
71 cpi->hba_misc = 0;
72 cpi->hba_eng_cnt = 0;
73 cpi->max_target = 0; //ISCSI_MAX_TARGETS - 1;
74 cpi->initiator_id = ISCSI_MAX_TARGETS;

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

183ic_action(struct cam_sim *sim, union ccb *ccb)
184{
185 isc_session_t *sp = cam_sim_softc(sim);
186 struct ccb_hdr *ccb_h = &ccb->ccb_h;
187
188 debug_called(8);
189
190 ccb_h->spriv_ptr0 = sp;
67
68 cpi->version_num = 1; /* XXX??? */
69 cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE | PI_WIDE_32;
70 cpi->target_sprt = 0;
71 cpi->hba_misc = 0;
72 cpi->hba_eng_cnt = 0;
73 cpi->max_target = 0; //ISCSI_MAX_TARGETS - 1;
74 cpi->initiator_id = ISCSI_MAX_TARGETS;

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

183ic_action(struct cam_sim *sim, union ccb *ccb)
184{
185 isc_session_t *sp = cam_sim_softc(sim);
186 struct ccb_hdr *ccb_h = &ccb->ccb_h;
187
188 debug_called(8);
189
190 ccb_h->spriv_ptr0 = sp;
191 sdebug(4, "func_code=0x%x flags=0x%x status=0x%x target=%d lun=%d retry_count=%d timeout=%d",
191 sdebug(4, "func_code=0x%x flags=0x%x status=0x%x target=%d lun=%jx retry_count=%d timeout=%d",
192 ccb_h->func_code, ccb->ccb_h.flags, ccb->ccb_h.status,
192 ccb_h->func_code, ccb->ccb_h.flags, ccb->ccb_h.status,
193 ccb->ccb_h.target_id, ccb->ccb_h.target_lun,
193 ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun,
194 ccb->ccb_h.retry_count, ccb_h->timeout);
195 if(sp == NULL) {
196 xdebug("sp == NULL! cannot happen");
197 return;
198 }
199 switch(ccb_h->func_code) {
200 case XPT_PATH_INQ:
201 _inq(sim, ccb);

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

230 break;
231 }
232
233 case XPT_CALC_GEOMETRY:
234 {
235 struct ccb_calc_geometry *ccg;
236
237 ccg = &ccb->ccg;
194 ccb->ccb_h.retry_count, ccb_h->timeout);
195 if(sp == NULL) {
196 xdebug("sp == NULL! cannot happen");
197 return;
198 }
199 switch(ccb_h->func_code) {
200 case XPT_PATH_INQ:
201 _inq(sim, ccb);

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

230 break;
231 }
232
233 case XPT_CALC_GEOMETRY:
234 {
235 struct ccb_calc_geometry *ccg;
236
237 ccg = &ccb->ccg;
238 debug(4, "sid=%d target=%d lun=%d XPT_CALC_GEOMETRY vsize=%jd bsize=%d",
239 sp->sid, ccb->ccb_h.target_id, ccb->ccb_h.target_lun,
238 debug(4, "sid=%d target=%d lun=%jx XPT_CALC_GEOMETRY vsize=%jd bsize=%d",
239 sp->sid, ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun,
240 ccg->volume_size, ccg->block_size);
241 if(ccg->block_size == 0 ||
242 (ccg->volume_size < ccg->block_size)) {
243 // print error message ...
244 /* XXX: what error is appropiate? */
245 break;
246 }
247 else {

--- 137 unchanged lines hidden ---
240 ccg->volume_size, ccg->block_size);
241 if(ccg->block_size == 0 ||
242 (ccg->volume_size < ccg->block_size)) {
243 // print error message ...
244 /* XXX: what error is appropiate? */
245 break;
246 }
247 else {

--- 137 unchanged lines hidden ---