sas协议之spc4中的receive diagnostic 和send diagnostic

 说明:这一部分主要是工作中的需要而所写的,源于个人的理解,主要是用于记录便于以后自己的深化。

 

SCSI Primary Commands - 4 (SPC-4)中我主要关注的是通信中使用的命令,即第六章所定义的命令。

 为什么要介绍这俩个命令?因为这俩个命令在数据的控制和数据信息的获取中常常被使用。理解了此命令能更好的理解协议,能更好的处理程序的命令的解析过程、

1:RECEIVE DIAGNOSTIC  和 SEND DIAGNOSTIC概述

其用以定义为:

The RECEIVE DIAGNOSTIC RESULTS command (see table 224) requests that data be sent to the application
client Data-In Buffer. The data is either data based on the most recent SEND DIAGNOSTIC command (see 6.32)
or is a diagnostic page specified by the PAGE CODE field.主要用来接收element的status 信息,读请求。

The SEND DIAGNOSTIC command (see table 266) requests the device server to perform diagnostic operations on
the SCSI target device, on the logical unit, or on both. Logical units that support this command shall implement, at
a minimum。主要用来对控制对elements进行控制,写操作。

主要是请求或控制page code所定义的数据报文,此处的page code包括如下:

page code在 01h to 2h 范围内所定义的page code,是在"SCSI Enclosure Services - 3 (SES-3)"中定义的,ses中主要是用来对enclosure进行管理的,

包括enclosure本身和自身所包含的各种elements,命令定义可以参见ses3中的第6章。elemes的定义可参见ses中的第7章 Element definitions。

Supported Diagnostic Pages所定义的表示:

定义其使用说明。

This clause defines the diagnostic page structure and the diagnostic pages that are applicable to enclosure services devices and other device types that provide communications access to an enclosure services process. Control pages are accessed with the SEND DIAGNOSTIC command. Status pages are accessed with the RECEIVE DIAGNOSTIC RESULTS command.The diagnostic page format is specified in SPC-4. All diagnostic pages have the diagnostic page header defined in SPC-4, including the PAGE CODE and PAGE LENGTH fields.
无论是spc还是ses中的命令都是用来在target和initiator之间数据同,其实target和initiator的定义也比较抽象,我个人理解还不是很透彻。

同时从上面的定义可以看处,ses中定义的命令的头部定义在spc中,即send diagnostic和receive diagnostic的数据包中包含中ses中的定义的命名格式。

在进行命令处理的时候,我们收到SPL(SAS Protocol Layer (SPL)) 第8章Transport layer所定义的SSP frame format格式之后,对相应的字段进行解析之后,最后就会处理到

send diagnostic 和receive diagnostic 对应的OPERATION CODE(1DH和1CH),send diagnostic和receive diagnostic根据帧格式中的page code来判断是Status pages 还是Control pages ,即从initiator获取数据信息还是向initiator发送控制信息。

2: SPC命令之 send diagnostic

    其实这个send diagnostic命令有点复杂,在信息的控制方面,不是显而易见的。即有不确定性,根据具体的参数不同就形成了不同的命令解析及处理方式。

    主要是请求服务,在target上面执行diagnostic操作,用于发送控制命名。对target中的elements进行控制、

 

3: SPC命令之 receive diagnostic

   

 上面的图中:A page code valid (PCV) bit set to one specifies that the device server return the diagnostic page specified in the PAGE CODE field。及pcv等于1,target将返回

page code 对于的数据项。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

家有工程师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值