public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* software unplug and plug USB
@ 2007-09-28 10:56 Miguel
  0 siblings, 0 replies; 10+ messages in thread
From: Miguel @ 2007-09-28 10:56 UTC (permalink / raw)
  To: lkml

hi,

I'm using a huawei E220 modem and occasionally it doesn't work and I
must unplug and plug it again, run the scripts connection to make it
works again.
how can I unplug an plug an USB modem via software?

The other problem is that this device is recognized like a cd rom
although I have patch my kernel 2.6.17. here is the var/messages:


Sep 28 12:53:41 ecar kernel: [17179613.972000]   Vendor: HUAWEI
Model: Mass Storage      Rev: 2.31
Sep 28 12:53:41 ecar kernel: [17179613.972000]   Type:   CD-ROM
ANSI SCSI revision: 02
Sep 28 12:53:41 ecar kernel: [17179613.996000] sr0: scsi3-mmc drive:
65x/349x xa/form2 cdda tray
Sep 28 12:53:41 ecar kernel: [17179613.996000] Uniform CD-ROM driver
Revision: 3.20


could anybody help me?

regards,

mike



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
@ 2007-09-28 12:17 Tomasz Chmielewski
  2007-10-01  7:36 ` Miguel
  0 siblings, 1 reply; 10+ messages in thread
From: Tomasz Chmielewski @ 2007-09-28 12:17 UTC (permalink / raw)
  To: Miguel; +Cc: LKML

> I'm using a huawei E220 modem and occasionally it doesn't work and I
> must unplug and plug it again, run the scripts connection to make it
> works again.
> how can I unplug an plug an USB modem via software?

If the modem doesn't have any other power sources than USB, just 
removing the modem's and USB modules, and the modprobing them again 
should help.

Just take care if you have it connected to the PC with a USB keyboard ;)


-- 
Tomasz Chmielewski
http://blog.wpkg.org


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-09-28 12:17 software unplug and plug USB Tomasz Chmielewski
@ 2007-10-01  7:36 ` Miguel
  2007-10-01  7:39   ` Tomasz Chmielewski
  0 siblings, 1 reply; 10+ messages in thread
From: Miguel @ 2007-10-01  7:36 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: LKML

actually, I have a USB keyboard, could that be the problem? why?

removing and adding modules doesn't solve my problem... The USB has
several functions: modem and usb mass storage and only the storage one
is recognized 
:(

any thoughts?

On Fri, 2007-09-28 at 14:17 +0200, Tomasz Chmielewski wrote:
> > I'm using a huawei E220 modem and occasionally it doesn't work and I
> > must unplug and plug it again, run the scripts connection to make it
> > works again.
> > how can I unplug an plug an USB modem via software?
> 
> If the modem doesn't have any other power sources than USB, just 
> removing the modem's and USB modules, and the modprobing them again 
> should help.
> 
> Just take care if you have it connected to the PC with a USB keyboard ;)
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01  7:36 ` Miguel
@ 2007-10-01  7:39   ` Tomasz Chmielewski
  2007-10-01  8:18     ` Miguel
  0 siblings, 1 reply; 10+ messages in thread
From: Tomasz Chmielewski @ 2007-10-01  7:39 UTC (permalink / raw)
  To: Miguel; +Cc: LKML

Miguel schrieb:
> actually, I have a USB keyboard, could that be the problem? why?

Because when you remove USB modules, USB devices, including USB 
keyboards, won't work...


> removing and adding modules doesn't solve my problem... The USB has
> several functions: modem and usb mass storage and only the storage one
> is recognized 
> :(

What modules exactly do you unload/load again, in what order, using 
which commands?


-- 
Tomasz Chmielewski
http://blog.wpkg.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01  7:39   ` Tomasz Chmielewski
@ 2007-10-01  8:18     ` Miguel
  2007-10-01  8:30       ` Jiri Slaby
                         ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Miguel @ 2007-10-01  8:18 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: LKML

I also have a mobile phone connected, a gps and a keyboard, i do the
following:


ecar@ecar:~$ lsmod | grep usb
usbserial              29928  1 pl2303
usbtouchscreen          8708  0 
usbcore               130304  7
libusual,pl2303,usbserial,usbtouchscreen,ehci_hcd,uhci_hcd
ecar@ecar:~$ rmmod pl2303
ERROR: Removing 'pl2303': Operation not permitted
ecar@ecar:~$ sudo rmmod pl2303
ecar@ecar:~$ sudo rmmod usbserial
ecar@ecar:~$ modprobe usbserial
FATAL: Error inserting usbserial
(/lib/modules/2.6.17-11-386/kernel/drivers/usb/serial/usbserial.ko):
Operation not permitted
(reverse-i-search)`mod': cd backup_modules/
(reverse-i-search)`modpro': sudo modprobe  ehci_hcd
ecar@ecar:~$ sudo modprobe usbserial vendor=0x12d1 product=0x1003
ecar@ecar:~$ lsmod | grep usb
usbserial              29928  0 
usbtouchscreen          8708  0 
usbcore               130304  6
usbserial,libusual,usbtouchscreen,ehci_hcd,uhci_hcd


but only when I unplug and plug manually, the modem starts up ...
Because of that i wanted to unplug/plug via scripting (software way)

On Mon, 2007-10-01 at 09:39 +0200, Tomasz Chmielewski wrote:
> Miguel schrieb:
> > actually, I have a USB keyboard, could that be the problem? why?
> 
> Because when you remove USB modules, USB devices, including USB 
> keyboards, won't work...
> 
> 
> > removing and adding modules doesn't solve my problem... The USB has
> > several functions: modem and usb mass storage and only the storage one
> > is recognized 
> > :(
> 
> What modules exactly do you unload/load again, in what order, using 
> which commands?
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01  8:18     ` Miguel
@ 2007-10-01  8:30       ` Jiri Slaby
  2007-10-01  9:58       ` Oliver Neukum
  2007-10-01 10:04       ` Tomasz Chmielewski
  2 siblings, 0 replies; 10+ messages in thread
From: Jiri Slaby @ 2007-10-01  8:30 UTC (permalink / raw)
  To: Miguel; +Cc: Tomasz Chmielewski, LKML

On 10/01/2007 10:18 AM, Miguel wrote:
> but only when I unplug and plug manually, the modem starts up ...
> Because of that i wanted to unplug/plug via scripting (software way)

You might try this (bottom of the page):
http://lkml.org/lkml/2007/5/28/193

regards,
-- 
Jiri Slaby (jirislaby@gmail.com)
Faculty of Informatics, Masaryk University

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01  8:18     ` Miguel
  2007-10-01  8:30       ` Jiri Slaby
@ 2007-10-01  9:58       ` Oliver Neukum
  2007-10-01 10:04       ` Tomasz Chmielewski
  2 siblings, 0 replies; 10+ messages in thread
From: Oliver Neukum @ 2007-10-01  9:58 UTC (permalink / raw)
  To: Miguel; +Cc: Tomasz Chmielewski, LKML

Am Montag 01 Oktober 2007 schrieb Miguel:
> but only when I unplug and plug manually, the modem starts up ...
> Because of that i wanted to unplug/plug via scripting (software way)

You can use the bind & unbind attributes in sysfs.

	Regards
		Oliver


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01  8:18     ` Miguel
  2007-10-01  8:30       ` Jiri Slaby
  2007-10-01  9:58       ` Oliver Neukum
@ 2007-10-01 10:04       ` Tomasz Chmielewski
  2007-10-01 10:46         ` Miguel
  2 siblings, 1 reply; 10+ messages in thread
From: Tomasz Chmielewski @ 2007-10-01 10:04 UTC (permalink / raw)
  To: Miguel; +Cc: LKML

Miguel schrieb:
> I also have a mobile phone connected, a gps and a keyboard, i do the
> following:
> 
> 
> ecar@ecar:~$ lsmod | grep usb
> usbserial              29928  1 pl2303
> usbtouchscreen          8708  0 
> usbcore               130304  7
> libusual,pl2303,usbserial,usbtouchscreen,ehci_hcd,uhci_hcd
> ecar@ecar:~$ rmmod pl2303
> ERROR: Removing 'pl2303': Operation not permitted
> ecar@ecar:~$ sudo rmmod pl2303
> ecar@ecar:~$ sudo rmmod usbserial

  Only then It's not enough. You also have to remove ehci_hcd / uhci_hcd 
/ ohci_hcd.the device will be powered off (unless the method described 
in the link given by Jiri Slaby powers the device off, too).


> ecar@ecar:~$ modprobe usbserial
> FATAL: Error inserting usbserial
> (/lib/modules/2.6.17-11-386/kernel/drivers/usb/serial/usbserial.ko):
> Operation not permitted
> (reverse-i-search)`mod': cd backup_modules/

cd backup_modules/? Where do you keep your modules?


-- 
Tomasz Chmielewski
http://blog.wpkg.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01 10:04       ` Tomasz Chmielewski
@ 2007-10-01 10:46         ` Miguel
  2007-10-01 11:13           ` Jiri Slaby
  0 siblings, 1 reply; 10+ messages in thread
From: Miguel @ 2007-10-01 10:46 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: LKML

if I remove ehci_hcd / uhci_hcd / ohci_hcd , some other devices like
touchscreen, GPS and keyboard could stop working.

backup_modules doesn't matter here, is my personal backup. I have tried
also to recompile some modules because some times my modem huaweis is
recognized like usb mass storage.

I will try a how to guide to do what oliver commented

"You can use the bind & unbind attributes in sysfs"

where can i find information about that?

kindest regards


On Mon, 2007-10-01 at 12:04 +0200, Tomasz Chmielewski wrote:
> ehci_hcd / uhci_hcd 
> / ohci_hcd 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: software unplug and plug USB
  2007-10-01 10:46         ` Miguel
@ 2007-10-01 11:13           ` Jiri Slaby
  0 siblings, 0 replies; 10+ messages in thread
From: Jiri Slaby @ 2007-10-01 11:13 UTC (permalink / raw)
  To: Miguel; +Cc: Tomasz Chmielewski, LKML

On 10/01/2007 12:46 PM, Miguel wrote:
> if I remove ehci_hcd / uhci_hcd / ohci_hcd , some other devices like
> touchscreen, GPS and keyboard could stop working.
> 
> backup_modules doesn't matter here, is my personal backup. I have tried
> also to recompile some modules because some times my modem huaweis is
> recognized like usb mass storage.
> 
> I will try a how to guide to do what oliver commented
> 
> "You can use the bind & unbind attributes in sysfs"
> 
> where can i find information about that?

gee, here:
http://lkml.org/lkml/2007/5/28/193

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-10-01 11:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-28 12:17 software unplug and plug USB Tomasz Chmielewski
2007-10-01  7:36 ` Miguel
2007-10-01  7:39   ` Tomasz Chmielewski
2007-10-01  8:18     ` Miguel
2007-10-01  8:30       ` Jiri Slaby
2007-10-01  9:58       ` Oliver Neukum
2007-10-01 10:04       ` Tomasz Chmielewski
2007-10-01 10:46         ` Miguel
2007-10-01 11:13           ` Jiri Slaby
  -- strict thread matches above, loose matches on Subject: below --
2007-09-28 10:56 Miguel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox