Git Your branch is ahead of 'origin/master' by X commits费事不费心解决方法


现象描述:有时候混合使用git gerrit,代码已经push,但还提示ahead,再次提示又担心出现问题。

#git pull

Already up-to-date

#git status ./

On branch master

Your branch is ahead of 'origin/master' by X commits

 

解决方法:

1:将代码复制到另外一个地方进行备份。

2:进行代码回退,修改会丢失,git reset --hard HEAD~x

3:然后再次查看git status,如果Your branch is behind of 'origin/master' by X commits,使用git pull再次更新

3:用备份代码与当前代码比较,重新commit,重新push。

 

注:x换成具体的数值。


Read More

openssl help(tools md5 sha256)


在cygwin下的openssl help命令返回如下

 

$ openssl help
Standard commands
asn1parse         ca                ciphers           cms
crl               crl2pkcs7         dgst              dhparam
dsa               dsaparam          ec                ecparam
enc               engine            errstr            gendsa
genpkey           genrsa            help              list
nseq              ocsp              passwd            pkcs12
pkcs7             pkcs8             pkey              pkeyparam
pkeyutl           prime             rand              rehash
req               rsa               rsautl            s_client
s_server          s_time            sess_id           smime
speed             spkac             srp               storeutl
ts                verify            version           x509

Message Digest commands (see the `dgst' command for more details)
blake2b512        blake2s256        gost              md2
md4               md5               rmd160            sha1
sha224            sha256            sha3-224          sha3-256
sha3-384          sha3-512          sha384            sha512
sha512-224        sha512-256        shake128          shake256
sm3

Cipher commands (see the `enc' command for more details)
aes-128-cbc       aes-128-ecb       aes-192-cbc       aes-192-ecb
aes-256-cbc       aes-256-ecb       aria-128-cbc      aria-128-cfb
aria-128-cfb1     aria-128-cfb8     aria-128-ctr      aria-128-ecb
aria-128-ofb      aria-192-cbc      aria-192-cfb      aria-192-cfb1
aria-192-cfb8     aria-192-ctr      aria-192-ecb      aria-192-ofb
aria-256-cbc      aria-256-cfb      aria-256-cfb1     aria-256-cfb8
aria-256-ctr      aria-256-ecb      aria-256-ofb      base64
bf                bf-cbc            bf-cfb            bf-ecb
bf-ofb            camellia-128-cbc  camellia-128-ecb  camellia-192-cbc
camellia-192-ecb  camellia-256-cbc  camellia-256-ecb  cast
cast-cbc          cast5-cbc         cast5-cfb         cast5-ecb
cast5-ofb         des               des-cbc           des-cfb
des-ecb           des-ede           des-ede-cbc       des-ede-cfb
des-ede-ofb       des-ede3          des-ede3-cbc      des-ede3-cfb
des-ede3-ofb      des-ofb           des3              desx
idea              idea-cbc          idea-cfb          idea-ecb
idea-ofb          rc2               rc2-40-cbc        rc2-64-cbc
rc2-cbc           rc2-cfb           rc2-ecb           rc2-ofb
rc4               rc4-40            rc5               rc5-cbc
rc5-cfb           rc5-ecb           rc5-ofb           seed
seed-cbc          seed-cfb          seed-ecb          seed-ofb
zlib

 


Read More

openssl介绍


openssl是一个安全套接字层密码库,囊括主要的密码算法、常用密钥、证书封装管理功能及实现ssl协议。OpenSSL整个软件包大概可以分成三个主要的功能部分:SSL协议库libssl、应用程序命令工具以及密码算法库libcrypto。

在linux系统下安装openssl,需要安装两个软件包:openssl和libssl-dev。具体使用方法和参数列表可参见命令行帮助。使用“openssl help”查看帮助信息


Read More

简单修改ipmitool代码,让工具支持LUN显示。


简单修改ipmitool代码,让工具支持LUN显示。

主要影响两个命令ipmitool sdr elist 和ipmitool sel elist

--- ipmitool-1.8.18/lib/ipmi_sdr.c      2016-05-30 03:56:30.000000000 +0800
+++ ipmitool-1.8.18x2/lib/ipmi_sdr.c    2021-05-28 13:41:11.000000000 +0800
@@ -1655,8 +1655,8 @@ ipmi_sdr_print_sensor_fc(struct ipmi_int
                /*
                 * print sensor name, number, state, entity, reading
                 */
-               printf("%-16s | %02Xh | ",
-                      sr->s_id, sensor->keys.sensor_num);
+               printf("%-16s | %02X.%02Xh | ",
+                      sr->s_id, sensor->keys.sensor_num, sensor->keys.lun);

                if (IS_THRESHOLD_SENSOR(sensor)) {
                        /* Threshold Analog & Discrete */
@@ -2105,9 +2105,9 @@ ipmi_sdr_print_sensor_eventonly(struct i
                               sensor->keys.sensor_num,
                               sensor->entity.id, sensor->entity.instance);
                else if (sdr_extended)
-                       printf("%-16s | %02Xh | ns  | %2d.%1d | Event-Only\n",
+                       printf("%-16s | %02X.%02Xh | ns  | %2d.%1d | Event-Only\n",
                               sensor->id_code ? desc : "",
-                              sensor->keys.sensor_num,
+                              sensor->keys.sensor_num,sensor->keys.lun,
                               sensor->entity.id, sensor->entity.instance);
                else
                        printf("%-16s | Event-Only        | ns\n",
@@ -3230,6 +3230,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_
                case SDR_RECORD_TYPE_COMPACT_SENSOR:
                        if (e->record.common->keys.sensor_num == num &&
                            e->record.common->keys.owner_id == (gen_id & 0x00ff) &&
+                           e->record.common->keys.lun == ((gen_id & 0xff00)>>8) &&
                            e->record.common->sensor.type == type)
                                return e;
                        break;
@@ -3272,6 +3273,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_
                            (struct sdr_record_common_sensor *) rec;
                        if (sdrr->record.common->keys.sensor_num == num
                            && sdrr->record.common->keys.owner_id == (gen_id & 0x00ff)
+                           && sdrr->record.common->keys.lun == ((gen_id & 0xff00)>>8)
                            && sdrr->record.common->sensor.type == type)
                                found = 1;
                        break;

 


Read More

ipmitool lanplus编译需要openssl libssl-dev否则会报错undefined reference to RVP_CIPHER_CTX_reset


本文描述如何在ubuntu下编译lanplus,并描述可能遇到的问题。

1:下载ipmitool的最新版本,并查看如何安装文件INSTALL

2:根据INSTALL文件最简单的,要使用./configure; make; make install进行编译安装

3:如果在执行configure,查看接口如果不支持lanplus,则可能是缺少库文件,需要安装openssl和libssl-dev

可以使用以下命令进行安装。

# apt-get install openssl

# apt-get install libssl-dev

 

异常表现一:lanplus:no

# ./configure 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for rpmbuild... rpm
checking for sed... sed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for sys/stat.h... (cached) yes
checking for unistd.h... (cached) yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/byteorder.h usability... no
checking sys/byteorder.h presence... no
checking for sys/byteorder.h... no
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for working strtod... yes
checking for alarm... yes
checking for gethostbyname... yes
checking for getaddrinfo... yes
checking for getifaddrs... yes
checking for socket... yes
checking for select... yes
checking for memmove... yes
checking for memset... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for getpassphrase... no
checking how to print strings... printf
checking for a sed that does not truncate output... sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for library containing gethostbyname... none required
checking for library containing getaddrinfo... none required
checking for library containing getifaddrs... none required
checking for library containing socket... none required
checking for EVP_aes_128_cbc in -lcrypto... no
checking for EVP_sha256 in -lcrypto... no
checking for MD5_Init in -lcrypto... no
checking for MD2_Init in -lcrypto... no
checking for linux/compiler.h... no
checking sys/ioccom.h usability... no
checking sys/ioccom.h presence... no
checking for sys/ioccom.h... no
checking linux/ipmi.h usability... yes
checking linux/ipmi.h presence... yes
checking for linux/ipmi.h... yes
checking for ipmi_open_inband in -lfreeipmi... no
checking for ipmi_ctx_open_inband in -lfreeipmi... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for OpenIPMI dual bridge support... no
checking sys/lipmi/lipmi_intf.h usability... no
checking sys/lipmi/lipmi_intf.h presence... no
checking for sys/lipmi/lipmi_intf.h... no
** Unable to build Solaris 9 x86 IPMI interface support!
checking for library containing tgetent... no
checking for library containing initscr... no
checking for library containing readline... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating contrib/Makefile
config.status: creating control/Makefile
config.status: creating control/pkginfo
config.status: creating control/prototype
config.status: creating control/rpmmacros
config.status: creating control/ipmitool.spec
config.status: creating lib/Makefile
config.status: creating include/Makefile
config.status: creating include/ipmitool/Makefile
config.status: creating src/Makefile
config.status: creating src/plugins/Makefile
config.status: creating src/plugins/lan/Makefile
config.status: creating src/plugins/lanplus/Makefile
config.status: creating src/plugins/open/Makefile
config.status: creating src/plugins/free/Makefile
config.status: creating src/plugins/imb/Makefile
config.status: creating src/plugins/bmc/Makefile
config.status: creating src/plugins/usb/Makefile
config.status: creating src/plugins/lipmi/Makefile
config.status: creating src/plugins/serial/Makefile
config.status: creating src/plugins/dummy/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

ipmitool 1.8.18

Interfaces
  lan     : yes
  lanplus : no
  open    : yes
  free    : no
  imb     : yes
  bmc     : no
  usb     : no
  lipmi   : no
  serial  : yes
  dummy   : no

Extra tools
  ipmievd   : yes
  ipmishell : no


异常表现2: undefined reference

 

undefined reference to RVP_CIPHER_CTX_reset


Read More

grep命令用法汇总


 

 

cat example.txt | grep "abcdef" 匹配字符串abcedf,匹配大小写
cat example.txt | grep -i "abcdef" 匹配字符串abcedf,忽略大小写
   
   

 

 

$ grep --help
用法: grep [选项]... PATTERN [FILE]...
在每个 FILE 或是标准输入中查找 PATTERN。
默认的 PATTERN 是一个基本正则表达式(缩写为 BRE)。
例如: grep -i 'hello world' menu.h main.c

正则表达式选择与解释:
  -E, --extended-regexp     PATTERN 是一个可扩展的正则表达式(缩写为 ERE)
  -F, --fixed-strings       PATTERN 是一组由断行符分隔的字符串。
  -G, --basic-regexp        PATTERN 是一个基本正则表达式(缩写为 BRE)
  -P, --perl-regexp         PATTERN 是一个 Perl 正则表达式
  -e, --regexp=PATTERN      用 PATTERN 来进行匹配操作
  -f, --file=FILE           从 FILE 中取得 PATTERN
  -i, --ignore-case         忽略大小写
  -w, --word-regexp         强制 PATTERN 仅完全匹配字词
  -x, --line-regexp         强制 PATTERN 仅完全匹配一行
  -z, --null-data           一个 0 字节的数据行,但不是空行

杂项:
  -s, --no-messages         不显示错误信息
  -v, --invert-match        选中不匹配的行
  -V, --version             显示版本信息并退出
      --help                显示此帮助并退出

输出控制:
  -m, --max-count=NUM       NUM 次匹配后停止
  -b, --byte-offset         输出的同时打印字节偏移
  -n, --line-number         输出的同时打印行号
      --line-buffered       每行输出清空
  -H, --with-filename       为每一匹配项打印文件名
  -h, --no-filename         输出时不显示文件名前缀
      --label=LABEL         将LABEL 作为标准输入文件名前缀
  -o, --only-matching       只显示匹配PATTERN 部分的行
  -q, --quiet, --silent     不显示所有常规输出
      --binary-files=TYPE   设定二进制文件的TYPE 类型;
                            TYPE 可以是`binary', `text', 或`without-match'
  -a, --text                等同于 --binary-files=text
  -I                        等同于 --binary-files=without-match
  -d, --directories=ACTION  读取目录的方式;
                            ACTION 可以是`read', `recurse',或`skip'
  -D, --devices=ACTION      读取设备、先入先出队列、套接字的方式;
                            ACTION 可以是`read'或`skip'
  -r, --recursive           等同于--directories=recurse
  -R, --dereference-recursive       同上,但遍历所有符号链接
      --include=FILE_PATTERN  只查找匹配FILE_PATTERN 的文件
      --exclude=FILE_PATTERN  跳过匹配FILE_PATTERN 的文件和目录
      --exclude-from=FILE   跳过所有除FILE 以外的文件
      --exclude-dir=PATTERN  跳过所有匹配PATTERN 的目录。
  -L, --files-without-match  只打印不匹配FILEs 的文件名
  -l, --files-with-matches  只打印匹配FILES 的文件名
  -c, --count               只打印每个FILE 中的匹配行数目
  -T, --initial-tab         行首tabs 分隔(如有必要)
  -Z, --null                在FILE 文件最后打印空字符

文件控制:
  -B, --before-context=NUM  打印文本及其前面NUM 行
  -A, --after-context=NUM   打印文本及其后面NUM 行
  -C, --context=NUM         打印NUM 行输出文本
  -NUM                      等同于 --context=NUM
      --color[=WHEN],
      --colour[=WHEN]       使用标记高亮匹配字串;
                            WHEN 可以是`always', `never'或`auto'
  -U, --binary              不要清除行尾的CR 字符(MSDOS/Windows)
  -u, --unix-byte-offsets   忽略CR 字符,报告字节偏移
                             (MSDOS/Windows)
 


Read More


LSI 3008的IT与IR模式的区别


本文综合baidu与bing返回结果。

https://www.supermicro.org.cn/support/faqs/faq.cfm?faq=16169

Question:
For LSI Host Bus Adapter (HBA) firmware, what is the difference between IT mode and IR mode?
对于LSI主机总线适配器(HBA)固件,IT模式与IR模式有何区别?

Answer:
The two firmware types are Initiator Target (IT) and Integrated RAID (IR). IR is the typical hardware RAID firmware that the internal cards or boards ship with.
The IT firmware, on the other hand, is the Initiator Target firmware which is designed to allow a SAS HBA to connect to up to 256 devices using SAS Expanders. The IT firmware is typically shipped on external cards. The IT firmware does not have any RAID capabilities and simply acts as an HBA.

这两种固件类型是启动器目标(IT)和集成RAID(IR)。
IR是内部卡或板附带的典型硬件RAID固件。
IT固件允许SAS HBA使用SAS扩展器连接到多达256个设备。IT固件通常在外部卡上提供。IT固件没有任何RAID功能,只是充当HBA。

 

LSI SAS3008是常用的RAID卡种类。此RIAD卡有两种固件:IT和IR。
当固件是3008IT时,只能直连硬盘而不能配置RAID。
当固件是3008IR时,可以配置RAID。

Basicly the IT firmware is only just a HBA and the boot up time is quick. The IR firmware is the raid software firmware so boot up is a bit longer than having the IT firmware only. You can cross flash with the LSI firmware in IT mode only or IT and IR mode which is default in LSI. If you are going with pure software raid then the IT firmware is best. 

更多解释:

LSI-RAID卡命名后缀的含义(it-ir-imr-mr)(华为)

broadcom官方MR、iMR、IR和IT软件功能比较矩阵


Read More

RJ45网口两个LED灯的指示意义以及控制原理


一般RJ45网口会有两个LED灯,至少从外观上看是两个。一个是link灯,一个是ACT灯。

参考下图所示,缺口朝上,一般右边绿灯常亮,表示link上,左边黄色、橘色、或者绿色灯闪烁,表示有数据传输。

有些act灯实际可能有多个是个多色灯,比如黄色、绿色。当100M时闪绿灯,当千兆时闪黄灯,以做区分。

 

这些灯是有PHY进行控制的。PHY的硬件接口文档中会有说明,以及相关的寄存器设置。

在uboot中可以使用mii来修改寄存器,改变亮灯状态。

在linux系统下,可以使用内核、驱动或者mii-tools修改控制灯的状态。

这些如何操作需要参考具体的硬件手册,因硬件手册厂家一般是不公开的,但从网上也能够找到零星的资料。

以下能够查找到的网上公开资料,可供参考

RTL8211F在uboot下使用mii工具配置网口灯详解

RJ45 LED灯


Read More

uboot下的mii命令简介


uboot下有一个mii命令。命令帮助信息如下:

mii - MII utility commands                                                      
                                                                                
Usage:                                                                          
mii device                     - list available devices                         
mii device            - set current device                             
mii info                 - display MII PHY info                           
mii read            - read  MII PHY  register             
mii write     - write MII PHY  register             
mii dump            - pretty-print   (0-5 only)           
Addr and/or reg may be ranges, e.g. 2-7. 

 

mii device示例,会输出MDC/MDIO总线设备

uboot>mii device                                                           
MII devices: 'FSL_MDIO0' 'FM_TGEC_MDIO'
Current device: 'FSL_MDIO0'

 

mii info打印输出,PHY后面跟的就是addr

uboot> mii info
PHY 0x00: OUI = 0x5043, Model = 0x1D, Rev = 0x01, 1000baseT, FDX
PHY 0x01: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x02: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x03: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x04: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x05: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x06: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX
PHY 0x07: OUI = 0x0000, Model = 0x00, Rev = 0x00,  10baseT, HDX

 

mii read          - read  MII PHY register            
mii write   - write MII PHY register  

上述两个命令,需要根据具体的芯片手册寄存器设置来进行配置。以下命令为示例

mii write 0 0 0x8000    向地址为0的phy芯片的0寄存器写入0x8000

mii  read 0 0     读取地址为0的phy芯片的寄存器0的值


Read More

#1295-D: Deprecated declaration xxxx- give arg types 解决方法


编译程序时出现“#1295-D: Deprecated declaration xxxx- give arg types”中文释义:给定函数的参数的类型过时,

解决办法: 在函数void xxxx()声明和定义的时候定义参数类型,无参函数定义为void,即可解决该问题。

示例:

void testfun()
{
  printf("this is a test function\r\n");
}

变为

void testfun(void)
{
  printf("this is a test function\r\n");
}

注意,无参函数定义为void,只需要在定义(h文件)和实现(c文件)中这样,实际函数调用时,不需要写参数。

void invoketest(int i)
{
  testfun();
  printf("this is a invoke test %d\r\n",i);
}

 

https://developer.arm.com/documentation/dui0067/d/c-and-c---compilers/command-syntax/controlling-warning-messages

这个是一个warning信息,使用arm编译器时会报这个错,这个信息可以使用编译开关-Wd忽略。

只所以报这个错,是ANSI C语言规定的,C++则不会。

-Wd
This option suppresses the warning message:

C2215W: Deprecated declaration foo() - give arg types

This warning is normally given when a declaration without argument types is encountered in ANSI C mode.

In ANSI C, declarations like this are deprecated. However, it is sometimes useful to suppress this warning when porting old code.

In C++, void foo(); means void foo(void); and no warning is generated.

 

 


Read More

ipmitool命令与raw命令与ipmi spec对照表2-NETFN_SENSOR


ipmitool命令与raw命令与ipmi spec对照表2-NETFN_SENSOR

raw命令索引 对应IPMI Spec的章节 raw命令格式 字符串命令
ipmitool raw 0x04 0x00 Set Event Receiver(29.1) ipmitool raw 0x04 0x00 Data[1:2]  
ipmitool raw 0x04 0x01 Get Event Receiver(29.2) ipmitool raw 0x04 0x01  
ipmitool raw 0x04 0x02 Platform Event(29.3) ipmitool raw 0x04 0x02 Data[1:7] ipmitool event [event_dir]
ipmitool event 1
ipmitool event 2
ipmitool event 3
ipmitool raw 0x04 0x10 Get PEF Capabilities(30.1) ipmitool raw 0x04 0x10 ipmitool pef
ipmitool pef info
ipmitool raw 0x04 0x11 Arm PEF Postpone Timer(30.2) ipmitool raw 0x04 0x11 Data[1]  
ipmitool raw 0x04 0x12 Set PEF Configuration Parameters(30.3) ipmitool raw 0x04 0x12 Data[1:N]  
ipmitool raw 0x04 0x13 Get PEF Configuration Parameters(30.4) ipmitool raw 0x04 0x13 Data[1:3] ipmitool pef list
ipmitool raw 0x04 0x14 Set Last Processed Event ID(30.5) ipmitool raw 0x04 0x14 Data[1:3]  
ipmitool raw 0x04 0x15 Get Last Processed Event ID(30.6) ipmitool raw 0x04 0x15 ipmitool pef status
ipmitool raw 0x04 0x16 Alert Immediate(30.7) ipmitool raw 0x04 0x16 Data[1:3]  
ipmitool raw 0x04 0x17 PET Acknowledge(30.8)    
ipmitool raw 0x04 0x20 Get Device SDR Info(35.2)    
ipmitool raw 0x04 0x21 Get Device SDR(35.3)    
ipmitool raw 0x04 0x22 Reserve Device SDR Repository(35.4)    
ipmitool raw 0x04 0x23 Get Sensor Reading Factors(35.5)    
ipmitool raw 0x04 0x24 Set Sensor Hysteresis(35.6)    
ipmitool raw 0x04 0x25 Get Sensor Hysteresis(35.7)    
ipmitool raw 0x04 0x26 Set Sensor Threshold(35.8)    
ipmitool raw 0x04 0x27 Get Sensor Threshold(35.9)    
ipmitool raw 0x04 0x28 Set Sensor Event Enable(35.1)    
ipmitool raw 0x04 0x29 Get Sensor Event Enable(35.11)    
ipmitool raw 0x04 0x2A Re-arm Sensor Events(35.12)    
ipmitool raw 0x04 0x2B Get Sensor Event Status(35.13)    
ipmitool raw 0x04 0x2D Get Sensor Reading(35.14)    
ipmitool raw 0x04 0x2E Set Sensor Type(35.15)    
ipmitool raw 0x04 0x2F Get Sensor Type(35.16)    
ipmitool raw 0x04 0x30 Set Sensor Reading And Event Status(35.17)    

 

参考IPMI Spec中的部分Appendix G。

ipmi spec sensor


Read More

RTL8211F在uboot下使用mii工具配置RJ45网口灯详解


RTL8211F在uboot下使用mii工具配置RJ45网口灯详解。

首先要明确使用这个工具的目的,类似于i2c-test工具测试i2c,使用这个工具验证测试网口灯的配置。然后再通过软件或者驱动来实现控制。

RTL8211F-CG-Realtek.pdf的手册可以通过bing搜索下载,alldatasheet也有这个文档。

 

先追加执行历史记录,再进行命令解释。

uboot>mii info
PHY 0x00: OUI = 0x0732, Model = 0x11, Rev = 0x06, 1000baseT, FDX
PHY 0x01: OUI = 0x0732, Model = 0x11, Rev = 0x06, 1000baseT, FDX
uboot>mii read 0 2
001C
uboot>mii read 0 3
C916
uboot>mii read 1 2
001C
uboot>mii read 1 3
C916
uboot>mii write 1 0x1f 0x0D04
uboot>mii read 1 0x1f
0D04
uboot>mii read 1 0x10
624B
uboot>mii write 0 0x1f 0x0D04
uboot>mii write 0 0x10 0x624B
uboot>mii write 0 0x1f
uboot>mii write 1 0x1f 0x0D04
uboot>mii read 1 0x1f
0D04
uboot>mii read 1 0x10
624B



 

首先解释OUI,通过硬件手册,能够看到里面提到OUI:0x0732,这个能够对应起来。

关于OUI的解释,需要查看ieee 802.3的定义Table 22–6—MII management register set。

rtl8211 oui

然后再看led的配置。缺省情况下,RTL8211F支持3个led,分别表示10M,100M,1000M的Active和Link。

这三个led会接到RJ45的状态灯上,这个具体的接法,可以参考硬件实际联线。

即一个灯即表示link又表示active,与一般的使用不同,两个灯一个表示link,另外一个表示active。

这个时候就需要通过配置寄存器修改灯的控制,使一个灯表示为100M、1000Mlink状态,一个灯表示100M的active状态,一个灯表示1000M的active状态。

参考手册,修改寄存器的状态来改变灯的行为。核心的命令如下:

uboot>mii write 0 0x1f 0x0D04
uboot>mii write 0 0x10 0x624B
uboot>mii write 0 0x1f

 

rtl8211f led


Read More


© 2008-2020 CunYouLu存有录博客 村友录 存游录 鲁ICP备08005943号