From: Mitsuhiro KOGA <hidden> Date: 2006-08-13 20:47:38
I had a problem with usb2vga and ppc linux.
The background of the console greens, and the font is not displayed.
This patch can be normally displayed by the Big endian machine.
Moreover, because KAIREN's usb2vga has two or more devices id, it adds it.
Signed-off-by: Mitsuhiro Koga <redacted>
Cc: linux-usb-devel@lists.sourceforge.net
Cc: linux-fbdev-devel@lists.sourceforge.net
---
drivers/usb/misc/sisusbvga/sisusb.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
From: "Antonino A. Daplas" <adaplas@gmail.com> Date: 2006-08-15 00:09:21
On Mon, 2006-08-14 at 05:47 +0900, Mitsuhiro KOGA wrote:
Added the author to the CC list.
It would be better if you remove the #ifdef within the functions.
So something like...
quoted hunk
I had a problem with usb2vga and ppc linux.
The background of the console greens, and the font is not displayed.
This patch can be normally displayed by the Big endian machine.
Moreover, because KAIREN's usb2vga has two or more devices id, it adds it.
Signed-off-by: Mitsuhiro Koga <redacted>
Cc: linux-usb-devel@lists.sourceforge.net
Cc: linux-fbdev-devel@lists.sourceforge.net
---
drivers/usb/misc/sisusbvga/sisusb.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Thanks.
I re-fixed the patch according to your advice.
And, because it's used #ifdef in other part, I also fixed it.
Would you please check it?
Signed-off-by: Mitsuhiro Koga <redacted>
---
diff -urp a/drivers/usb/misc/sisusbvga/sisusb.c
b/drivers/usb/misc/sisusbvga/sisusb.c
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Why not merge the #ifdefs, so you need only one?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
I think it is because legibly two functions of the same name queues up.
Of course, both are not cared about either.
--
Mitsuhiro KOGA
[off-list ref]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
@@ -408,7 +465,11 @@ static int sisusb_send_bulk_msg(struct s } else if (fromkern) {- memcpy(buffer, kernbuffer, passsize);+ if ((len & 3) == 0)+ sisusb_memcpy((u16 *)buffer, (u16 *)kernbuffer, passsize / 2);+ else+ memcpy(buffer, kernbuffer, passsize);
What happens if (len & 3) != 0? It ends up doing a regular memcpy()
without the reordering. Better if you move the if (len & 3) == 0 check
to sisusb_memcpy(), so instead of
if ((len & 3) == 0)
sisusb_memcpy((u16 *)buffer, (u16 )kernbuffer, passsize / 2);
else
memcpy(buffer, kernbuffer, passsize);
it simply condenses into
sisusb_memcpy().
@@ -3435,6 +3472,9 @@ static void sisusb_disconnect(struct usb
I would agree with Geert. Combine all into a single #ifdef/#else/#endif.
Since we are still in the reviewing phase, do not submit incremental
patches.
Tony
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
@@ -408,7 +465,11 @@ static int sisusb_send_bulk_msg(struct s } else if (fromkern) {- memcpy(buffer, kernbuffer, passsize);+ if ((len & 3) == 0)+ sisusb_memcpy((u16 *)buffer, (u16 *)kernbuffer, passsize / 2);+ else+ memcpy(buffer, kernbuffer, passsize);
What happens if (len & 3) != 0? It ends up doing a regular memcpy()
without the reordering. Better if you move the if (len & 3) == 0 check
to sisusb_memcpy(), so instead of
if ((len & 3) == 0)
sisusb_memcpy((u16 *)buffer, (u16 )kernbuffer, passsize / 2);
else
memcpy(buffer, kernbuffer, passsize);
(a) if (len & 3) != 0
When former data length is 4 or less, struct sisusb_packet is used.
It becomes 10 in length for writing.
Because data is not used, it becomes 6 in length for reading.
struct sisusb_packet {
unsigned short header;
u32 address;
u32 data;
} __attribute__((__packed__));
(b) if (len & 3) == 0
When former data length is larger than 4,
it corresponds to this case because the length of (data & ~3) is passed.
As for the data of the remainder, the logic of (a) is used.
@@ -3435,6 +3472,9 @@ static void sisusb_disconnect(struct usb
I would agree with Geert. Combine all into a single #ifdef/#else/#endif.
Since we are still in the reviewing phase, do not submit incremental
patches.
Thank you for your advice. I understand.
--
Mitsuhiro KOGA
[off-list ref]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
@@ -408,7 +465,11 @@ static int sisusb_send_bulk_msg(struct s } else if (fromkern) {- memcpy(buffer, kernbuffer, passsize);+ if ((len & 3) == 0)+ sisusb_memcpy((u16 *)buffer, (u16 *)kernbuffer, passsize / 2);+ else+ memcpy(buffer, kernbuffer, passsize);
What happens if (len & 3) != 0? It ends up doing a regular memcpy()
without the reordering. Better if you move the if (len & 3) == 0 check
to sisusb_memcpy(), so instead of
if ((len & 3) == 0)
sisusb_memcpy((u16 *)buffer, (u16 )kernbuffer, passsize / 2);
else
memcpy(buffer, kernbuffer, passsize);
(a) if (len & 3) != 0
When former data length is 4 or less, struct sisusb_packet is used.
It becomes 10 in length for writing.
Because data is not used, it becomes 6 in length for reading.
struct sisusb_packet {
unsigned short header;
u32 address;
u32 data;
} __attribute__((__packed__));
(b) if (len & 3) == 0
When former data length is larger than 4,
it corresponds to this case because the length of (data & ~3) is passed.
As for the data of the remainder, the logic of (a) is used.
The length passed here is not (data & ~3) but (former data length & ~3).
And, variable buffer becomes a character string displayed in the monitor
a couple of byte sequence by two bytes (the character-code and the delimiter).
Because this order reverses for the Big endian, variable buffer is
being replaced.
In the case of (a), sisusb_pack->data is being replaced with
cpu_to_le32 in existing processing,
and because the order of the character reverses for four bytes, data
is being replaced
with sisusb_order_mem_32 further.
Regards,
--
Mitsuhiro KOGA
[off-list ref]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642