Author Topic: Getting Nibble-mode Device ID requests continuously from windows host port  (Read 16714 times)

nagesha71

  • Member
  • ***
  • Posts: 3
Hello Jan,
Its nice to find this forum at-last.

I am writing a driver for SPP on device side in Linux.  We have thermal printer board
which has linux as the image.

The problem am facing here is, getting a Event 25 time out in termination phase, when
I connect the cable to parallel port in Windows host. 
Below is the sequence of operations between our SPP driver and the Windows host:

1. Host issued negotiation phase for Device Id request in nibble mode (0x04)
2. My driver responding with Event 5.
3. Data read of device id length is happening properly.
4. Once after all the data transmitted to the host, my driver giving Event 13 and 11.
5. There by, Windows host driver is giving a sequence of three termination phase requests.
    In which first two termination phases are responding properly,
    and in the third termination phase, am getting a Event 25 time out.

And, further windows host repeats the same sequence continuously from 1 to 5.

Upon all this, my driver is working fine and giving device id properly
when I connect to Linux host port. (observed when I run "system-config-printer" tool in Linux host).


I am not getting where am doing wrong, and why this time out is happening from Windows host driver.
Please give me your inputs.

Below is the sequence of some printks (dmesg) taken from my SPP driver on device console:

linux host:
# insmod at91_piospp.ko
[  196.850000] Driver Name[atmel_spp]
[  196.860000] SPPDBG: atmel_spp_probe: begin ->
[  196.860000] SPPINFO: spp_init_module: SPP char module is loaded with dev entry sppdev
(Run "system-config-printer" tool)

# [  214.450000] Nag: spp_termination_phase
[  214.460000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[  214.470000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[  214.480000] Nag: spp_termination_phase
[  214.630000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[  214.640000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[  214.660000] Nag: spp_termination_phase
[  214.880000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[  214.890000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[  214.910000] Nag: spp_termination_phase

windows host:
# insmod at91_piospp.ko
[42949383.910000] Driver Name[atmel_spp]
[42949383.910000] SPPDBG: atmel_spp_probe: begin ->
[42949383.920000] SPPINFO: spp_init_module: SPP char module is loaded with dev entry sppdev
(simply attach cable to Windows host)

# [42949385.340000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[42949385.350000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[42949385.350000] Nag: spp_termination_phase
[42949385.420000] Nag: spp_termination_phase
[42949385.560000] Nag: spp_termination_phase
[42949386.560000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949386.560000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949386.570000] Nag: spp_termination_phase
[42949387.570000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949387.570000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949390.360000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[42949390.360000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[42949390.370000] Nag: spp_termination_phase
[42949390.440000] Nag: spp_termination_phase
[42949390.580000] Nag: spp_termination_phase
[42949391.580000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949391.580000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949391.590000] Nag: spp_termination_phase
[42949392.590000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949392.590000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949395.370000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[42949395.380000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[42949395.390000] Nag: spp_termination_phase
[42949395.450000] Nag: spp_termination_phase
[42949395.590000] Nag: spp_termination_phase
[42949396.600000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949396.600000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949396.610000] Nag: spp_termination_phase
[42949397.610000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949397.610000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949400.390000] SPPNEGO: spp_negotiation_phase: mode - 4, phase - 2
[42949400.390000] SPPNEGO: spp_negotiation_phase: dataAvail - 1
[42949400.400000] Nag: spp_termination_phase
[42949400.470000] Nag: spp_termination_phase
[42949400.610000] Nag: spp_termination_phase
[42949401.610000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949401.610000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
[42949401.620000] Nag: spp_termination_phase
[42949402.620000] SPPDBG: spp_termination_phase: Event 25 time out!
[42949402.620000] SPPDBG: spp_1284Active_isr: spp_termination_phase - ERROR
(repeatedly getting the termination phase sequence ..)


regards,
-Nagesh A

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
The printer works OK with a Linux host?

What is spp_termination_phase?

Jan

nagesha71

  • Member
  • ***
  • Posts: 3
Hi Jan,
Yes, the printer works fine with Linux host.

spp_termination_phase() is the function that will call on Event 22 triggers.
The spp_termination_phase() function handles the events as below:
1. Event 23: Set nDataAvail, PtrBusy, AckReqData high
    ndelay(500);
2. Event 24: Set Xflag high, and PtrClk low
3. Waits for host Event 25: HostBusy go low
4. Event 26: Set nDataAvail, xFlag low
    ndelay(500);
5. Event 27: Set PtrClk high to complete handshake with host
6. Waits for host Event 28: HostBusy go high

Here, after the device ID data is transfered successfully to the host
(I could see the ID data of 72 bytes are transferred), host isssuing 3 termination phases (Evnet 22)
sequencially, in which first 2 are successfully handled, but the 3rd Event 22 handling has a
time out at Event 25.

thanks,
-Nagesh A
regards,
-Nagesh A

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
OK, I see the events are from the IEEE-1284 spec, and spp_termination_phase is the final phase in transitioning from nibble mode to compatibility mode.

Maybe there is something wrong with the Device ID format that Linux tolerates and Windows doesn't?

Jan

nagesha71

  • Member
  • ***
  • Posts: 3

With Linux, am not getting NibbleDevice ID request right after the cable connection, I should
run the command "system-config-printer" tool.

But where as in Windows, gettign NibbleDevice ID reqeust once after teh cable connected to the port ?

regards,
-Nagesh A

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
You could try ignoring the request for the Device ID.

Jan