From: Jeff Dike <jdike@ka...> - 2002-09-18 21:04:12
> First question: Is the code below a reasonable template for
> implementing a session based driver?
With a quick look through it, it looks reasonable.
> Second question: Do I have to create another interrupt line (mode
> IRQ_WRITE) to support draining a large output buffer, or can I use
> the same interrupt for reading and writing?
I split read and write irqs for slightly better efficiency. It shouldn't
matter as long as your handler can tolerate either nothing being able to
be written or nothing available for reading.
> For that matter, could I
> share ACCEPT_IRQ instead of using MYDEV_IRQ? Would the right handler
> be called?
You can. You specify the fd and handler to um_request_irq, so your
handler will be called.
> Third question: Do I have to worry how long I spend in the interrupt
> handler? Is reentrance an issue?
It might be, but I haven't worried about it so far. Latency isn't a
correctness issue, but a responsiveness one.
> Fourth question: I need to allocate several megabytes of buffer per
> network connection, how would I best do that? These buffers would
> need only be visible to the driver.
vmalloc is your best bet.