#include <linux/init.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_srp.h>
#include "scsi_priv.h"
struct srp_host_attrs { … };
#define to_srp_host_attrs(host) …
#define SRP_HOST_ATTRS …
#define SRP_RPORT_ATTRS …
struct srp_internal { … };
static int scsi_is_srp_rport(const struct device *dev);
#define to_srp_internal(tmpl) …
#define dev_to_rport(d) …
#define transport_class_to_srp_rport(dev) …
static inline struct Scsi_Host *rport_to_shost(struct srp_rport *r)
{ … }
static int find_child_rport(struct device *dev, void *data)
{ … }
static inline struct srp_rport *shost_to_rport(struct Scsi_Host *shost)
{ … }
int srp_tmo_valid(int reconnect_delay, int fast_io_fail_tmo, long dev_loss_tmo)
{ … }
EXPORT_SYMBOL_GPL(…);
static int srp_host_setup(struct transport_container *tc, struct device *dev,
struct device *cdev)
{ … }
static DECLARE_TRANSPORT_CLASS(srp_host_class, "srp_host", srp_host_setup,
NULL, NULL);
static DECLARE_TRANSPORT_CLASS(srp_rport_class, "srp_remote_ports",
NULL, NULL, NULL);
static ssize_t
show_srp_rport_id(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(port_id, S_IRUGO, show_srp_rport_id, NULL);
static const struct { … } srp_rport_role_names[] = …;
static ssize_t
show_srp_rport_roles(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(roles, S_IRUGO, show_srp_rport_roles, NULL);
static ssize_t store_srp_rport_delete(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(delete, S_IWUSR, NULL, store_srp_rport_delete);
static ssize_t show_srp_rport_state(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(state, S_IRUGO, show_srp_rport_state, NULL);
static ssize_t srp_show_tmo(char *buf, int tmo)
{ … }
int srp_parse_tmo(int *tmo, const char *buf)
{ … }
EXPORT_SYMBOL(…);
static ssize_t show_reconnect_delay(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_reconnect_delay(struct device *dev,
struct device_attribute *attr,
const char *buf, const size_t count)
{ … }
static DEVICE_ATTR(reconnect_delay, S_IRUGO | S_IWUSR, show_reconnect_delay,
store_reconnect_delay);
static ssize_t show_failed_reconnects(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(failed_reconnects, S_IRUGO, show_failed_reconnects, NULL);
static ssize_t show_srp_rport_fast_io_fail_tmo(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t store_srp_rport_fast_io_fail_tmo(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(fast_io_fail_tmo, S_IRUGO | S_IWUSR,
show_srp_rport_fast_io_fail_tmo,
store_srp_rport_fast_io_fail_tmo);
static ssize_t show_srp_rport_dev_loss_tmo(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t store_srp_rport_dev_loss_tmo(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(dev_loss_tmo, S_IRUGO | S_IWUSR,
show_srp_rport_dev_loss_tmo,
store_srp_rport_dev_loss_tmo);
static int srp_rport_set_state(struct srp_rport *rport,
enum srp_rport_state new_state)
{ … }
static void srp_reconnect_work(struct work_struct *work)
{ … }
static void __rport_fail_io_fast(struct srp_rport *rport)
{ … }
static void rport_fast_io_fail_timedout(struct work_struct *work)
{ … }
static void rport_dev_loss_timedout(struct work_struct *work)
{ … }
static void __srp_start_tl_fail_timers(struct srp_rport *rport)
{ … }
void srp_start_tl_fail_timers(struct srp_rport *rport)
{ … }
EXPORT_SYMBOL(…);
int srp_reconnect_rport(struct srp_rport *rport)
{ … }
EXPORT_SYMBOL(…);
enum scsi_timeout_action srp_timed_out(struct scsi_cmnd *scmd)
{ … }
EXPORT_SYMBOL(…);
static void srp_rport_release(struct device *dev)
{ … }
static int scsi_is_srp_rport(const struct device *dev)
{ … }
static int srp_rport_match(struct attribute_container *cont,
struct device *dev)
{ … }
static int srp_host_match(struct attribute_container *cont, struct device *dev)
{ … }
void srp_rport_get(struct srp_rport *rport)
{ … }
EXPORT_SYMBOL(…);
void srp_rport_put(struct srp_rport *rport)
{ … }
EXPORT_SYMBOL(…);
struct srp_rport *srp_rport_add(struct Scsi_Host *shost,
struct srp_rport_identifiers *ids)
{ … }
EXPORT_SYMBOL_GPL(…);
void srp_rport_del(struct srp_rport *rport)
{ … }
EXPORT_SYMBOL_GPL(…);
static int do_srp_rport_del(struct device *dev, void *data)
{ … }
void srp_remove_host(struct Scsi_Host *shost)
{ … }
EXPORT_SYMBOL_GPL(…);
void srp_stop_rport_timers(struct srp_rport *rport)
{ … }
EXPORT_SYMBOL_GPL(…);
struct scsi_transport_template *
srp_attach_transport(struct srp_function_template *ft)
{ … }
EXPORT_SYMBOL_GPL(…);
void srp_release_transport(struct scsi_transport_template *t)
{ … }
EXPORT_SYMBOL_GPL(…);
static __init int srp_transport_init(void)
{ … }
static void __exit srp_transport_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(srp_transport_exit);