Skip to content
Snippets Groups Projects
Select Git revision
  • 574780fd5e6ec52bd43e0bdb777a19e4c4c6aa9c
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

target_core_pscsi.c

Blame
  • target_core_pscsi.c 29.87 KiB
    /*******************************************************************************
     * Filename:  target_core_pscsi.c
     *
     * This file contains the generic target mode <-> Linux SCSI subsystem plugin.
     *
     * (c) Copyright 2003-2012 RisingTide Systems LLC.
     *
     * Nicholas A. Bellinger <nab@kernel.org>
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     *
     ******************************************************************************/
    
    #include <linux/string.h>
    #include <linux/parser.h>
    #include <linux/timer.h>
    #include <linux/blkdev.h>
    #include <linux/blk_types.h>
    #include <linux/slab.h>
    #include <linux/spinlock.h>
    #include <linux/genhd.h>
    #include <linux/cdrom.h>
    #include <linux/ratelimit.h>
    #include <linux/module.h>
    #include <asm/unaligned.h>
    
    #include <scsi/scsi.h>
    #include <scsi/scsi_device.h>
    #include <scsi/scsi_cmnd.h>
    #include <scsi/scsi_host.h>
    #include <scsi/scsi_tcq.h>
    
    #include <target/target_core_base.h>
    #include <target/target_core_backend.h>
    
    #include "target_core_alua.h"
    #include "target_core_pscsi.h"
    
    #define ISPRINT(a)  ((a >= ' ') && (a <= '~'))
    
    static inline struct pscsi_dev_virt *PSCSI_DEV(struct se_device *dev)
    {
    	return container_of(dev, struct pscsi_dev_virt, dev);
    }
    
    static struct se_subsystem_api pscsi_template;
    
    static sense_reason_t pscsi_execute_cmd(struct se_cmd *cmd);
    static void pscsi_req_done(struct request *, int);
    
    /*	pscsi_attach_hba():
     *
     * 	pscsi_get_sh() used scsi_host_lookup() to locate struct Scsi_Host.
     *	from the passed SCSI Host ID.
     */
    static int pscsi_attach_hba(struct se_hba *hba, u32 host_id)
    {
    	struct pscsi_hba_virt *phv;