Also add a quirk for my CardBus based eSATA controller.
#
SUBSYSTEM=="pci", ACTION=="add|change", ENV{ID_MODEL_FROM_DATABASE}=="", ATTR{class}=="0x01*", IMPORT{program}="pci-db %p"
+# Set eSATA port type for known eSATA CardBus adapters - first we want to ensure
+# the device is on a cardbus controller (upper PCI device) - then we check
+# vid/pid (lower PCI device)
+#
+SUBSYSTEM=="scsi_host", ATTRS{class}=="0x060700", GOTO="ata_port_cardbus"
+GOTO="ata_port_cardbus_end"
+LABEL="ata_port_cardbus"
+# Mass storage controller: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller (rev 01)
+#
+ATTRS{vendor}=="0x1095", ATTRS{device}=="0x3512", ENV{UDISKS_ATA_PORT_CONNECTOR_TYPE}="ata_sata_external"
+LABEL="ata_port_cardbus_end"
+
# probe SAS expanders
#
# (hmm, this might be racy, we might not have the BSG device just yet - if
</doc:para></doc:description></doc:doc>
</property>
+ <property name="ConnectorType" type="s" access="read">
+ <doc:doc><doc:description><doc:para>
+ The connector type for the port (or for wide connectors, that the port is part of) or blank if unknown.
+ <doc:list>
+ <doc:item>
+ <doc:term>ata</doc:term><doc:definition>Some kind of ATA connector</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>ata_pata</doc:term><doc:definition>Parallel ATA</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>ata_sata</doc:term><doc:definition>Serial ATA - not sure whether it's an internal or external port.</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>ata_sata_internal</doc:term><doc:definition>Internal Serial ATA</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>ata_sata_external</doc:term><doc:definition>External Serial ATA</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi</doc:term><doc:definition>Some kind of SCSI connector</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas</doc:term><doc:definition>Some kind of SAS connector</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_internal</doc:term><doc:definition>SAS (SFF-8482)</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_2x</doc:term><doc:definition>SAS connector with 2 lanes</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_2x_wideband</doc:term><doc:definition>SAS Hi-Density with 2 lanes (SFF-8484)</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_4x</doc:term><doc:definition>Some kind of SAS connector with 4 lanes</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_4x_wideband</doc:term><doc:definition>SAS Hi-Density with 4 lanes (SFF-8484)</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_4x_mini</doc:term><doc:definition>Mini-SAS with 4 lanes (SFF-8087, iPass)</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_4x_mini_external</doc:term><doc:definition>External Mini-SAS with 4 lanes (SFF-8088)</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>scsi_sas_4x_infiband</doc:term><doc:definition>Infiniband with 4 lanes (SFF-8470)</doc:definition>
+ </doc:item>
+ </doc:list>
+ TODO: include other connector types
+ </doc:para></doc:description></doc:doc>
+ </property>
+
</interface>
</node>
}
void
-daemon_local_synthesize_changed (Daemon *daemon,
- Device *device)
+daemon_local_synthesize_changed (Daemon *daemon, Device *device)
{
g_object_ref (device->priv->d);
_device_changed (daemon, device->priv->d, TRUE);
void daemon_local_synthesize_changed_on_all_devices (Daemon *daemon);
-void daemon_local_synthesize_changed (Daemon *daemon,
- Device *device);
+void daemon_local_synthesize_changed (Daemon *daemon, Device *device);
void daemon_local_update_poller (Daemon *daemon);
}
void
+port_set_connector_type (Port *port,
+ const gchar *value)
+{
+ if (G_UNLIKELY (g_strcmp0 (port->priv->connector_type, value) != 0))
+ {
+ g_free (port->priv->connector_type);
+ port->priv->connector_type = g_strdup (value);
+ emit_changed (port, "connector_type");
+ }
+}
+
+void
port_set_number (Port *port,
gint value)
{
gchar *adapter;
gchar *parent;
+ gchar *connector_type;
gint number;
};
const gchar *value);
void port_set_parent (Port *port,
const gchar *value);
+void port_set_connector_type (Port *port,
+ const gchar *value);
void port_set_number (Port *port,
gint value);
/*--------------------------------------------------------------------------------------------------------------*/
#include "port-glue.h"
-static void
-port_class_init (PortClass *klass);
-static void
-port_init (Port *seat);
-static void
-port_finalize (GObject *object);
+static void port_class_init (PortClass *klass);
+static void port_init (Port *seat);
+static void port_finalize (GObject *object);
-static gboolean
-update_info (Port *port);
+static gboolean update_info (Port *port);
static void
drain_pending_changes (Port *port,
PROP_ADAPTER,
PROP_PARENT,
PROP_NUMBER,
+ PROP_CONNECTOR_TYPE,
};
enum
g_value_set_int (value, port->priv->number);
break;
+ case PROP_CONNECTOR_TYPE:
+ g_value_set_string (value, port->priv->connector_type);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
G_MAXINT,
-1,
G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_CONNECTOR_TYPE, g_param_spec_string ("connector-type",
+ NULL,
+ NULL,
+ NULL,
+ G_PARAM_READABLE));
}
static void
/* free properties */
g_free (port->priv->adapter);
g_free (port->priv->parent);
+ g_free (port->priv->connector_type);
G_OBJECT_CLASS (port_parent_class)->finalize (object);
}
const gchar *basename;
gint port_host_number;
gint port_number;
+ const gchar *adapter_fabric;
+ const gchar *connector_type;
ret = FALSE;
port_number = -1;
}
}
+ /* Third, guess the connector type.
+ *
+ * This can be overriden via the udev property UDISKS_ATA_PORT_CONNECTOR_TYPE -
+ * see the data/80-udisks.rules for an example.
+ */
+ connector_type = g_udev_device_get_property (port->priv->d, "UDISKS_ATA_PORT_CONNECTOR_TYPE");
+ if (connector_type == NULL)
+ {
+ connector_type = "ata";
+ adapter_fabric = adapter_local_get_fabric (adapter);
+ if (g_strcmp0 (adapter_fabric, "ata_pata") == 0)
+ {
+ connector_type = "ata_pata";
+ }
+ else if (g_strcmp0 (adapter_fabric, "ata_sata") == 0)
+ {
+ connector_type = "ata_sata";
+ }
+ }
+
port_set_number (port, port_number);
+ port_set_connector_type (port, connector_type);
port->priv->port_type = PORT_TYPE_ATA;
ret = TRUE;
port_number = g_udev_device_get_sysfs_attr_as_int (port->priv->d, "phy_identifier");
port_set_number (port, port_number);
+ /* We can't get it any more precise than this until we read SES-2 or SAS-2.0 info */
+ port_set_connector_type (port, "scsi_sas");
+
port->priv->port_type = PORT_TYPE_SAS;
return TRUE;