aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-10-15 10:08:11 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-25 15:18:43 -0400
commit3794ade5b286cbd4551009dd341dbe9aeead2bc3 (patch)
tree015dca8e45fb49168516825c71daa255b179dc5f /drivers/usb
parentc93d46509e7aee7d58680c4c8a12cfbe98df98cb (diff)
USB: isd200: sort out USB/IDE dependancy mess
The ISD200 driver imports a single trivial routine from the IDE layer and in doing so creates a mess of dependancies that drag in the entire old IDE layer. Even more sad - it does this for a routine which is usually (little endian) a null function! - Copy the function into ISD200 - Rename it so it doesn't clash with the ide header prototype - Remove all the depend constraints Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/storage/Kconfig1
-rw-r--r--drivers/usb/storage/isd200.c105
2 files changed, 104 insertions, 2 deletions
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index fe2c4cd53f5a..7e53333be013 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -48,7 +48,6 @@ config USB_STORAGE_FREECOM
48config USB_STORAGE_ISD200 48config USB_STORAGE_ISD200
49 bool "ISD-200 USB/ATA Bridge support" 49 bool "ISD-200 USB/ATA Bridge support"
50 depends on USB_STORAGE 50 depends on USB_STORAGE
51 depends on BLK_DEV_IDE=y || BLK_DEV_IDE=USB_STORAGE
52 ---help--- 51 ---help---
53 Say Y here if you want to use USB Mass Store devices based 52 Say Y here if you want to use USB Mass Store devices based
54 on the In-Systems Design ISD-200 USB/ATA bridge. 53 on the In-Systems Design ISD-200 USB/ATA bridge.
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index 93a7724e167a..49ba6c0ff1e8 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -977,6 +977,109 @@ static int isd200_manual_enum(struct us_data *us)
977 return(retStatus); 977 return(retStatus);
978} 978}
979 979
980/*
981 * We are the last non IDE user of the legacy IDE ident structures
982 * and we thus want to keep a private copy of this function so the
983 * driver can be used without the obsolete drivers/ide layer
984 */
985
986static void isd200_fix_driveid (struct hd_driveid *id)
987{
988#ifndef __LITTLE_ENDIAN
989# ifdef __BIG_ENDIAN
990 int i;
991 u16 *stringcast;
992
993 id->config = __le16_to_cpu(id->config);
994 id->cyls = __le16_to_cpu(id->cyls);
995 id->reserved2 = __le16_to_cpu(id->reserved2);
996 id->heads = __le16_to_cpu(id->heads);
997 id->track_bytes = __le16_to_cpu(id->track_bytes);
998 id->sector_bytes = __le16_to_cpu(id->sector_bytes);
999 id->sectors = __le16_to_cpu(id->sectors);
1000 id->vendor0 = __le16_to_cpu(id->vendor0);
1001 id->vendor1 = __le16_to_cpu(id->vendor1);
1002 id->vendor2 = __le16_to_cpu(id->vendor2);
1003 stringcast = (u16 *)&id->serial_no[0];
1004 for (i = 0; i < (20/2); i++)
1005 stringcast[i] = __le16_to_cpu(stringcast[i]);
1006 id->buf_type = __le16_to_cpu(id->buf_type);
1007 id->buf_size = __le16_to_cpu(id->buf_size);
1008 id->ecc_bytes = __le16_to_cpu(id->ecc_bytes);
1009 stringcast = (u16 *)&id->fw_rev[0];
1010 for (i = 0; i < (8/2); i++)
1011 stringcast[i] = __le16_to_cpu(stringcast[i]);
1012 stringcast = (u16 *)&id->model[0];
1013 for (i = 0; i < (40/2); i++)
1014 stringcast[i] = __le16_to_cpu(stringcast[i]);
1015 id->dword_io = __le16_to_cpu(id->dword_io);
1016 id->reserved50 = __le16_to_cpu(id->reserved50);
1017 id->field_valid = __le16_to_cpu(id->field_valid);
1018 id->cur_cyls = __le16_to_cpu(id->cur_cyls);
1019 id->cur_heads = __le16_to_cpu(id->cur_heads);
1020 id->cur_sectors = __le16_to_cpu(id->cur_sectors);
1021 id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0);
1022 id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1);
1023 id->lba_capacity = __le32_to_cpu(id->lba_capacity);
1024 id->dma_1word = __le16_to_cpu(id->dma_1word);
1025 id->dma_mword = __le16_to_cpu(id->dma_mword);
1026 id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes);
1027 id->eide_dma_min = __le16_to_cpu(id->eide_dma_min);
1028 id->eide_dma_time = __le16_to_cpu(id->eide_dma_time);
1029 id->eide_pio = __le16_to_cpu(id->eide_pio);
1030 id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy);
1031 for (i = 0; i < 2; ++i)
1032 id->words69_70[i] = __le16_to_cpu(id->words69_70[i]);
1033 for (i = 0; i < 4; ++i)
1034 id->words71_74[i] = __le16_to_cpu(id->words71_74[i]);
1035 id->queue_depth = __le16_to_cpu(id->queue_depth);
1036 for (i = 0; i < 4; ++i)
1037 id->words76_79[i] = __le16_to_cpu(id->words76_79[i]);
1038 id->major_rev_num = __le16_to_cpu(id->major_rev_num);
1039 id->minor_rev_num = __le16_to_cpu(id->minor_rev_num);
1040 id->command_set_1 = __le16_to_cpu(id->command_set_1);
1041 id->command_set_2 = __le16_to_cpu(id->command_set_2);
1042 id->cfsse = __le16_to_cpu(id->cfsse);
1043 id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1);
1044 id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2);
1045 id->csf_default = __le16_to_cpu(id->csf_default);
1046 id->dma_ultra = __le16_to_cpu(id->dma_ultra);
1047 id->trseuc = __le16_to_cpu(id->trseuc);
1048 id->trsEuc = __le16_to_cpu(id->trsEuc);
1049 id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues);
1050 id->mprc = __le16_to_cpu(id->mprc);
1051 id->hw_config = __le16_to_cpu(id->hw_config);
1052 id->acoustic = __le16_to_cpu(id->acoustic);
1053 id->msrqs = __le16_to_cpu(id->msrqs);
1054 id->sxfert = __le16_to_cpu(id->sxfert);
1055 id->sal = __le16_to_cpu(id->sal);
1056 id->spg = __le32_to_cpu(id->spg);
1057 id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2);
1058 for (i = 0; i < 22; i++)
1059 id->words104_125[i] = __le16_to_cpu(id->words104_125[i]);
1060 id->last_lun = __le16_to_cpu(id->last_lun);
1061 id->word127 = __le16_to_cpu(id->word127);
1062 id->dlf = __le16_to_cpu(id->dlf);
1063 id->csfo = __le16_to_cpu(id->csfo);
1064 for (i = 0; i < 26; i++)
1065 id->words130_155[i] = __le16_to_cpu(id->words130_155[i]);
1066 id->word156 = __le16_to_cpu(id->word156);
1067 for (i = 0; i < 3; i++)
1068 id->words157_159[i] = __le16_to_cpu(id->words157_159[i]);
1069 id->cfa_power = __le16_to_cpu(id->cfa_power);
1070 for (i = 0; i < 14; i++)
1071 id->words161_175[i] = __le16_to_cpu(id->words161_175[i]);
1072 for (i = 0; i < 31; i++)
1073 id->words176_205[i] = __le16_to_cpu(id->words176_205[i]);
1074 for (i = 0; i < 48; i++)
1075 id->words206_254[i] = __le16_to_cpu(id->words206_254[i]);
1076 id->integrity_word = __le16_to_cpu(id->integrity_word);
1077# else
1078# error "Please fix <asm/byteorder.h>"
1079# endif
1080#endif
1081}
1082
980 1083
981/************************************************************************** 1084/**************************************************************************
982 * isd200_get_inquiry_data 1085 * isd200_get_inquiry_data
@@ -1018,7 +1121,7 @@ static int isd200_get_inquiry_data( struct us_data *us )
1018 int i; 1121 int i;
1019 __be16 *src; 1122 __be16 *src;
1020 __u16 *dest; 1123 __u16 *dest;
1021 ide_fix_driveid(id); 1124 isd200_fix_driveid(id);
1022 1125
1023 US_DEBUGP(" Identify Data Structure:\n"); 1126 US_DEBUGP(" Identify Data Structure:\n");
1024 US_DEBUGP(" config = 0x%x\n", id->config); 1127 US_DEBUGP(" config = 0x%x\n", id->config);