Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136215
b: refs/heads/master
c: 40c3460
h: refs/heads/master
i:
  136213: b831662
  136211: af9a28d
  136207: 966f430
v: v3
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Mar 12, 2009
1 parent 30cc2d2 commit db3177f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 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: 881a256d84e658d14ca1c162fe56e9cbbb1cdd49
refs/heads/master: 40c3460f3cad1672f22baadcdbe20b9b3200cc20
31 changes: 4 additions & 27 deletions trunk/drivers/scsi/ses.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,44 +345,21 @@ static int ses_enclosure_find_by_addr(struct enclosure_device *edev,
return 0;
}

#define VPD_INQUIRY_SIZE 36

static void ses_match_to_enclosure(struct enclosure_device *edev,
struct scsi_device *sdev)
{
unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL);
unsigned char *buf;
unsigned char *desc;
u16 vpd_len;
unsigned int vpd_len;
struct efd efd = {
.addr = 0,
};
unsigned char cmd[] = {
INQUIRY,
1,
0x83,
VPD_INQUIRY_SIZE >> 8,
VPD_INQUIRY_SIZE & 0xff,
0
};

buf = scsi_get_vpd_page(sdev, 0x83);
if (!buf)
return;

if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf,
VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES,
NULL))
goto free;

vpd_len = (buf[2] << 8) + buf[3];
kfree(buf);
buf = kmalloc(vpd_len, GFP_KERNEL);
if (!buf)
return;
cmd[3] = vpd_len >> 8;
cmd[4] = vpd_len & 0xff;
if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf,
vpd_len, NULL, SES_TIMEOUT, SES_RETRIES, NULL))
goto free;
vpd_len = ((buf[2] << 8) | buf[3]) + 4;

desc = buf + 4;
while (desc < buf + vpd_len) {
Expand Down

0 comments on commit db3177f

Please sign in to comment.