1/*- 2 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. 3 * |
4 * Copyright (c) 1997-2006 by Matthew Jacob 5 * All rights reserved. |
6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice immediately at the beginning of the file, without modification, 12 * this list of conditions, and the following disclaimer. 13 * 2. The name of the author may not be used to endorse or promote products --- 8 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/isp/isp_freebsd.c 154704 2006-01-23 06:23:37Z mjacob $"); |
31 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> --- 464 unchanged lines hidden (view full) --- 503 } 504 retval = EINVAL; 505 break; 506 } 507 case ISP_TSK_MGMT: 508 { 509 int needmarker; 510 struct isp_fc_tsk_mgmt *fct = (struct isp_fc_tsk_mgmt *) addr; |
511 u_int16_t loopid; |
512 mbreg_t mbs; 513 514 if (IS_SCSI(isp)) { 515 retval = EINVAL; 516 break; 517 } 518 519 memset(&mbs, 0, sizeof (mbs)); 520 needmarker = retval = 0; |
521 loopid = fct->loopid; 522 if (IS_2KLOGIN(isp) == 0) { 523 loopid <<= 8; 524 } |
525 switch (fct->action) { 526 case CLEAR_ACA: 527 mbs.param[0] = MBOX_CLEAR_ACA; |
528 mbs.param[1] = loopid; |
529 mbs.param[2] = fct->lun; 530 break; 531 case TARGET_RESET: 532 mbs.param[0] = MBOX_TARGET_RESET; |
533 mbs.param[1] = loopid; |
534 needmarker = 1; 535 break; 536 case LUN_RESET: 537 mbs.param[0] = MBOX_LUN_RESET; |
538 mbs.param[1] = loopid; |
539 mbs.param[2] = fct->lun; 540 needmarker = 1; 541 break; 542 case CLEAR_TASK_SET: 543 mbs.param[0] = MBOX_CLEAR_TASK_SET; |
544 mbs.param[1] = loopid; |
545 mbs.param[2] = fct->lun; 546 needmarker = 1; 547 break; 548 case ABORT_TASK_SET: 549 mbs.param[0] = MBOX_ABORT_TASK_SET; |
550 mbs.param[1] = loopid; |
551 mbs.param[2] = fct->lun; 552 needmarker = 1; 553 break; 554 default: 555 retval = EINVAL; 556 break; 557 } 558 if (retval == 0) { --- 47 unchanged lines hidden (view full) --- 606static cam_status isp_abort_tgt_ccb(struct ispsoftc *, union ccb *); 607static timeout_t isp_refire_putback_atio; 608static void isp_complete_ctio(union ccb *); 609static void isp_target_putback_atio(union ccb *); 610static cam_status isp_target_start_ctio(struct ispsoftc *, union ccb *); 611static int isp_handle_platform_atio(struct ispsoftc *, at_entry_t *); 612static int isp_handle_platform_atio2(struct ispsoftc *, at2_entry_t *); 613static int isp_handle_platform_ctio(struct ispsoftc *, void *); |
614static int isp_handle_platform_notify_scsi(struct ispsoftc *, in_entry_t *); 615static int isp_handle_platform_notify_fc(struct ispsoftc *, in_fcentry_t *); 616 617static INLINE int 618is_lun_enabled(struct ispsoftc *isp, int bus, lun_id_t lun) 619{ 620 tstate_t *tptr; 621 tptr = isp->isp_osinfo.lun_hash[LUN_HASH_FUNC(isp, bus, lun)]; --- 1173 unchanged lines hidden (view full) --- 1795 isp_target_putback_atio(ccb); 1796 } else { 1797 isp_complete_ctio(ccb); 1798 1799 } 1800 return (0); 1801} 1802 |
1803static int 1804isp_handle_platform_notify_scsi(struct ispsoftc *isp, in_entry_t *inp) 1805{ 1806 return (0); /* XXXX */ 1807} 1808 1809static int 1810isp_handle_platform_notify_fc(struct ispsoftc *isp, in_fcentry_t *inp) --- 1256 unchanged lines hidden (view full) --- 3067 lp->fc4_type = clp->fc4_type; 3068 lp->node_wwn = clp->node_wwn; 3069 lp->port_wwn = clp->port_wwn; 3070 lp->portid = clp->portid; 3071 lp->fabric_dev = 1; 3072 break; 3073 } 3074#ifdef ISP_TARGET_MODE |
3075 case ISPASYNC_TARGET_NOTIFY: |
3076 { |
3077 tmd_notify_t *nt = arg; |
3078 isp_prt(isp, ISP_LOGALL, |
3079 "target notify code 0x%x", nt->nt_ncode); |
3080 break; 3081 } |
3082 case ISPASYNC_TARGET_ACTION: 3083 switch (((isphdr_t *)arg)->rqs_entry_type) { 3084 default: 3085 isp_prt(isp, ISP_LOGWARN, 3086 "event 0x%x for unhandled target action", 3087 ((isphdr_t *)arg)->rqs_entry_type); 3088 break; 3089 case RQSTYPE_NOTIFY: --- 85 unchanged lines hidden --- |