Re: Linux cdc-acm-driver

2012-03-06 Thread Greg KH
On Tue, Mar 06, 2012 at 11:30:33AM +0400, tamerlan311 wrote:
 2012/3/6 Greg KH gre...@linuxfoundation.org
 
 On Mon, Mar 05, 2012 at 03:24:17PM +0400, tamerlan311 wrote:
  This kernel module was completely stable.
  But i think that i should do some clean up code before upstream it.
 
 There's no need to do that now, you can always send follow-on patches
 doing that.
 
 Ok.
  
 
 
  Was planned for future developments:
  implement write to device support. (I do not know why, but this feature
 was
  implemented in original source)
 
 How can a barcode scanner be written to?
 
 Official service software can configure scanner via Bi-Directional port mode.
 Instead of special barcode for config.
 
 
 
  implement work in UNI-Directional mode (0c2e:0710)
 
  I am busy working, but I'll try to finish in few week.
 
 How about I take what you have now, that ensures we make the 3.4 kernel
 release deadline, and then you send follow-on patches for the other
 things as you work on them?  That way people can use the driver now,
 which is what they want to do :)
 
 
 I do not mind, it's a great idea!
 still need some kind of reaction from me at now?

No, I can take the code as-is and create a patch and add it to the tree
if you don't want to do that.  I'll try to do it by the end of this week
and I'll cc: you on the patch.

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux cdc-acm-driver

2012-03-05 Thread Greg KH
On Mon, Mar 05, 2012 at 03:24:17PM +0400, tamerlan311 wrote:
 This kernel module was completely stable.
 But i think that i should do some clean up code before upstream it.

There's no need to do that now, you can always send follow-on patches
doing that.

 Was planned for future developments:
 implement write to device support. (I do not know why, but this feature was
 implemented in original source)

How can a barcode scanner be written to?

 implement work in UNI-Directional mode (0c2e:0710)
 
 I am busy working, but I'll try to finish in few week.

How about I take what you have now, that ensures we make the 3.4 kernel
release deadline, and then you send follow-on patches for the other
things as you work on them?  That way people can use the driver now,
which is what they want to do :)

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux cdc-acm-driver

2012-03-02 Thread Manavendra Nath Manav
Hi Stefan

On Thu, Mar 1, 2012 at 7:51 PM, Stefan Dreyer
stefan.dre...@ddnetservice.net wrote:
 Hi,



 Am 01.03.2012 14:57, schrieb Manavendra Nath Manav:

 The Metrologic scanner is working perfectly in bi-directional serial
 mode. But when I configure it as USB HID Keyboard mode as shown in the
 link and keyboard layout as US-English, I am not getting any data from
 Scanner. I have opened a terminal and scanned multiple barcodes but no
 output on screen.

 [root@pe1800xs e518816]# dmesg
 [98498.945783] input: Honeywell Scanning and Mobility Honeywell
 Scanning and Mobility Scanner as
 /devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
 [98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
 v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
 Mobility Scanner] on usb-:00:1d.1-2/input0

 [root@pe1800xs e518816]# lsusb -v
 Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner
 [root@pe1800xs e518816]# cat /proc/bus/usb/devices
 T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0c2e ProdID=0200 Rev=58.88
 S:  Manufacturer=Honeywell Scanning and Mobility
 S:  Product=Honeywell Scanning and Mobility Scanner
 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

 Can you help me in getting data from Scanner in USB HID Keyboard
 Emulation mode as this would reduce the burden of using an extra
 driver and the application program can read directly from the
 emulation keyboard instead of listening to serial device.


 For me, that looks good. But i never have any problems using the scanner in
 Keyboard-Mode. Are all the necessary drivers loaded
 (usbcore,hid,usbhid,...)
 What happens, if you plug a new USB-Keyboard in. Does it works? Did you try
 to recall factory-settings before? Maybe the Keyboard-mode is disabled
 somewhere else.

 you can test all the input-devices, in directory /dev/input there must be
 device-files named event0 ... eventN (You could identify it via directory:
 /dev/input/by-id, if you have it on fedora 14)
 you can test them via
 # cat /dev/input/event9 | hexdump
 If you scan codes, the hexdump of the keycodes is shown.


I scanned all the required bar-codes to make Metrologic MS1690 work as
USB HID Keyboard, it is being detected and driver usbhid attached to
it, but I am not able to see any output on console. The output is fine
when it is configured in serial mode. However, hexdump shows keycodes.
I attached another standard USB Dell keyboard and it is working fine.

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-:00:1d.1-2/input0

[root@pe1800xs input]# cat /proc/bus/usb/devices
T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0200 Rev=58.88
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

[root@pe1800xs ~]# ll /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 Feb 29 15:46
usb-Dell_Dell_QuietKey_Keyboard-event-kbd - ../event2
lrwxrwxrwx 1 root root 9 Feb 29 17:17
usb-Dell_Dell_USB_Entry_Keyboard-event-kbd - ../event5
lrwxrwxrwx 1 root root 9 Mar  1 19:10
usb-Honeywell_Scanning_and_Mobility_Honeywell_Scanning_and_Mobility_Scanner-event-kbd
- ../event6

[root@pe1800xs input]# cat event6 | hexdump
000 8be0 4f50 ef90 0009 0004 0004 0027 0007
010 8be0 4f50 ef97 0009 0001 000b 0001 
020 8be0 4f50 ef98 0009    
030 8be0 4f50 0ecf 000a 0004 0004 0027 0007
040 8be0 4f50 0ed4 000a 0001 000b  
050 8be0 4f50 0ed5 000a    
*** snip ***

I am getting hexdump after scanning bar-codes, but why it is not
coming on console as it should like a standard keyboard.

-- 
Manavendra Nath Manav

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux cdc-acm-driver

2012-03-02 Thread Manavendra Nath Manav
On Fri, Mar 2, 2012 at 2:50 PM, Stefan Dreyer
stefan.dre...@ddnetservice.net wrote:
 Hi,

 Am 02.03.2012 10:05, schrieb Manavendra Nath Manav:

 Hi Stefan

 On Thu, Mar 1, 2012 at 7:51 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net  wrote:

 Hi,



 Am 01.03.2012 14:57, schrieb Manavendra Nath Manav:

 The Metrologic scanner is working perfectly in bi-directional serial
 mode. But when I configure it as USB HID Keyboard mode as shown in the
 link and keyboard layout as US-English, I am not getting any data from
 Scanner. I have opened a terminal and scanned multiple barcodes but no
 output on screen.

 [root@pe1800xs e518816]# dmesg
 [98498.945783] input: Honeywell Scanning and Mobility Honeywell
 Scanning and Mobility Scanner as
 /devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
 [98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
 v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
 Mobility Scanner] on usb-:00:1d.1-2/input0

 [root@pe1800xs e518816]# lsusb -v
 Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner
 [root@pe1800xs e518816]# cat /proc/bus/usb/devices
 T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0c2e ProdID=0200 Rev=58.88
 S:  Manufacturer=Honeywell Scanning and Mobility
 S:  Product=Honeywell Scanning and Mobility Scanner
 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

 Can you help me in getting data from Scanner in USB HID Keyboard
 Emulation mode as this would reduce the burden of using an extra
 driver and the application program can read directly from the
 emulation keyboard instead of listening to serial device.



 For me, that looks good. But i never have any problems using the scanner
 in
 Keyboard-Mode. Are all the necessary drivers loaded
 (usbcore,hid,usbhid,...)
 What happens, if you plug a new USB-Keyboard in. Does it works? Did you
 try
 to recall factory-settings before? Maybe the Keyboard-mode is disabled
 somewhere else.

 you can test all the input-devices, in directory /dev/input there must be
 device-files named event0 ... eventN (You could identify it via
 directory:
 /dev/input/by-id, if you have it on fedora 14)
 you can test them via
 # cat /dev/input/event9 | hexdump
 If you scan codes, the hexdump of the keycodes is shown.


 I scanned all the required bar-codes to make Metrologic MS1690 work as
 USB HID Keyboard, it is being detected and driver usbhid attached to
 it, but I am not able to see any output on console. The output is fine
 when it is configured in serial mode. However, hexdump shows keycodes.
 I attached another standard USB Dell keyboard and it is working fine.

 [98498.945783] input: Honeywell Scanning and Mobility Honeywell
 Scanning and Mobility Scanner as
 /devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
 [98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
 v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
 Mobility Scanner] on usb-:00:1d.1-2/input0

 [root@pe1800xs input]# cat /proc/bus/usb/devices
 T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0c2e ProdID=0200 Rev=58.88
 S:  Manufacturer=Honeywell Scanning and Mobility
 S:  Product=Honeywell Scanning and Mobility Scanner
 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

 [root@pe1800xs ~]# ll /dev/input/by-id/
 total 0
 lrwxrwxrwx 1 root root 9 Feb 29 15:46
 usb-Dell_Dell_QuietKey_Keyboard-event-kbd -  ../event2
 lrwxrwxrwx 1 root root 9 Feb 29 17:17
 usb-Dell_Dell_USB_Entry_Keyboard-event-kbd -  ../event5
 lrwxrwxrwx 1 root root 9 Mar  1 19:10

 usb-Honeywell_Scanning_and_Mobility_Honeywell_Scanning_and_Mobility_Scanner-event-kbd
 -  ../event6

 [root@pe1800xs input]# cat event6 | hexdump
 000 8be0 4f50 ef90 0009 0004 0004 0027 0007
 010 8be0 4f50 ef97 0009 0001 000b 0001 
 020 8be0 4f50 ef98 0009    
 030 8be0 4f50 0ecf 000a 0004 0004 0027 0007
 040 8be0 4f50 0ed4 000a 0001 000b  
 050 8be0 4f50 0ed5 000a    
 *** snip ***

 I am getting hexdump after scanning bar-codes, but why it is not
 coming on console as it should like a standard keyboard.


 If you get the hexdump, your scanner is configured and working correctly.
 There must be a problem with your console or your X-configuration.



Thanks Stefan, you are right that if I get hexdump then the scanner is
working properly. This test was failing before because I was trying to
get barcodes over Putty terminal emulation which is basically a SSH
session and will not display the keyboard inputs from the host
machine. When I checked on the host machine, it’s 

Re: Linux cdc-acm-driver

2012-03-01 Thread Manavendra Nath Manav
On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
stefan.dre...@ddnetservice.net wrote:
 Hi,

 allthough the answer is offtopic for cdc-acm-driver, i will answer, because
 maybe it helps other people in future.

 I can tell you exactly, what is going on. If the scanner switches to
 ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
 want the scanner let work as serial device, you have to use the driver
 metro-usb. The manufacturer has this driver, but that one is outdatet and
 doesn't compile on actual Linux kernel.
 I found an actual driver, which compiles even with kernel 3.2
 https://gitorious.org/other/metro-usb/commits/master

Thanks a lot for the prompt reply, this should adequately solve my
problem. I am able to download the driver source and compile. However,
I have run into a trivial module format error.

[root@pe1800xs serial]# modinfo metro-usb.ko
filename:       metro-usb.ko
description:    Metrologic Instruments Inc. - USB-POS driver
author:         Aleksey Babahin tamerlan...@gmail.com
author:         Philip Nicastro
license:        GPL
srcversion:     AF4C7DDE2804EBB1578A05F
alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
depends:        usbserial
vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
parm:           vendor:User specified vendor ID (ushort) (ushort)
parm:           product:User specified product ID (ushort) (ushort)

[root@pe1800xs serial]# modprobe -f -v metro-usb
insmod /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
FATAL: Error inserting metro_usb
(/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
Invalid module format

[root@pe1800xs serial]# uname -a
Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
2010 i686 i686 i386 GNU/Linux

[root@pe1800xs serial]# dmesg
[84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP
mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP
mod_unload 686 '

I am running Fedora14 with Force module loading option disabled. How
can I turn it ON without recompiling the kernel. Or, since I have the
souce files of the driver (attached), how can I modify the metro-usb.c
file to provide suitable module version.

--
Manavendra Nath Manav


Makefile
Description: Binary data
/*
  Date Created:	9/15/2006
  File Name:		metro-usb.c
  Description:	metro-usb.c is the drivers main source file. The driver is a USB to Serial converter.
		The driver takes USB data and sends it to a virtual ttyUSB# serial port.
		The driver interfaces with the usbserial.ko driver supplied by Linux. 

		NOTES: 
		To install the driver:
		1. Install the usbserial.ko module supplied by Linux with: # insmod usbserial.ko
		2. Install the metro-usb.ko module with: # insmod metro-usb.ko vender=0x product=0x debug=1
		   The vendor, product and debug parameters are optional.

		Some of this code is credited to Linux USB open source files that are distributed with Linux.

  Copyright:	2007 Metrologic Instruments. All rights reserved.
  Copyright:	2011 Azimut Ltd. http://azimutrzn.ru/
  Requirements: gedit.exe, notepad.exe
 
  Revision History:

  Date:			Developer:			Revisions:		
  --
  1/30/2007		Philip Nicastro		Initial release. (v1.0.0.0)
  2/27/2007		Philip Nicastro		Changed the metrousb_read_int_callback function to use a loop with the tty_insert_flip_char function to copy each byte to the tty layer. Removed the tty_buffer_request_room and the tty_insert_flip_string function calls. These calls were not supported on Fedora.
  2/27/2007		Philip Nicastro		Released. (v1.1.0.0)
  10/07/2011		Aleksey Babahin		Update for new kernel (tested on 2.6.38)
		Add unidirection mode support
 
 
*/

#include linux/kernel.h
#include linux/init.h
#include linux/tty.h
#include linux/module.h
#include linux/usb.h
#include linux/errno.h
#include linux/slab.h
#include linux/tty_driver.h
#include linux/tty_flip.h
#include linux/moduleparam.h
#include linux/spinlock.h
#include asm/uaccess.h
#include linux/errno.h
#include metro-usb.h
#include linux/usb/serial.h

/* Version Information */
#define DRIVER_VERSION v1.2.0.0
#define DRIVER_DESC Metrologic Instruments Inc. - USB-POS driver

/* Device table list. */
static struct usb_device_id id_table [] = {
	{ USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID) },	
	{ USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID_UNI) },
	{ }, /* Optional paramenter entry. */
	{ }, /* Terminating entry. */
};
MODULE_DEVICE_TABLE(usb, id_table);

/* Input parameter constants. */
static int debug;
static __u16 vendor;
static __u16 product;

/* Function prototypes. */
static void metrousb_cleanup (struct usb_serial_port *port);
static void metrousb_close (struct usb_serial_port *port);
static int  metrousb_open (struct tty_struct *tty, struct usb_serial_port 

Re: Linux cdc-acm-driver

2012-03-01 Thread Manavendra Nath Manav
On Thu, Mar 1, 2012 at 3:18 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net wrote:
 Hi,

 allthough the answer is offtopic for cdc-acm-driver, i will answer, because
 maybe it helps other people in future.

 I can tell you exactly, what is going on. If the scanner switches to
 ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
 want the scanner let work as serial device, you have to use the driver
 metro-usb. The manufacturer has this driver, but that one is outdatet and
 doesn't compile on actual Linux kernel.
 I found an actual driver, which compiles even with kernel 3.2
 https://gitorious.org/other/metro-usb/commits/master

 Thanks a lot for the prompt reply, this should adequately solve my
 problem. I am able to download the driver source and compile. However,
 I have run into a trivial module format error.

 [root@pe1800xs serial]# modinfo metro-usb.ko
 filename:       metro-usb.ko
 description:    Metrologic Instruments Inc. - USB-POS driver
 author:         Aleksey Babahin tamerlan...@gmail.com
 author:         Philip Nicastro
 license:        GPL
 srcversion:     AF4C7DDE2804EBB1578A05F
 alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
 alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
 depends:        usbserial
 vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
 parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
 parm:           vendor:User specified vendor ID (ushort) (ushort)
 parm:           product:User specified product ID (ushort) (ushort)

 [root@pe1800xs serial]# modprobe -f -v metro-usb
 insmod 
 /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
 FATAL: Error inserting metro_usb
 (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
 Invalid module format

 [root@pe1800xs serial]# uname -a
 Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
 2010 i686 i686 i386 GNU/Linux

 [root@pe1800xs serial]# dmesg
 [84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP
 mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP
 mod_unload 686 '

 I am running Fedora14 with Force module loading option disabled. How
 can I turn it ON without recompiling the kernel. Or, since I have the
 souce files of the driver (attached), how can I modify the metro-usb.c
 file to provide suitable module version.


I am able to load the metro-usb.ko module now and the scanner works
perfectly.  I opened the serial console using
bash# serial /dev/ttyUSB0 9600
and can see the 1D and 2D scanned barcodes. Thanks :)

[89073.533413] metro-usb 7-1:1.0: Metrologic USB to serial converter.
converter detected
[89073.533489] usb 7-1: Metrologic USB to serial converter. converter
now attached to ttyUSB0

The workaround I did to remove invalid module format error is that I
modified the vermagic.h file.

[root@pe1800xs e518816]# diff
/usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.old
/usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.new
32,33c32
   MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS   \
   MODULE_ARCH_VERMAGIC
---
   MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC

Is this the correct way to resolve the error, although it works for
me? I am sure there would be other better ways to resolve vermagic
conflict errors.

-- 
Manavendra Nath Manav

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux cdc-acm-driver

2012-03-01 Thread Manavendra Nath Manav
Hi Stefan

On Thu, Mar 1, 2012 at 5:48 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 On Thu, Mar 1, 2012 at 3:18 PM, Manavendra Nath Manav
 mnm.ker...@gmail.com wrote:
 On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net wrote:
 Hi,

 allthough the answer is offtopic for cdc-acm-driver, i will answer, because
 maybe it helps other people in future.

 I can tell you exactly, what is going on. If the scanner switches to
 ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
 want the scanner let work as serial device, you have to use the driver
 metro-usb. The manufacturer has this driver, but that one is outdatet and
 doesn't compile on actual Linux kernel.
 I found an actual driver, which compiles even with kernel 3.2
 https://gitorious.org/other/metro-usb/commits/master

 Thanks a lot for the prompt reply, this should adequately solve my
 problem. I am able to download the driver source and compile. However,
 I have run into a trivial module format error.

 [root@pe1800xs serial]# modinfo metro-usb.ko
 filename:       metro-usb.ko
 description:    Metrologic Instruments Inc. - USB-POS driver
 author:         Aleksey Babahin tamerlan...@gmail.com
 author:         Philip Nicastro
 license:        GPL
 srcversion:     AF4C7DDE2804EBB1578A05F
 alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
 alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
 depends:        usbserial
 vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
 parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
 parm:           vendor:User specified vendor ID (ushort) (ushort)
 parm:           product:User specified product ID (ushort) (ushort)

 [root@pe1800xs serial]# modprobe -f -v metro-usb
 insmod 
 /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
 FATAL: Error inserting metro_usb
 (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
 Invalid module format

 [root@pe1800xs serial]# uname -a
 Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
 2010 i686 i686 i386 GNU/Linux

 [root@pe1800xs serial]# dmesg
 [84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP
 mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP
 mod_unload 686 '

 I am running Fedora14 with Force module loading option disabled. How
 can I turn it ON without recompiling the kernel. Or, since I have the
 souce files of the driver (attached), how can I modify the metro-usb.c
 file to provide suitable module version.


 I am able to load the metro-usb.ko module now and the scanner works
 perfectly.  I opened the serial console using
 bash# serial /dev/ttyUSB0 9600
 and can see the 1D and 2D scanned barcodes. Thanks :)

 [89073.533413] metro-usb 7-1:1.0: Metrologic USB to serial converter.
 converter detected
 [89073.533489] usb 7-1: Metrologic USB to serial converter. converter
 now attached to ttyUSB0

 The workaround I did to remove invalid module format error is that I
 modified the vermagic.h file.

 [root@pe1800xs e518816]# diff
 /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.old
 /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.new
 32,33c32
        MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS       \
        MODULE_ARCH_VERMAGIC
 ---
       MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC

 Is this the correct way to resolve the error, although it works for
 me? I am sure there would be other better ways to resolve vermagic
 conflict errors.


The Metrologic scanner is working perfectly in bi-directional serial
mode. But when I configure it as USB HID Keyboard mode as shown in the
link and keyboard layout as US-English, I am not getting any data from
Scanner. I have opened a terminal and scanned multiple barcodes but no
output on screen.

[root@pe1800xs e518816]# dmesg
[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-:00:1d.1-2/input0

[root@pe1800xs e518816]# lsusb -v
Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x0c2e Metro
  idProduct  0x0200 Metrologic Scanner
  bcdDevice   58.88
  iManufacturer   1 Honeywell Scanning and Mobility
  iProduct2 Honeywell Scanning and Mobility Scanner
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   34
   

Re: Linux cdc-acm-driver

2012-03-01 Thread Greg KH
On Thu, Mar 01, 2012 at 03:48:57PM +0530, Manavendra Nath Manav wrote:
 On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net wrote:
  Hi,
 
  allthough the answer is offtopic for cdc-acm-driver, i will answer, because
  maybe it helps other people in future.
 
  I can tell you exactly, what is going on. If the scanner switches to
  ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
  want the scanner let work as serial device, you have to use the driver
  metro-usb. The manufacturer has this driver, but that one is outdatet and
  doesn't compile on actual Linux kernel.
  I found an actual driver, which compiles even with kernel 3.2
  https://gitorious.org/other/metro-usb/commits/master
 
 Thanks a lot for the prompt reply, this should adequately solve my
 problem. I am able to download the driver source and compile. However,
 I have run into a trivial module format error.
 
 [root@pe1800xs serial]# modinfo metro-usb.ko
 filename:       metro-usb.ko
 description:    Metrologic Instruments Inc. - USB-POS driver
 author:         Aleksey Babahin tamerlan...@gmail.com
 author:         Philip Nicastro
 license:        GPL
 srcversion:     AF4C7DDE2804EBB1578A05F
 alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
 alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
 depends:        usbserial
 vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
 parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
 parm:           vendor:User specified vendor ID (ushort) (ushort)
 parm:           product:User specified product ID (ushort) (ushort)

Aleksey, any reason this driver hasn't been submitted upstream yet?  If
you don't mind, I'll be glad to forward port it and get it merged to the
main kernel.org tree.  Or is there some reason we can't do that?

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux cdc-acm-driver

2012-02-29 Thread Manavendra Nath Manav
Hi Johan

On Wed, Feb 29, 2012 at 8:28 PM, Johan Hovold jhov...@gmail.com wrote:
 On Sun, Feb 26, 2012 at 04:37:33PM +0100, Stefan Dreyer wrote:
 Hello Johan,

 i hope, you can help me. I try to get a barcode-Scanner (Metrologic
 Focus MS 1690) to work. If i take a look at the Windows driver, this
 scanner should work in serial-mode as CDC ACM.
 i have added the device:
       { USB_DEVICE(0x0c2e, 0x0720), /*Metro Metrologic MS7120 Barcode Scanner
 (bi-directional serial mode)  */
       },

 and recompile the module. If i plug the device in, the module cdc-acm is
 loaded. But no device ttyACM0 appears.

 What does lsusb -v say? If it is a cdc-acm device you should not need to
 add the pid/vid to the cdc-acm driver.

 What is written to the system logs?

 Is there a possibility to debug the module? I would like to know, what
 happens.

 If your recompiling the module you can enable debugging by changing the
 following undef

        #undef DEBUG

 to define, or you can enable dynamic debugging (see
 Documentation/dynamic-debug-howto.txt).

 Thanks,
 Johan

Sorry for jumping in the middle of the thread, but I too have a
similar problem with Metrologic Focus MS1690 Barcode scanner.
Currently, I am getting the device as bi-directional serial mode but I
want to make it work as a USB HID Keyboard device. In the
manufacturer's manual there is a barcode to configure the device as
such. After this I can see from dmesg that first the device gets
registered as  USB HID v1.11 Keyboard, the I guess the scanner power
cycles disconnecting the USB  and again gets registered as a new
device.

*** dmesg snip ***
[69818.065741] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci:00/:00:1d.1/usb7/7-1/7-1:1.0/input/input6
[69818.065810] generic-usb 0003:0C2E:0200.0003: input,hidraw2: USB HID
v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-:00:1d.1-1/input0
[69823.804854] usb 7-1: USB disconnect, address 2
[69827.180717] usb 7-1: new low speed USB device using uhci_hcd and address 3
[69827.355585] usb 7-1: New USB device found, idVendor=0c2e, idProduct=0720
[69827.355590] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[69827.355593] usb 7-1: Product: Honeywell Scanning and Mobility Scanner
[69827.355596] usb 7-1: Manufacturer: Honeywell Scanning and Mobility

[root@pe1800xs ~]# lsusb -v
Bus 007 Device 003: ID 0c2e:0720 Metro Metrologic MS7120 Barcode
Scanner (bi-dir ectional
serial mode)
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x0c2e Metro
  idProduct  0x0720 Metrologic MS7120 Barcode Scanner
(bi-directional se rial
mode)
  bcdDevice1.00
  iManufacturer   1 Honeywell Scanning and Mobility
  iProduct2 Honeywell Scanning and Mobility Scanner
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   41
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  3 POS USB
bmAttributes 0x80
  (Bus Powered)
MaxPower  450mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0
  bInterfaceProtocol  0
  iInterface  0
  ** UNRECOGNIZED:  09 21 11 01 00 01 22 3f 00
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02  EP 2 OUT
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval  10
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval  10
Device Status: 0x
  (Bus Powered)

[root@pe1800xs ~]# cat /proc/bus/usb/devices
T:  Bus=07 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0720 Rev= 1.00
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner
C:*