亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? l1_command.c

?? 根據(jù)添加了fs2410平臺的arch目錄
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* $Id$ * * This file is subject to the terms and conditions of the GNU General Public * License.  See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. * Copyright (C) 2000 by Colin Ngam */ #include <linux/types.h>#include <linux/slab.h>#include <asm/sn/sgi.h>#include <asm/sn/iograph.h>#include <asm/sn/invent.h>#include <asm/sn/hcl.h>#include <asm/sn/hcl_util.h>#include <asm/sn/labelcl.h>#include <asm/sn/eeprom.h>#include <asm/sn/ksys/i2c.h>#include <asm/sn/router.h>#include <asm/sn/module.h>#include <asm/sn/ksys/l1.h>#include <asm/sn/nodepda.h>#include <asm/sn/clksupport.h>#define ELSC_TIMEOUT	1000000		/* ELSC response timeout (usec) */#define LOCK_TIMEOUT	5000000		/* Hub lock timeout (usec) */#define LOCAL_HUB	LOCAL_HUB_ADDR#define LD(x)		(*(volatile uint64_t *)(x))#define SD(x, v)	(LD(x) = (uint64_t) (v))#define hub_cpu_get()	0#define LBYTE(caddr)	(*(char *) caddr)extern char *bcopy(const char * src, char * dest, int count);#define LDEBUG		0/* * ELSC data is in NVRAM page 7 at the following offsets. */#define NVRAM_MAGIC_AD	0x700		/* magic number used for init */#define NVRAM_PASS_WD	0x701		/* password (4 bytes in length) */#define NVRAM_DBG1	0x705		/* virtual XOR debug switches */#define NVRAM_DBG2	0x706		/* physical XOR debug switches */#define NVRAM_CFG	0x707		/* ELSC Configuration info */#define NVRAM_MODULE	0x708		/* system module number */#define NVRAM_BIST_FLG	0x709		/* BIST flags (2 bits per nodeboard) */#define NVRAM_PARTITION 0x70a		/* module's partition id */#define	NVRAM_DOMAIN	0x70b		/* module's domain id */#define	NVRAM_CLUSTER	0x70c		/* module's cluster id */#define	NVRAM_CELL	0x70d		/* module's cellid */#define NVRAM_MAGIC_NO	0x37		/* value of magic number */#define NVRAM_SIZE	16		/* 16 bytes in nvram *//* * Declare a static ELSC NVRAM buffer to hold all data read from * and written to NVRAM.  This nvram "cache" will be used only during the * IP27prom execution. */static char elsc_nvram_buffer[NVRAM_SIZE];#define SC_COMMAND sc_command/* * elsc_init * *   Initialize ELSC structure */void elsc_init(elsc_t *e, nasid_t nasid){    sc_init((l1sc_t *)e, nasid, BRL1_LOCALUART);}/* * elsc_errmsg * *   Given a negative error code, *   returns a corresponding static error string. */char *elsc_errmsg(int code){    switch (code) {    case ELSC_ERROR_CMD_SEND:	return "Command send error";    case ELSC_ERROR_CMD_CHECKSUM:	return "Command packet checksum error";    case ELSC_ERROR_CMD_UNKNOWN:	return "Unknown command";    case ELSC_ERROR_CMD_ARGS:	return "Invalid command argument(s)";    case ELSC_ERROR_CMD_PERM:	return "Permission denied";    case ELSC_ERROR_RESP_TIMEOUT:	return "System controller response timeout";    case ELSC_ERROR_RESP_CHECKSUM:	return "Response packet checksum error";    case ELSC_ERROR_RESP_FORMAT:	return "Response format error";    case ELSC_ERROR_RESP_DIR:	return "Response direction error";    case ELSC_ERROR_MSG_LOST:	return "Message lost because queue is full";    case ELSC_ERROR_LOCK_TIMEOUT:	return "Timed out getting ELSC lock";    case ELSC_ERROR_DATA_SEND:	return "Error sending data";    case ELSC_ERROR_NIC:	return "NIC protocol error";    case ELSC_ERROR_NVMAGIC:	return "Bad magic number in NVRAM";    case ELSC_ERROR_MODULE:	return "Module location protocol error";    default:	return "Unknown error";    }}/* * elsc_nvram_init * *   Initializes reads and writes to NVRAM.  This will perform a single *   read to NVRAM, getting all data at once.  When the PROM tries to *   read NVRAM, it returns the data from the buffer being read.  If the *   PROM tries to write out to NVRAM, the write is done, and the internal *   buffer is updated. */void elsc_nvram_init(nasid_t nasid, uchar_t *elsc_nvram_data){    /* This might require implementation of multiple-packet request/responses     * if it's to provide the same behavior that was available in SN0.     */    nasid = nasid;    elsc_nvram_data = elsc_nvram_data;}/* * elsc_nvram_copy * *   Copies the content of a buffer into the static buffer in this library. */void elsc_nvram_copy(uchar_t *elsc_nvram_data){    memcpy(elsc_nvram_buffer, elsc_nvram_data, NVRAM_SIZE);}/* * elsc_nvram_write * *   Copies bytes from 'buf' into NVRAM, starting at NVRAM address *   'addr' which must be between 0 and 2047. * *   If 'len' is non-negative, the routine copies 'len' bytes. * *   If 'len' is negative, the routine treats the data as a string and *   copies bytes up to and including a NUL-terminating zero, but not *   to exceed '-len' bytes. */int elsc_nvram_write(elsc_t *e, int addr, char *buf, int len){    /* Here again, we might need to work out the details of a     * multiple-packet protocol.     */    /* For now, pretend it worked. */    e = e;    addr = addr;    buf = buf;    return (len < 0 ? -len : len);}/* * elsc_nvram_read * *   Copies bytes from NVRAM into 'buf', starting at NVRAM address *   'addr' which must be between 0 and 2047. * *   If 'len' is non-negative, the routine copies 'len' bytes. * *   If 'len' is negative, the routine treats the data as a string and *   copies bytes up to and including a NUL-terminating zero, but not *   to exceed '-len' bytes.  NOTE:  This method is no longer supported. *   It was never used in the first place. */int elsc_nvram_read(elsc_t *e, int addr, char *buf, int len){    /* multiple packets? */    e = e;    addr = addr;    buf = buf;    len = len;    return -1;}/* * Command Set */int elsc_version(elsc_t *e, char *result){    char	msg[BRL1_QSIZE];    int		len;    /* length of message being sent */    int		subch;  /* system controller subchannel used */    int		major,  /* major rev number */	        minor,  /* minor rev number */                bugfix; /* bugfix rev number */    /* fill in msg with the opcode & params */    bzero( msg, BRL1_QSIZE );    subch = sc_open( (l1sc_t *)e, L1_ADDR_LOCAL );    if( (len = sc_construct_msg( (l1sc_t *)e, subch, msg, BRL1_QSIZE,				 L1_ADDR_TASK_GENERAL,				 L1_REQ_FW_REV, 0 )) < 0 )    {	sc_close( e, subch );	return( ELSC_ERROR_CMD_ARGS );    }    /* send the request to the L1 */    if( SC_COMMAND( (l1sc_t *)e, subch, msg, msg, &len ) < 0 )    {	sc_close( e, subch );	return( ELSC_ERROR_CMD_SEND );    }    /* free up subchannel */    sc_close( (l1sc_t *)e, subch );    /* check response */    if( sc_interpret_resp( msg, 6, L1_ARG_INT, &major,			   L1_ARG_INT, &minor, L1_ARG_INT, &bugfix )	< 0 )    {	return( ELSC_ERROR_RESP_FORMAT );    }    sprintf( result, "%d.%d.%d", major, minor, bugfix );    return 0;}int elsc_debug_set(elsc_t *e, u_char byte1, u_char byte2){    /* shush compiler */    e = e;    byte1 = byte1;    byte2 = byte2;    /* fill in a buffer with the opcode & params; call sc_command */    return 0;}int elsc_debug_get(elsc_t *e, u_char *byte1, u_char *byte2){    char	msg[BRL1_QSIZE];    int		subch;  /* system controller subchannel used */    int		dbg_sw; /* holds debug switch settings */    int		len;	/* number of msg buffer bytes used */    /* fill in msg with the opcode & params */    bzero( msg, BRL1_QSIZE );    if( (subch = sc_open( (l1sc_t *)e, L1_ADDR_LOCAL )) < 0 ) {	return( ELSC_ERROR_CMD_SEND );    }    if( (len = sc_construct_msg( (l1sc_t *)e, subch, msg, BRL1_QSIZE,				 L1_ADDR_TASK_GENERAL,				 L1_REQ_RDBG, 0 ) ) < 0 )    {	sc_close( e, subch );	return( ELSC_ERROR_CMD_ARGS );    }    /* send the request to the L1 */    if( sc_command( (l1sc_t *)e, subch, msg, msg, &len ) < 0 )    {	sc_close( e, subch );	return( ELSC_ERROR_CMD_SEND );    }    /* free up subchannel */    sc_close( (l1sc_t *)e, subch );    /* check response */    if( sc_interpret_resp( msg, 2, L1_ARG_INT, &dbg_sw ) < 0 )    {	return( ELSC_ERROR_RESP_FORMAT );    }    /* copy out debug switch settings (last two bytes of the     * integer response)     */    *byte1 = ((dbg_sw >> 8) & 0xFF);    *byte2 = (dbg_sw & 0xFF);    return 0;}/* * elsc_rack_bay_get fills in the two int * arguments with the * rack number and bay number of the L1 being addressed */int elsc_rack_bay_get(elsc_t *e, uint *rack, uint *bay){    char msg[BRL1_QSIZE];	/* L1 request/response info */    int subch;			/* system controller subchannel used */    int len;			/* length of message */    uint32_t	buf32;		/* used to copy 32-bit rack/bay out of msg */    /* fill in msg with the opcode & params */    bzero( msg, BRL1_QSIZE );    if( (subch = sc_open( (l1sc_t *)e, L1_ADDR_LOCAL )) < 0 ) {	return( ELSC_ERROR_CMD_SEND );    }    if( (len = sc_construct_msg( (l1sc_t *)e, subch, msg, BRL1_QSIZE,				 L1_ADDR_TASK_GENERAL,				 L1_REQ_RRACK, 0 )) < 0 )     {	sc_close( e, subch );	return( ELSC_ERROR_CMD_ARGS );    }    /* send the request to the L1 */    if( sc_command( (l1sc_t *)e, subch, msg, msg, &len ) ) {	sc_close( e, subch );	return( ELSC_ERROR_CMD_SEND );    }    /* free up subchannel */    sc_close(e, subch);    /* check response */    if( sc_interpret_resp( msg, 2, L1_ARG_INT, &buf32 ) < 0 )    {	return( ELSC_ERROR_RESP_FORMAT );    }    /* extract rack/bay info     *     * note that the 32-bit value returned by the L1 actually     * only uses the low-order sixteen bits for rack and bay     * information.  A "normal" L1 address puts rack and bay     * information in bit positions 12 through 28.  So if     * we initially shift the value returned 12 bits to the left,     * we can use the L1 addressing #define's to extract the     * values we need (see ksys/l1.h for a complete list of the     * various fields of an L1 address).     */    buf32 <<= L1_ADDR_BAY_SHFT;    *rack = (buf32 & L1_ADDR_RACK_MASK) >> L1_ADDR_RACK_SHFT;    *bay = (buf32 & L1_ADDR_BAY_MASK) >> L1_ADDR_BAY_SHFT;    return 0;}/* elsc_rack_bay_type_get fills in the three int * arguments with the * rack number, bay number and brick type of the L1 being addressed.  Note * that if the L1 operation fails and this function returns an error value,  * garbage may be written to brick_type. */int elsc_rack_bay_type_get( l1sc_t *sc, uint *rack, 			       uint *bay, uint *brick_type ){    char msg[BRL1_QSIZE];       /* L1 request/response info */    int subch;                  /* system controller subchannel used */    int len;                    /* length of message */    uint32_t buf32;	        /* used to copy 32-bit rack & bay out of msg */    /* fill in msg with the opcode & params */    bzero( msg, BRL1_QSIZE );    if( (subch = sc_open( sc, L1_ADDR_LOCAL )) < 0 ) {	return ELSC_ERROR_CMD_SEND;    }    if( (len = sc_construct_msg( sc, subch, msg, BRL1_QSIZE,				 L1_ADDR_TASK_GENERAL,				 L1_REQ_RRBT, 0 )) < 0 )    {	sc_close( sc, subch );	return( ELSC_ERROR_CMD_ARGS );    }    /* send the request to the L1 */    if( SC_COMMAND( sc, subch, msg, msg, &len ) ) {	sc_close( sc, subch );	return( ELSC_ERROR_CMD_SEND );    }    /* free up subchannel */    sc_close( sc, subch );    /* check response */    if( sc_interpret_resp( msg, 4, L1_ARG_INT, &buf32, 			           L1_ARG_INT, brick_type ) < 0 )    {	return( ELSC_ERROR_RESP_FORMAT );    }    /* extract rack/bay info     *     * note that the 32-bit value returned by the L1 actually     * only uses the low-order sixteen bits for rack and bay     * information.  A "normal" L1 address puts rack and bay     * information in bit positions 12 through 28.  So if     * we initially shift the value returned 12 bits to the left,     * we can use the L1 addressing #define's to extract the     * values we need (see ksys/l1.h for a complete list of the     * various fields of an L1 address).     */    buf32 <<= L1_ADDR_BAY_SHFT;    *rack = (buf32 & L1_ADDR_RACK_MASK) >> L1_ADDR_RACK_SHFT;    *bay = (buf32 & L1_ADDR_BAY_MASK) >> L1_ADDR_BAY_SHFT;    /* convert brick_type to lower case */    *brick_type = *brick_type - 'A' + 'a';    return 0;}int elsc_module_get(elsc_t *e){    extern char brick_types[];    uint rnum, rack, bay, bricktype, t;    int ret;    /* construct module ID from rack and slot info */    if ((ret = elsc_rack_bay_type_get(e, &rnum, &bay, &bricktype)) < 0) {	return ret;    }    /* report unset location info. with a special, otherwise invalid modid */    if (rnum == 0 && bay == 0)	return MODULE_NOT_SET;    if (bay > MODULE_BPOS_MASK >> MODULE_BPOS_SHFT)	return ELSC_ERROR_MODULE;    /* Build a moduleid_t-compatible rack number */    rack = 0;		    t = rnum / 100;		/* rack class (CPU/IO) */    if (t > RACK_CLASS_MASK(rack) >> RACK_CLASS_SHFT(rack))	return ELSC_ERROR_MODULE;    RACK_ADD_CLASS(rack, t);    rnum %= 100;    t = rnum / 10;		/* rack group */    if (t > RACK_GROUP_MASK(rack) >> RACK_GROUP_SHFT(rack))	return ELSC_ERROR_MODULE;    RACK_ADD_GROUP(rack, t);    t = rnum % 10;		/* rack number (one-based) */    if (t-1 > RACK_NUM_MASK(rack) >> RACK_NUM_SHFT(rack))	return ELSC_ERROR_MODULE;    RACK_ADD_NUM(rack, t);    for( t = 0; t < MAX_BRICK_TYPES; t++ ) {	if( brick_types[t] == bricktype )	    return RBT_TO_MODULE(rack, bay, t);    }        return ELSC_ERROR_MODULE;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99国产精品成人| 蜜臀av一区二区| 久久综合久久久久88| 在线中文字幕一区| 国产一区二区三区四区在线观看| 一区二区三区高清不卡| 国产性色一区二区| 欧美日韩久久久久久| av欧美精品.com| 国产精品综合一区二区| 天使萌一区二区三区免费观看| 国产精品久久久久影视| 日韩女优av电影| 欧美男女性生活在线直播观看| 北岛玲一区二区三区四区| 国内精品国产成人国产三级粉色 | 国产 欧美在线| 免费观看91视频大全| 亚洲激情自拍视频| √…a在线天堂一区| 久久久精品天堂| 2020国产精品久久精品美国| 91精品国产色综合久久| 欧美日韩成人一区| 欧美视频在线观看一区二区| 91麻豆国产福利精品| 92国产精品观看| 91色porny| 国产a视频精品免费观看| 韩国在线一区二区| 亚洲精品免费在线播放| 亚洲精品欧美激情| 国产精品电影院| 久久一区二区三区四区| 91精品国产综合久久久久久| 色婷婷综合久久久中文一区二区| 国产一区二区三区免费播放| 秋霞电影网一区二区| 亚洲一区在线视频| 亚洲精品高清在线| 久久久一区二区| 久久男人中文字幕资源站| 日韩欧美你懂的| 日韩一区二区三免费高清| 91视视频在线观看入口直接观看www | 国产精品99久久久久| 丝袜美腿一区二区三区| 亚洲午夜在线视频| 亚洲精品中文在线| 成人欧美一区二区三区1314| 国产色产综合色产在线视频| 久久综合色综合88| 337p日本欧洲亚洲大胆色噜噜| 日韩免费一区二区三区在线播放| 欧美日韩的一区二区| 欧美一区二区三区爱爱| 欧美日韩美少妇| 欧美日韩久久一区| 欧美日韩三级一区二区| 欧美日韩国产首页| 欧美性色黄大片| 欧美精品国产精品| 欧洲精品一区二区三区在线观看| 国产91高潮流白浆在线麻豆 | 成人高清av在线| www.成人网.com| 色综合亚洲欧洲| 在线免费观看日本欧美| 欧美日韩你懂得| 精品免费一区二区三区| 国产欧美日产一区| 精品少妇一区二区三区| 日韩色视频在线观看| 精品日韩av一区二区| 亚洲国产精品精华液ab| 亚洲婷婷在线视频| 亚洲大片免费看| 奇米888四色在线精品| 精彩视频一区二区三区| 国产成人h网站| 成人午夜在线播放| 色94色欧美sute亚洲线路一ni | 91精品国产综合久久久久| 精品久久久久久综合日本欧美| 久久久久久久久岛国免费| 国产精品麻豆视频| 亚洲国产美女搞黄色| 久久机这里只有精品| 成人激情文学综合网| 91精品国产欧美一区二区| 国产精品成人一区二区三区夜夜夜| 亚洲一区二区三区四区的 | 国产精品国产精品国产专区不蜜 | 9久草视频在线视频精品| 欧美在线三级电影| 亚洲精品一区二区三区影院| 日韩理论片网站| 麻豆精品国产传媒mv男同| k8久久久一区二区三区| 欧美猛男男办公室激情| 国产欧美日韩三区| 亚洲国产一二三| 高清shemale亚洲人妖| 欧洲视频一区二区| 亚洲精品在线免费播放| 一区二区三区美女| 欧美aaaaa成人免费观看视频| 91在线视频播放地址| 日韩精品一区二区在线| 一区二区三区.www| 国产精品系列在线观看| 欧美精品久久一区| 国产精品久久久久久久久晋中| 天天影视色香欲综合网老头| 福利电影一区二区三区| 精品久久久久久久久久久久久久久 | 日韩一级二级三级| 成人免费视频在线观看| 久久电影国产免费久久电影| 欧美午夜免费电影| 中文字幕av一区二区三区高 | 国产成人一区在线| 欧美精品成人一区二区三区四区| 国产欧美一区二区三区鸳鸯浴 | 91丨porny丨蝌蚪视频| 欧美大肚乱孕交hd孕妇| 一区二区在线看| 福利一区在线观看| 国产日韩精品一区| 国产精品夜夜嗨| 色婷婷亚洲综合| 亚洲制服丝袜av| 91麻豆蜜桃一区二区三区| 国产午夜精品一区二区| 精一区二区三区| 在线成人午夜影院| 亚洲一区免费在线观看| 91美女福利视频| 1024成人网| 成人激情小说乱人伦| 欧美韩国日本综合| 黑人巨大精品欧美黑白配亚洲| 日韩欧美一区二区视频| 日韩国产精品久久久| 欧美日韩久久一区| 亚洲成人免费在线观看| 在线欧美小视频| 日韩伦理免费电影| 韩国欧美国产一区| 国产欧美中文在线| 国产盗摄一区二区| 中文字幕精品综合| 波多野结衣欧美| 国产精品毛片高清在线完整版| 粉嫩aⅴ一区二区三区四区| 久久久久久久精| 久久精品国产一区二区| 日韩精品中午字幕| 国产精品一区二区不卡| 亚洲欧美日韩综合aⅴ视频| 9191国产精品| 国产 欧美在线| 亚洲国产视频直播| 在线免费精品视频| 久久精品国产精品亚洲综合| 26uuu精品一区二区| 国产suv精品一区二区6| 中文字幕在线免费不卡| 91黄色免费观看| 日韩中文字幕91| 久久久久久毛片| av中文一区二区三区| 亚洲啪啪综合av一区二区三区| 色就色 综合激情| 日韩精品免费专区| 日韩欧美激情一区| 午夜视频一区二区三区| 日韩免费高清视频| 成人午夜电影久久影院| 亚洲女人****多毛耸耸8| 欧美日韩色一区| 国产一区二区在线视频| 亚洲色图一区二区| 欧美精品久久99久久在免费线| 极品少妇xxxx偷拍精品少妇| 国产精品免费观看视频| 欧美日韩中文字幕一区| 久久99精品国产.久久久久久| 国产精品网站在线观看| 欧美日韩国产高清一区二区| 韩国v欧美v亚洲v日本v| 亚洲欧美精品午睡沙发| 欧美一区国产二区| 91久久国产综合久久| 久久精品国产网站| 亚洲手机成人高清视频| 欧美刺激脚交jootjob| 99视频国产精品| 美国十次了思思久久精品导航| 中文字幕日韩欧美一区二区三区|