rapidio: add definitions of Component Tag fields
authorAlexandre Bounine <alexandre.bounine@idt.com>
Thu, 13 Jan 2011 01:00:40 +0000 (17:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2011 16:03:18 +0000 (08:03 -0800)
Add definition of the unique device identifier field in the component tag.
 RIO_CTAG_UDEVID does not take all 32 bits of the component tag value to
allow future extensions to the component tag use.

Selected size of the RIO_CTAG_UDEVID field (17 bits) is sufficient to
accommodate maximum number of endpoints in large RIO network (16-bit id)
plus switches.

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Micha Nelissen <micha@neli.hopto.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rapidio/rio.c
include/linux/rio.h

index c13289e..cc2a3b7 100644 (file)
@@ -710,7 +710,7 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg)
        u32 err_status, em_perrdet, em_ltlerrdet;
        int rc, portnum;
 
-       rdev = rio_get_comptag(pw_msg->em.comptag, NULL);
+       rdev = rio_get_comptag((pw_msg->em.comptag & RIO_CTAG_UDEVID), NULL);
        if (rdev == NULL) {
                /* Device removed or enumeration error */
                pr_debug("RIO: %s No matching device for CTag 0x%08x\n",
index 9b55885..ff681eb 100644 (file)
 
 #define RIO_PW_MSG_SIZE                64
 
+/*
+ * A component tag value (stored in the component tag CSR) is used as device's
+ * unique identifier assigned during enumeration. Besides being used for
+ * identifying switches (which do not have device ID register), it also is used
+ * by error management notification and therefore has to be assigned
+ * to endpoints as well.
+ */
+#define RIO_CTAG_RESRVD        0xfffe0000 /* Reserved */
+#define RIO_CTAG_UDEVID        0x0001ffff /* Unique device identifier */
+
 extern struct bus_type rio_bus_type;
 extern struct device rio_bus;
 extern struct list_head rio_devices;   /* list of all devices */