mfi_cam.c (235318) | mfi_cam.c (242681) |
---|---|
1/*- 2 * Copyright 2007 Scott Long 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright 2007 Scott Long 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/mfi/mfi_cam.c 235318 2012-05-12 03:30:50Z sbruno $"); | 28__FBSDID("$FreeBSD: head/sys/dev/mfi/mfi_cam.c 242681 2012-11-06 23:25:06Z ambrisko $"); |
29 30#include "opt_mfi.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> --- 37 unchanged lines hidden (view full) --- 74static int mfip_probe(device_t); 75static int mfip_attach(device_t); 76static int mfip_detach(device_t); 77static void mfip_cam_action(struct cam_sim *, union ccb *); 78static void mfip_cam_poll(struct cam_sim *); 79static struct mfi_command * mfip_start(void *); 80static void mfip_done(struct mfi_command *cm); 81 | 29 30#include "opt_mfi.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> --- 37 unchanged lines hidden (view full) --- 74static int mfip_probe(device_t); 75static int mfip_attach(device_t); 76static int mfip_detach(device_t); 77static void mfip_cam_action(struct cam_sim *, union ccb *); 78static void mfip_cam_poll(struct cam_sim *); 79static struct mfi_command * mfip_start(void *); 80static void mfip_done(struct mfi_command *cm); 81 |
82static int mfi_allow_disks = 0; 83TUNABLE_INT("hw.mfi.allow_cam_disk_passthrough", &mfi_allow_disks); 84SYSCTL_INT(_hw_mfi, OID_AUTO, allow_cam_disk_passthrough, CTLFLAG_RD, 85 &mfi_allow_disks, 0, "event message locale"); 86 |
|
82static devclass_t mfip_devclass; 83static device_method_t mfip_methods[] = { 84 DEVMETHOD(device_probe, mfip_probe), 85 DEVMETHOD(device_attach, mfip_attach), 86 DEVMETHOD(device_detach, mfip_detach), 87 {0, 0} 88}; 89static driver_t mfip_driver = { --- 254 unchanged lines hidden (view full) --- 344 ccbh->status = CAM_REQ_CMP; 345 csio->scsi_status = pt->header.scsi_status; 346 if (ccbh->flags & CAM_CDB_POINTER) 347 command = csio->cdb_io.cdb_ptr[0]; 348 else 349 command = csio->cdb_io.cdb_bytes[0]; 350 if (command == INQUIRY) { 351 device = csio->data_ptr[0] & 0x1f; | 87static devclass_t mfip_devclass; 88static device_method_t mfip_methods[] = { 89 DEVMETHOD(device_probe, mfip_probe), 90 DEVMETHOD(device_attach, mfip_attach), 91 DEVMETHOD(device_detach, mfip_detach), 92 {0, 0} 93}; 94static driver_t mfip_driver = { --- 254 unchanged lines hidden (view full) --- 349 ccbh->status = CAM_REQ_CMP; 350 csio->scsi_status = pt->header.scsi_status; 351 if (ccbh->flags & CAM_CDB_POINTER) 352 command = csio->cdb_io.cdb_ptr[0]; 353 else 354 command = csio->cdb_io.cdb_bytes[0]; 355 if (command == INQUIRY) { 356 device = csio->data_ptr[0] & 0x1f; |
352 if ((device == T_DIRECT) || (device == T_PROCESSOR)) | 357 if ((!mfi_allow_disks && device == T_DIRECT) || 358 (device == T_PROCESSOR)) |
353 csio->data_ptr[0] = 354 (csio->data_ptr[0] & 0xe0) | T_NODEVICE; 355 } 356 break; 357 } 358 case MFI_STAT_SCSI_DONE_WITH_ERROR: 359 { 360 int sense_len; --- 26 unchanged lines hidden (view full) --- 387 388 mfi_release_command(cm); 389 xpt_done(ccb); 390} 391 392static void 393mfip_cam_poll(struct cam_sim *sim) 394{ | 359 csio->data_ptr[0] = 360 (csio->data_ptr[0] & 0xe0) | T_NODEVICE; 361 } 362 break; 363 } 364 case MFI_STAT_SCSI_DONE_WITH_ERROR: 365 { 366 int sense_len; --- 26 unchanged lines hidden (view full) --- 393 394 mfi_release_command(cm); 395 xpt_done(ccb); 396} 397 398static void 399mfip_cam_poll(struct cam_sim *sim) 400{ |
395 return; | 401 struct mfip_softc *sc = cam_sim_softc(sim); 402 struct mfi_softc *mfisc = sc->mfi_sc; 403 404 mfisc->mfi_intr_ptr(mfisc); |
396} 397 | 405} 406 |