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_rd.c

Blame
  • target_core_rd.c 11.86 KiB
    /*******************************************************************************
     * Filename:  target_core_rd.c
     *
     * This file contains the Storage Engine <-> Ramdisk transport
     * specific functions.
     *
     * (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/slab.h>
    #include <linux/spinlock.h>
    #include <scsi/scsi.h>
    #include <scsi/scsi_host.h>
    
    #include <target/target_core_base.h>
    #include <target/target_core_backend.h>
    
    #include "target_core_rd.h"
    
    static inline struct rd_dev *RD_DEV(struct se_device *dev)
    {
    	return container_of(dev, struct rd_dev, dev);
    }
    
    /*	rd_attach_hba(): (Part of se_subsystem_api_t template)
     *
     *
     */
    static int rd_attach_hba(struct se_hba *hba, u32 host_id)
    {
    	struct rd_host *rd_host;
    
    	rd_host = kzalloc(sizeof(struct rd_host), GFP_KERNEL);
    	if (!rd_host) {
    		pr_err("Unable to allocate memory for struct rd_host\n");
    		return -ENOMEM;
    	}
    
    	rd_host->rd_host_id = host_id;
    
    	hba->hba_ptr = rd_host;
    
    	pr_debug("CORE_HBA[%d] - TCM Ramdisk HBA Driver %s on"
    		" Generic Target Core Stack %s\n", hba->hba_id,
    		RD_HBA_VERSION, TARGET_CORE_MOD_VERSION);
    
    	return 0;
    }