Since you want to do ordinary ISA/PCI I/O on SASR and SCMD, I think you want to
get rid of the pointers and put the plain I/O port numbers there:
unsigned long SASR;
unsigned long SCMD;
> +#else
> volatile unsigned char *SASR;
> volatile unsigned char *SCMD;
> +#endif
M68k and MIPS use pointers because they do MMIO.
Then the following can go away:
> +static unsigned int SASR;
> +static unsigned int SCMD;
> +static wd33c93_regs regs = {&SASR, &SCMD};
And you store the I/O ports here:
static wd33c93_regs regs;
> + for (i = 0; i < nr_base_ios; i++) {
> + base_io = base_ios[i];
> + SASR = REG_ADDRST;
> + SCMD = REG_CONTRL;
regs.SASR = REG_ADDRST;
regs.SCMD = REG_CONTRL;
> +static int pc980155_abort(Scsi_Cmnd *cmd)
> +{
> + if (wd33c93_abort(cmd) == SCSI_ABORT_SUCCESS)
> + return SUCCESS;
> +
> + return FAILED;
> +}
The abort handler is generic. Hence it can be moved to wd33c93.c, so the other
wd33c93 drivers (my main interest :-) can use it.
> +static int pc980155_bus_reset(Scsi_Cmnd *cmd)
> +{
> + struct WD33C93_hostdata *hostdata
> + = (struct WD33C93_hostdata *)cmd->device->host->hostdata;
> +
> + pc980155_int_disable(hostdata->regs);
> + pc980155_assert_bus_reset(hostdata->regs);
> + udelay(50);
> + pc980155_negate_bus_reset(hostdata->regs);
> + (void) inb(*hostdata->regs.SASR);
> + (void) read_pc980155(hostdata->regs, WD_SCSI_STATUS);
> + pc980155_int_enable(hostdata->regs);
> + wd33c93_reset(cmd, 0);
> + return SUCCESS;
> +}
Is there a generic (wd33c93) way to do this?
> +static int pc980155_host_reset(Scsi_Cmnd *cmd)
> +{
> + wd33c93_reset(cmd, 0);
> + return SUCCESS;
> +}
The host reset handler is generic, too.
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.orgIn personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/