Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
scsi_devinfo.c File Reference
#include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_devinfo.h>
#include "scsi_priv.h"

Go to the source code of this file.

Data Structures

struct  scsi_dev_info_list
 
struct  scsi_dev_info_list_table
 

Functions

int scsi_dev_info_list_add_keyed (int compatible, char *vendor, char *model, char *strflags, int flags, int key)
 
 EXPORT_SYMBOL (scsi_dev_info_list_add_keyed)
 
int scsi_dev_info_list_del_keyed (char *vendor, char *model, int key)
 
 EXPORT_SYMBOL (scsi_dev_info_list_del_keyed)
 
int scsi_get_device_flags (struct scsi_device *sdev, const unsigned char *vendor, const unsigned char *model)
 
int scsi_get_device_flags_keyed (struct scsi_device *sdev, const unsigned char *vendor, const unsigned char *model, int key)
 
 EXPORT_SYMBOL (scsi_get_device_flags_keyed)
 
 module_param_string (dev_flags, scsi_dev_flags, sizeof(scsi_dev_flags), 0)
 
 MODULE_PARM_DESC (dev_flags,"Given scsi_dev_flags=vendor:model:flags[,v:m:f] add black/white"" list entries for vendor and model with an integer value of flags"" to the scsi device info list")
 
 module_param_named (default_dev_flags, scsi_default_dev_flags, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (default_dev_flags,"scsi default device flag integer value")
 
void scsi_exit_devinfo (void)
 
: Name of the list to add (for /proc/scsi/device_info)

scsi_dev_info_add_list - add a new devinfo list : key of the list to add

Adds the requested list, returns zero on success, -EEXIST if the key is already registered to a list, or other error on failure.

int scsi_dev_info_add_list (int key, const char *name)
 
 EXPORT_SYMBOL (scsi_dev_info_add_list)
 
int scsi_dev_info_remove_list (int key)
 
 EXPORT_SYMBOL (scsi_dev_info_remove_list)
 
int __init scsi_init_devinfo (void)
 

Function Documentation

EXPORT_SYMBOL ( scsi_dev_info_list_add_keyed  )
EXPORT_SYMBOL ( scsi_dev_info_list_del_keyed  )
EXPORT_SYMBOL ( scsi_get_device_flags_keyed  )
EXPORT_SYMBOL ( scsi_dev_info_add_list  )
EXPORT_SYMBOL ( scsi_dev_info_remove_list  )
module_param_named ( default_dev_flags  ,
scsi_default_dev_flags  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_string ( dev_flags  ,
scsi_dev_flags  ,
sizeof(scsi_dev_flags)  ,
 
)
MODULE_PARM_DESC ( dev_flags  ,
"Given  scsi_dev_flags = vendor:model:flags[,
v:m:f] add black/white""list entries for vendor and model with an integer value of flags""to the scsi device info list  
)
MODULE_PARM_DESC ( default_dev_flags  ,
"scsi default device flag integer value  
)
int scsi_dev_info_add_list ( int  key,
const char name 
)

Definition at line 795 of file scsi_devinfo.c.

int scsi_dev_info_list_add_keyed ( int  compatible,
char vendor,
char model,
char strflags,
int  flags,
int  key 
)

scsi_dev_info_list_add_keyed - add one dev_info list entry. : if true, null terminate short strings. Otherwise space pad. : vendor string : model (product) string : integer string : if strflags NULL, use this flag value : specify list to use

Description: Create and add one dev_info entry for , , or in list specified by . If , add to the tail of the list, do not space pad, and set devinfo->compatible. The scsi_static_device_list entries are added with 1 and NULL.

Returns: 0 OK, -error on failure.

Definition at line 348 of file scsi_devinfo.c.

int scsi_dev_info_list_del_keyed ( char vendor,
char model,
int  key 
)

scsi_dev_info_list_del_keyed - remove one dev_info list entry. : vendor string : model (product) string : specify list to use

Description: Remove and destroy one dev_info entry for , in list specified by .

Returns: 0 OK, -error on failure.

Definition at line 399 of file scsi_devinfo.c.

int scsi_dev_info_remove_list ( int  key)

scsi_dev_info_remove_list - destroy an added devinfo list : key of the list to destroy

Iterates over the entire list first, freeing all the values, then frees the list itself. Returns 0 on success or -EINVAL if the key can't be found.

Definition at line 827 of file scsi_devinfo.c.

void scsi_exit_devinfo ( void  )

scsi_exit_devinfo - remove /proc/scsi/device_info & the scsi_dev_info_list

Definition at line 778 of file scsi_devinfo.c.

int scsi_get_device_flags ( struct scsi_device sdev,
const unsigned char vendor,
const unsigned char model 
)

get_device_flags - get device specific flags from the dynamic device list. : &scsi_device to get flags for : vendor name : model name

Description: Search the global scsi_dev_info_list (specified by list zero) for an entry matching and , if found, return the matching flags value, else return the host or global default settings. Called during scan time.

Definition at line 535 of file scsi_devinfo.c.

int scsi_get_device_flags_keyed ( struct scsi_device sdev,
const unsigned char vendor,
const unsigned char model,
int  key 
)

scsi_get_device_flags_keyed - get device specific flags from the dynamic device list : &scsi_device to get flags for : vendor name : model name : list to look up

Description: Search the scsi_dev_info_list specified by for an entry matching and , if found, return the matching flags value, else return the host or global default settings. Called during scan time.

Definition at line 557 of file scsi_devinfo.c.

int __init scsi_init_devinfo ( void  )

scsi_init_devinfo - set up the dynamic device list.

Description: Add command line entries from scsi_dev_flags, then add scsi_static_device_list entries to the scsi device info list.

Definition at line 860 of file scsi_devinfo.c.

Variable Documentation

unsigned flags

Definition at line 54 of file scsi_devinfo.c.

char* model

Definition at line 52 of file scsi_devinfo.c.

Definition at line 53 of file scsi_devinfo.c.

Definition at line 51 of file scsi_devinfo.c.