Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hosts.c File Reference
#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/kthread.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/transport_class.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include "scsi_priv.h"
#include "scsi_logging.h"

Go to the source code of this file.


int scsi_host_set_state (struct Scsi_Host *shost, enum scsi_host_state state)
 EXPORT_SYMBOL (scsi_host_set_state)
void scsi_remove_host (struct Scsi_Host *shost)
 EXPORT_SYMBOL (scsi_remove_host)
int scsi_add_host_with_dma (struct Scsi_Host *shost, struct device *dev, struct device *dma_dev)
 EXPORT_SYMBOL (scsi_add_host_with_dma)
struct Scsi_Hostscsi_host_alloc (struct scsi_host_template *sht, int privsize)
 EXPORT_SYMBOL (scsi_host_alloc)
struct Scsi_Hostscsi_register (struct scsi_host_template *sht, int privsize)
 EXPORT_SYMBOL (scsi_register)
void scsi_unregister (struct Scsi_Host *shost)
 EXPORT_SYMBOL (scsi_unregister)
struct Scsi_Hostscsi_host_lookup (unsigned short hostnum)
 EXPORT_SYMBOL (scsi_host_lookup)
struct Scsi_Hostscsi_host_get (struct Scsi_Host *shost)
 EXPORT_SYMBOL (scsi_host_get)
void scsi_host_put (struct Scsi_Host *shost)
 EXPORT_SYMBOL (scsi_host_put)
int scsi_init_hosts (void)
void scsi_exit_hosts (void)
int scsi_is_host_device (const struct device *dev)
 EXPORT_SYMBOL (scsi_is_host_device)
int scsi_queue_work (struct Scsi_Host *shost, struct work_struct *work)
 EXPORT_SYMBOL_GPL (scsi_queue_work)
void scsi_flush_work (struct Scsi_Host *shost)
 EXPORT_SYMBOL_GPL (scsi_flush_work)

Function Documentation

EXPORT_SYMBOL ( scsi_host_set_state  )
EXPORT_SYMBOL ( scsi_remove_host  )
EXPORT_SYMBOL ( scsi_add_host_with_dma  )
EXPORT_SYMBOL ( scsi_host_alloc  )
EXPORT_SYMBOL ( scsi_register  )
EXPORT_SYMBOL ( scsi_unregister  )
EXPORT_SYMBOL ( scsi_host_lookup  )
EXPORT_SYMBOL ( scsi_host_get  )
EXPORT_SYMBOL ( scsi_host_put  )
EXPORT_SYMBOL ( scsi_is_host_device  )
EXPORT_SYMBOL_GPL ( scsi_queue_work  )
EXPORT_SYMBOL_GPL ( scsi_flush_work  )
int scsi_add_host_with_dma ( struct Scsi_Host shost,
struct device dev,
struct device dma_dev 

scsi_add_host_with_dma - add a scsi host with dma device : scsi host pointer to add : a struct device of type scsi class : dma device for the host

Note: You rarely need to worry about this unless you're in a virtualised host environments, so use the simpler scsi_add_host() function instead.

Return value: 0 on success / != 0 for error

Definition at line 200 of file hosts.c.

void scsi_exit_hosts ( void  )

Definition at line 534 of file hosts.c.

void scsi_flush_work ( struct Scsi_Host shost)

scsi_flush_work - Flush a Scsi_Host's workqueue. : Pointer to Scsi_Host.

Definition at line 574 of file hosts.c.

struct Scsi_Host* scsi_host_alloc ( struct scsi_host_template sht,
int  privsize 

scsi_host_alloc - register a scsi host adapter instance. : pointer to scsi host template : extra bytes to allocate for driver

Note: Allocate a new Scsi_Host and perform basic initialization. The host is not published to the scsi midlayer until scsi_add_host is called.

Return value: Pointer to a new Scsi_Host

Definition at line 337 of file hosts.c.

struct Scsi_Host* scsi_host_get ( struct Scsi_Host shost)

scsi_host_get - inc a Scsi_Host ref count : Pointer to Scsi_Host to inc.

Definition at line 510 of file hosts.c.

struct Scsi_Host* scsi_host_lookup ( unsigned short  hostnum)

scsi_host_lookup - get a reference to a Scsi_Host by host no : host number to locate

Return value: A pointer to located Scsi_Host or NULL.

The caller must do a scsi_host_put() to drop the reference that scsi_host_get() took. The put_device() below dropped the reference from class_find_device().

Definition at line 491 of file hosts.c.

void scsi_host_put ( struct Scsi_Host shost)

scsi_host_put - dec a Scsi_Host ref count : Pointer to Scsi_Host to dec.

Definition at line 523 of file hosts.c.

int scsi_host_set_state ( struct Scsi_Host shost,
enum scsi_host_state  state 

scsi_host_set_state - Take the given host through the host state model. : scsi host to change the state of. : state to change to.

Returns zero if unsuccessful or an error if the requested transition is illegal.

Definition at line 66 of file hosts.c.

int scsi_init_hosts ( void  )

Definition at line 529 of file hosts.c.

int scsi_is_host_device ( const struct device dev)

Definition at line 539 of file hosts.c.

int scsi_queue_work ( struct Scsi_Host shost,
struct work_struct work 

scsi_queue_work - Queue work to the Scsi_Host workqueue. : Pointer to Scsi_Host. : Work to queue for execution.

Return value: 1 - work queued for execution 0 - work is already queued -EINVAL - work queue doesn't exist

Definition at line 555 of file hosts.c.

struct Scsi_Host* scsi_register ( struct scsi_host_template sht,
int  privsize 

Definition at line 448 of file hosts.c.

void scsi_remove_host ( struct Scsi_Host shost)

scsi_remove_host - remove a scsi host : a pointer to a scsi host to remove

Definition at line 157 of file hosts.c.

void scsi_unregister ( struct Scsi_Host shost)

Definition at line 464 of file hosts.c.