Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6

+144 -342
+1 -1
drivers/ide/ide-cd.c
··· 3328 3328 #endif 3329 3329 3330 3330 static ide_driver_t ide_cdrom_driver = { 3331 - .owner = THIS_MODULE, 3332 3331 .gen_driver = { 3332 + .owner = THIS_MODULE, 3333 3333 .name = "ide-cdrom", 3334 3334 .bus = &ide_bus_type, 3335 3335 .probe = ide_cd_probe,
+1 -1
drivers/ide/ide-disk.c
··· 1089 1089 } 1090 1090 1091 1091 static ide_driver_t idedisk_driver = { 1092 - .owner = THIS_MODULE, 1093 1092 .gen_driver = { 1093 + .owner = THIS_MODULE, 1094 1094 .name = "ide-disk", 1095 1095 .bus = &ide_bus_type, 1096 1096 .probe = ide_disk_probe,
+1 -1
drivers/ide/ide-floppy.c
··· 1925 1925 static int ide_floppy_probe(struct device *); 1926 1926 1927 1927 static ide_driver_t idefloppy_driver = { 1928 - .owner = THIS_MODULE, 1929 1928 .gen_driver = { 1929 + .owner = THIS_MODULE, 1930 1930 .name = "ide-floppy", 1931 1931 .bus = &ide_bus_type, 1932 1932 .probe = ide_floppy_probe,
+4 -4
drivers/ide/ide-lib.c
··· 410 410 { 411 411 u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ 412 412 413 - if (on && drive->media == ide_disk) { 414 - if (!PCI_DMA_BUS_IS_PHYS) 415 - addr = BLK_BOUNCE_ANY; 416 - else if (HWIF(drive)->pci_dev) 413 + if (!PCI_DMA_BUS_IS_PHYS) { 414 + addr = BLK_BOUNCE_ANY; 415 + } else if (on && drive->media == ide_disk) { 416 + if (HWIF(drive)->pci_dev) 417 417 addr = HWIF(drive)->pci_dev->dma_mask; 418 418 } 419 419
+1 -1
drivers/ide/ide-tape.c
··· 4748 4748 static int ide_tape_probe(struct device *); 4749 4749 4750 4750 static ide_driver_t idetape_driver = { 4751 - .owner = THIS_MODULE, 4752 4751 .gen_driver = { 4752 + .owner = THIS_MODULE, 4753 4753 .name = "ide-tape", 4754 4754 .bus = &ide_bus_type, 4755 4755 .probe = ide_tape_probe,
-47
drivers/ide/pci/aec62xx.c
··· 65 65 #define BUSCLOCK(D) \ 66 66 ((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D))) 67 67 68 - #if 0 69 - if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { 70 - (void) pci_read_config_byte(dev, 0x54, &art); 71 - p += sprintf(p, "DMA Mode: %s(%s)", 72 - (c0&0x20)?((art&0x03)?"UDMA":" DMA"):" PIO", 73 - (art&0x02)?"2":(art&0x01)?"1":"0"); 74 - p += sprintf(p, " %s(%s)", 75 - (c0&0x40)?((art&0x0c)?"UDMA":" DMA"):" PIO", 76 - (art&0x08)?"2":(art&0x04)?"1":"0"); 77 - p += sprintf(p, " %s(%s)", 78 - (c1&0x20)?((art&0x30)?"UDMA":" DMA"):" PIO", 79 - (art&0x20)?"2":(art&0x10)?"1":"0"); 80 - p += sprintf(p, " %s(%s)\n", 81 - (c1&0x40)?((art&0xc0)?"UDMA":" DMA"):" PIO", 82 - (art&0x80)?"2":(art&0x40)?"1":"0"); 83 - } else { 84 - #endif 85 68 86 69 /* 87 70 * TO DO: active tuning and correction of cards without a bios. ··· 95 112 switch(hwif->pci_dev->device) { 96 113 case PCI_DEVICE_ID_ARTOP_ATP865: 97 114 case PCI_DEVICE_ID_ARTOP_ATP865R: 98 - #if 0 99 - mode = (hwif->INB(hwif->dma_master) & 0x10) ? 4 : 3; 100 - #else 101 115 mode = (hwif->INB(((hwif->channel) ? 102 116 hwif->mate->dma_status : 103 117 hwif->dma_status)) & 0x10) ? 4 : 3; 104 - #endif 105 118 break; 106 119 case PCI_DEVICE_ID_ARTOP_ATP860: 107 120 case PCI_DEVICE_ID_ARTOP_ATP860R: ··· 242 263 case PCI_DEVICE_ID_ARTOP_ATP865: 243 264 case PCI_DEVICE_ID_ARTOP_ATP865R: 244 265 printk(" AEC62XX time out "); 245 - #if 0 246 - { 247 - int i = 0; 248 - u8 reg49h = 0; 249 - pci_read_config_byte(HWIF(drive)->pci_dev, 0x49, &reg49h); 250 - for (i=0;i<256;i++) 251 - pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h|0x10); 252 - pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h & ~0x10); 253 - } 254 - return 0; 255 - #endif 256 266 default: 257 267 break; 258 268 } 259 - #if 0 260 - { 261 - ide_hwif_t *hwif = HWIF(drive); 262 - struct pci_dev *dev = hwif->pci_dev; 263 - u8 tmp1 = 0, tmp2 = 0, mode6 = 0; 264 - 265 - pci_read_config_byte(dev, 0x44, &tmp1); 266 - pci_read_config_byte(dev, 0x45, &tmp2); 267 - printk(" AEC6280 r44=%x r45=%x ",tmp1,tmp2); 268 - mode6 = HWIF(drive)->INB(((hwif->channel) ? 269 - hwif->mate->dma_status : 270 - hwif->dma_status)); 271 - printk(" AEC6280 133=%x ", (mode6 & 0x10)); 272 - } 273 - #endif 274 269 return 0; 275 270 } 276 271
+7 -2
drivers/ide/pci/alim15x3.c
··· 876 876 877 877 static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id) 878 878 { 879 + static struct pci_device_id ati_rs100[] = { 880 + { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100) }, 881 + { }, 882 + }; 883 + 879 884 ide_pci_device_t *d = &ali15x3_chipset; 880 885 881 - if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, NULL)) 882 - printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not yet fully tested.\n"); 886 + if (pci_dev_present(ati_rs100)) 887 + printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n"); 883 888 884 889 #if defined(CONFIG_SPARC64) 885 890 d->init_hwif = init_hwif_common_ali15x3;
+2 -3
drivers/ide/pci/cs5520.c
··· 222 222 223 223 /* We must not grab the entire device, it has 'ISA' space in its 224 224 BARS too and we will freak out other bits of the kernel */ 225 - if(pci_enable_device_bars(dev, 1<<2)) 226 - { 225 + if (pci_enable_device_bars(dev, 1<<2)) { 227 226 printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name); 228 - return 1; 227 + return -ENODEV; 229 228 } 230 229 pci_set_master(dev); 231 230 if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
+7 -1
drivers/ide/pci/siimage.c
··· 6 6 * 7 7 * May be copied or modified under the terms of the GNU General Public License 8 8 * 9 - * Documentation available under NDA only 9 + * Documentation for CMD680: 10 + * http://gkernel.sourceforge.net/specs/sii/sii-0680a-v1.31.pdf.bz2 11 + * 12 + * Documentation for SiI 3112: 13 + * http://gkernel.sourceforge.net/specs/sii/3112A_SiI-DS-0095-B2.pdf.bz2 14 + * 15 + * Errata and other documentation only available under NDA. 10 16 * 11 17 * 12 18 * FAQ Items:
+115 -264
drivers/ide/pci/via82cxxx.c
··· 100 100 { NULL } 101 101 }; 102 102 103 - static struct via_isa_bridge *via_config; 104 - static unsigned int via_80w; 105 103 static unsigned int via_clock; 106 104 static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" }; 107 105 108 - /* 109 - * VIA /proc entry. 110 - */ 111 - 112 - #if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) 113 - 114 - #include <linux/stat.h> 115 - #include <linux/proc_fs.h> 116 - 117 - static u8 via_proc = 0; 118 - static unsigned long via_base; 119 - static struct pci_dev *bmide_dev, *isa_dev; 120 - 121 - static char *via_control3[] = { "No limit", "64", "128", "192" }; 122 - 123 - #define via_print(format, arg...) p += sprintf(p, format "\n" , ## arg) 124 - #define via_print_drive(name, format, arg...)\ 125 - p += sprintf(p, name); for (i = 0; i < 4; i++) p += sprintf(p, format, ## arg); p += sprintf(p, "\n"); 126 - 127 - 128 - /** 129 - * via_get_info - generate via /proc file 130 - * @buffer: buffer for data 131 - * @addr: set to start of data to use 132 - * @offset: current file offset 133 - * @count: size of read 134 - * 135 - * Fills in buffer with the debugging/configuration information for 136 - * the VIA chipset tuning and attached drives 137 - */ 138 - 139 - static int via_get_info(char *buffer, char **addr, off_t offset, int count) 106 + struct via82cxxx_dev 140 107 { 141 - int speed[4], cycle[4], setup[4], active[4], recover[4], den[4], 142 - uen[4], udma[4], umul[4], active8b[4], recover8b[4]; 143 - struct pci_dev *dev = bmide_dev; 144 - unsigned int v, u, i; 145 - int len; 146 - u16 c, w; 147 - u8 t, x; 148 - char *p = buffer; 149 - 150 - via_print("----------VIA BusMastering IDE Configuration" 151 - "----------------"); 152 - 153 - via_print("Driver Version: 3.38"); 154 - via_print("South Bridge: VIA %s", 155 - via_config->name); 156 - 157 - pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t); 158 - pci_read_config_byte(dev, PCI_REVISION_ID, &x); 159 - via_print("Revision: ISA %#x IDE %#x", t, x); 160 - via_print("Highest DMA rate: %s", 161 - via_dma[via_config->flags & VIA_UDMA]); 162 - 163 - via_print("BM-DMA base: %#lx", via_base); 164 - via_print("PCI clock: %d.%dMHz", 165 - via_clock / 1000, via_clock / 100 % 10); 166 - 167 - pci_read_config_byte(dev, VIA_MISC_1, &t); 168 - via_print("Master Read Cycle IRDY: %dws", 169 - (t & 64) >> 6); 170 - via_print("Master Write Cycle IRDY: %dws", 171 - (t & 32) >> 5); 172 - via_print("BM IDE Status Register Read Retry: %s", 173 - (t & 8) ? "yes" : "no"); 174 - 175 - pci_read_config_byte(dev, VIA_MISC_3, &t); 176 - via_print("Max DRDY Pulse Width: %s%s", 177 - via_control3[(t & 0x03)], (t & 0x03) ? " PCI clocks" : ""); 178 - 179 - via_print("-----------------------Primary IDE" 180 - "-------Secondary IDE------"); 181 - via_print("Read DMA FIFO flush: %10s%20s", 182 - (t & 0x80) ? "yes" : "no", (t & 0x40) ? "yes" : "no"); 183 - via_print("End Sector FIFO flush: %10s%20s", 184 - (t & 0x20) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); 185 - 186 - pci_read_config_byte(dev, VIA_IDE_CONFIG, &t); 187 - via_print("Prefetch Buffer: %10s%20s", 188 - (t & 0x80) ? "yes" : "no", (t & 0x20) ? "yes" : "no"); 189 - via_print("Post Write Buffer: %10s%20s", 190 - (t & 0x40) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); 191 - 192 - pci_read_config_byte(dev, VIA_IDE_ENABLE, &t); 193 - via_print("Enabled: %10s%20s", 194 - (t & 0x02) ? "yes" : "no", (t & 0x01) ? "yes" : "no"); 195 - 196 - c = inb(via_base + 0x02) | (inb(via_base + 0x0a) << 8); 197 - via_print("Simplex only: %10s%20s", 198 - (c & 0x80) ? "yes" : "no", (c & 0x8000) ? "yes" : "no"); 199 - 200 - via_print("Cable Type: %10s%20s", 201 - (via_80w & 1) ? "80w" : "40w", (via_80w & 2) ? "80w" : "40w"); 202 - 203 - via_print("-------------------drive0----drive1" 204 - "----drive2----drive3-----"); 205 - 206 - pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); 207 - pci_read_config_dword(dev, VIA_DRIVE_TIMING, &v); 208 - pci_read_config_word(dev, VIA_8BIT_TIMING, &w); 209 - 210 - if (via_config->flags & VIA_UDMA) 211 - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 212 - else u = 0; 213 - 214 - for (i = 0; i < 4; i++) { 215 - 216 - setup[i] = ((t >> ((3 - i) << 1)) & 0x3) + 1; 217 - recover8b[i] = ((w >> ((1 - (i >> 1)) << 3)) & 0xf) + 1; 218 - active8b[i] = ((w >> (((1 - (i >> 1)) << 3) + 4)) & 0xf) + 1; 219 - active[i] = ((v >> (((3 - i) << 3) + 4)) & 0xf) + 1; 220 - recover[i] = ((v >> ((3 - i) << 3)) & 0xf) + 1; 221 - udma[i] = ((u >> ((3 - i) << 3)) & 0x7) + 2; 222 - umul[i] = ((u >> (((3 - i) & 2) << 3)) & 0x8) ? 1 : 2; 223 - uen[i] = ((u >> ((3 - i) << 3)) & 0x20); 224 - den[i] = (c & ((i & 1) ? 0x40 : 0x20) << ((i & 2) << 2)); 225 - 226 - speed[i] = 2 * via_clock / (active[i] + recover[i]); 227 - cycle[i] = 1000000 * (active[i] + recover[i]) / via_clock; 228 - 229 - if (!uen[i] || !den[i]) 230 - continue; 231 - 232 - switch (via_config->flags & VIA_UDMA) { 233 - 234 - case VIA_UDMA_33: 235 - speed[i] = 2 * via_clock / udma[i]; 236 - cycle[i] = 1000000 * udma[i] / via_clock; 237 - break; 238 - 239 - case VIA_UDMA_66: 240 - speed[i] = 4 * via_clock / (udma[i] * umul[i]); 241 - cycle[i] = 500000 * (udma[i] * umul[i]) / via_clock; 242 - break; 243 - 244 - case VIA_UDMA_100: 245 - speed[i] = 6 * via_clock / udma[i]; 246 - cycle[i] = 333333 * udma[i] / via_clock; 247 - break; 248 - 249 - case VIA_UDMA_133: 250 - speed[i] = 8 * via_clock / udma[i]; 251 - cycle[i] = 250000 * udma[i] / via_clock; 252 - break; 253 - } 254 - } 255 - 256 - via_print_drive("Transfer Mode: ", "%10s", 257 - den[i] ? (uen[i] ? "UDMA" : "DMA") : "PIO"); 258 - 259 - via_print_drive("Address Setup: ", "%8dns", 260 - 1000000 * setup[i] / via_clock); 261 - via_print_drive("Cmd Active: ", "%8dns", 262 - 1000000 * active8b[i] / via_clock); 263 - via_print_drive("Cmd Recovery: ", "%8dns", 264 - 1000000 * recover8b[i] / via_clock); 265 - via_print_drive("Data Active: ", "%8dns", 266 - 1000000 * active[i] / via_clock); 267 - via_print_drive("Data Recovery: ", "%8dns", 268 - 1000000 * recover[i] / via_clock); 269 - via_print_drive("Cycle Time: ", "%8dns", 270 - cycle[i]); 271 - via_print_drive("Transfer Rate: ", "%4d.%dMB/s", 272 - speed[i] / 1000, speed[i] / 100 % 10); 273 - 274 - /* hoping it is less than 4K... */ 275 - len = (p - buffer) - offset; 276 - *addr = buffer + offset; 277 - 278 - return len > count ? count : len; 279 - } 280 - 281 - #endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ 108 + struct via_isa_bridge *via_config; 109 + unsigned int via_80w; 110 + }; 282 111 283 112 /** 284 113 * via_set_speed - write timing registers ··· 118 289 * via_set_speed writes timing values to the chipset registers 119 290 */ 120 291 121 - static void via_set_speed(struct pci_dev *dev, u8 dn, struct ide_timing *timing) 292 + static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing) 122 293 { 294 + struct pci_dev *dev = hwif->pci_dev; 295 + struct via82cxxx_dev *vdev = ide_get_hwifdata(hwif); 123 296 u8 t; 124 297 125 - if (~via_config->flags & VIA_BAD_AST) { 298 + if (~vdev->via_config->flags & VIA_BAD_AST) { 126 299 pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); 127 300 t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); 128 301 pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t); ··· 136 305 pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn), 137 306 ((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1)); 138 307 139 - switch (via_config->flags & VIA_UDMA) { 308 + switch (vdev->via_config->flags & VIA_UDMA) { 140 309 case VIA_UDMA_33: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break; 141 310 case VIA_UDMA_66: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break; 142 311 case VIA_UDMA_100: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break; ··· 160 329 static int via_set_drive(ide_drive_t *drive, u8 speed) 161 330 { 162 331 ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1); 332 + struct via82cxxx_dev *vdev = ide_get_hwifdata(drive->hwif); 163 333 struct ide_timing t, p; 164 334 unsigned int T, UT; 165 335 ··· 169 337 170 338 T = 1000000000 / via_clock; 171 339 172 - switch (via_config->flags & VIA_UDMA) { 340 + switch (vdev->via_config->flags & VIA_UDMA) { 173 341 case VIA_UDMA_33: UT = T; break; 174 342 case VIA_UDMA_66: UT = T/2; break; 175 343 case VIA_UDMA_100: UT = T/3; break; ··· 184 352 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT); 185 353 } 186 354 187 - via_set_speed(HWIF(drive)->pci_dev, drive->dn, &t); 355 + via_set_speed(HWIF(drive), drive->dn, &t); 188 356 189 357 if (!drive->init_speed) 190 358 drive->init_speed = speed; ··· 222 390 223 391 static int via82cxxx_ide_dma_check (ide_drive_t *drive) 224 392 { 225 - u16 w80 = HWIF(drive)->udma_four; 393 + ide_hwif_t *hwif = HWIF(drive); 394 + struct via82cxxx_dev *vdev = ide_get_hwifdata(hwif); 395 + u16 w80 = hwif->udma_four; 226 396 227 397 u16 speed = ide_find_best_mode(drive, 228 398 XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA | 229 - (via_config->flags & VIA_UDMA ? XFER_UDMA : 0) | 230 - (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) | 231 - (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) | 232 - (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0)); 399 + (vdev->via_config->flags & VIA_UDMA ? XFER_UDMA : 0) | 400 + (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) | 401 + (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) | 402 + (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0)); 233 403 234 404 via_set_drive(drive, speed); 235 405 236 406 if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) 237 - return HWIF(drive)->ide_dma_on(drive); 238 - return HWIF(drive)->ide_dma_off_quietly(drive); 407 + return hwif->ide_dma_on(drive); 408 + return hwif->ide_dma_off_quietly(drive); 409 + } 410 + 411 + static struct via_isa_bridge *via_config_find(struct pci_dev **isa) 412 + { 413 + struct via_isa_bridge *via_config; 414 + u8 t; 415 + 416 + for (via_config = via_isa_bridges; via_config->id; via_config++) 417 + if ((*isa = pci_find_device(PCI_VENDOR_ID_VIA + 418 + !!(via_config->flags & VIA_BAD_ID), 419 + via_config->id, NULL))) { 420 + 421 + pci_read_config_byte(*isa, PCI_REVISION_ID, &t); 422 + if (t >= via_config->rev_min && 423 + t <= via_config->rev_max) 424 + break; 425 + } 426 + 427 + return via_config; 239 428 } 240 429 241 430 /** ··· 271 418 static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name) 272 419 { 273 420 struct pci_dev *isa = NULL; 421 + struct via_isa_bridge *via_config; 274 422 u8 t, v; 275 423 unsigned int u; 276 - int i; 277 424 278 425 /* 279 426 * Find the ISA bridge to see how good the IDE is. 280 427 */ 281 - 282 - for (via_config = via_isa_bridges; via_config->id; via_config++) 283 - if ((isa = pci_find_device(PCI_VENDOR_ID_VIA + 284 - !!(via_config->flags & VIA_BAD_ID), 285 - via_config->id, NULL))) { 286 - 287 - pci_read_config_byte(isa, PCI_REVISION_ID, &t); 288 - if (t >= via_config->rev_min && 289 - t <= via_config->rev_max) 290 - break; 291 - } 292 - 428 + via_config = via_config_find(&isa); 293 429 if (!via_config->id) { 294 430 printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n"); 295 431 return -ENODEV; 296 432 } 297 433 298 434 /* 299 - * Check 80-wire cable presence and setup Clk66. 435 + * Setup or disable Clk66 if appropriate 300 436 */ 301 437 302 - switch (via_config->flags & VIA_UDMA) { 303 - 304 - case VIA_UDMA_66: 305 - /* Enable Clk66 */ 306 - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 307 - pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008); 308 - for (i = 24; i >= 0; i -= 8) 309 - if (((u >> (i & 16)) & 8) && 310 - ((u >> i) & 0x20) && 311 - (((u >> i) & 7) < 2)) { 312 - /* 313 - * 2x PCI clock and 314 - * UDMA w/ < 3T/cycle 315 - */ 316 - via_80w |= (1 << (1 - (i >> 4))); 317 - } 318 - break; 319 - 320 - case VIA_UDMA_100: 321 - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 322 - for (i = 24; i >= 0; i -= 8) 323 - if (((u >> i) & 0x10) || 324 - (((u >> i) & 0x20) && 325 - (((u >> i) & 7) < 4))) { 326 - /* BIOS 80-wire bit or 327 - * UDMA w/ < 60ns/cycle 328 - */ 329 - via_80w |= (1 << (1 - (i >> 4))); 330 - } 331 - break; 332 - 333 - case VIA_UDMA_133: 334 - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 335 - for (i = 24; i >= 0; i -= 8) 336 - if (((u >> i) & 0x10) || 337 - (((u >> i) & 0x20) && 338 - (((u >> i) & 7) < 6))) { 339 - /* BIOS 80-wire bit or 340 - * UDMA w/ < 60ns/cycle 341 - */ 342 - via_80w |= (1 << (1 - (i >> 4))); 343 - } 344 - break; 345 - 346 - } 347 - 348 - /* Disable Clk66 */ 349 - if (via_config->flags & VIA_BAD_CLK66) { 438 + if ((via_config->flags & VIA_UDMA) == VIA_UDMA_66) { 439 + /* Enable Clk66 */ 440 + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 441 + pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008); 442 + } else if (via_config->flags & VIA_BAD_CLK66) { 350 443 /* Would cause trouble on 596a and 686 */ 351 444 pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 352 445 pci_write_config_dword(dev, VIA_UDMA_TIMING, u & ~0x80008); ··· 359 560 via_dma[via_config->flags & VIA_UDMA], 360 561 pci_name(dev)); 361 562 362 - /* 363 - * Setup /proc/ide/via entry. 364 - */ 365 - 366 - #if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) 367 - if (!via_proc) { 368 - via_base = pci_resource_start(dev, 4); 369 - bmide_dev = dev; 370 - isa_dev = isa; 371 - ide_pci_create_host_proc("via", via_get_info); 372 - via_proc = 1; 373 - } 374 - #endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ 375 563 return 0; 564 + } 565 + 566 + /* 567 + * Check and handle 80-wire cable presence 568 + */ 569 + static void __devinit via_cable_detect(struct pci_dev *dev, struct via82cxxx_dev *vdev) 570 + { 571 + unsigned int u; 572 + int i; 573 + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); 574 + 575 + switch (vdev->via_config->flags & VIA_UDMA) { 576 + 577 + case VIA_UDMA_66: 578 + for (i = 24; i >= 0; i -= 8) 579 + if (((u >> (i & 16)) & 8) && 580 + ((u >> i) & 0x20) && 581 + (((u >> i) & 7) < 2)) { 582 + /* 583 + * 2x PCI clock and 584 + * UDMA w/ < 3T/cycle 585 + */ 586 + vdev->via_80w |= (1 << (1 - (i >> 4))); 587 + } 588 + break; 589 + 590 + case VIA_UDMA_100: 591 + for (i = 24; i >= 0; i -= 8) 592 + if (((u >> i) & 0x10) || 593 + (((u >> i) & 0x20) && 594 + (((u >> i) & 7) < 4))) { 595 + /* BIOS 80-wire bit or 596 + * UDMA w/ < 60ns/cycle 597 + */ 598 + vdev->via_80w |= (1 << (1 - (i >> 4))); 599 + } 600 + break; 601 + 602 + case VIA_UDMA_133: 603 + for (i = 24; i >= 0; i -= 8) 604 + if (((u >> i) & 0x10) || 605 + (((u >> i) & 0x20) && 606 + (((u >> i) & 7) < 6))) { 607 + /* BIOS 80-wire bit or 608 + * UDMA w/ < 60ns/cycle 609 + */ 610 + vdev->via_80w |= (1 << (1 - (i >> 4))); 611 + } 612 + break; 613 + 614 + } 376 615 } 377 616 378 617 static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) 379 618 { 619 + struct via82cxxx_dev *vdev = kmalloc(sizeof(struct via82cxxx_dev), 620 + GFP_KERNEL); 621 + struct pci_dev *isa = NULL; 380 622 int i; 623 + 624 + if (vdev == NULL) { 625 + printk(KERN_ERR "VP_IDE: out of memory :(\n"); 626 + return; 627 + } 628 + 629 + memset(vdev, 0, sizeof(struct via82cxxx_dev)); 630 + ide_set_hwifdata(hwif, vdev); 631 + 632 + vdev->via_config = via_config_find(&isa); 633 + via_cable_detect(hwif->pci_dev, vdev); 381 634 382 635 hwif->autodma = 0; 383 636 ··· 445 594 446 595 for (i = 0; i < 2; i++) { 447 596 hwif->drives[i].io_32bit = 1; 448 - hwif->drives[i].unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1; 597 + hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1; 449 598 hwif->drives[i].autotune = 1; 450 599 hwif->drives[i].dn = hwif->channel * 2 + i; 451 600 } ··· 459 608 hwif->swdma_mask = 0x07; 460 609 461 610 if (!hwif->udma_four) 462 - hwif->udma_four = (via_80w >> hwif->channel) & 1; 611 + hwif->udma_four = (vdev->via_80w >> hwif->channel) & 1; 463 612 hwif->ide_dma_check = &via82cxxx_ide_dma_check; 464 613 if (!noautodma) 465 614 hwif->autodma = 1;
-14
drivers/ide/ppc/pmac.c
··· 1401 1401 /* We probe the hwif now */ 1402 1402 probe_hwif_init(hwif); 1403 1403 1404 - /* The code IDE code will have set hwif->present if we have devices attached, 1405 - * if we don't, the discard the interface except if we are on a media bay slot 1406 - */ 1407 - if (!hwif->present && !pmif->mediabay) { 1408 - printk(KERN_INFO "ide%d: Bus empty, interface released.\n", 1409 - hwif->index); 1410 - default_hwif_iops(hwif); 1411 - for (i = IDE_DATA_OFFSET; i <= IDE_CONTROL_OFFSET; ++i) 1412 - hwif->io_ports[i] = 0; 1413 - hwif->chipset = ide_unknown; 1414 - hwif->noprobe = 1; 1415 - return -ENODEV; 1416 - } 1417 - 1418 1404 return 0; 1419 1405 } 1420 1406
+1 -1
drivers/ide/setup-pci.c
··· 787 787 static LIST_HEAD(ide_pci_drivers); 788 788 789 789 /* 790 - * __ide_register_pci_driver - attach IDE driver 790 + * __ide_pci_register_driver - attach IDE driver 791 791 * @driver: pci driver 792 792 * @module: owner module of the driver 793 793 *
+1 -1
drivers/scsi/ide-scsi.c
··· 784 784 #endif 785 785 786 786 static ide_driver_t idescsi_driver = { 787 - .owner = THIS_MODULE, 788 787 .gen_driver = { 788 + .owner = THIS_MODULE, 789 789 .name = "ide-scsi", 790 790 .bus = &ide_bus_type, 791 791 .probe = ide_scsi_probe,
+3 -1
include/linux/ide.h
··· 1089 1089 1090 1090 /* 1091 1091 * Subdrivers support. 1092 + * 1093 + * The gendriver.owner field should be set to the module owner of this driver. 1094 + * The gendriver.name field should be set to the name of this driver 1092 1095 */ 1093 1096 typedef struct ide_driver_s { 1094 - struct module *owner; 1095 1097 const char *version; 1096 1098 u8 media; 1097 1099 unsigned supports_dsc_overlap : 1;