Linux ATA/IDE development
 help / color / mirror / Atom feed
* SELECT_DRIVE and friends
@ 2004-06-06  0:36 Marc Singer
  2004-06-06  1:13 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Singer @ 2004-06-06  0:36 UTC (permalink / raw)
  To: linux-ide

> > > > > > The OUTB breaks my interface because I don't really have byte-level
> > > > > > access to the resgisters.  So, is selectproc a pre-select procedure
> > > > > > or should it be a substitute?
> > > > >
> > > > > pre-select but you can change it to be substitute if you need
> > > > > (just remember to update all users if you decide to do this)
> > > >
> > > > I'll have to search the kernel to see what uses it.  Maybe the better
> > > > way would be to define a new select proc that *is* a substitute.
> > >
> > > Nope.
> >
> > So then we break anyone who is using the selectproc as a pre-select
> > proc?  I don't understand what you mean here.  There are several
> > drivers that use this function.  How do you propose that we provide
> > both types of behavior with one entry point?
> 
> You can add last line of SELECT_DRIVE() to all ->selectproc()
> implementations and add 'else' to SELECT_DRIVE().

This would probably work if all references to the IDE_SELECT_REG were
replaced with SELECT_DRIVE calls.  This, it turns out, is not true.
There are direct calls to access the select register in several files
listed below.  Are you confortable with all of these being replaced
with SELECT_DRIVE calls?

  ide-disk.c:                     hwif->OUTB(0x00|drive->select.all,IDE_SELECT_REG);
  ide-disk.c:                     hwif->OUTB(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG);
  ide-disk.c:             hwif->OUTB(head|drive->select.all,IDE_SELECT_REG);
  ide-floppy.c:   HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG);
  ide-io.c:               hwif->OUTB(sel, IDE_SELECT_REG);
  ide-iops.c:             HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG);
  ide-probe.c:                    hwif->OUTB(drive->select.all, IDE_SELECT_REG);
  ide-tape.c:     hwif->OUTB(drive->select.all, IDE_SELECT_REG);
  ide-taskfile.c: hwif->OUTB((taskfile->device_head & HIHI) | drive->select.all, IDE_SELECT_REG);
  ide-taskfile.c: hwif->OUTB(taskfile->device_head | drive->select.all, IDE_SELECT_REG);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SELECT_DRIVE and friends
  2004-06-06  0:36 SELECT_DRIVE and friends Marc Singer
@ 2004-06-06  1:13 ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-06-06  1:13 UTC (permalink / raw)
  To: Marc Singer, linux-ide

On Sunday 06 of June 2004 02:36, Marc Singer wrote:
> > > > > > > The OUTB breaks my interface because I don't really have
> > > > > > > byte-level access to the resgisters.  So, is selectproc a
> > > > > > > pre-select procedure or should it be a substitute?
> > > > > >
> > > > > > pre-select but you can change it to be substitute if you need
> > > > > > (just remember to update all users if you decide to do this)
> > > > >
> > > > > I'll have to search the kernel to see what uses it.  Maybe the
> > > > > better way would be to define a new select proc that *is* a
> > > > > substitute.
> > > >
> > > > Nope.
> > >
> > > So then we break anyone who is using the selectproc as a pre-select
> > > proc?  I don't understand what you mean here.  There are several
> > > drivers that use this function.  How do you propose that we provide
> > > both types of behavior with one entry point?
> >
> > You can add last line of SELECT_DRIVE() to all ->selectproc()
> > implementations and add 'else' to SELECT_DRIVE().
>
> This would probably work if all references to the IDE_SELECT_REG were
> replaced with SELECT_DRIVE calls.  This, it turns out, is not true.
> There are direct calls to access the select register in several files
> listed below.  Are you confortable with all of these being replaced
> with SELECT_DRIVE calls?

No, SELECT_DRIVE only writes drive->select.all.

I need to think some more about it.

>   ide-disk.c:                    
> hwif->OUTB(0x00|drive->select.all,IDE_SELECT_REG); ide-disk.c:             
>        hwif->OUTB(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG);
> ide-disk.c:             hwif->OUTB(head|drive->select.all,IDE_SELECT_REG);
> ide-floppy.c:   HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG);
> ide-io.c:               hwif->OUTB(sel, IDE_SELECT_REG);
>   ide-iops.c:             HWIF(drive)->OUTB(drive->select.all,
> IDE_SELECT_REG); ide-probe.c:                   
> hwif->OUTB(drive->select.all, IDE_SELECT_REG); ide-tape.c:    
> hwif->OUTB(drive->select.all, IDE_SELECT_REG);
>   ide-taskfile.c: hwif->OUTB((taskfile->device_head & HIHI) |
> drive->select.all, IDE_SELECT_REG); ide-taskfile.c:
> hwif->OUTB(taskfile->device_head | drive->select.all, IDE_SELECT_REG);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-06  1:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-06  0:36 SELECT_DRIVE and friends Marc Singer
2004-06-06  1:13 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox