#include <linux/kernel.h>
#include <linux/blkdev.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <scsi/scsi_transport.h>
#include <linux/libata.h>
#include <linux/hdreg.h>
#include <linux/uaccess.h>
#include <linux/pm_runtime.h>
#include "libata.h"
#include "libata-transport.h"
#define ATA_PORT_ATTRS …
#define ATA_LINK_ATTRS …
#define ATA_DEV_ATTRS …
struct scsi_transport_template;
struct scsi_transport_template *ata_scsi_transport_template;
struct ata_internal { … };
#define to_ata_internal(tmpl) …
#define tdev_to_device(d) …
#define transport_class_to_dev(dev) …
#define tdev_to_link(d) …
#define transport_class_to_link(dev) …
#define tdev_to_port(d) …
#define transport_class_to_port(dev) …
static int ata_tdev_add(struct ata_device *dev);
static void ata_tdev_delete(struct ata_device *dev);
#define ATA_DEVICE_ATTR(_prefix,_name,_mode,_show,_store) …
#define ata_bitfield_name_match(title, table) …
#define ata_bitfield_name_search(title, table) …
static struct { … } ata_class_names[] = …;
ata_bitfield_name_search(class, ata_class_names)
static struct { … } ata_err_names[] = …;
ata_bitfield_name_match(err, ata_err_names)
static struct { … } ata_xfer_names[] = …;
ata_bitfield_name_search(xfer, ata_xfer_names)
#define ata_port_show_simple(field, name, format_string, cast) …
#define ata_port_simple_attr(field, name, format_string, type) …
ata_port_simple_attr(…) …;
ata_port_simple_attr(…) …;
ata_port_simple_attr(…) …;
static DECLARE_TRANSPORT_CLASS(ata_port_class,
"ata_port", NULL, NULL, NULL);
static void ata_tport_release(struct device *dev)
{ … }
static int ata_is_port(const struct device *dev)
{ … }
static int ata_tport_match(struct attribute_container *cont,
struct device *dev)
{ … }
void ata_tport_delete(struct ata_port *ap)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct device_type ata_port_sas_type = …;
int ata_tport_add(struct device *parent,
struct ata_port *ap)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int ata_port_classify(struct ata_port *ap,
const struct ata_taskfile *tf)
{ … }
EXPORT_SYMBOL_GPL(…);
static int noop(int x) { … }
#define ata_link_show_linkspeed(field, format) …
#define ata_link_linkspeed_attr(field, format) …
ata_link_linkspeed_attr(…);
ata_link_linkspeed_attr(…);
ata_link_linkspeed_attr(…);
static DECLARE_TRANSPORT_CLASS(ata_link_class,
"ata_link", NULL, NULL, NULL);
static void ata_tlink_release(struct device *dev)
{ … }
static int ata_is_link(const struct device *dev)
{ … }
static int ata_tlink_match(struct attribute_container *cont,
struct device *dev)
{ … }
void ata_tlink_delete(struct ata_link *link)
{ … }
int ata_tlink_add(struct ata_link *link)
{ … }
#define ata_dev_show_class(title, field) …
#define ata_dev_attr(title, field) …
ata_dev_attr(…);
ata_dev_attr(…);
ata_dev_attr(…);
ata_dev_attr(…);
#define ata_dev_show_simple(field, format_string, cast) …
#define ata_dev_simple_attr(field, format_string, type) …
ata_dev_simple_attr(…) …;
struct ata_show_ering_arg { … };
static int ata_show_ering(struct ata_ering_entry *ent, void *void_arg)
{ … }
static ssize_t
show_ata_dev_ering(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(ering, S_IRUGO, show_ata_dev_ering, NULL);
static ssize_t
show_ata_dev_id(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(id, S_IRUGO, show_ata_dev_id, NULL);
static ssize_t
show_ata_dev_gscr(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(gscr, S_IRUGO, show_ata_dev_gscr, NULL);
static ssize_t
show_ata_dev_trim(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(trim, S_IRUGO, show_ata_dev_trim, NULL);
static DECLARE_TRANSPORT_CLASS(ata_dev_class,
"ata_device", NULL, NULL, NULL);
static void ata_tdev_release(struct device *dev)
{ … }
static int ata_is_ata_dev(const struct device *dev)
{ … }
static int ata_tdev_match(struct attribute_container *cont,
struct device *dev)
{ … }
static void ata_tdev_free(struct ata_device *dev)
{ … }
static void ata_tdev_delete(struct ata_device *ata_dev)
{ … }
static int ata_tdev_add(struct ata_device *ata_dev)
{ … }
#define SETUP_TEMPLATE(attrb, field, perm, test) …
#define SETUP_LINK_ATTRIBUTE(field) …
#define SETUP_PORT_ATTRIBUTE(field) …
#define SETUP_DEV_ATTRIBUTE(field) …
struct scsi_transport_template *ata_attach_transport(void)
{ … }
void ata_release_transport(struct scsi_transport_template *t)
{ … }
__init int libata_transport_init(void)
{ … }
void __exit libata_transport_exit(void)
{ … }