Serial port hangups.

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Fri, 13 Aug 1999 16:03:40 +0200 (MEST)


Hi,

I have a customer who is using hylafax to send faxes.

Turns out that after sending the EOP command, the modem (or remote
site) will send an acknowledgement and then quickly hangup:

Aug 12 11:13:49.81: [ 346]: SEND end page
Aug 12 11:13:49.81: [ 346]: SEND send EOP (no more pages or documents)
Aug 12 11:13:49.81: [ 346]: <-- data [2]
Aug 12 11:13:58.20: [ 346]: --> [7:+FHS:00]
Aug 12 11:13:58.20: [ 346]: REMOTE HANGUP: Normal and proper end of
connection (code 0)

Now, when this client uses my SX driver, it turns out that the card
reports those 7 characters ("+FHS:00") in the same hardware interrupt
as it reports the "DCD dropped". So I end up sending the hangup
signal and those last few characters at the same time. The hangup wins
the race and Hylafax thinks the remote side hung up early.

Delaying reporting the "hangup" helps a bit, but I need to delay it a
full second to make it reliable for this client (when sending faxes on
say 16 ports at the same time).

Has anybody seen this before? Is there a way to make this reliable,
without just blindly delaying the hangup too long?

I've been thinking about checking the read-buffer. But should I be
allowed to defer sending the application the "hangup" even if there
are still characters coming in?

I think I'm going to defer the hangup max 10 times for 100ms. The
hangup is deferred 100 more ms, if there are still characters in the
recieve buffer.

Does anybody see any problems with this?

By the way, after the hangup, I see my driver reporting "io error"
when Hylafax tries to write to the modem. Is that correct?

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/