Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4df4db5c authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Ralf Baechle
Browse files

[TC] dec_esp: Driver model for the PMAZ-A



This is a set of changes that converts the PMAZ-A support to the driver model.

The use of the driver model required switching to the hotplug SCSI
initialization model, which in turn required a change to the core NCR53C9x
driver.  I decided not to break all the frontend drivers and introduced an
additional parameter for esp_allocate() to select between the old and the new
model.  I hope this is OK, but I would be fine with converting NCR53C9x to the
new model unconditionally as long as I do not have to fix all the other
frontends (OK, perhaps I could do some of them ;-) ).

Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 335dc50c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -528,11 +528,15 @@ void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
/* Allocate structure and insert basic data such as SCSI chip frequency
 * data and a pointer to the device
 */
struct NCR_ESP* esp_allocate(struct scsi_host_template *tpnt, void *esp_dev)
struct NCR_ESP* esp_allocate(struct scsi_host_template *tpnt, void *esp_dev,
			     int hotplug)
{
	struct NCR_ESP *esp, *elink;
	struct Scsi_Host *esp_host;

	if (hotplug)
		esp_host = scsi_host_alloc(tpnt, sizeof(struct NCR_ESP));
	else
		esp_host = scsi_register(tpnt, sizeof(struct NCR_ESP));
	if(!esp_host)
		panic("Cannot register ESP SCSI host");
+1 −1
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ extern int nesps, esps_in_use, esps_running;

/* External functions */
extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs);
extern struct NCR_ESP *esp_allocate(struct scsi_host_template *, void *);
extern struct NCR_ESP *esp_allocate(struct scsi_host_template *, void *, int);
extern void esp_deallocate(struct NCR_ESP *);
extern void esp_release(void);
extern void esp_initialize(struct NCR_ESP *);
+2 −1
Original line number Diff line number Diff line
@@ -121,7 +121,8 @@ int __init blz1230_esp_detect(struct scsi_host_template *tpnt)
		 */
		address = ZTWO_VADDR(board);
		eregs = (struct ESP_regs *)(address + REAL_BLZ1230_ESP_ADDR);
		esp = esp_allocate(tpnt, (void *)board+REAL_BLZ1230_ESP_ADDR);
		esp = esp_allocate(tpnt, (void *)board + REAL_BLZ1230_ESP_ADDR,
				   0);

		esp_write(eregs->esp_cfg1, (ESP_CONFIG1_PENABLE | 7));
		udelay(5);
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ int __init blz2060_esp_detect(struct scsi_host_template *tpnt)
	    unsigned long board = z->resource.start;
	    if (request_mem_region(board+BLZ2060_ESP_ADDR,
				   sizeof(struct ESP_regs), "NCR53C9x")) {
		esp = esp_allocate(tpnt, (void *)board+BLZ2060_ESP_ADDR);
		esp = esp_allocate(tpnt, (void *)board + BLZ2060_ESP_ADDR, 0);

		/* Do command transfer with programmed I/O */
		esp->do_pio_cmds = 1;
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ int __init cyber_esp_detect(struct scsi_host_template *tpnt)
					   sizeof(struct ESP_regs));
			return 0;
		}
		esp = esp_allocate(tpnt, (void *)board+CYBER_ESP_ADDR);
		esp = esp_allocate(tpnt, (void *)board + CYBER_ESP_ADDR, 0);

		/* Do command transfer with programmed I/O */
		esp->do_pio_cmds = 1;
Loading