Hi all, I've 2 HP multifunctional devices MFP 1005M and HPOJ PRO 1150 C. Since 1005M is not supported by hplip, I have to use the old 1150C scanner. I'm on a AMD64 x86_64 Gentoo GNU/Linux system, using hplip ebuild provided by Gentoo.
The scanner is detected by xsane but doesn't work. CPU is 100% busy because of the io daemon of the hp system. I can't say if it's something related to the parport user space driver (linux kernel gentoo-sources-2.6.22-r1) or an hplip-1.7.4a specific problem. However, I've managed to get the scanner working resuming the old hpoj-0.91, applyed the patch still present in gentoo cvs and fixed for working (scanner part only) under amd64. For those who have the same problem, here is the patch to fix hpoj. I've seen just now that hplip 2.7.6 is out, I'll test it again for hpoj 1150C and MFP 1005M. Having 2 HP devices not working let me think that my next multi function device will not be an HP. However, here is the promised patch: diff -ur hpoj-0.91/lib/hpojip/xjpg_fix.c hpoj-0.91.my/lib/hpojip/xjpg_fix.c --- hpoj-0.91/lib/hpojip/xjpg_fix.c 2002-07-25 11:01:24.000000000 +0200 +++ hpoj-0.91.my/lib/hpojip/xjpg_fix.c 2007-07-25 22:45:56.869037163 +0200 @@ -437,7 +437,7 @@ unsigned char xthumb; /* 0x00 */ unsigned char ythumb; /* 0x00 */ } *pOutputSoiApp0; - struct { + struct pOutputSof0Part1_s { unsigned char sof0[2]; /* 0xFF, 0xC0 */ unsigned char sof0Length[2]; /* 0x00, 0x?? */ unsigned char eight; /* 0x08 */ @@ -445,22 +445,22 @@ unsigned char width[2]; unsigned char numComponents; /* 1=gray, 3=color */ } *pOutputSof0Part1; - struct { + struct pOutputSofComponent_s { unsigned char iComponent; unsigned char xySampleFactors; unsigned char isNotFirstComponent; } *pOutputSofComponent; - struct { + struct pOutputDqt_s { unsigned char dqt[2]; /* 0xFF, 0xDB */ unsigned char dqtLength[2]; /* 0x00, 0x43 */ unsigned char ident; /* 0=lum., 1=chrom. */ unsigned char elements[64]; } *pOutputDqt; - struct { + struct pOutputDhtPart1_s { unsigned char dht[2]; /* 0xFF, 0xC4 */ unsigned char dhtLength[2]; /* 0x00, 0x?? */ } *pOutputDhtPart1; - struct { + struct pOutputDhtPart2_s { unsigned char hclass_ident; unsigned char counts[16]; /* Variable-length huffval table follows. */ @@ -476,16 +476,16 @@ {0x11,chrom_AC_counts,chrom_AC_values} }; int dhtCountCounts[4]; - struct { + struct pOutputSosPart1_s { unsigned char sos[2]; /* 0xFF, 0xDA */ unsigned char sosLength[2]; /* 0x00, 0x?? */ unsigned char numComponents; /* 1=gray, 3=color */ } *pOutputSosPart1; - struct { + struct pOutputSosComponent_s { unsigned char iComponent; unsigned char x00x11; /* (i==0 ? 0x00 : 0x11) */ } *pOutputSosComponent; - struct { + struct pOutputSosPart2_s { unsigned char zero1; /* 0x00 */ unsigned char sixtythree; /* 0x3F */ unsigned char zero2; /* 0x00 */ @@ -509,7 +509,8 @@ lenRemovedHeader=sizeof(*pInputHeader); /* Start Of Image record. */ - MYLOCATE(pOutputSoiApp0); + /*MYLOCATE(pOutputSoiApp0);*/ + pOutputSoiApp0 = (struct outputSoiApp0_s *) g->headerBuffer+lenAddedHeader; pOutputSoiApp0->soi[0]=0xFF; pOutputSoiApp0->soi[1]=0xD8; /* APP0 (JFIF header) record. */ @@ -530,7 +531,8 @@ MYWRITE(pOutputSoiApp0); /* Start Of Frame record. */ - MYLOCATE(pOutputSof0Part1); + /*MYLOCATE(pOutputSof0Part1);*/ + pOutputSof0Part1 = (struct pOutputSof0Part1_s *) g->headerBuffer+lenAddedHeader; pOutputSof0Part1->sof0[0]=0xFF; pOutputSof0Part1->sof0[1]=0xC0; pOutputSof0Part1->sof0Length[0]=0x00; @@ -546,7 +548,8 @@ x=BEND_GET_SHORT(pInputHeader->xSampleFactors); y=BEND_GET_SHORT(pInputHeader->ySampleFactors); for (i=0;i<pInputHeader->numComponents;i++) { - MYLOCATE(pOutputSofComponent); + /*MYLOCATE(pOutputSofComponent);*/ + pOutputSofComponent = (struct pOutputSofComponent_s *) g->headerBuffer+lenAddedHeader; pOutputSofComponent->iComponent=i; pOutputSofComponent->xySampleFactors= (((x>>(4*(3-i)))&0x0F)<<4) | ((y>>(4*(3-i)))&0x0F); @@ -557,7 +560,8 @@ /* Define Quantization Table record. */ imax=pInputHeader->numComponents>1?1:0; for (i=0;i<=imax;i++) { - MYLOCATE(pOutputDqt); + /*MYLOCATE(pOutputDqt);*/ + pOutputDqt = (struct pOutputDqt_s *) g->headerBuffer+lenAddedHeader; pOutputDqt->dqt[0]=0xFF; pOutputDqt->dqt[1]=0xDB; pOutputDqt->dqtLength[0]=0x00; @@ -578,21 +582,24 @@ x+=y; } } - MYLOCATE(pOutputDhtPart1); + /*MYLOCATE(pOutputDhtPart1);*/ + pOutputDhtPart1 = (struct pOutputDhtPart1_s *) g->headerBuffer+lenAddedHeader; pOutputDhtPart1->dht[0]=0xFF; pOutputDhtPart1->dht[1]=0xC4; BEND_SET_SHORT(pOutputDhtPart1->dhtLength,x); MYWRITE(pOutputDhtPart1); for (i=0;i<imax;i++) { - MYLOCATE(pOutputDhtPart2); - pOutputDhtPart2->hclass_ident=dhtInfo[i].hclass_ident; + /*MYLOCATE(pOutputDhtPart2);*/ + pOutputDhtPart2 = (struct pOutputDhtPart2_s *)g->headerBuffer+lenAddedHeader; + pOutputDhtPart2->hclass_ident=dhtInfo[i].hclass_ident; memcpy(pOutputDhtPart2->counts,dhtInfo[i].counts,16); MYWRITE(pOutputDhtPart2); MYWRITEBUF(dhtInfo[i].huffval,dhtCountCounts[i]); } /* Start Of Scan record. */ - MYLOCATE(pOutputSosPart1); + /*MYLOCATE(pOutputSosPart1);*/ + pOutputSosPart1 = (struct pOutputSosPart1_s *) g->headerBuffer+lenAddedHeader; imax=pInputHeader->numComponents; pOutputSosPart1->sos[0]=0xFF; pOutputSosPart1->sos[1]=0xDA; @@ -602,12 +609,14 @@ pOutputSosPart1->numComponents=imax; MYWRITE(pOutputSosPart1); for (i=0;i<imax;i++) { - MYLOCATE(pOutputSosComponent); + /*MYLOCATE(pOutputSosComponent);*/ + pOutputSosComponent = (struct pOutputSosComponent_s *) g->headerBuffer+lenAddedHeader; pOutputSosComponent->iComponent=i; pOutputSosComponent->x00x11=(!i?0x00:0x11); MYWRITE(pOutputSosComponent); } - MYLOCATE(pOutputSosPart2); + /*MYLOCATE(pOutputSosPart2);*/ + pOutputSosPart2 = (struct pOutputSosPart2_s *) g->headerBuffer+lenAddedHeader; pOutputSosPart2->zero1=0; pOutputSosPart2->sixtythree=63; pOutputSosPart2->zero2=0; diff -ur hpoj-0.91/lib/hpojip/xpnm.c hpoj-0.91.my/lib/hpojip/xpnm.c --- hpoj-0.91/lib/hpojip/xpnm.c 2002-07-25 11:01:24.000000000 +0200 +++ hpoj-0.91.my/lib/hpojip/xpnm.c 2007-07-25 22:45:56.870037011 +0200 @@ -443,17 +443,17 @@ goto fatal_error; } - snprintf(buffer,MAX_ENCODE_HEADER_SIZE,"\n%d %d\n", + snprintf((char*)buffer,MAX_ENCODE_HEADER_SIZE,"\n%d %d\n", g->traits.iPixelsPerRow,g->dwRowsDone); if (g->traits.iComponentsPerPixel>1 || maxval>1) { buffer[MAX_ENCODE_HEADER_SIZE-1]=0; - len=strlen(buffer); - snprintf(buffer+len,MAX_ENCODE_HEADER_SIZE-len, + len=strlen((char*)buffer); + snprintf((char*)buffer+len,MAX_ENCODE_HEADER_SIZE-len, "%d\n",maxval); } buffer[MAX_ENCODE_HEADER_SIZE-1]=0; - len=strlen(buffer); + len=strlen((char*)buffer); memcpy(pbOutputBuf+MAX_ENCODE_HEADER_SIZE-len,buffer,len); *pdwOutputUsed=MAX_ENCODE_HEADER_SIZE; Only in hpoj-0.91.my: .Makefile.in.swp diff -ur hpoj-0.91/mlcd/ExMgr.cpp hpoj-0.91.my/mlcd/ExMgr.cpp --- hpoj-0.91/mlcd/ExMgr.cpp 2003-11-04 02:03:18.000000000 +0100 +++ hpoj-0.91.my/mlcd/ExMgr.cpp 2007-07-25 22:45:56.880035485 +0200 @@ -248,8 +248,8 @@ #ifdef JD_DEBUGLITE void ExWatchdogTimer::dump(void) { - printf("pMsgHandler=0x%8.8X\n",(int)pMsgHandler); - printf("pMsg=0x%8.8X\n",(int)pMsg); + printf("pMsgHandler=0x%8.8X\n",(long)pMsgHandler); + printf("pMsg=0x%8.8X\n",(long)pMsg); printf("delay=%d seconds, %d usec\n", (int)delay.tv_sec,(int)delay.tv_usec); printf("cancelled=%d\n",cancelled); @@ -1307,13 +1307,13 @@ printf("\tstate=%d\n",session[scd].state); printf("\tfd=%d\n",session[scd].fd); printf("\tscdlink=%d\n",session[scd].scdlink); - printf("\tpLookup=0x%8.8X\n",(int)session[scd].pLookup); + printf("\tpLookup=0x%8.8X\n",(long)session[scd].pLookup); printf("\toutstandingForwardBdrCount=%d\n", session[scd].outstandingForwardBdrCount); printf("\tpReverseBdrQueue: depth=%d\n", session[scd].pReverseBdrQueue->depth()); - printf("\ttcd=0x%8.8X\n",(int)session[scd].tcd); - printf("\tpCommandBdr=0x%8.8X\n",(int)session[scd].pCommandBdr); + printf("\ttcd=0x%8.8X\n",(long)session[scd].tcd); + printf("\tpCommandBdr=0x%8.8X\n",(long)session[scd].pCommandBdr); printf("\tpmlTrapsRegistered=%d\n",session[scd].pmlTrapsRegistered); printf("\tbitbucketSocket=%d\n",session[scd].bitbucketSocket); @@ -1330,7 +1330,8 @@ sessionPmlEnable(); } - for (SCD scd=0;scd<MAX_SESSIONS;scd++) { + for (SCD scd=0;scd<MAX_SESSIONS;scd++) + { sessionChangeState(scd,state); } } diff -ur hpoj-0.91/mlcd/ExMgr.h hpoj-0.91.my/mlcd/ExMgr.h --- hpoj-0.91/mlcd/ExMgr.h 2003-11-04 02:03:18.000000000 +0100 +++ hpoj-0.91.my/mlcd/ExMgr.h 2007-07-25 22:45:56.880035485 +0200 @@ -128,7 +128,7 @@ #ifdef JD_DEBUGLITE void dump(void) { printf("QueueEntry(0x%8.8X): prev=0x%8.8X, next=0x%8.8X\n", - (int)this,(int)prev,(int)next); + (long)this,(long)prev,(long)next); } #endif int isEnqueued(void) { return (prev || next); } diff -ur hpoj-0.91/mlcd/transport/ExMlcCommandChannel.cpp hpoj-0.91.my/mlcd/transport/ExMlcCommandChannel.cpp --- hpoj-0.91/mlcd/transport/ExMlcCommandChannel.cpp 2003-11-04 02:03:19.000000000 +0100 +++ hpoj-0.91.my/mlcd/transport/ExMlcCommandChannel.cpp 2007-07-25 22:45:56.881035333 +0200 @@ -217,19 +217,19 @@ ExMlcTransportChannel::dump(); printf("----------------\n"); printf("pForwardCommandPool=0x%8.8X\n", - (int)pForwardCommandPool); + (long)pForwardCommandPool); printf("pForwardNonconsumingQueue=0x%8.8X\n", - (int)pForwardNonconsumingQueue); + (long)pForwardNonconsumingQueue); printf("pForwardReplyQueue=0x%8.8X\n", - (int)pForwardReplyQueue); + (long)pForwardReplyQueue); printf("pForwardRequestQueue=0x%8.8X\n", - (int)pForwardRequestQueue); + (long)pForwardRequestQueue); printf("forwardRequestCredit: "); forwardRequestCredit.dump(); printf("pCommandReplyTimer=0x%8.8X (count=%d)\n", - (int)pCommandReplyTimer,pCommandReplyTimer->getCount()); + (long)pCommandReplyTimer,pCommandReplyTimer->getCount()); printf("pCommandReplyTimeoutMsg=0x%8.8X\n", - (int)pCommandReplyTimeoutMsg); + (long)pCommandReplyTimeoutMsg); printf("allowErrorPackets=%d\n", allowErrorPackets); printf("lastRequest=0x%2.2X\n", diff -ur hpoj-0.91/mlcd/transport/ExMlcTransport.cpp hpoj-0.91.my/mlcd/transport/ExMlcTransport.cpp --- hpoj-0.91/mlcd/transport/ExMlcTransport.cpp 2003-11-04 02:03:19.000000000 +0100 +++ hpoj-0.91.my/mlcd/transport/ExMlcTransport.cpp 2007-07-25 22:45:56.880035485 +0200 @@ -412,19 +412,19 @@ ExTransportChannel::dump(); printf("----------------\n"); printf("pMlcTransport=0x%8.8X\n", - (int)pMlcTransport); + (long)pMlcTransport); printf("pCommandChannel=0x%8.8X\n", - (int)pCommandChannel); + (long)pCommandChannel); printf("disableCreditCommands=%d\n", disableCreditCommands); printf("pForwardCreditRequestTimer=0x%8.8X\n", - (int)pForwardCreditRequestTimer); + (long)pForwardCreditRequestTimer); printf("pForwardCreditRequestMsg=0x%8.8X\n", - (int)pForwardCreditRequestMsg); + (long)pForwardCreditRequestMsg); printf("pReverseCreditHeartbeatTimer=0x%8.8X\n", - (int)pReverseCreditHeartbeatTimer); + (long)pReverseCreditHeartbeatTimer); printf("pReverseCreditHeartbeatMsg=0x%8.8X\n", - (int)pReverseCreditHeartbeatMsg); + (long)pReverseCreditHeartbeatMsg); printf("musherFirstCreditRequestDelay=%d\n", musherFirstCreditRequestDelay); printf("musherNextCreditRequestDelay=%d\n", @@ -1602,11 +1602,11 @@ ExTransport::dump(); printf("----------------\n"); printf("pForwardHeaderPool=0x%8.8X\n", - (int)pForwardHeaderPool); + (long)pForwardHeaderPool); printf("mlcChannelArray=0x%8.8X\n", - (int)mlcChannelArray); + (long)mlcChannelArray); printf("pCommandChannel=0x%8.8X\n", - (int)pCommandChannel); + (long)pCommandChannel); printf("grcState=%d\n", grcState); printf("reverseDataStopped=%d\n", diff -ur hpoj-0.91/mlcd/transport/ExTransport.cpp hpoj-0.91.my/mlcd/transport/ExTransport.cpp --- hpoj-0.91/mlcd/transport/ExTransport.cpp 2003-11-04 02:03:19.000000000 +0100 +++ hpoj-0.91.my/mlcd/transport/ExTransport.cpp 2007-07-25 22:45:56.881035333 +0200 @@ -71,9 +71,9 @@ #ifdef JD_DEBUGLITE void ExLookup::dump(void) { printf("sizeof(ExLookup)=%d, this=0x%8.8X\n", - sizeof(ExLookup),(int)this); + sizeof(ExLookup),(long)this); printf("pService=0x%8.8X\n", - (int)pService); + (long)pService); printf("serviceName='%s' (len=%d)\n", serviceName,strlen(serviceName)); printf("socketID=%d\n", @@ -317,7 +317,7 @@ #ifdef JD_DEBUGLITE void ExTransportChannel::dump(void) { printf("this=0x%8.8X\n", - (int)this); + (long)this); printf("port=%d\n", port); printf("channel=%d\n", @@ -325,11 +325,11 @@ printf("localSocket=%d\n", localSocket); printf("pTransport=0x%8.8X\n", - (int)pTransport); + (long)pTransport); printf("pMgr=0x%8.8X\n", - (int)pMgr); + (long)pMgr); printf("pPhysicalPort=0x%8.8X\n", - (int)pPhysicalPort); + (long)pPhysicalPort); printf("openingAnySetFlags=0x%4.4X\n", openingAnySetFlags); printf("closingAnySetFlags=0x%4.4X\n", @@ -341,7 +341,7 @@ printf("countOpenFailure=%d\n", countOpenFailure.get()); printf("pService=0x%8.8X\n", - (int)pService); + (long)pService); printf("scd=0x%8.8X\n", (int)scd); printf("forwardDataPriority=%d\n", @@ -370,10 +370,10 @@ countReverseBufferReturns.get()); #ifdef JD_DEBUGLITE // Redundant ifdef, I know. printf("lastReverseBuffer=0x%8.8X\n", - (int)lastReverseBuffer); + (long)lastReverseBuffer); #endif printf("currentForwardBuffer=0x%8.8X\n", - (int)currentForwardBuffer); + (long)currentForwardBuffer); printf("currentGrabbedCredit=%d\n", currentGrabbedCredit); printf("currentGrabbedTransaction=%d\n", @@ -925,31 +925,31 @@ int channel; printf("this=0x%8.8X\n", - (int)this); + (long)this); printf("port=%d\n", port); printf("pMgr=0x%8.8X\n", - (int)pMgr); + (long)pMgr); printf("pPhysicalPort=0x%8.8X\n", - (int)pPhysicalPort); + (long)pPhysicalPort); printf("forwardTransactionCounter: "); forwardTransactionCounter.dump(); printf("channelCount=%d\n", channelCount); printf("channelArray=0x%8.8X\n", - (int)channelArray); + (long)channelArray); for (channel=0;channel<channelCount;channel++) { printf("channelArray[%d]=0x%8.8X\n", - channel,(int)channelArray[channel]); + channel,(long)channelArray[channel]); } printf("overheadBufferCount=%d\n", overheadBufferCount); printf("pNextTransport=0x%8.8X\n", - (int)pNextTransport); + (long)pNextTransport); printf("pForwardDataTimer=0x%8.8X (count=%d)\n", - (int)pForwardDataTimer,pForwardDataTimer->getCount()); + (long)pForwardDataTimer,pForwardDataTimer->getCount()); printf("pForwardDataTimeoutMsg=0x%8.8X\n", - (int)pForwardDataTimeoutMsg); + (long)pForwardDataTimeoutMsg); printf("reverseDataBufferCount=%d\n", reverseDataBufferCount); printf("reverseDataBufferSize=%d\n", @@ -967,7 +967,7 @@ int depth=lookupQueue.depth(); ExLookup *pLookupRequest=lookupQueue.peek(); printf("lookupQueue: depth=%d, peek=0x%8.8X\n", - depth,(int)pLookupRequest); + depth,(long)pLookupRequest); if (pLookupRequest) { pLookupRequest->dump(); } @@ -1101,7 +1101,7 @@ ExMsg *pMsg=pMgr->getFreeMsg(); pMsg->setType(eEXMSG_ACTIVATE_WAIT); - pMsg->setParams(eEXCLASS_TRANSPORT,(int)this); + pMsg->setParams(eEXCLASS_TRANSPORT,(long)this); pMsg->send(pMgr); } @@ -1248,7 +1248,7 @@ ExMsg *pMsg=pMgr->getFreeMsg(); pMsg->setType(eEXMSG_ACTIVATE_RESPONSE); - pMsg->setParams(eEXCLASS_TRANSPORT,(int)this,status); + pMsg->setParams(eEXCLASS_TRANSPORT,(long)this,status); pMsg->send(pMgr); } @@ -1282,7 +1282,7 @@ ExMsg *pMsg=pMgr->getFreeMsg(); pMsg->setType(eEXMSG_DEACTIVATE_RESPONSE); - pMsg->setParams(eEXCLASS_TRANSPORT,(int)this,status); + pMsg->setParams(eEXCLASS_TRANSPORT,(long)this,status); pMsg->send(pMgr); } -- Dott. Ing. Sandro Bonazzola ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ HPLIP-Help mailing list HPLIP-Help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hplip-help