FreeBSD Bugzilla – Attachment 99890 Details for
Bug 139094
update port: devel/libpasori: libusb issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.39 KB, created by
Yoshihiko Sarumaru
on 2009-09-23 22:00:08 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Yoshihiko Sarumaru
Created:
2009-09-23 22:00:08 UTC
Size:
3.39 KB
patch
obsolete
>diff -urN libpasori.orig/Makefile libpasori/Makefile >--- libpasori.orig/Makefile 2009-09-24 05:42:52.000000000 +0900 >+++ libpasori/Makefile 2009-09-24 05:44:15.000000000 +0900 >@@ -6,7 +6,7 @@ > > PORTNAME= libpasori > PORTVERSION= 02 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= devel > MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP} > MASTER_SITE_SUBDIR= ${PORTNAME}/20457 >@@ -29,8 +29,8 @@ > .else > @${CP} ${FILESDIR}/Makefile.lib.usb20 ${WRKSRC}/lib/Makefile > .endif >- @${CP} ${FILESDIR}/Makefile.lpdump ${WRKSRC}/lpdump/Makefile >- @${CP} ${FILESDIR}/Makefile.lptest ${WRKSRC}/lptest/Makefile >+ @${CP} ${FILESDIR}/Makefile.lpdump ${WRKSRC}/lptest/Makefile >+ @${CP} ${FILESDIR}/Makefile.lptest ${WRKSRC}/lpdump/Makefile > > post-install: > @${CAT} ${PKGMESSAGE} >diff -urN libpasori.orig/files/patch-libpasori_com_libusb.c libpasori/files/patch-libpasori_com_libusb.c >--- libpasori.orig/files/patch-libpasori_com_libusb.c 1970-01-01 09:00:00.000000000 +0900 >+++ libpasori/files/patch-libpasori_com_libusb.c 2009-09-24 05:32:22.000000000 +0900 >@@ -0,0 +1,75 @@ >+--- src/libpasori_com_libusb.c.orig 2006-03-20 09:12:58.000000000 +0900 >++++ src/libpasori_com_libusb.c 2009-03-09 03:11:29.000000000 +0900 >+@@ -1,13 +1,14 @@ >+ /* libpasori communicate LIBUSB ver. */ >+ >++#include <stdlib.h> >+ #include "libpasori_liblocal.h" >+-#include <usb.h> >+ >+ #define PASORIUSB_VENDOR 0x054c >+-#define PASORIUSB_PRODUCT 0x01bb >++#define PASORIUSB_PRODUCT_RC_S310 0x006c >++#define PASORIUSB_PRODUCT_RC_S320 0x01bb >+ >+ void dbg_dump(unsigned char *b,unsigned int size){ >+- int i; >++ unsigned int i; >+ if(size > 255) size = 255; >+ for(i=0;i!=size;i++){ >+ Log("%02X ",b[i]); >+@@ -25,8 +26,8 @@ >+ pasori* pasori_open(char *p){ /* FIXME: unused arg. */ >+ struct usb_bus *bus; >+ struct usb_device *dev; >+- pasori *pp; >+- pp = (pasori *)malloc(sizeof(pasori)); >++ pasori *pp = NULL; >++ (void)p; >+ usb_init(); >+ #ifdef DEBUG >+ usb_set_debug(255); >+@@ -40,7 +41,8 @@ >+ for(dev = bus->devices; dev ; dev = dev->next){ >+ Log("check for %04x:%04x\n",dev->descriptor.idVendor,dev->descriptor.idProduct); /* debug */ >+ if(dev->descriptor.idVendor == PASORIUSB_VENDOR && >+- dev->descriptor.idProduct== PASORIUSB_PRODUCT){ >++ ((dev->descriptor.idProduct== PASORIUSB_PRODUCT_RC_S310) || >++ (dev->descriptor.idProduct== PASORIUSB_PRODUCT_RC_S320))){ >+ goto finish; >+ } >+ } >+@@ -48,6 +50,7 @@ >+ Log("pasori not found in USB BUS"); >+ return NULL; >+ finish: >++ pp = (pasori *)malloc(sizeof(pasori)); >+ pp->dh = usb_open(dev); >+ pp->dev= dev; >+ >+@@ -66,13 +69,13 @@ >+ } >+ >+ int pasori_send(pasori* pp,uint8* data,uint8 size,int timeout){ /* FIXME: ignore timeout */ >+- uint8 msg[256]; >+ uint8 resp[256]; >+ signed int i; >++ (void)timeout; >+ Log("(send) send:"); >+ dbg_dump(data,size); >+- i = usb_control_msg(pp->dh,USB_TYPE_VENDOR,0,0,0,data,size,400); >+- i = usb_interrupt_read(pp->dh,0x81,resp,256,400); >++ i = usb_control_msg(pp->dh,USB_TYPE_VENDOR,0,0,0,(char*)data,size,400); >++ i = usb_interrupt_read(pp->dh,0x81,(char*)resp,256,400); >+ /* printf("i = %d",i); */ /* debug */ >+ if(i<0) return 1; /* FIXME:HANDLE INVALID RESPONSES */ >+ if(i!=6) return 1; >+@@ -88,7 +91,7 @@ >+ >+ int pasori_recv(pasori* pp,uint8* data,uint8 size,int timeout){ >+ signed int i; >+- i = usb_interrupt_read(pp->dh,0x81,data,size,timeout); >++ i = usb_interrupt_read(pp->dh,0x81,(char*)data,size,timeout); >+ if(i>0){ >+ Log("(recv) recv:"); >+ dbg_dump(data,i);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139094
: 99890