Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158509
b: refs/heads/master
c: 77cdec1
h: refs/heads/master
i:
  158507: 01bb43d
v: v3
  • Loading branch information
Matthew Garrett authored and Jeff Garzik committed Sep 1, 2009
1 parent aa23d9a commit ba835d0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f17259a31237cf0fd5c6c8cf2a4f9e6df405744b
refs/heads/master: 77cdec1ad527560b59ab8dbb063dbb3d0a138bf7
44 changes: 44 additions & 0 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,24 @@ static ssize_t ahci_activity_store(struct ata_device *dev,
enum sw_activity val);
static void ahci_init_sw_activity(struct ata_link *link);

static ssize_t ahci_show_host_caps(struct device *dev,
struct device_attribute *attr, char *buf);
static ssize_t ahci_show_host_version(struct device *dev,
struct device_attribute *attr, char *buf);
static ssize_t ahci_show_port_cmd(struct device *dev,
struct device_attribute *attr, char *buf);

DEVICE_ATTR(ahci_host_caps, S_IRUGO, ahci_show_host_caps, NULL);
DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL);
DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);

static struct device_attribute *ahci_shost_attrs[] = {
&dev_attr_link_power_management_policy,
&dev_attr_em_message_type,
&dev_attr_em_message,
&dev_attr_ahci_host_caps,
&dev_attr_ahci_host_version,
&dev_attr_ahci_port_cmd,
NULL
};

Expand Down Expand Up @@ -702,6 +716,36 @@ static void ahci_enable_ahci(void __iomem *mmio)
WARN_ON(1);
}

static ssize_t ahci_show_host_caps(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct Scsi_Host *shost = class_to_shost(dev);
struct ata_port *ap = ata_shost_to_port(shost);
struct ahci_host_priv *hpriv = ap->host->private_data;

return sprintf(buf, "%x\n", hpriv->cap);
}

static ssize_t ahci_show_host_version(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct Scsi_Host *shost = class_to_shost(dev);
struct ata_port *ap = ata_shost_to_port(shost);
void __iomem *mmio = ap->host->iomap[AHCI_PCI_BAR];

return sprintf(buf, "%x\n", readl(mmio + HOST_VERSION));
}

static ssize_t ahci_show_port_cmd(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct Scsi_Host *shost = class_to_shost(dev);
struct ata_port *ap = ata_shost_to_port(shost);
void __iomem *port_mmio = ahci_port_base(ap);

return sprintf(buf, "%x\n", readl(port_mmio + PORT_CMD));
}

/**
* ahci_save_initial_config - Save and fixup initial config values
* @pdev: target PCI device
Expand Down

0 comments on commit ba835d0

Please sign in to comment.