http://fx.damasgate.com/more-about-stall/

In other USB classes, a sender can indicate the end of a transfer
by transmitting a short packet, which is a data packet that contains
zero data bytes or any quantity fewer than wMaxPacketSize.

The mass-storage class is unique in its use of the STALL handshake
to end bulk transfers. In contrast, mass-storage devices
use STALL for this purpose and to respond to other error conditions.

After a bulk endpoint returns STALL, the endpoint is in the halt condition.
To resume communications with the endpoint, the host must issue a Clear
Feature(ENDPOINT_HALT) control request with the endpoint’s address
in the Setup transaction’s wIndex field.

Endpoint zero can also use the STALL handshake. On receiving a
Get Max LUN request, a device with a single LUN may return a STALL
to indicate that the device doesn’t support the command.
The endpoint resumes normal operation on receiving a new Setup transaction.

A mass-storage device must stall one or both bulk endpoints in these situations:

If a device sends less than the requested amount of data in the data-transport phase,
the device must stall the bulk IN endpoint.

If a received CBW isn’t valid, the device must stall the bulk IN endpoint and must
either stall the bulk OUT endpoint
or accept and discard any received data on the endpoint.

On experiencing an internal error that requires a reset, a device must
either stall the endpoint being used in any data transfer in progress and set bCSWStatus = 02h
or stall the bulk IN and bulk OUT endpoints until a reset recovery.

A mass-storage device may stall a bulk endpoints in these situations:
If a device expects to send more data than the host specified in the CBW,
after sending the requested quantity of data,
the device may stall the bulk IN endpoint.

If a device expects to receive a different quantity of
data than the host specified in the CBW,
the device may stall the bulk OUT endpoint.

If a device determinines that it can’t complete a command
during the data-transport phase, the device may stall
the bulk IN or bulk OUT endpoint as appropriate.

The thirteen cases described below have more about
the use of STALL with mass-storage commands.

Thirteen Cases for Any Situation
The mass-storage bulk-only transport specification spells out
how the host and device should behave after the host sends a command
in each of thirteen cases.

Cases 1, 6, and 12 (in bold) are the normal cases,
where the host and device each expect the same quantity
and direction of data transfer in the data-transport phase.

The other cases are situations where the host and device have differing expectations.

 

最新文章

  1. 转:MYSQL连接字符串参数解析(解释)
  2. 使用Autodesk Vault插件向导轻松创建Vault插件
  3. AC日记——合法C标识符 openjudge 1.7 06
  4. SQL的一切常用函数展示
  5. 【五子棋AI循序渐进】关于VCT,VCF的思考和核心代码
  6. pouchdb sync
  7. Spring IOC整理
  8. VS2013中Django流水账笔记--配置环境
  9. 【oracle】初学jobs
  10. Spark、Shark集群安装部署及遇到的问题解决
  11. Linux shell入门基础(二)
  12. 【转】 Spinner的常用技巧
  13. rabbitmq-message(C#)
  14. 抛弃vue-resource拥抱axios
  15. jquery/js知识点收藏
  16. 第一周——数据分析之表示 —— Numpy入门
  17. elementUI 时间格式化(一般方法)
  18. react使用ant-design组件库
  19. jar包版本介绍(beta,alpha,release),软件的版本介绍
  20. Cmd管理员运行

热门文章

  1. asp.net mvc 本地化 默认的错误提示
  2. 洛谷P2746校园网
  3. 20165301 2017-2018-2《Java程序设计》课程总结
  4. MySQL学习笔记:三种组内排序方法
  5. HttpService与WebService的差异
  6. centos7 配置ftp访问
  7. 安装配置SVN
  8. day5模块学习--random模块
  9. linux添加桌面快捷方式
  10. Numpy的简单用法