Deleted Added
full compact
27c27
< * $FreeBSD: head/sys/dev/twe/twe.c 73104 2001-02-26 20:13:19Z msmith $
---
> * $FreeBSD: head/sys/dev/twe/twe.c 76340 2001-05-07 21:46:44Z msmith $
1640c1640
< int result;
---
> int result = 0;
1642,1656c1642,1650
< switch (cmd->generic.flags) {
< case TWE_FLAGS_SUCCESS:
< result = 0;
< break;
< case TWE_FLAGS_INFORMATIONAL:
< case TWE_FLAGS_WARNING:
< twe_printf(sc, "command completed - %s\n",
< twe_describe_code(twe_table_status, cmd->generic.status));
< result = 0;
< break;
<
< case TWE_FLAGS_FATAL:
< default:
< twe_printf(sc, "command failed - %s\n",
< twe_describe_code(twe_table_status, cmd->generic.status));
---
> /*
> * Check the command status value and handle accordingly.
> */
> if (cmd->generic.status == TWE_STATUS_RESET) {
> /*
> * The status code 0xff requests a controller reset.
> */
> twe_printf(sc, "command returned with controller rest request\n");
> twe_reset(sc);
1658c1652
<
---
> } else if (cmd->generic.status > TWE_STATUS_FATAL) {
1660c1654
< * The status code 0xff requests a controller reset
---
> * Fatal errors that don't require controller reset.
1662,1664c1656,1673
< if (cmd->generic.status == 0xff)
< twe_reset(sc);
< break;
---
> twe_printf(sc, "command returned fatal status - %s (flags = 0x%x)\n",
> twe_describe_code(twe_table_status, cmd->generic.status),
> cmd->generic.flags);
> result = 1;
> } else if (cmd->generic.status > TWE_STATUS_WARNING) {
> /*
> * Warning level status.
> */
> twe_printf(sc, "command returned warning status - %s (flags = 0x%x)\n",
> twe_describe_code(twe_table_status, cmd->generic.status),
> cmd->generic.flags);
> } else if (cmd->generic.status > 0x40) {
> /*
> * Info level status.
> */
> twe_printf(sc, "command returned info status: %s (flags = 0x%x)\n",
> twe_describe_code(twe_table_status, cmd->generic.status),
> cmd->generic.flags);
1665a1675
>