Chinaunix首页 | 论坛 | 博客
  • 博客访问: 136176
  • 博文数量: 79
  • 博客积分: 11
  • 博客等级: 民兵
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-19 22:16
文章分类
文章存档

2015年(1)

2014年(9)

2013年(43)

2012年(26)

我的朋友

分类: LINUX

2013-10-31 23:21:53

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

 

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 对于的数据项。

阅读(766) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~