Remove USB Host Controller driver from Linux - linux-device-driver

Can you please let me know how do i disable/remove the USB Host Controller driver from the kernel. Is there a way I can unhook the usb driver module from the kernel.
Linux 2.6.24.7-r1116 / Fedora

sudo lsmod | grep ohci
sudo lsmod | grep ehci
If these commands show nothing - then your host controller drivers are compilled into the kernel. Otherwise rmmod all modules, that my commands show.
This is a programmer question. I've used this techinque while debugging hotplug of my USB device in my device driver.

Related

Raspberry Pi Zero W not interacting with GSM HAT

I have Raspberry Pi Zero W and this hat.
I did the following things:
disabled login shell through serial in rasp-config
enabled serial port hardware in rasp-config
removed console=serial0 in /boot/cmdline.txt
added lines to /boot/config.txt:
enable_uart=1
dtoverlay=pi-miniuart-bt
Then I restart the RPI.
Problem...
But when I do sudo minicom -D /dev/serial0 (serial1, ttyS0, and ttyAMA0 doesnt work either), it says its offline...
Am I missing something?
Here are all the files that might be interesting:
cmdline.txt
config.txt
To switch the bluetooth controller to the mini-UART so you can use the PL011 UART to communicate with your HAT, you should specify
dtoverlay=miniuart-bt
Alternatively you can use
dtoverlay=pi3-miniuart-bt
which was kept around for backwards compatibility.

kernel module insertion issue

We are running the latest raspibian on the raspberry pi board and have a kernel driver for a USB peripheral which is added externally (sudo insmod driverx.ko) after boot-up by connecting to the hardware using ssh (its a headless system).
The problem is as follows:
If the device is already connected to the system upon power-up then running sudo insmod driverx.ko leads to the terminal getting stuck (no response, Ctrl+C doesn't work). Running lsmod by starting another ssh session shows that the module is in use even though there is no code running that will use it.
If I plug the USB device after the system boots up then sudo insmod driverx.ko works normally, (the terminal is still active). Running lsmod subsequently shows that that module is loaded but not in use by anyone. I can then run my user code and everything is fine. Upon running my user code lsmod shows the kernel module is in use and the number of users is 1.
In our system the USB device will always be plugged in. The kernel version and the driver version are the same.
I can fill in more details but do not wish to bias or make this query un-readble.
Please advise on what could the problem be.
Thank you for your time and help.
Possibility is that, the device is already attached into some other driver during startup. If it’s the case, the device credential of your specific device has to be removed from the startup driver.
Check the USB device list before to insert your driver.

Raspberry pi interfacing with windows PC

Hello Friends,
I have a raspberry pi powered with Raspbian OS. I want to create a device which will perform some action like "open calculator ,open notepad,etc" on windows pc by commanding from a raspberry pi. So my problem is how to establish communication between raspberry pi and another windows pc ?
If i use VNC and SSH service, can i invoke other programs remotely on pc ?
You could use netcat, also known as nc which is included in most Linux distros and is available for Windows.
All you would do on the Windows box is get your IP address with:
ipconfig
Then you would start listening on some random port, say 5000 because that has no security restrictions and pass whatever arrives on that port to CMD.EXE for execution:
nc -l -p 5000 -e CMD.EXE
Then, on your Raspberry Pi, you would just do:
nc <WINDOWS_IP_ADDRESS> 5000
Now you can type Windows commands in your Rasperry Pi terminal for execution on the Windows box:
DIR
NOTEPAD
There is a "cheatsheet" here and I am using the technique in the section entitled "Backdoor Shells".
Note that this is a big security hole, but if it is just for yourself playing around on a private network, it is nice and simple.

Enabling wlan on Raspberry Pi 3 bare linux

I have built the linux system for my RPi3 using buildroot. It boots properly and I can access the wired connection properly. However, I am stuck with enabling the wlan.
Here is what I have done so far.
Built the filesystem using buildroot:
make raspberrypi3_defconfig
make
After booting linux successfully I followed this link to enable wlan.
As the author of the post mentions, I had to select some of the wireless related packages by running make linux-menuconfig. But when I did run it, these packages were already selected.
I then ran make menuconfig and selected wpa_supplicant and other packages.
Now, when I boot the RPi3, wlan0 is not listed when I run ifconfig -a. I googled it a bit and found that there should be folder named wlan0 under /sys/class/net/. But I can only find eth0 and lo
Kindly guide me on how to get the wlan working. dmesg log is posted here
If you are using Buildroot, make sure you have selected BR2_PACKAGE_RPI_WIFI_FIRMWARE.
Also you have to manual load the wifi kernel module:
# modprobe brcmfmac
After that, you can confirm wlan0 with
# ifconfig -a
You could also configure Buildroot to build udev as /dev management option, in this case, WiFi kernel module will be loaded automatically.

How could I check the loaded drivers and their versions?

The operating system is CentOS 6.5, we could use the following commands for hardware information:
cat /proc/cpuinfo
cat /proc/meminfo
lspci
lsusb
And, how could I get the drivers of these hardware and their versions? Does it need root access? Thank you!
UPDATED