Deleted Added
full compact
isp_freebsd.c (167473) isp_freebsd.c (168240)
1/*-
2 * Copyright (c) 1997-2006 by Matthew Jacob
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 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
29 */
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2006 by Matthew Jacob
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 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
29 */
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/isp/isp_freebsd.c 167473 2007-03-12 04:54:30Z mjacob $");
31__FBSDID("$FreeBSD: head/sys/dev/isp/isp_freebsd.c 168240 2007-04-02 01:04:20Z mjacob $");
32#include <dev/isp/isp_freebsd.h>
33#include <sys/unistd.h>
34#include <sys/kthread.h>
35#include <machine/stdarg.h> /* for use by isp_prt below */
36#include <sys/conf.h>
37#include <sys/module.h>
38#include <sys/ioccom.h>
39#include <dev/isp/isp_ioctl.h>

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

377 retval = 0;
378 break;
379 case ISP_SETROLE:
380 nr = *(int *)addr;
381 if (nr & ~(ISP_ROLE_INITIATOR|ISP_ROLE_TARGET)) {
382 retval = EINVAL;
383 break;
384 }
32#include <dev/isp/isp_freebsd.h>
33#include <sys/unistd.h>
34#include <sys/kthread.h>
35#include <machine/stdarg.h> /* for use by isp_prt below */
36#include <sys/conf.h>
37#include <sys/module.h>
38#include <sys/ioccom.h>
39#include <dev/isp/isp_ioctl.h>

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

377 retval = 0;
378 break;
379 case ISP_SETROLE:
380 nr = *(int *)addr;
381 if (nr & ~(ISP_ROLE_INITIATOR|ISP_ROLE_TARGET)) {
382 retval = EINVAL;
383 break;
384 }
385 /*
386 * XXX: Current
387 */
388 if (nr == ISP_ROLE_BOTH) {
389 isp_prt(isp, ISP_LOGERR, "dual roles not supported");
390 retval = EINVAL;
391 break;
392 }
385 *(int *)addr = isp->isp_role;
386 isp->isp_role = nr;
387 /* FALLTHROUGH */
388 case ISP_RESETHBA:
389 ISP_LOCK(isp);
390 isp_reinit(isp);
391 ISP_UNLOCK(isp);
392 retval = 0;

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

1128 isp->isp_osinfo.leact[seq] = 0;
1129 ccb->ccb_h.status = CAM_REQ_CMP_ERR;
1130 return (-1);
1131}
1132
1133static void
1134isp_ledone(ispsoftc_t *isp, lun_entry_t *lep)
1135{
393 *(int *)addr = isp->isp_role;
394 isp->isp_role = nr;
395 /* FALLTHROUGH */
396 case ISP_RESETHBA:
397 ISP_LOCK(isp);
398 isp_reinit(isp);
399 ISP_UNLOCK(isp);
400 retval = 0;

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

1136 isp->isp_osinfo.leact[seq] = 0;
1137 ccb->ccb_h.status = CAM_REQ_CMP_ERR;
1138 return (-1);
1139}
1140
1141static void
1142isp_ledone(ispsoftc_t *isp, lun_entry_t *lep)
1143{
1136 const char lfmt[] = "now %sabled for target mode";
1144 const char lfmt[] = "now %sabled for target mode\n";
1137 union ccb *ccb;
1138 uint32_t seq;
1139 tstate_t *tptr;
1140 int av;
1141 struct ccb_en_lun *cel;
1142
1143 seq = lep->le_reserved - 1;
1144 if (seq >= NLEACT) {

--- 2569 unchanged lines hidden ---
1145 union ccb *ccb;
1146 uint32_t seq;
1147 tstate_t *tptr;
1148 int av;
1149 struct ccb_en_lun *cel;
1150
1151 seq = lep->le_reserved - 1;
1152 if (seq >= NLEACT) {

--- 2569 unchanged lines hidden ---