How to install Lan card driver using freebsd kernel - freebsd

I have bought Asus xg-c100c LAN Card. But freeBSD(TrueNas) not supporting. I have download driver files from manufacturer website. All files have .c Or .h extension. How to install it ?

The short answer is: if the card didn't specifically have a FreeBSD driver, you cannot use the one you downloaded. It sounds like you downloaded a linux driver in source form, because I'm relatively sure your chipset has no FreeBSD driver.
There was the ability to use NDIS drivers back-in-the-day. You're talking about the ASUS 10GE chipset, I believe. There is not driver it (yet).
Your best bet is to get a cheap card and put it in a PCIe slot or get a USB3 ethernet (better than USB2 for 1GE) and use it. Obviously, the USB solution won't be 10GE.

Related

How to learn network Ethernet device driver programming?

I am looking what piece of hardware should i buy (NIC Or FPGA Or ASIC etc) which i could connect to my system, and write device driver to implement and learn Ethernet device driver typical functions like - packet trapping/ receiving and sending packet/ reprogramming the hardware etc ? How can i learn all this stuff at home ?
I think that if your "system" is a computer, it should have a NIC (or you can buy one). Anyway, you need a computer to write a driver... so download the kernel sources and look at the driver source for the NIC you are using.

Controlling a driverless USB Audio Device

I have a USB audio device (Scarlett Focusrite 18i6) which does not require a driver, so I assume it uses the USB HID Audio Class standard.
It works on everything from Windows and Mac to Linux and iOS.
But on Mac and Windows, it has a control application which can for instance enable and disable direct monitoring.
How would I go about reverse-engineering how this is done, so that I can reproduce it on platforms where the control application does not exist?
I'm thinking of booting up Windows in a VMWare session and then logging the USB communication (somehow?) while using the control application, but it does sound tedious considering the amount of data and my very limited understanding of USB.
Any other suggestions?
You could try running the control application using Wine instead of reverse engineering it. However, if it's accessing USB devices then there is a good chance it might be using an API not supported by Wine.
To reverse engineer it, you should find a way to look at the USB traffic between the computer and the device. Total Phase has some hardware USB protocol analyzers, but you might be able to find a good software solution for free.

Linux Virtual USB device driver

My goal is to create a virtual USB char device (not block device) for Linux 2.6.32 and above (I use debian squeeze) that would be recognize by the system.
I would like that this device be listed with lsusb as a normal USB device, and that every application could use libusb in order to open the device, and send control message, and make bulk write/read. But behind this virtual device, it's behavior would be set by my application. I want to set it's product ID, it's vendor ID, answer to USB status, and bulk read.
I've read some posts about how to use USB/IP in order to create a virtual USB device, and that's exactly what I want to do
Installation and emulation of virtual USB Device
http://breaking-the-system.blogspot.fr/2014/08/emulating-usb-devices-in-python-with-no.html
But unfortunately, when I tried with 2.6.32 kernel and above, I didn't succeed making it work. So I looked at how to create a kernel module that would create the virtual device :
http://pete.akeo.ie/2011/08/writing-linux-device-driver-for-kernels.html
This one looks great also, but the sample provided doest not indicate how to make it an USB device.
I've seen some post talking about it with windows but none that could help me with Linux.
I would like to avoid buying some USB programmable cards when it can be done with software.
Have anyone any leads on how to make the first methods works under newer kernel, or convert the sample code of the second method for making an USB device ?
I have fixed the code of http://breaking-the-system.blogspot.fr/2014/08/emulating-usb-devices-in-python-with-no.html (first method using USB/IP) to work with linux 4.3.
In the original code are missing USB requests like set configuration and get status. Without the implementation of all USB requests used for the OS driver the code will not work.
The fixed code can be downloaded in https://github.com/lcgamboa/USB-Emulation .
I guess raw-gadget kernel module is the thing that you want?
you can check the dummy_hcd and tests directory inside the repo, it will guide you how to create a virtual USB device

Use a Linux Computer as a USB Coupler

I am on debian and:
I have a USB controller hooked up to a USB port on my PC (Device 1).
I have a male to male USB cord hooked up to another port on the PC that connects to Device 2. (it is a "bridging" usb cord, and has the chip for it)
I want to make them connect to each other as if they were one cord, so neither device knows that there is a computer in the middle.
This would be called a 'Coupler', except that I am using a PC as a coupler.
Here is a (really bad) diagram I made:
What I have done:
I have been able to connect the two devices independently of each other and sniff the results for when they fail to connect. The devices don't send a large volume of data back and forth.
Maybe there is some kind of command tool that I could use, for example (psudocode):
$ couple-usb-ports PORT1 PORT2
You're trying to reinvent the wheel here.
You might consider looking at this link instead.
http://dan3lmi.blogspot.com/2012/10/sniffing-usb-traffic-different.html
Specifically this.
Windows: You cannot directly capture raw USB traffic on Windows with Wireshark/WinPcap, but it is possible to capture and debug USB traffic on a virtual Windows machine under Oracle Virtual Box.
You cannot use a simple PC as transparent USB sniffer without extra (expensive) hardware. An USB bus has always one host (and one or more devices), and the PC can only be the host. This is a hardware limitation.
But you can capture USB data in a Windows machine using Wireshark and USBPcap, eliminating the need for the middle box in most cases.
As this post is tagged Linux, I suppose the controller PC is a Linux machine. Instead of connecting USB ports with a male-male connector, which is all kinds of bad (you are connecting the 5V lines of both machine with each other!), just run Wireshark in the controller PC.
There might be a little work to be done previously, as you have to enable Wireshark for USB monitoring (Particularly in Debian, this is disabled by default), and you might have to install a small driver to enable the monitoring. Have a look at this page for more information.
Once you get it working, Wireshark is an excellent tool for this!

Linux driver for embedded Linux

I'm looking to attach some USB devices to my embedded Linux board.
It is an TI-ARM processor running embedded Linux, but I guess it could be any embedded Linux board.
If I purchase an USB device which has Linux support/driver, can this driver (generally) be re-compiled to work with the ARM architecture? (Instead of Windows ect.).
Yes, USB drivers can generally be expected to compile for other architectures other than x86. Of course this presumes that your board does have a host USB port. There are a few boards that have only USB device ports, and many SoCs have both USB host & device ports.
But successfully compiling the (USB) driver may only be part of the task.
Some (USB) devices may require additional packages of libraries and other drivers for interfacing to application programs. For instance a USB digital TV tuner requires numerous packages (V4L, ALSA, I2C driver, userland firmware loading) to actually work.
Clarification
These additional dependencies that you may have to build are not because of USB.
The dependencies are related to the type of device.
An Ethernet interface, whether integrated into the SoC or offboard using USB, would be easily configured for full support in the kernel (e.g. protocol stack) and userland (e.g. Busybox has ifconfig, ping and routing apps).
A PCI TV tuner would have the same dependencies as the USB tuner. But the embedded environment typically means that you don't have any/most of these multimedia dependencies already built/installed.

Resources