X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fesp_scsi.c;h=a0b6d414953dda3128acc7477827a7dcfbdd429b;hb=7cece14acd063dd1c4e8933461d44ec6a5a5517b;hp=95cf7b6cd6225043f7a13ef33939b118303cba1c;hpb=731aa5fd9971a5163845fbe55de63d686a11da0a;p=linux-2.6 diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 95cf7b6cd6..a0b6d41495 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -978,7 +978,7 @@ static int esp_check_spur_intr(struct esp *esp) */ if (!esp->ops->dma_error(esp)) { printk(KERN_ERR PFX "esp%d: Spurious irq, " - "sreg=%x.\n", + "sreg=%02x.\n", esp->host->unique_id, esp->sreg); return -1; } @@ -1447,6 +1447,9 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp) if (offset > 15) goto do_reject; + if (esp->flags & ESP_FLAG_DISABLE_SYNC) + offset = 0; + if (offset) { int rounded_up, one_clock; @@ -1697,7 +1700,12 @@ again: else ent->flags &= ~ESP_CMD_FLAG_WRITE; - dma_len = esp_dma_length_limit(esp, dma_addr, dma_len); + if (esp->ops->dma_length_limit) + dma_len = esp->ops->dma_length_limit(esp, dma_addr, + dma_len); + else + dma_len = esp_dma_length_limit(esp, dma_addr, dma_len); + esp->data_dma_len = dma_len; if (!dma_len) { @@ -1761,7 +1769,6 @@ again: esp_advance_dma(esp, ent, cmd, bytes_sent); esp_event(esp, ESP_EVENT_CHECK_PHASE); goto again; - break; } case ESP_EVENT_STATUS: { @@ -2026,8 +2033,8 @@ static void esp_reset_cleanup(struct esp *esp) tp->flags |= ESP_TGT_CHECK_NEGO; if (tp->starget) - starget_for_each_device(tp->starget, NULL, - esp_clear_hold); + __starget_for_each_device(tp->starget, NULL, + esp_clear_hold); } esp->flags &= ~ESP_FLAG_RESETTING; } @@ -2138,7 +2145,7 @@ irqreturn_t scsi_esp_intr(int irq, void *dev_id) } EXPORT_SYMBOL(scsi_esp_intr); -static void __devinit esp_get_revision(struct esp *esp) +static void esp_get_revision(struct esp *esp) { u8 val; @@ -2187,7 +2194,7 @@ static void __devinit esp_get_revision(struct esp *esp) } } -static void __devinit esp_init_swstate(struct esp *esp) +static void esp_init_swstate(struct esp *esp) { int i; @@ -2233,9 +2240,9 @@ static void esp_bootup_reset(struct esp *esp) esp_read8(ESP_INTRPT); } -static void __devinit esp_set_clock_params(struct esp *esp) +static void esp_set_clock_params(struct esp *esp) { - int fmhz; + int fhz; u8 ccf; /* This is getting messy but it has to be done correctly or else @@ -2270,9 +2277,9 @@ static void __devinit esp_set_clock_params(struct esp *esp) * This entails the smallest and largest sync period we could ever * handle on this ESP. */ - fmhz = esp->cfreq; + fhz = esp->cfreq; - ccf = ((fmhz / 1000000) + 4) / 5; + ccf = ((fhz / 1000000) + 4) / 5; if (ccf == 1) ccf = 2; @@ -2281,16 +2288,16 @@ static void __devinit esp_set_clock_params(struct esp *esp) * been unable to find the clock-frequency PROM property. All * other machines provide useful values it seems. */ - if (fmhz <= 5000000 || ccf < 1 || ccf > 8) { - fmhz = 20000000; + if (fhz <= 5000000 || ccf < 1 || ccf > 8) { + fhz = 20000000; ccf = 4; } esp->cfact = (ccf == 8 ? 0 : ccf); - esp->cfreq = fmhz; - esp->ccycle = ESP_MHZ_TO_CYCLE(fmhz); + esp->cfreq = fhz; + esp->ccycle = ESP_HZ_TO_CYCLE(fhz); esp->ctick = ESP_TICK(ccf, esp->ccycle); - esp->neg_defp = ESP_NEG_DEFP(fmhz, ccf); + esp->neg_defp = ESP_NEG_DEFP(fhz, ccf); esp->sync_defp = SYNC_DEFP_SLOW; } @@ -2306,7 +2313,7 @@ static const char *esp_chip_names[] = { static struct scsi_transport_template *esp_transport_template; -int __devinit scsi_esp_register(struct esp *esp, struct device *dev) +int scsi_esp_register(struct esp *esp, struct device *dev) { static int instance; int err; @@ -2346,7 +2353,7 @@ int __devinit scsi_esp_register(struct esp *esp, struct device *dev) } EXPORT_SYMBOL(scsi_esp_register); -void __devexit scsi_esp_unregister(struct esp *esp) +void scsi_esp_unregister(struct esp *esp) { scsi_remove_host(esp->host); } @@ -2382,6 +2389,12 @@ static int esp_slave_configure(struct scsi_device *dev) struct esp_target_data *tp = &esp->target[dev->id]; int goal_tags, queue_depth; + if (esp->flags & ESP_FLAG_DISABLE_SYNC) { + /* Bypass async domain validation */ + dev->ppr = 0; + dev->sdtr = 0; + } + goal_tags = 0; if (dev->tagged_supported) {