Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89726
b: refs/heads/master
c: d70d466
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and James Bottomley committed Apr 7, 2008
1 parent 339b1db commit 814eba0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c5e03d3cf70161413aaf7152dafa96daca5bb2f
refs/heads/master: d70d4667e9eead06aa38be947274fda22dcf923b
33 changes: 17 additions & 16 deletions trunk/drivers/scsi/ch.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static const struct {
unsigned char asc;
unsigned char ascq;
int errno;
} err[] = {
} ch_err[] = {
/* Just filled in what looks right. Hav'nt checked any standard paper for
these errno assignments, so they may be wrong... */
{
Expand Down Expand Up @@ -155,11 +155,11 @@ static int ch_find_errno(struct scsi_sense_hdr *sshdr)
/* Check to see if additional sense information is available */
if (scsi_sense_valid(sshdr) &&
sshdr->asc != 0) {
for (i = 0; err[i].errno != 0; i++) {
if (err[i].sense == sshdr->sense_key &&
err[i].asc == sshdr->asc &&
err[i].ascq == sshdr->ascq) {
errno = -err[i].errno;
for (i = 0; ch_err[i].errno != 0; i++) {
if (ch_err[i].sense == sshdr->sense_key &&
ch_err[i].asc == sshdr->asc &&
ch_err[i].ascq == sshdr->ascq) {
errno = -ch_err[i].errno;
break;
}
}
Expand Down Expand Up @@ -721,8 +721,8 @@ static long ch_ioctl(struct file *file,
case CHIOGELEM:
{
struct changer_get_element cge;
u_char cmd[12];
u_char *buffer;
u_char ch_cmd[12];
u_char *buffer;
unsigned int elem;
int result,i;

Expand All @@ -739,17 +739,18 @@ static long ch_ioctl(struct file *file,
mutex_lock(&ch->lock);

voltag_retry:
memset(cmd,0,sizeof(cmd));
cmd[0] = READ_ELEMENT_STATUS;
cmd[1] = (ch->device->lun << 5) |
memset(ch_cmd, 0, sizeof(ch_cmd));
ch_cmd[0] = READ_ELEMENT_STATUS;
ch_cmd[1] = (ch->device->lun << 5) |
(ch->voltags ? 0x10 : 0) |
ch_elem_to_typecode(ch,elem);
cmd[2] = (elem >> 8) & 0xff;
cmd[3] = elem & 0xff;
cmd[5] = 1;
cmd[9] = 255;
ch_cmd[2] = (elem >> 8) & 0xff;
ch_cmd[3] = elem & 0xff;
ch_cmd[5] = 1;
ch_cmd[9] = 255;

if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256, DMA_FROM_DEVICE))) {
result = ch_do_scsi(ch, ch_cmd, buffer, 256, DMA_FROM_DEVICE);
if (!result) {
cge.cge_status = buffer[18];
cge.cge_flags = 0;
if (buffer[18] & CESTATUS_EXCEPT) {
Expand Down

0 comments on commit 814eba0

Please sign in to comment.