Commit b9984b78 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: Some small bte code clean ups

From: Pat Gefre <pfg@sgi.com>

Some small bte code clean ups
parent 050b3e58
......@@ -62,36 +62,11 @@ bte_crb_error_handler(vertex_hdl_t hub_v, int btenum,
* in the bte handle structure for the thread excercising the
* interface to consume.
*/
switch (ioe->ie_errortype) {
case IIO_ICRB_ECODE_PERR:
bte->bh_error = BTEFAIL_POISON;
break;
case IIO_ICRB_ECODE_WERR:
bte->bh_error = BTEFAIL_PROT;
break;
case IIO_ICRB_ECODE_AERR:
bte->bh_error = BTEFAIL_ACCESS;
break;
case IIO_ICRB_ECODE_TOUT:
bte->bh_error = BTEFAIL_TOUT;
break;
case IIO_ICRB_ECODE_XTERR:
bte->bh_error = BTEFAIL_XTERR;
break;
case IIO_ICRB_ECODE_DERR:
bte->bh_error = BTEFAIL_DIR;
break;
case IIO_ICRB_ECODE_PWERR:
case IIO_ICRB_ECODE_PRERR:
/* NO BREAK */
default:
bte->bh_error = BTEFAIL_ERROR;
}
bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET;
bte->bte_error_count++;
BTE_PRINTK(("Got an error on cnode %d bte %d\n",
bte->bte_cnode, bte->bte_num));
BTE_PRINTK(("Got an error on cnode %d bte %d: HW error type 0x%x\n",
bte->bte_cnode, bte->bte_num, ioe->ie_errortype));
bte_error_handler((unsigned long) hinfo->h_nodepda);
}
......
......@@ -81,16 +81,25 @@
/* Possible results from bte_copy and bte_unaligned_copy */
/* The following error codes map into the BTE hardware codes
* IIO_ICRB_ECODE_* (in shubio.h). The hardware uses
* an error code of 0 (IIO_ICRB_ECODE_DERR), but we want zero
* to mean BTE_SUCCESS, so add one (BTEFAIL_OFFSET) to the error
* codes to give the following error codes.
*/
#define BTEFAIL_OFFSET 1
typedef enum {
BTE_SUCCESS, /* 0 is success */
BTEFAIL_DIR, /* Directory error due to IIO access*/
BTEFAIL_POISON, /* poison error on IO access (write to poison page) */
BTEFAIL_WERR, /* Write error (ie WINV to a Read only line) */
BTEFAIL_ACCESS, /* access error (protection violation) */
BTEFAIL_PWERR, /* Partial Write Error */
BTEFAIL_PRERR, /* Partial Read Error */
BTEFAIL_TOUT, /* CRB Time out */
BTEFAIL_XTERR, /* Incoming xtalk pkt had error bit */
BTEFAIL_NOTAVAIL, /* BTE not available */
BTEFAIL_POISON, /* poison page */
BTEFAIL_PROT, /* Protection violation */
BTEFAIL_ACCESS, /* access error */
BTEFAIL_TOUT, /* Time out */
BTEFAIL_XTERR, /* Diretory error */
BTEFAIL_DIR, /* Diretory error */
BTEFAIL_ERROR, /* Generic error */
} bte_result_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment