diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/Kconfig | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-ep93xx.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ChangeLog.history | 2 | ||||
-rw-r--r-- | drivers/usb/serial/Kconfig | 4 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 58 | ||||
-rw-r--r-- | drivers/usb/storage/isd200.c | 239 | ||||
-rw-r--r-- | drivers/usb/storage/transport.c | 2 | ||||
-rw-r--r-- | drivers/usb/wusbcore/devconnect.c | 2 | ||||
-rw-r--r-- | drivers/usb/wusbcore/security.c | 2 |
10 files changed, 115 insertions, 200 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index b6483dd98acc..9cf9ff69e3e3 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -626,7 +626,7 @@ static void uea_upload_pre_firmware(const struct firmware *fw_entry, void *conte | |||
626 | goto err_fw_corrupted; | 626 | goto err_fw_corrupted; |
627 | 627 | ||
628 | /* | 628 | /* |
629 | * Start to upload formware : send reset | 629 | * Start to upload firmware : send reset |
630 | */ | 630 | */ |
631 | value = 1; | 631 | value = 1; |
632 | ret = uea_send_modem_cmd(usb, F8051_USBCS, sizeof(value), &value); | 632 | ret = uea_send_modem_cmd(usb, F8051_USBCS, sizeof(value), &value); |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 770b3eaa9184..080bb1e4b847 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -392,7 +392,7 @@ config USB_GADGET_FSL_QE | |||
392 | controllers having QE or CPM2, given minor tweaks. | 392 | controllers having QE or CPM2, given minor tweaks. |
393 | 393 | ||
394 | Set CONFIG_USB_GADGET to "m" to build this driver as a | 394 | Set CONFIG_USB_GADGET to "m" to build this driver as a |
395 | dynmically linked module called "fsl_qe_udc". | 395 | dynamically linked module called "fsl_qe_udc". |
396 | 396 | ||
397 | config USB_FSL_QE | 397 | config USB_FSL_QE |
398 | tristate | 398 | tristate |
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index fb3055f084b5..7cf74f8c2db1 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c | |||
@@ -28,8 +28,6 @@ | |||
28 | #include <linux/signal.h> | 28 | #include <linux/signal.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | 30 | ||
31 | #include <mach/hardware.h> | ||
32 | |||
33 | static struct clk *usb_host_clock; | 31 | static struct clk *usb_host_clock; |
34 | 32 | ||
35 | static void ep93xx_start_hc(struct device *dev) | 33 | static void ep93xx_start_hc(struct device *dev) |
diff --git a/drivers/usb/serial/ChangeLog.history b/drivers/usb/serial/ChangeLog.history index c1b279939bbf..f13fd488ebec 100644 --- a/drivers/usb/serial/ChangeLog.history +++ b/drivers/usb/serial/ChangeLog.history | |||
@@ -715,7 +715,7 @@ io_edgeport.c Change Log comments: | |||
715 | 715 | ||
716 | 0.2 (01/30/2000) greg kroah-hartman | 716 | 0.2 (01/30/2000) greg kroah-hartman |
717 | Milestone 1 release. | 717 | Milestone 1 release. |
718 | Device is found by USB subsystem, enumerated, fimware is downloaded | 718 | Device is found by USB subsystem, enumerated, firmware is downloaded |
719 | and the descriptors are printed to the debug log, config is set, and | 719 | and the descriptors are printed to the debug log, config is set, and |
720 | green light starts to blink. Open port works, and data can be sent | 720 | green light starts to blink. Open port works, and data can be sent |
721 | and received at the default settings of the UART. Loopback connector | 721 | and received at the default settings of the UART. Loopback connector |
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index a65f9196b0a0..c480ea4c19f2 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -518,8 +518,8 @@ config USB_SERIAL_SIERRAWIRELESS | |||
518 | help | 518 | help |
519 | Say M here if you want to use Sierra Wireless devices. | 519 | Say M here if you want to use Sierra Wireless devices. |
520 | 520 | ||
521 | Many deviecs have a feature known as TRU-Install, for those devices | 521 | Many devices have a feature known as TRU-Install. For those devices |
522 | to work properly the USB Storage Sierra feature must be enabled. | 522 | to work properly, the USB Storage Sierra feature must be enabled. |
523 | 523 | ||
524 | To compile this driver as a module, choose M here: the | 524 | To compile this driver as a module, choose M here: the |
525 | module will be called sierra. | 525 | module will be called sierra. |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 742a5bc44be8..2a70563bbee1 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/tty_flip.h> | 26 | #include <linux/tty_flip.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/moduleparam.h> | 28 | #include <linux/moduleparam.h> |
29 | #include <linux/seq_file.h> | ||
29 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
30 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
31 | #include <linux/list.h> | 32 | #include <linux/list.h> |
@@ -421,57 +422,52 @@ static int serial_break(struct tty_struct *tty, int break_state) | |||
421 | return 0; | 422 | return 0; |
422 | } | 423 | } |
423 | 424 | ||
424 | static int serial_read_proc(char *page, char **start, off_t off, int count, | 425 | static int serial_proc_show(struct seq_file *m, void *v) |
425 | int *eof, void *data) | ||
426 | { | 426 | { |
427 | struct usb_serial *serial; | 427 | struct usb_serial *serial; |
428 | int length = 0; | ||
429 | int i; | 428 | int i; |
430 | off_t begin = 0; | ||
431 | char tmp[40]; | 429 | char tmp[40]; |
432 | 430 | ||
433 | dbg("%s", __func__); | 431 | dbg("%s", __func__); |
434 | length += sprintf(page, "usbserinfo:1.0 driver:2.0\n"); | 432 | seq_puts(m, "usbserinfo:1.0 driver:2.0\n"); |
435 | for (i = 0; i < SERIAL_TTY_MINORS && length < PAGE_SIZE; ++i) { | 433 | for (i = 0; i < SERIAL_TTY_MINORS; ++i) { |
436 | serial = usb_serial_get_by_index(i); | 434 | serial = usb_serial_get_by_index(i); |
437 | if (serial == NULL) | 435 | if (serial == NULL) |
438 | continue; | 436 | continue; |
439 | 437 | ||
440 | length += sprintf(page+length, "%d:", i); | 438 | seq_printf(m, "%d:", i); |
441 | if (serial->type->driver.owner) | 439 | if (serial->type->driver.owner) |
442 | length += sprintf(page+length, " module:%s", | 440 | seq_printf(m, " module:%s", |
443 | module_name(serial->type->driver.owner)); | 441 | module_name(serial->type->driver.owner)); |
444 | length += sprintf(page+length, " name:\"%s\"", | 442 | seq_printf(m, " name:\"%s\"", |
445 | serial->type->description); | 443 | serial->type->description); |
446 | length += sprintf(page+length, " vendor:%04x product:%04x", | 444 | seq_printf(m, " vendor:%04x product:%04x", |
447 | le16_to_cpu(serial->dev->descriptor.idVendor), | 445 | le16_to_cpu(serial->dev->descriptor.idVendor), |
448 | le16_to_cpu(serial->dev->descriptor.idProduct)); | 446 | le16_to_cpu(serial->dev->descriptor.idProduct)); |
449 | length += sprintf(page+length, " num_ports:%d", | 447 | seq_printf(m, " num_ports:%d", serial->num_ports); |
450 | serial->num_ports); | 448 | seq_printf(m, " port:%d", i - serial->minor + 1); |
451 | length += sprintf(page+length, " port:%d", | ||
452 | i - serial->minor + 1); | ||
453 | usb_make_path(serial->dev, tmp, sizeof(tmp)); | 449 | usb_make_path(serial->dev, tmp, sizeof(tmp)); |
454 | length += sprintf(page+length, " path:%s", tmp); | 450 | seq_printf(m, " path:%s", tmp); |
455 | 451 | ||
456 | length += sprintf(page+length, "\n"); | 452 | seq_putc(m, '\n'); |
457 | if ((length + begin) > (off + count)) { | ||
458 | usb_serial_put(serial); | ||
459 | goto done; | ||
460 | } | ||
461 | if ((length + begin) < off) { | ||
462 | begin += length; | ||
463 | length = 0; | ||
464 | } | ||
465 | usb_serial_put(serial); | 453 | usb_serial_put(serial); |
466 | } | 454 | } |
467 | *eof = 1; | 455 | return 0; |
468 | done: | ||
469 | if (off >= (length + begin)) | ||
470 | return 0; | ||
471 | *start = page + (off-begin); | ||
472 | return (count < begin+length-off) ? count : begin+length-off; | ||
473 | } | 456 | } |
474 | 457 | ||
458 | static int serial_proc_open(struct inode *inode, struct file *file) | ||
459 | { | ||
460 | return single_open(file, serial_proc_show, NULL); | ||
461 | } | ||
462 | |||
463 | static const struct file_operations serial_proc_fops = { | ||
464 | .owner = THIS_MODULE, | ||
465 | .open = serial_proc_open, | ||
466 | .read = seq_read, | ||
467 | .llseek = seq_lseek, | ||
468 | .release = single_release, | ||
469 | }; | ||
470 | |||
475 | static int serial_tiocmget(struct tty_struct *tty, struct file *file) | 471 | static int serial_tiocmget(struct tty_struct *tty, struct file *file) |
476 | { | 472 | { |
477 | struct usb_serial_port *port = tty->driver_data; | 473 | struct usb_serial_port *port = tty->driver_data; |
@@ -1113,9 +1109,9 @@ static const struct tty_operations serial_ops = { | |||
1113 | .unthrottle = serial_unthrottle, | 1109 | .unthrottle = serial_unthrottle, |
1114 | .break_ctl = serial_break, | 1110 | .break_ctl = serial_break, |
1115 | .chars_in_buffer = serial_chars_in_buffer, | 1111 | .chars_in_buffer = serial_chars_in_buffer, |
1116 | .read_proc = serial_read_proc, | ||
1117 | .tiocmget = serial_tiocmget, | 1112 | .tiocmget = serial_tiocmget, |
1118 | .tiocmset = serial_tiocmset, | 1113 | .tiocmset = serial_tiocmset, |
1114 | .proc_fops = &serial_proc_fops, | ||
1119 | }; | 1115 | }; |
1120 | 1116 | ||
1121 | struct tty_driver *usb_serial_tty_driver; | 1117 | struct tty_driver *usb_serial_tty_driver; |
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 882c57b399f7..fdba2f69d4c9 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/errno.h> | 46 | #include <linux/errno.h> |
47 | #include <linux/module.h> | 47 | #include <linux/module.h> |
48 | #include <linux/slab.h> | 48 | #include <linux/slab.h> |
49 | #include <linux/ata.h> | ||
49 | #include <linux/hdreg.h> | 50 | #include <linux/hdreg.h> |
50 | #include <linux/scatterlist.h> | 51 | #include <linux/scatterlist.h> |
51 | 52 | ||
@@ -328,7 +329,7 @@ struct isd200_config { | |||
328 | 329 | ||
329 | struct isd200_info { | 330 | struct isd200_info { |
330 | struct inquiry_data InquiryData; | 331 | struct inquiry_data InquiryData; |
331 | struct hd_driveid *id; | 332 | u16 *id; |
332 | struct isd200_config ConfigData; | 333 | struct isd200_config ConfigData; |
333 | unsigned char *RegsBuf; | 334 | unsigned char *RegsBuf; |
334 | unsigned char ATARegs[8]; | 335 | unsigned char ATARegs[8]; |
@@ -419,19 +420,19 @@ static void isd200_build_sense(struct us_data *us, struct scsi_cmnd *srb) | |||
419 | buf->Flags = UNIT_ATTENTION; | 420 | buf->Flags = UNIT_ATTENTION; |
420 | buf->AdditionalSenseCode = 0; | 421 | buf->AdditionalSenseCode = 0; |
421 | buf->AdditionalSenseCodeQualifier = 0; | 422 | buf->AdditionalSenseCodeQualifier = 0; |
422 | } else if(error & MCR_ERR) { | 423 | } else if (error & ATA_MCR) { |
423 | buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; | 424 | buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; |
424 | buf->AdditionalSenseLength = 0xb; | 425 | buf->AdditionalSenseLength = 0xb; |
425 | buf->Flags = UNIT_ATTENTION; | 426 | buf->Flags = UNIT_ATTENTION; |
426 | buf->AdditionalSenseCode = 0; | 427 | buf->AdditionalSenseCode = 0; |
427 | buf->AdditionalSenseCodeQualifier = 0; | 428 | buf->AdditionalSenseCodeQualifier = 0; |
428 | } else if(error & TRK0_ERR) { | 429 | } else if (error & ATA_TRK0NF) { |
429 | buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; | 430 | buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; |
430 | buf->AdditionalSenseLength = 0xb; | 431 | buf->AdditionalSenseLength = 0xb; |
431 | buf->Flags = NOT_READY; | 432 | buf->Flags = NOT_READY; |
432 | buf->AdditionalSenseCode = 0; | 433 | buf->AdditionalSenseCode = 0; |
433 | buf->AdditionalSenseCodeQualifier = 0; | 434 | buf->AdditionalSenseCodeQualifier = 0; |
434 | } else if(error & ECC_ERR) { | 435 | } else if (error & ATA_UNC) { |
435 | buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; | 436 | buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; |
436 | buf->AdditionalSenseLength = 0xb; | 437 | buf->AdditionalSenseLength = 0xb; |
437 | buf->Flags = DATA_PROTECT; | 438 | buf->Flags = DATA_PROTECT; |
@@ -547,16 +548,16 @@ static int isd200_action( struct us_data *us, int action, | |||
547 | ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_5; | 548 | ata.generic.ActionSelect = ACTION_SELECT_1|ACTION_SELECT_5; |
548 | ata.generic.RegisterSelect = REG_DEVICE_HEAD | REG_COMMAND; | 549 | ata.generic.RegisterSelect = REG_DEVICE_HEAD | REG_COMMAND; |
549 | ata.write.DeviceHeadByte = info->DeviceHead; | 550 | ata.write.DeviceHeadByte = info->DeviceHead; |
550 | ata.write.CommandByte = WIN_SRST; | 551 | ata.write.CommandByte = ATA_CMD_DEV_RESET; |
551 | isd200_set_srb(info, DMA_NONE, NULL, 0); | 552 | isd200_set_srb(info, DMA_NONE, NULL, 0); |
552 | break; | 553 | break; |
553 | 554 | ||
554 | case ACTION_IDENTIFY: | 555 | case ACTION_IDENTIFY: |
555 | US_DEBUGP(" isd200_action(IDENTIFY)\n"); | 556 | US_DEBUGP(" isd200_action(IDENTIFY)\n"); |
556 | ata.generic.RegisterSelect = REG_COMMAND; | 557 | ata.generic.RegisterSelect = REG_COMMAND; |
557 | ata.write.CommandByte = WIN_IDENTIFY; | 558 | ata.write.CommandByte = ATA_CMD_ID_ATA; |
558 | isd200_set_srb(info, DMA_FROM_DEVICE, info->id, | 559 | isd200_set_srb(info, DMA_FROM_DEVICE, info->id, |
559 | sizeof(struct hd_driveid)); | 560 | ATA_ID_WORDS * 2); |
560 | break; | 561 | break; |
561 | 562 | ||
562 | default: | 563 | default: |
@@ -944,22 +945,22 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave, | |||
944 | break; | 945 | break; |
945 | 946 | ||
946 | if (!detect) { | 947 | if (!detect) { |
947 | if (regs[ATA_REG_STATUS_OFFSET] & BUSY_STAT) { | 948 | if (regs[ATA_REG_STATUS_OFFSET] & ATA_BUSY) { |
948 | US_DEBUGP(" %s status is still BSY, try again...\n",mstr); | 949 | US_DEBUGP(" %s status is still BSY, try again...\n",mstr); |
949 | } else { | 950 | } else { |
950 | US_DEBUGP(" %s status !BSY, continue with next operation\n",mstr); | 951 | US_DEBUGP(" %s status !BSY, continue with next operation\n",mstr); |
951 | break; | 952 | break; |
952 | } | 953 | } |
953 | } | 954 | } |
954 | /* check for BUSY_STAT and */ | 955 | /* check for ATA_BUSY and */ |
955 | /* WRERR_STAT (workaround ATA Zip drive) and */ | 956 | /* ATA_DF (workaround ATA Zip drive) and */ |
956 | /* ERR_STAT (workaround for Archos CD-ROM) */ | 957 | /* ATA_ERR (workaround for Archos CD-ROM) */ |
957 | else if (regs[ATA_REG_STATUS_OFFSET] & | 958 | else if (regs[ATA_REG_STATUS_OFFSET] & |
958 | (BUSY_STAT | WRERR_STAT | ERR_STAT )) { | 959 | (ATA_BUSY | ATA_DF | ATA_ERR)) { |
959 | US_DEBUGP(" Status indicates it is not ready, try again...\n"); | 960 | US_DEBUGP(" Status indicates it is not ready, try again...\n"); |
960 | } | 961 | } |
961 | /* check for DRDY, ATA devices set DRDY after SRST */ | 962 | /* check for DRDY, ATA devices set DRDY after SRST */ |
962 | else if (regs[ATA_REG_STATUS_OFFSET] & READY_STAT) { | 963 | else if (regs[ATA_REG_STATUS_OFFSET] & ATA_DRDY) { |
963 | US_DEBUGP(" Identified ATA device\n"); | 964 | US_DEBUGP(" Identified ATA device\n"); |
964 | info->DeviceFlags |= DF_ATA_DEVICE; | 965 | info->DeviceFlags |= DF_ATA_DEVICE; |
965 | info->DeviceHead = master_slave; | 966 | info->DeviceHead = master_slave; |
@@ -1053,103 +1054,50 @@ static int isd200_manual_enum(struct us_data *us) | |||
1053 | return(retStatus); | 1054 | return(retStatus); |
1054 | } | 1055 | } |
1055 | 1056 | ||
1056 | static void isd200_fix_driveid (struct hd_driveid *id) | 1057 | static void isd200_fix_driveid(u16 *id) |
1057 | { | 1058 | { |
1058 | #ifndef __LITTLE_ENDIAN | 1059 | #ifndef __LITTLE_ENDIAN |
1059 | # ifdef __BIG_ENDIAN | 1060 | # ifdef __BIG_ENDIAN |
1060 | int i; | 1061 | int i; |
1061 | u16 *stringcast; | 1062 | |
1062 | 1063 | for (i = 0; i < ATA_ID_WORDS; i++) | |
1063 | id->config = __le16_to_cpu(id->config); | 1064 | id[i] = __le16_to_cpu(id[i]); |
1064 | id->cyls = __le16_to_cpu(id->cyls); | ||
1065 | id->reserved2 = __le16_to_cpu(id->reserved2); | ||
1066 | id->heads = __le16_to_cpu(id->heads); | ||
1067 | id->track_bytes = __le16_to_cpu(id->track_bytes); | ||
1068 | id->sector_bytes = __le16_to_cpu(id->sector_bytes); | ||
1069 | id->sectors = __le16_to_cpu(id->sectors); | ||
1070 | id->vendor0 = __le16_to_cpu(id->vendor0); | ||
1071 | id->vendor1 = __le16_to_cpu(id->vendor1); | ||
1072 | id->vendor2 = __le16_to_cpu(id->vendor2); | ||
1073 | stringcast = (u16 *)&id->serial_no[0]; | ||
1074 | for (i = 0; i < (20/2); i++) | ||
1075 | stringcast[i] = __le16_to_cpu(stringcast[i]); | ||
1076 | id->buf_type = __le16_to_cpu(id->buf_type); | ||
1077 | id->buf_size = __le16_to_cpu(id->buf_size); | ||
1078 | id->ecc_bytes = __le16_to_cpu(id->ecc_bytes); | ||
1079 | stringcast = (u16 *)&id->fw_rev[0]; | ||
1080 | for (i = 0; i < (8/2); i++) | ||
1081 | stringcast[i] = __le16_to_cpu(stringcast[i]); | ||
1082 | stringcast = (u16 *)&id->model[0]; | ||
1083 | for (i = 0; i < (40/2); i++) | ||
1084 | stringcast[i] = __le16_to_cpu(stringcast[i]); | ||
1085 | id->dword_io = __le16_to_cpu(id->dword_io); | ||
1086 | id->reserved50 = __le16_to_cpu(id->reserved50); | ||
1087 | id->field_valid = __le16_to_cpu(id->field_valid); | ||
1088 | id->cur_cyls = __le16_to_cpu(id->cur_cyls); | ||
1089 | id->cur_heads = __le16_to_cpu(id->cur_heads); | ||
1090 | id->cur_sectors = __le16_to_cpu(id->cur_sectors); | ||
1091 | id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0); | ||
1092 | id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1); | ||
1093 | id->lba_capacity = __le32_to_cpu(id->lba_capacity); | ||
1094 | id->dma_1word = __le16_to_cpu(id->dma_1word); | ||
1095 | id->dma_mword = __le16_to_cpu(id->dma_mword); | ||
1096 | id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes); | ||
1097 | id->eide_dma_min = __le16_to_cpu(id->eide_dma_min); | ||
1098 | id->eide_dma_time = __le16_to_cpu(id->eide_dma_time); | ||
1099 | id->eide_pio = __le16_to_cpu(id->eide_pio); | ||
1100 | id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy); | ||
1101 | for (i = 0; i < 2; ++i) | ||
1102 | id->words69_70[i] = __le16_to_cpu(id->words69_70[i]); | ||
1103 | for (i = 0; i < 4; ++i) | ||
1104 | id->words71_74[i] = __le16_to_cpu(id->words71_74[i]); | ||
1105 | id->queue_depth = __le16_to_cpu(id->queue_depth); | ||
1106 | for (i = 0; i < 4; ++i) | ||
1107 | id->words76_79[i] = __le16_to_cpu(id->words76_79[i]); | ||
1108 | id->major_rev_num = __le16_to_cpu(id->major_rev_num); | ||
1109 | id->minor_rev_num = __le16_to_cpu(id->minor_rev_num); | ||
1110 | id->command_set_1 = __le16_to_cpu(id->command_set_1); | ||
1111 | id->command_set_2 = __le16_to_cpu(id->command_set_2); | ||
1112 | id->cfsse = __le16_to_cpu(id->cfsse); | ||
1113 | id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1); | ||
1114 | id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); | ||
1115 | id->csf_default = __le16_to_cpu(id->csf_default); | ||
1116 | id->dma_ultra = __le16_to_cpu(id->dma_ultra); | ||
1117 | id->trseuc = __le16_to_cpu(id->trseuc); | ||
1118 | id->trsEuc = __le16_to_cpu(id->trsEuc); | ||
1119 | id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); | ||
1120 | id->mprc = __le16_to_cpu(id->mprc); | ||
1121 | id->hw_config = __le16_to_cpu(id->hw_config); | ||
1122 | id->acoustic = __le16_to_cpu(id->acoustic); | ||
1123 | id->msrqs = __le16_to_cpu(id->msrqs); | ||
1124 | id->sxfert = __le16_to_cpu(id->sxfert); | ||
1125 | id->sal = __le16_to_cpu(id->sal); | ||
1126 | id->spg = __le32_to_cpu(id->spg); | ||
1127 | id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2); | ||
1128 | for (i = 0; i < 22; i++) | ||
1129 | id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); | ||
1130 | id->last_lun = __le16_to_cpu(id->last_lun); | ||
1131 | id->word127 = __le16_to_cpu(id->word127); | ||
1132 | id->dlf = __le16_to_cpu(id->dlf); | ||
1133 | id->csfo = __le16_to_cpu(id->csfo); | ||
1134 | for (i = 0; i < 26; i++) | ||
1135 | id->words130_155[i] = __le16_to_cpu(id->words130_155[i]); | ||
1136 | id->word156 = __le16_to_cpu(id->word156); | ||
1137 | for (i = 0; i < 3; i++) | ||
1138 | id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); | ||
1139 | id->cfa_power = __le16_to_cpu(id->cfa_power); | ||
1140 | for (i = 0; i < 14; i++) | ||
1141 | id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); | ||
1142 | for (i = 0; i < 31; i++) | ||
1143 | id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); | ||
1144 | for (i = 0; i < 48; i++) | ||
1145 | id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); | ||
1146 | id->integrity_word = __le16_to_cpu(id->integrity_word); | ||
1147 | # else | 1065 | # else |
1148 | # error "Please fix <asm/byteorder.h>" | 1066 | # error "Please fix <asm/byteorder.h>" |
1149 | # endif | 1067 | # endif |
1150 | #endif | 1068 | #endif |
1151 | } | 1069 | } |
1152 | 1070 | ||
1071 | static void isd200_dump_driveid(u16 *id) | ||
1072 | { | ||
1073 | US_DEBUGP(" Identify Data Structure:\n"); | ||
1074 | US_DEBUGP(" config = 0x%x\n", id[ATA_ID_CONFIG]); | ||
1075 | US_DEBUGP(" cyls = 0x%x\n", id[ATA_ID_CYLS]); | ||
1076 | US_DEBUGP(" heads = 0x%x\n", id[ATA_ID_HEADS]); | ||
1077 | US_DEBUGP(" track_bytes = 0x%x\n", id[4]); | ||
1078 | US_DEBUGP(" sector_bytes = 0x%x\n", id[5]); | ||
1079 | US_DEBUGP(" sectors = 0x%x\n", id[ATA_ID_SECTORS]); | ||
1080 | US_DEBUGP(" serial_no[0] = 0x%x\n", *(char *)&id[ATA_ID_SERNO]); | ||
1081 | US_DEBUGP(" buf_type = 0x%x\n", id[20]); | ||
1082 | US_DEBUGP(" buf_size = 0x%x\n", id[ATA_ID_BUF_SIZE]); | ||
1083 | US_DEBUGP(" ecc_bytes = 0x%x\n", id[22]); | ||
1084 | US_DEBUGP(" fw_rev[0] = 0x%x\n", *(char *)&id[ATA_ID_FW_REV]); | ||
1085 | US_DEBUGP(" model[0] = 0x%x\n", *(char *)&id[ATA_ID_PROD]); | ||
1086 | US_DEBUGP(" max_multsect = 0x%x\n", id[ATA_ID_MAX_MULTSECT] & 0xff); | ||
1087 | US_DEBUGP(" dword_io = 0x%x\n", id[ATA_ID_DWORD_IO]); | ||
1088 | US_DEBUGP(" capability = 0x%x\n", id[ATA_ID_CAPABILITY] >> 8); | ||
1089 | US_DEBUGP(" tPIO = 0x%x\n", id[ATA_ID_OLD_PIO_MODES] >> 8); | ||
1090 | US_DEBUGP(" tDMA = 0x%x\n", id[ATA_ID_OLD_DMA_MODES] >> 8); | ||
1091 | US_DEBUGP(" field_valid = 0x%x\n", id[ATA_ID_FIELD_VALID]); | ||
1092 | US_DEBUGP(" cur_cyls = 0x%x\n", id[ATA_ID_CUR_CYLS]); | ||
1093 | US_DEBUGP(" cur_heads = 0x%x\n", id[ATA_ID_CUR_HEADS]); | ||
1094 | US_DEBUGP(" cur_sectors = 0x%x\n", id[ATA_ID_CUR_SECTORS]); | ||
1095 | US_DEBUGP(" cur_capacity = 0x%x\n", ata_id_u32(id, 57)); | ||
1096 | US_DEBUGP(" multsect = 0x%x\n", id[ATA_ID_MULTSECT] & 0xff); | ||
1097 | US_DEBUGP(" lba_capacity = 0x%x\n", ata_id_u32(id, ATA_ID_LBA_CAPACITY)); | ||
1098 | US_DEBUGP(" command_set_1 = 0x%x\n", id[ATA_ID_COMMAND_SET_1]); | ||
1099 | US_DEBUGP(" command_set_2 = 0x%x\n", id[ATA_ID_COMMAND_SET_2]); | ||
1100 | } | ||
1153 | 1101 | ||
1154 | /************************************************************************** | 1102 | /************************************************************************** |
1155 | * isd200_get_inquiry_data | 1103 | * isd200_get_inquiry_data |
@@ -1163,7 +1111,7 @@ static int isd200_get_inquiry_data( struct us_data *us ) | |||
1163 | { | 1111 | { |
1164 | struct isd200_info *info = (struct isd200_info *)us->extra; | 1112 | struct isd200_info *info = (struct isd200_info *)us->extra; |
1165 | int retStatus = ISD200_GOOD; | 1113 | int retStatus = ISD200_GOOD; |
1166 | struct hd_driveid *id = info->id; | 1114 | u16 *id = info->id; |
1167 | 1115 | ||
1168 | US_DEBUGP("Entering isd200_get_inquiry_data\n"); | 1116 | US_DEBUGP("Entering isd200_get_inquiry_data\n"); |
1169 | 1117 | ||
@@ -1180,8 +1128,7 @@ static int isd200_get_inquiry_data( struct us_data *us ) | |||
1180 | /* this must be an ATA device */ | 1128 | /* this must be an ATA device */ |
1181 | /* perform an ATA Command Identify */ | 1129 | /* perform an ATA Command Identify */ |
1182 | transferStatus = isd200_action( us, ACTION_IDENTIFY, | 1130 | transferStatus = isd200_action( us, ACTION_IDENTIFY, |
1183 | id, | 1131 | id, ATA_ID_WORDS * 2); |
1184 | sizeof(struct hd_driveid) ); | ||
1185 | if (transferStatus != ISD200_TRANSPORT_GOOD) { | 1132 | if (transferStatus != ISD200_TRANSPORT_GOOD) { |
1186 | /* Error issuing ATA Command Identify */ | 1133 | /* Error issuing ATA Command Identify */ |
1187 | US_DEBUGP(" Error issuing ATA Command Identify\n"); | 1134 | US_DEBUGP(" Error issuing ATA Command Identify\n"); |
@@ -1191,35 +1138,9 @@ static int isd200_get_inquiry_data( struct us_data *us ) | |||
1191 | int i; | 1138 | int i; |
1192 | __be16 *src; | 1139 | __be16 *src; |
1193 | __u16 *dest; | 1140 | __u16 *dest; |
1194 | isd200_fix_driveid(id); | ||
1195 | 1141 | ||
1196 | US_DEBUGP(" Identify Data Structure:\n"); | 1142 | isd200_fix_driveid(id); |
1197 | US_DEBUGP(" config = 0x%x\n", id->config); | 1143 | isd200_dump_driveid(id); |
1198 | US_DEBUGP(" cyls = 0x%x\n", id->cyls); | ||
1199 | US_DEBUGP(" heads = 0x%x\n", id->heads); | ||
1200 | US_DEBUGP(" track_bytes = 0x%x\n", id->track_bytes); | ||
1201 | US_DEBUGP(" sector_bytes = 0x%x\n", id->sector_bytes); | ||
1202 | US_DEBUGP(" sectors = 0x%x\n", id->sectors); | ||
1203 | US_DEBUGP(" serial_no[0] = 0x%x\n", id->serial_no[0]); | ||
1204 | US_DEBUGP(" buf_type = 0x%x\n", id->buf_type); | ||
1205 | US_DEBUGP(" buf_size = 0x%x\n", id->buf_size); | ||
1206 | US_DEBUGP(" ecc_bytes = 0x%x\n", id->ecc_bytes); | ||
1207 | US_DEBUGP(" fw_rev[0] = 0x%x\n", id->fw_rev[0]); | ||
1208 | US_DEBUGP(" model[0] = 0x%x\n", id->model[0]); | ||
1209 | US_DEBUGP(" max_multsect = 0x%x\n", id->max_multsect); | ||
1210 | US_DEBUGP(" dword_io = 0x%x\n", id->dword_io); | ||
1211 | US_DEBUGP(" capability = 0x%x\n", id->capability); | ||
1212 | US_DEBUGP(" tPIO = 0x%x\n", id->tPIO); | ||
1213 | US_DEBUGP(" tDMA = 0x%x\n", id->tDMA); | ||
1214 | US_DEBUGP(" field_valid = 0x%x\n", id->field_valid); | ||
1215 | US_DEBUGP(" cur_cyls = 0x%x\n", id->cur_cyls); | ||
1216 | US_DEBUGP(" cur_heads = 0x%x\n", id->cur_heads); | ||
1217 | US_DEBUGP(" cur_sectors = 0x%x\n", id->cur_sectors); | ||
1218 | US_DEBUGP(" cur_capacity = 0x%x\n", (id->cur_capacity1 << 16) + id->cur_capacity0 ); | ||
1219 | US_DEBUGP(" multsect = 0x%x\n", id->multsect); | ||
1220 | US_DEBUGP(" lba_capacity = 0x%x\n", id->lba_capacity); | ||
1221 | US_DEBUGP(" command_set_1 = 0x%x\n", id->command_set_1); | ||
1222 | US_DEBUGP(" command_set_2 = 0x%x\n", id->command_set_2); | ||
1223 | 1144 | ||
1224 | memset(&info->InquiryData, 0, sizeof(info->InquiryData)); | 1145 | memset(&info->InquiryData, 0, sizeof(info->InquiryData)); |
1225 | 1146 | ||
@@ -1229,30 +1150,30 @@ static int isd200_get_inquiry_data( struct us_data *us ) | |||
1229 | /* The length must be at least 36 (5 + 31) */ | 1150 | /* The length must be at least 36 (5 + 31) */ |
1230 | info->InquiryData.AdditionalLength = 0x1F; | 1151 | info->InquiryData.AdditionalLength = 0x1F; |
1231 | 1152 | ||
1232 | if (id->command_set_1 & COMMANDSET_MEDIA_STATUS) { | 1153 | if (id[ATA_ID_COMMAND_SET_1] & COMMANDSET_MEDIA_STATUS) { |
1233 | /* set the removable bit */ | 1154 | /* set the removable bit */ |
1234 | info->InquiryData.DeviceTypeModifier = DEVICE_REMOVABLE; | 1155 | info->InquiryData.DeviceTypeModifier = DEVICE_REMOVABLE; |
1235 | info->DeviceFlags |= DF_REMOVABLE_MEDIA; | 1156 | info->DeviceFlags |= DF_REMOVABLE_MEDIA; |
1236 | } | 1157 | } |
1237 | 1158 | ||
1238 | /* Fill in vendor identification fields */ | 1159 | /* Fill in vendor identification fields */ |
1239 | src = (__be16*)id->model; | 1160 | src = (__be16 *)&id[ATA_ID_PROD]; |
1240 | dest = (__u16*)info->InquiryData.VendorId; | 1161 | dest = (__u16*)info->InquiryData.VendorId; |
1241 | for (i=0;i<4;i++) | 1162 | for (i=0;i<4;i++) |
1242 | dest[i] = be16_to_cpu(src[i]); | 1163 | dest[i] = be16_to_cpu(src[i]); |
1243 | 1164 | ||
1244 | src = (__be16*)(id->model+8); | 1165 | src = (__be16 *)&id[ATA_ID_PROD + 8/2]; |
1245 | dest = (__u16*)info->InquiryData.ProductId; | 1166 | dest = (__u16*)info->InquiryData.ProductId; |
1246 | for (i=0;i<8;i++) | 1167 | for (i=0;i<8;i++) |
1247 | dest[i] = be16_to_cpu(src[i]); | 1168 | dest[i] = be16_to_cpu(src[i]); |
1248 | 1169 | ||
1249 | src = (__be16*)id->fw_rev; | 1170 | src = (__be16 *)&id[ATA_ID_FW_REV]; |
1250 | dest = (__u16*)info->InquiryData.ProductRevisionLevel; | 1171 | dest = (__u16*)info->InquiryData.ProductRevisionLevel; |
1251 | for (i=0;i<2;i++) | 1172 | for (i=0;i<2;i++) |
1252 | dest[i] = be16_to_cpu(src[i]); | 1173 | dest[i] = be16_to_cpu(src[i]); |
1253 | 1174 | ||
1254 | /* determine if it supports Media Status Notification */ | 1175 | /* determine if it supports Media Status Notification */ |
1255 | if (id->command_set_2 & COMMANDSET_MEDIA_STATUS) { | 1176 | if (id[ATA_ID_COMMAND_SET_2] & COMMANDSET_MEDIA_STATUS) { |
1256 | US_DEBUGP(" Device supports Media Status Notification\n"); | 1177 | US_DEBUGP(" Device supports Media Status Notification\n"); |
1257 | 1178 | ||
1258 | /* Indicate that it is enabled, even though it is not | 1179 | /* Indicate that it is enabled, even though it is not |
@@ -1301,7 +1222,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1301 | union ata_cdb * ataCdb) | 1222 | union ata_cdb * ataCdb) |
1302 | { | 1223 | { |
1303 | struct isd200_info *info = (struct isd200_info *)us->extra; | 1224 | struct isd200_info *info = (struct isd200_info *)us->extra; |
1304 | struct hd_driveid *id = info->id; | 1225 | u16 *id = info->id; |
1305 | int sendToTransport = 1; | 1226 | int sendToTransport = 1; |
1306 | unsigned char sectnum, head; | 1227 | unsigned char sectnum, head; |
1307 | unsigned short cylinder; | 1228 | unsigned short cylinder; |
@@ -1369,13 +1290,12 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1369 | 1290 | ||
1370 | US_DEBUGP(" ATA OUT - SCSIOP_READ_CAPACITY\n"); | 1291 | US_DEBUGP(" ATA OUT - SCSIOP_READ_CAPACITY\n"); |
1371 | 1292 | ||
1372 | if (id->capability & CAPABILITY_LBA ) { | 1293 | if (ata_id_has_lba(id)) |
1373 | capacity = id->lba_capacity - 1; | 1294 | capacity = ata_id_u32(id, ATA_ID_LBA_CAPACITY) - 1; |
1374 | } else { | 1295 | else |
1375 | capacity = (id->heads * | 1296 | capacity = (id[ATA_ID_HEADS] * id[ATA_ID_CYLS] * |
1376 | id->cyls * | 1297 | id[ATA_ID_SECTORS]) - 1; |
1377 | id->sectors) - 1; | 1298 | |
1378 | } | ||
1379 | readCapacityData.LogicalBlockAddress = cpu_to_be32(capacity); | 1299 | readCapacityData.LogicalBlockAddress = cpu_to_be32(capacity); |
1380 | readCapacityData.BytesPerBlock = cpu_to_be32(0x200); | 1300 | readCapacityData.BytesPerBlock = cpu_to_be32(0x200); |
1381 | 1301 | ||
@@ -1392,16 +1312,16 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1392 | lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]); | 1312 | lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]); |
1393 | blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8]; | 1313 | blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8]; |
1394 | 1314 | ||
1395 | if (id->capability & CAPABILITY_LBA) { | 1315 | if (ata_id_has_lba(id)) { |
1396 | sectnum = (unsigned char)(lba); | 1316 | sectnum = (unsigned char)(lba); |
1397 | cylinder = (unsigned short)(lba>>8); | 1317 | cylinder = (unsigned short)(lba>>8); |
1398 | head = ATA_ADDRESS_DEVHEAD_LBA_MODE | (unsigned char)(lba>>24 & 0x0F); | 1318 | head = ATA_ADDRESS_DEVHEAD_LBA_MODE | (unsigned char)(lba>>24 & 0x0F); |
1399 | } else { | 1319 | } else { |
1400 | sectnum = (unsigned char)((lba % id->sectors) + 1); | 1320 | sectnum = (u8)((lba % id[ATA_ID_SECTORS]) + 1); |
1401 | cylinder = (unsigned short)(lba / (id->sectors * | 1321 | cylinder = (u16)(lba / (id[ATA_ID_SECTORS] * |
1402 | id->heads)); | 1322 | id[ATA_ID_HEADS])); |
1403 | head = (unsigned char)((lba / id->sectors) % | 1323 | head = (u8)((lba / id[ATA_ID_SECTORS]) % |
1404 | id->heads); | 1324 | id[ATA_ID_HEADS]); |
1405 | } | 1325 | } |
1406 | ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; | 1326 | ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; |
1407 | ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; | 1327 | ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; |
@@ -1415,7 +1335,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1415 | ataCdb->write.CylinderHighByte = (unsigned char)(cylinder>>8); | 1335 | ataCdb->write.CylinderHighByte = (unsigned char)(cylinder>>8); |
1416 | ataCdb->write.CylinderLowByte = (unsigned char)cylinder; | 1336 | ataCdb->write.CylinderLowByte = (unsigned char)cylinder; |
1417 | ataCdb->write.DeviceHeadByte = (head | ATA_ADDRESS_DEVHEAD_STD); | 1337 | ataCdb->write.DeviceHeadByte = (head | ATA_ADDRESS_DEVHEAD_STD); |
1418 | ataCdb->write.CommandByte = WIN_READ; | 1338 | ataCdb->write.CommandByte = ATA_CMD_PIO_READ; |
1419 | break; | 1339 | break; |
1420 | 1340 | ||
1421 | case WRITE_10: | 1341 | case WRITE_10: |
@@ -1424,14 +1344,16 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1424 | lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]); | 1344 | lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]); |
1425 | blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8]; | 1345 | blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8]; |
1426 | 1346 | ||
1427 | if (id->capability & CAPABILITY_LBA) { | 1347 | if (ata_id_has_lba(id)) { |
1428 | sectnum = (unsigned char)(lba); | 1348 | sectnum = (unsigned char)(lba); |
1429 | cylinder = (unsigned short)(lba>>8); | 1349 | cylinder = (unsigned short)(lba>>8); |
1430 | head = ATA_ADDRESS_DEVHEAD_LBA_MODE | (unsigned char)(lba>>24 & 0x0F); | 1350 | head = ATA_ADDRESS_DEVHEAD_LBA_MODE | (unsigned char)(lba>>24 & 0x0F); |
1431 | } else { | 1351 | } else { |
1432 | sectnum = (unsigned char)((lba % id->sectors) + 1); | 1352 | sectnum = (u8)((lba % id[ATA_ID_SECTORS]) + 1); |
1433 | cylinder = (unsigned short)(lba / (id->sectors * id->heads)); | 1353 | cylinder = (u16)(lba / (id[ATA_ID_SECTORS] * |
1434 | head = (unsigned char)((lba / id->sectors) % id->heads); | 1354 | id[ATA_ID_HEADS])); |
1355 | head = (u8)((lba / id[ATA_ID_SECTORS]) % | ||
1356 | id[ATA_ID_HEADS]); | ||
1435 | } | 1357 | } |
1436 | ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; | 1358 | ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; |
1437 | ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; | 1359 | ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; |
@@ -1445,7 +1367,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1445 | ataCdb->write.CylinderHighByte = (unsigned char)(cylinder>>8); | 1367 | ataCdb->write.CylinderHighByte = (unsigned char)(cylinder>>8); |
1446 | ataCdb->write.CylinderLowByte = (unsigned char)cylinder; | 1368 | ataCdb->write.CylinderLowByte = (unsigned char)cylinder; |
1447 | ataCdb->write.DeviceHeadByte = (head | ATA_ADDRESS_DEVHEAD_STD); | 1369 | ataCdb->write.DeviceHeadByte = (head | ATA_ADDRESS_DEVHEAD_STD); |
1448 | ataCdb->write.CommandByte = WIN_WRITE; | 1370 | ataCdb->write.CommandByte = ATA_CMD_PIO_WRITE; |
1449 | break; | 1371 | break; |
1450 | 1372 | ||
1451 | case ALLOW_MEDIUM_REMOVAL: | 1373 | case ALLOW_MEDIUM_REMOVAL: |
@@ -1459,7 +1381,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, | |||
1459 | ataCdb->generic.TransferBlockSize = 1; | 1381 | ataCdb->generic.TransferBlockSize = 1; |
1460 | ataCdb->generic.RegisterSelect = REG_COMMAND; | 1382 | ataCdb->generic.RegisterSelect = REG_COMMAND; |
1461 | ataCdb->write.CommandByte = (srb->cmnd[4] & 0x1) ? | 1383 | ataCdb->write.CommandByte = (srb->cmnd[4] & 0x1) ? |
1462 | WIN_DOORLOCK : WIN_DOORUNLOCK; | 1384 | ATA_CMD_MEDIA_LOCK : ATA_CMD_MEDIA_UNLOCK; |
1463 | isd200_srb_set_bufflen(srb, 0); | 1385 | isd200_srb_set_bufflen(srb, 0); |
1464 | } else { | 1386 | } else { |
1465 | US_DEBUGP(" Not removeable media, just report okay\n"); | 1387 | US_DEBUGP(" Not removeable media, just report okay\n"); |
@@ -1539,8 +1461,7 @@ static int isd200_init_info(struct us_data *us) | |||
1539 | if (!info) | 1461 | if (!info) |
1540 | retStatus = ISD200_ERROR; | 1462 | retStatus = ISD200_ERROR; |
1541 | else { | 1463 | else { |
1542 | info->id = (struct hd_driveid *) | 1464 | info->id = kzalloc(ATA_ID_WORDS * 2, GFP_KERNEL); |
1543 | kzalloc(sizeof(struct hd_driveid), GFP_KERNEL); | ||
1544 | info->RegsBuf = (unsigned char *) | 1465 | info->RegsBuf = (unsigned char *) |
1545 | kmalloc(sizeof(info->ATARegs), GFP_KERNEL); | 1466 | kmalloc(sizeof(info->ATARegs), GFP_KERNEL); |
1546 | info->srb.sense_buffer = | 1467 | info->srb.sense_buffer = |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index d48c8553539d..49aedb36dc19 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -787,7 +787,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) | |||
787 | /* Did we transfer less than the minimum amount required? */ | 787 | /* Did we transfer less than the minimum amount required? */ |
788 | if ((srb->result == SAM_STAT_GOOD || srb->sense_buffer[2] == 0) && | 788 | if ((srb->result == SAM_STAT_GOOD || srb->sense_buffer[2] == 0) && |
789 | scsi_bufflen(srb) - scsi_get_resid(srb) < srb->underflow) | 789 | scsi_bufflen(srb) - scsi_get_resid(srb) < srb->underflow) |
790 | srb->result = (DID_ERROR << 16) | (SUGGEST_RETRY << 24); | 790 | srb->result = DID_ERROR << 16; |
791 | 791 | ||
792 | last_sector_hacks(us, srb); | 792 | last_sector_hacks(us, srb); |
793 | return; | 793 | return; |
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c index f0aac0cf315a..386eaa22d215 100644 --- a/drivers/usb/wusbcore/devconnect.c +++ b/drivers/usb/wusbcore/devconnect.c | |||
@@ -471,7 +471,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc) | |||
471 | */ | 471 | */ |
472 | static void wusbhc_keep_alive_run(struct work_struct *ws) | 472 | static void wusbhc_keep_alive_run(struct work_struct *ws) |
473 | { | 473 | { |
474 | struct delayed_work *dw = container_of(ws, struct delayed_work, work); | 474 | struct delayed_work *dw = to_delayed_work(ws); |
475 | struct wusbhc *wusbhc = container_of(dw, struct wusbhc, keep_alive_timer); | 475 | struct wusbhc *wusbhc = container_of(dw, struct wusbhc, keep_alive_timer); |
476 | 476 | ||
477 | mutex_lock(&wusbhc->mutex); | 477 | mutex_lock(&wusbhc->mutex); |
diff --git a/drivers/usb/wusbcore/security.c b/drivers/usb/wusbcore/security.c index 8118db7f1d8d..b2f149fedcc5 100644 --- a/drivers/usb/wusbcore/security.c +++ b/drivers/usb/wusbcore/security.c | |||
@@ -562,7 +562,7 @@ void wusbhc_gtk_rekey(struct wusbhc *wusbhc) | |||
562 | struct wusb_dev *wusb_dev; | 562 | struct wusb_dev *wusb_dev; |
563 | 563 | ||
564 | wusb_dev = wusbhc->port[p].wusb_dev; | 564 | wusb_dev = wusbhc->port[p].wusb_dev; |
565 | if (!wusb_dev || !wusb_dev->usb_dev | !wusb_dev->usb_dev->authenticated) | 565 | if (!wusb_dev || !wusb_dev->usb_dev || !wusb_dev->usb_dev->authenticated) |
566 | continue; | 566 | continue; |
567 | 567 | ||
568 | usb_fill_control_urb(wusb_dev->set_gtk_urb, wusb_dev->usb_dev, | 568 | usb_fill_control_urb(wusb_dev->set_gtk_urb, wusb_dev->usb_dev, |