How to remove old USB device drivers from Windows? How to disable or enable USB ports in Windows How to reset USB ports.

Good afternoon, dear readers of the blog site, today I want to tell you how to delete data about USB Flash Drives in the Windows registry. This article is a continuation of the article. All information about any USB storage media ever connected to a computer is stored in system registry... If a lot of flash drives are connected to the computer different models and manufacturers, then over time a lot of garbage accumulates in the registry. As a result, the process of identifying and connecting a new device begins to take a significant amount of time and slows down the system.

There is only one way out. You need to periodically clean the registry keys that store data about plug-in flash drives and other USB drives. Clearing these sections will speed up the connection of new USB devices and the operation of the system as a whole.

Cleaning must be done with system program Regedit. It starts like this.
Start - Run - Regedit

Registry keys that store data about any USB drive ever connected to a PC - Flash drives, external hard drives, as well as cameras, phones, flash players and other devices that, when connected to a PC, were recognized as external USB stick... All subsections with the Disc prefix can be deleted here.

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Enum \ USBSTOR
HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \ Enum \ USBSTOR
HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet002 \ Enum \ USBSTOR

The screenshots show that the hubs and HDDs were also connected via the hub

If you don't want to clean it by hand, then there is free software, for example USB Oblivion. Run the utility

Check the box Perform real cleaning

We see that everything is complete and many entries have been deleted from the registry. Let's check the registry. Please note that there is no USBSTOR folder.

Well, let's look at the sequence with the USBDeview program, everything is also clean.

Here are dear readers where the data about your flash drives is stored, so if something needs to be deleted then start.

I use 3G to reserve internet connection modem Huawei E173 connected to USB port router. The connection through it is always up in hot standby mode (to switch to the modem, it is enough to reset the default route from the main connection). But there is one problem - the modem periodically "freezes" and the connection is lost.

Restarting pppd is usually sufficient, but yesterday the modem stopped responding altogether. Messages appeared in the log that relate to hardware problems.

Xhci_hcd 0000: 02: 00.0: WARN Event TRB for slot 1 ep 4 with no TDs queued? xhci_hcd 0000: 02: 00.0: WARN Event TRB for slot 1 ep 4 with no TDs queued? xhci_hcd 0000: 02: 00.0: WARN Event TRB for slot 1 ep 4 with no TDs queued? xhci_hcd 0000: 02: 00.0: ERROR Transfer event TRB DMA ptr not part of current TD xhci_hcd 0000: 02: 00.0: ERROR Transfer event TRB DMA ptr not part of current TD xhci_hcd 0000: 02: 00.0: ERROR Transfer event TRB DMA ptr not part of current TD
Restarting pppd gave nothing, it seems the modem is not responding to any command.

Apr 24 10:02:11 inet chat: abort on (\ nBUSY \ r) Apr 24 10:02:11 inet chat: abort on (\ nERROR \ r) Apr 24 10:02:11 inet chat: abort on (\ nNO ANSWER \ r) Apr 24 10:02:11 inet chat: abort on (\ nNO CARRIER \ r) Apr 24 10:02:11 inet chat: abort on (\ nNO DIALTONE \ r) Apr 24 10:02:11 inet chat: abort on (\ nRINGING \ r \ n \ r \ nRINGING \ r) Apr 24 10:02:11 inet chat: send (^ MAT ^ M) Apr 24 10:02:11 inet chat: timeout set to 12 seconds Apr 24 10:02:11 inet chat: expect (OK) Apr 24 10:02:23 inet chat: alarm Apr 24 10:02:23 inet chat: Failed
Attempts to reinitialize the modem programmatically failed because its device (/ dev / ttyUSB0) does not respond to AT commands. It remains only to disconnect and reconnect the modem to the port. But first I decided to try a method that I came across recently on the Internet.

To reset the desired USB bus we need to compile the binary. In order not to compile it again every time and use it on almost any machine, I will compile it statically.

$ wget https://gist.githubusercontent.com/x2q/5124616/raw -O usbreset.c $ gcc -Wall -static -o usbreset usbreset.c $ sudo install -o root -g root -m 0755 usbreset / usr / local / sbin $ lsusb | grep Huawei Bus 001 Device 002: ID 12d1: 1001 Huawei Technologies Co., Ltd. E169 / E620 / E800 HSDPA Modem $ sudo usbreset / dev / bus / usb / 001/002 Error in ioctl: No such device
In spite of the error in the log, there are entries indicating the "reboot" of the modem.

$ dmesg | tail usb 1-6: New USB device strings: Mfr = 3, Product = 2, SerialNumber = 0 usb 1-6: Product: HUAWEI Mobile usb 1-6: Manufacturer: HUAWEI Technology usb 1-6: configuration # 1 chosen from 1 choice option 1-6: 1.0: GSM modem (1-port) converter detected usb 1-6: GSM modem (1-port) converter now attached to ttyUSB0 option 1-6: 1.1: GSM modem (1-port) converter detected usb 1-6: GSM modem ( 1-port) converter now attached to ttyUSB1 option 1-6: 1.2: GSM modem (1-port) converter detected usb 1-6: GSM modem (1-port) converter now attached to ttyUSB2
Let's try to connect to it and execute several AT commands.

The program can reset the channel using the channel reset register. The channel configuration and data marker remain unchanged. Only banks and status bits are returned to their original state.

For full reset the program must disable the channel and then enable the channel.

23.11. Access to channel data

To write to or read from a FIFO channel, the CPU must select the channel number using the UPNUM register and write or read data from the UPDATX register.

23.12. Organization of the control channel

The control gear consists of three phases:

  • SETUP,
  • data (IN or OUT),
  • status (OUT or IN).

The software must change the marker after each phase. Initially, data markers are set as follows (for control channels only):

  • SETUP: Data0,
  • OUT: Data1,
  • IN: Data1 (waiting for data marker change).

23.13. OUT channels control

Initially, the channel must be configured and not stopped. Note: if software switches to suspend mode (SOFEN reset) even if the bank is ready to be sent, the USB controller will automatically exit suspend and the bank will be sent.

The TXOUT bit is set in hardware when the current bank is released. This results in an interrupt if the TXOUTE bit is set. The FIFOCON bit is set at the same time. The CPU writes data to the FIFO and clears the FIFOCON bit to allow the USB controller to send data. If the OUT channel consists of several banks, then it also switches to the next data bank. The TXOUT and FIFOCON bits change according to the state of the new bank.


23.14. Controlling IN channels

Initially, the channel must be configured. Before the host requests data from the device, the program must set the IN transfer mode using the INMODE bit:

  • INMODE = 0. The INRQX register is taken into account. The host controller makes a data request (INRQX + 1) times on the selected channel before stopping the channel. This mode avoids unnecessary data requests through the channel.
  • INMODE = 1. The USB controller continually sends an IN request for data until the program stops the channel.

The data request starts after the PFREEZE bit is cleared. Each time the current bank is full, the RXIN and FIFOCON bits are set. The program can acknowledge receipt of the interrupt by clearing the RXIN bit. The program reads the data and clears the FIFOCON bit to free the current bank. If an IN channel consists of multiple channels, clearing FIFOCON will switch to the next bank. The RXIN and FIFOCON bits change according to the state of the new bank.

23.14.1. CRC error(only for isochronous channels)

A CRC error can occur when receiving data if the USB controller receives a corrupted packet. In this situation, a STALLEDI / CRCERRI interrupt occurs. This does not prevent the RXINI interrupt from occurring.

The device (modem) that really went off. Sometimes it works great, but other times it refuses to connect. The only solution I have found to fix it when it gets into a bad state is to physically unplug the device and plug it back in. However, I don't always have physical access to the computer to which it is connected, M is looking for a way to do this through the command line.

This article assumes running:

$ sudo modprobe -w -r usb_storage; sudo modprobe usb_storage

However, I get "unknown option -w". This slightly modified command:

$ sudo modprobe -r usb_storage

Error with FATAL message: usb_storage module is being used. If I try to kill -9 processes marked before starting, they refuse to die (I think because they are heavily tied to the kernel).

Does anyone know how to do this?

NOTE. I cross-posted this on the server as I didn't know which would be more appropriate. I will delete and / or contact whoever gets answered first.

5 Solutions collect form web for “USB Hard Reset in Ubuntu 10.04”

I have Ubuntu 14.04.4. I have no idea if this works in 10.04. I tested it on Cyborg Rumble Pad (and a generic USB stick).

Immediately after connecting the device:

Dmesg | grep usb | tail -n 20

I get (perhaps by the way):

[2875.790610] usb 2-1.2: new full-speed USB device number 7 using ehci-pci [2875.887485] usb 2-1.2: New USB device found, idVendor = 0738, idProduct = cb02 [2875.887489] usb 2-1.2: New USB device strings: Mfr = 1, Product = 2, SerialNumber = 3 [2875.887490] usb 2-1.2: Product: Cyborg Rumble Pad - PC / Xbox 360 [2875.887492] usb 2-1.2: Manufacturer: Saitek [2875.887493] usb 2-1.2 : SerialNumber: 0CFE6B97

2-1.2 part - line 2-1.2. It identifies the USB port. The good news is that it shouldn't change unless I connect the device to a different port, so I only need to get the string once.

Then I go to the right place:

Cd / sys / bus / usb / drivers / usb

And call as root(for example sudo bash):

Echo 2-1.2> unbind; sleep 3; echo 2-1.2> bind

As a result, my Rumble Pad reinitializes itself as if it were on and off again. I also tested my USB stick. It (its LED) behaves like nothing happened, but my KDE reacts and asks if I want to mount.

Powering the device all the time. This method will not work if your modem is reset due to power outage.

You are just looking for the device you want to dump (lsusb):

# lsusb Bus 005 Device 004: ID 0951: 1642 Kingston Technology DT101 G2

And then:

# usbreset / dev / bus / usb / 005/004

Why are you trying to unload the usb_storage module when your device is a USB modem?

Sudo lshw and find the entry for your USB tethering. There should be a configuration: line like this (your driver will be different, obviously):

Configuration: ... driver = iwlagn ...

Make sure the module is loaded (substituting the correct driver name):

Lsmod | grep iwlagn

Then just do:

Sudo modprobe -r iwlagn && sleep 2 && sudo modprobe iwlagn

I like to sleep there just in case the device takes a while to turn off the power.

This is a "way out" solution, but it might work.

  • Get a second, old, not very powerful PC. Install Debian on it. Install usbip on it.
  • Then install usbip on your server.
  • Connect the modem to the second PC. Configure usbip on both machines so that the modem connected to the second PC is accessible via VHCI from the server.
  • Set up ssh on the second PC or other means that you can remove to it and issue commands.
  • When the device fails, login and reboot the second computer with the reboot command, and then when it comes back, reconnect by whatever means, usbip provides usbip (I've never used usbip). This should reset the device. You could probably write this.

The easiest way to disconnect arbitrary USB devices from command line(i.e. with real power cycle to USB):

  1. Buy DELOCK 87445 4-port USB hub (google for )
  2. This hardware is compatible with hub-ctrl.c (google for ). Therefore, arbitrary ports can be enabled / disabled. Additional information see also at:.