RE: [PATCH 5/6] PCI Express Advanced Error Reporting Driver

2005-03-15 Thread Nguyen, Tom L
Friday, March 11, 2005 11:30 PM Greg KH wrote:
>> +
>> +LIST_HEAD(rc_list); /* Define Root Complex List */
>>
>Static?

The rc_list is not static. Thanks for pointing it out. Will make it
static. 

Thanks,
Long
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 5/6] PCI Express Advanced Error Reporting Driver

2005-03-15 Thread Nguyen, Tom L
Friday, March 11, 2005 11:30 PM Greg KH wrote:
 +
 +LIST_HEAD(rc_list); /* Define Root Complex List */

Static?

The rc_list is not static. Thanks for pointing it out. Will make it
static. 

Thanks,
Long
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/6] PCI Express Advanced Error Reporting Driver

2005-03-12 Thread Greg KH
On Fri, Mar 11, 2005 at 04:16:54PM -0800, long wrote:
> This patch includes the source code of core component of PCI Express
> Advanced Error Reporting driver.
> 
> Signed-off-by: T. Long Nguyen <[EMAIL PROTECTED]>
> 
> 
> diff -urpN linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c 
> patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c
> --- linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c   1969-12-31 
> 19:00:00.0 -0500
> +++ patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c  
> 2005-03-10 10:31:09.0 -0500
> @@ -0,0 +1,911 @@
> +/*
> + * Copyright (C) 2005 Intel
> + * Copyright (C) Tom Long Nguyen ([EMAIL PROTECTED])
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "aerdrv.h"
> +
> +LIST_HEAD(rc_list);  /* Define Root Complex List */

Static?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/6] PCI Express Advanced Error Reporting Driver

2005-03-12 Thread Greg KH
On Fri, Mar 11, 2005 at 04:16:54PM -0800, long wrote:
 This patch includes the source code of core component of PCI Express
 Advanced Error Reporting driver.
 
 Signed-off-by: T. Long Nguyen [EMAIL PROTECTED]
 
 
 diff -urpN linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c 
 patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c
 --- linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c   1969-12-31 
 19:00:00.0 -0500
 +++ patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c  
 2005-03-10 10:31:09.0 -0500
 @@ -0,0 +1,911 @@
 +/*
 + * Copyright (C) 2005 Intel
 + * Copyright (C) Tom Long Nguyen ([EMAIL PROTECTED])
 + *
 + */
 +
 +#include linux/module.h
 +#include linux/pci.h
 +#include linux/kernel.h
 +#include linux/errno.h
 +#include linux/pm.h
 +#include linux/rtc.h
 +#include linux/suspend.h
 +#include linux/acpi.h
 +#include linux/pci-acpi.h
 +#include aerdrv.h
 +
 +LIST_HEAD(rc_list);  /* Define Root Complex List */

Static?


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/6] PCI Express Advanced Error Reporting Driver

2005-03-11 Thread long
This patch includes the source code of core component of PCI Express
Advanced Error Reporting driver.

Signed-off-by: T. Long Nguyen <[EMAIL PROTECTED]>


diff -urpN linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c 
patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c
--- linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c 1969-12-31 
19:00:00.0 -0500
+++ patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c
2005-03-10 10:31:09.0 -0500
@@ -0,0 +1,911 @@
+/*
+ * Copyright (C) 2005 Intel
+ * Copyright (C) Tom Long Nguyen ([EMAIL PROTECTED])
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "aerdrv.h"
+
+LIST_HEAD(rc_list);/* Define Root Complex List */
+static int verbose = VERBOSE_LIMIT_DISPLAY;
+static int auto_mode = 1;
+static int aer_init_flag = 0;
+
+/**
+ * print_source_devices - print a list of AER devices in Root Port hierarchy
+ * @head: pointer to Root Port's children list
+ * @page: pointer to a buffer
+ *
+ * Invoked by user interface status. Caller must acquire Root semaphore prior
+ * to calling. 
+ **/
+static int print_source_devices(struct list_head *head, char *page)
+{
+   struct list_head *entry;
+   struct aer_device *dev;
+   char *p = page;
+   char *error_name;
+
+   list_for_each(entry, head) {
+   dev = container_of(entry, struct aer_device, node);
+   p += sprintf(p, "  Bus %d, device %d, function %d:\n",
+   AER_DEVICE_BUS(dev->requestor_id),
+   AER_DEVICE_DEV(dev->requestor_id),
+   AER_DEVICE_FUNC(dev->requestor_id)); 
+   if (dev->handle) {
+   p += sprintf(p, "Class %04x: PCI device 
%02x:%02x\n",
+   dev->class_code, dev->device, dev->vendor);
+   p += sprintf(p, "COR_ERR %d, NONFATAL_ERR %d,"
+   " FATAL_ERR %d\n",
+   dev->correctables, 
+   dev->nonfatals,
+   dev->fatals);
+   } else
+   p += sprintf(p, "COR_ERR %d, UNCOR_ERR %d\n",
+   dev->correctables, 
+   dev->uncorrectables);
+   error_name = aer_get_error_source_name(>last_recorded_err);
+   if (error_name) {
+   p += sprintf(p, "Last Error Detected @ "
+   "%d/%d/%d %d:%d:%d - %s\n", 
+   dev->time_stamp.month, dev->time_stamp.day, 
+   dev->time_stamp.year + 1900, dev->time_stamp.hours,
+   dev->time_stamp.minutes, dev->time_stamp.seconds,
+   error_name);
+   }
+   p += sprintf(p, "Register Callbacks - %s\n",
+   (dev->handle != NULL) ? "Yes" : "No");
+   if (PCIE_PORT(dev->attribute.type)) 
+   p += print_source_devices(>children, p);
+   }
+
+   return p-page;
+}
+
+/**
+ * search_node - search for a Root Port node associated with this
+ *  downstream ID
+ * @requestor_id: endpoint source ID
+ *
+ * Invoked to search for an associated Root Port node.
+ * A rc_list list, initialized during driver init, contains physical
+ * Root Port devices in Root Complex, no semaphore access lock is 
+ * necessary prior to calling.
+ **/
+static struct aer_rpc* search_node(unsigned short requestor_id)
+{
+   struct list_head *entry;
+   struct aer_rpc *rpc = NULL;
+   int bus = AER_DEVICE_BUS(requestor_id);
+
+   if (!list_empty(_list)) {
+   struct aer_rpc *tmp;
+
+   list_for_each(entry, _list) {
+   tmp = container_of(entry, struct aer_rpc, node);
+   if ((bus >= tmp->secondary && bus <= tmp->subordinate)||
+   tmp->self_id == requestor_id) {
+   rpc = tmp;
+   break;  
+   }
+   }
+   }
+
+   return rpc; 
+}
+
+/**
+ * search_direct_parent - search for a direct PCIE Port for endpoint
+ * @head: pointer to a Root Port's children list
+ * @id: endpoint source ID
+ *
+ * Invoked to search for a direct one-to-one PCIE Port associated with
+ * endpoint. Caller must acquire Root semaphore "rpc_sema" prior to
+ * calling.
+ **/
+static struct aer_device* search_direct_parent(struct list_head *head, u16 id)
+{
+   struct list_head *entry;
+   struct aer_device *parent = NULL;
+
+   if (list_empty(head)) 
+   return NULL;
+
+   list_for_each(entry, head) {
+   struct aer_device *dev;
+   int secondary, subordinate, bus = 

[PATCH 5/6] PCI Express Advanced Error Reporting Driver

2005-03-11 Thread long
This patch includes the source code of core component of PCI Express
Advanced Error Reporting driver.

Signed-off-by: T. Long Nguyen [EMAIL PROTECTED]


diff -urpN linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c 
patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c
--- linux-2.6.11-rc5/drivers/pci/pcie/aer/aerdrv_core.c 1969-12-31 
19:00:00.0 -0500
+++ patch-2.6.11-rc5-aerc3-split5/drivers/pci/pcie/aer/aerdrv_core.c
2005-03-10 10:31:09.0 -0500
@@ -0,0 +1,911 @@
+/*
+ * Copyright (C) 2005 Intel
+ * Copyright (C) Tom Long Nguyen ([EMAIL PROTECTED])
+ *
+ */
+
+#include linux/module.h
+#include linux/pci.h
+#include linux/kernel.h
+#include linux/errno.h
+#include linux/pm.h
+#include linux/rtc.h
+#include linux/suspend.h
+#include linux/acpi.h
+#include linux/pci-acpi.h
+#include aerdrv.h
+
+LIST_HEAD(rc_list);/* Define Root Complex List */
+static int verbose = VERBOSE_LIMIT_DISPLAY;
+static int auto_mode = 1;
+static int aer_init_flag = 0;
+
+/**
+ * print_source_devices - print a list of AER devices in Root Port hierarchy
+ * @head: pointer to Root Port's children list
+ * @page: pointer to a buffer
+ *
+ * Invoked by user interface status. Caller must acquire Root semaphore prior
+ * to calling. 
+ **/
+static int print_source_devices(struct list_head *head, char *page)
+{
+   struct list_head *entry;
+   struct aer_device *dev;
+   char *p = page;
+   char *error_name;
+
+   list_for_each(entry, head) {
+   dev = container_of(entry, struct aer_device, node);
+   p += sprintf(p,   Bus %d, device %d, function %d:\n,
+   AER_DEVICE_BUS(dev-requestor_id),
+   AER_DEVICE_DEV(dev-requestor_id),
+   AER_DEVICE_FUNC(dev-requestor_id)); 
+   if (dev-handle) {
+   p += sprintf(p, Class %04x: PCI device 
%02x:%02x\n,
+   dev-class_code, dev-device, dev-vendor);
+   p += sprintf(p, COR_ERR %d, NONFATAL_ERR %d,
+FATAL_ERR %d\n,
+   dev-correctables, 
+   dev-nonfatals,
+   dev-fatals);
+   } else
+   p += sprintf(p, COR_ERR %d, UNCOR_ERR %d\n,
+   dev-correctables, 
+   dev-uncorrectables);
+   error_name = aer_get_error_source_name(dev-last_recorded_err);
+   if (error_name) {
+   p += sprintf(p, Last Error Detected @ 
+   %d/%d/%d %d:%d:%d - %s\n, 
+   dev-time_stamp.month, dev-time_stamp.day, 
+   dev-time_stamp.year + 1900, dev-time_stamp.hours,
+   dev-time_stamp.minutes, dev-time_stamp.seconds,
+   error_name);
+   }
+   p += sprintf(p, Register Callbacks - %s\n,
+   (dev-handle != NULL) ? Yes : No);
+   if (PCIE_PORT(dev-attribute.type)) 
+   p += print_source_devices(dev-children, p);
+   }
+
+   return p-page;
+}
+
+/**
+ * search_node - search for a Root Port node associated with this
+ *  downstream ID
+ * @requestor_id: endpoint source ID
+ *
+ * Invoked to search for an associated Root Port node.
+ * A rc_list list, initialized during driver init, contains physical
+ * Root Port devices in Root Complex, no semaphore access lock is 
+ * necessary prior to calling.
+ **/
+static struct aer_rpc* search_node(unsigned short requestor_id)
+{
+   struct list_head *entry;
+   struct aer_rpc *rpc = NULL;
+   int bus = AER_DEVICE_BUS(requestor_id);
+
+   if (!list_empty(rc_list)) {
+   struct aer_rpc *tmp;
+
+   list_for_each(entry, rc_list) {
+   tmp = container_of(entry, struct aer_rpc, node);
+   if ((bus = tmp-secondary  bus = tmp-subordinate)||
+   tmp-self_id == requestor_id) {
+   rpc = tmp;
+   break;  
+   }
+   }
+   }
+
+   return rpc; 
+}
+
+/**
+ * search_direct_parent - search for a direct PCIE Port for endpoint
+ * @head: pointer to a Root Port's children list
+ * @id: endpoint source ID
+ *
+ * Invoked to search for a direct one-to-one PCIE Port associated with
+ * endpoint. Caller must acquire Root semaphore rpc_sema prior to
+ * calling.
+ **/
+static struct aer_device* search_direct_parent(struct list_head *head, u16 id)
+{
+   struct list_head *entry;
+   struct aer_device *parent = NULL;
+
+   if (list_empty(head)) 
+   return NULL;
+
+   list_for_each(entry, head) {
+   struct