Re: [PARPORT] IEEE1284


Tim Waugh (tim@cyberelk.demon.co.uk)
Mon, 7 Dec 1998 19:38:38 +0000 (GMT)


On Mon, 7 Dec 1998, Thomas Sailer wrote:

> Looks good so far. One point though:
> it should IMHO be possible to avoid IEEE negotiation
> and force the use of a certain mode.

I'm working on that. My current plan is this:

struct ieee1284_ops {
  ssize_t (*write_compat) (struct parport *, const void *, size_t);
  ssize_t (*read_nibble) (struct parport *, void *, size_t);
  ssize_t (*read_byte) (struct parport *, void *, size_t);
  ...
};
struct ieee1284_info {
  ...
  struct ieee1284_ops *ops;
};

In parport_share.c:

static struct ieee1284_ops parport_ieee1284_ops {
  parport_ieee1284_write_compat,
  parport_ieee1284_read_nibble,
  parport_ieee1284_read_byte,
  ...
};

In parport_register_port:

  tmp->ieee1284.ops = &parport_ieee1284_ops;

In parport_ieee1284.c and parport.h, make available
parport_ieee1284_read_nibble, etc.

In parport_{arch}.c, override elements of ieee1284.ops as appropriate.

Then, the generic methods are available as
parport_ieee1284_{read,write}_mode, and chipset-specific speed-ups are
available as port->ieee1284.ops->{read,write}_mode.

I intend to implement this once I've tested the interrupt handling code --
at the moment I don't seem to be getting any interrupts generated when I
print...

At the moment I'm unsure about ECP, though. When we negotiate to ECP
mode, both the peripheral and the host start at channel zero. The host
can change channel, to get the peripheral to do {whatever magic
peripheral-dependent things there are on that channel}, and that's all
fine and dandy, and can be done with parport_ieee1284_set_channeladdress.

But what if the peripheral changes the channel it talks to us on? It can
do that any time it likes.

My only theory on how to do it is to make parport_ieee1284_read_ecp return
as soon as the peripheral changes channel, and tell driver writers that
they must call parport_ieee1284_get_channeladdress after each call to
parport_ieee1284_read that returns a short byte count.

So, this kind of thing:

Host Peripheral
---- ----------
negotiate(ECP) go to ECP mode

read(30) = 4 send 0x41, 0x42, 0x43, 0x44.
                    change channel.

"hmm, only read 4
 bytes."

get_channeladdress

Tim.
*/

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:18:51 EST