How to compile driver in FreeBSD

In Ubuntu 16.04 I can do this like this:
Code:
apt-get install build-essential git
git clone https://github.com/CristianVladescu/rtl8814AU.git
cd rtl8814AU && make && make install
In FreeBSD, I tried this:
  • Install FreeBSD 10.3 with source files - OK
  • pkg install git - OK
  • git clone https://github.com/CristianVladescu/rtl8814AU.git - OK
  • cd rtl8814AU - OK
  • make - FAIL
    • Code:
      make: "/root/rtl8814AU/Makefile" line 137: Missing dependency operator
      make: "/root/rtl8814AU/Makefile" line 139: Need an operator
      make: "/root/rtl8814AU/Makefile" line 141: Missing dependency operator
      ...
      make: "/root/rtl8814AU/Makefile" line 1688: Need an operator
      make: "/root/rtl8814AU/Makefile" line 1692: Need an operator
      make: "/root/rtl8814AU/Makefile" line 1734: Need an operator
      make: Fatal errors encountered -- cannot continue
      make: stopped in /root/rtl8814AU
  • pkg install gmake - OK
  • gmake - FAIL
    • Code:
      gmake ARCH=amd64 CROSS_COMPILE= -C /lib/modules/10.3-RELEASE/build M=/root/rtl8814AU  modules
      gmake[1]: *** /lib/modules/10.3-RELEASE/build: No such file or directory.  Stop.
      gmake: *** [Makefile:1699: modules] Error 2
Now I reached a dead end. I have no clue what to google.
 
A driver is usually build for a specific operating system. When looking at the original repository I noticed that were developed for Linux, which could definitely explain your issues.

I'm not familiar with this chipset from mind myself but have you tested already to check that it's not natively supported by FreeBSD?
 
Yeah, I was hopping that a driver which compiles on Debian flavored Linux, will also compile on BSD flavored Unix, to a certain degree. I asked the same thing on on stackexchange and got the same answer.
I also checked if it is supported natively, and neither AR9271 or MT7610 are supported.
 
I was hopping that a driver which compiles on Debian flavored Linux, will also compile on BSD flavored Unix, to a certain degree.
That's not going to work. Even if you can get it to compile the way drivers interact with the kernel is entirely different.
 
ShelLuser Hi again.
I'm in the same.
How can I compile the drivers for a TP-LINK WN722N? In the list of supported devices, this specific model, doesn't appear. Some people told me that I must look for the chipset, not for the model of the device...
So, I must look for the chipset, right. What else?
 
Please explain a lot more.

What is a TP-LINK WN722N? Let's assume it is a USB-connected purple elephant. One of the problems with PCI cards and USB devices is that vendors often don't tell you what the chip in the device is, and sometimes even change chips without changing the model number of the device. So the Foo brand purple elephant of model FOO-1234 might contain an Arago 987 chip, or a Broadcom 456, or a Cirrus 321, or something like that. So you need to translate from WN722N to what the actual chip in there is. We can't do this for you in all cases.

So tell us what chipset or chip is in there; that information might be found in the output of dmesg, or of usbconfig, or pciconf, or something like that (depending on how it is connected to the system). Then use man to find a list of related chips. For example the driver for USB-connected colored pachyderms of brand foo can be found by typing "man ufoop" (obviously that's a joke, but for example the USB-connected RAL wireless chips can be found under "man ural"). That will get you much closer, and you can ask a sensible question for example: "I bought a USB connected purple elephant that contains the Foo 123b chip. The man page for driver ufoop says that it supports the Foo 123 pink hippopotamus. Anyone have experience with using it with the purple elephant? Do I have to download and install a special driver?"

In order to ask a sensible question, you first have to do your homework.
 
ralphbsz
Ok, all right. I asked because the handbook didn't was too much help.
But your response makes me to see that here I neither found any kind of help.
So thanks for nothing. I'll try to understand it by myself and try to be the less bother that I can here.
Thanks for speaking about pachyderms and hippopotammus, but my message was about a USB card or whatever that gives me the conection to wireless connections.
But it doesn't matter: thanks for the advice. I only was asking how to fuck do something but with your reply, at least now I know that here I can't ask anything of that kind. So what the fuck it's the purppose of this forums?
Anyway, thanks for nothing.
And I'll be sure that this will the last time that I will ask something here, at least where you reply.
 
ShelLuser Hi again.
I'm in the same.
How can I compile the drivers for a TP-LINK WN722N? In the list of supported devices, this specific model, doesn't appear. Some people told me that I must look for the chipset, not for the model of the device...
So, I must look for the chipset, right. What else?

Professional help, not to be found within this forum I am afraid.
 
You guys may not like what ralphbsz had to say but he most definitely has a point. I also have no idea what a WN722N is supposed to be, which is quite essential in order to address this. When I looked it up on Google then all I found was a wireless dongle. But apparently it's an USB card of some sort? (PCI or... ?).

But most definitely: usbconfig, pciconf -l and dmesg (optionally: less /var/run/dmesg.boot) are all very solid suggestions on how to find the relevant chipset. The only thing I would like to add is mention of the apropos(1) command which can also be invaluable to find existing information based on keywords.

You may not like the direct wording being used, fair enough, but don't forget that in the end this is a technical forum we're attending. Being direct means leaving as little as possible to the assumption (or imagination) of others, which is very important to get to the solution of a problem as best as possible.

Yet this also means that you should not take stuff too personal in here. Ralph wasn't trying to ridicule or offend, he merely explained - in detail - why the question couldn't be answered. Sure, also poked a little bit of fun but at the same time provided some very serious and useful examples as well.

The alternative would simply have been to fully ignore the question because there's not enough information to address it.

No professional help here? Correct. You usually have to pay for that and some people seem to forget that most of us here are doing what we do in our spare time. If you want professional then this link could provide some alternative options.

But I most certainly disagree that the quality of the provided help on this forum can't reach that same professional level. You'd be surprised. Quite a few regulars on this forum have been working within the field of IT for years. Sometimes even within support ;)

The main difference though is the way the information is being presented, which can indeed be a bit direct sometimes. If you can't handle that then, well, sorry to say but then this forum might not be for you. Nor any other technical forum I might add. I've been active on quite a bit, including Microsoft based fora, and you mostly get the same kind of direct responses there.
 
I'm sorry if I have offended you. That was not my intent. I apologize.

So what was the intent? I think there are three parts to it.

First, I simply am not capable of helping, nor is anyone else. If you tell me that you have a WN722N, that doesn't tell us what chip is really in there. As explained above, there is no 1-to-1 translation from devices to chips. You need to find that out and post it. Some of the commands to find that out were posted above. And thanks to ShelLuser for making the list of commands even more complete. Once we have the exact ID of the chip, we might be able to find out which driver to use.

Second, I'm not really interested in solving your problem. Instead, I prefer to teach you how to solve your problem yourself. That's why there are the references to using "man" above, and ShelLuser's reference to Apropos. Why do I want to teach you? Because (a) it is less work for me to help you do the first steps, and then you do the rest yourself, (b) I'm hoping that in a few weeks or a year, you'll be able to help others, and (c) as a parent of a grown child, I can't help it but I have to educate people and make the world a better place.

Third, I'm not the FreeBSD support system. I have many hobbies and tasks in life (including being a parent, a spouse, an employee, an amateur musician, the section leader of percussion in a band, and so on), and performing support for an operating system I happen to like is pretty low on the list. I invest a few minutes here and there into it, but I can't be bothered to do it full-time. Yes, I work in the computer industry, and yes, I have helped paying customers and supported them. Those are customers that typically spend M$ on their systems, and dozens or hundreds of K$ per year on their support contract. If you insist on getting technical support from me, you have to be aware that the going rate is many hundreds of $ per hour, and billing would be through my employer. So consider yourself happy that I gave you a little bit of help for free.

Now, I'll go and find some other thread on this forum, to see whether anyone else needs help. And if you post the USB manufacturer and model ID of your chip, I'll probably spend half an hour checking whether I can find out which driver you should use and how to get it installed/compiled/configured/whatever. But you need to make that first step. There is a German saying: "Hilft Dir selbst, so hilft Gott": If you help yourself, god will help too.
 
ShelLuser Hi again.
I'm in the same.
How can I compile the drivers for a TP-LINK WN722N? In the list of supported devices, this specific model, doesn't appear. Some people told me that I must look for the chipset, not for the model of the device...
So, I must look for the chipset, right. What else?

So, TP-LINK WNT22N strikes again? That beautiful dongle often betrays new FreeBSD users expectations (you're not the first one I see struggling with it). The problem is that there are 2 versions of this usb card:

- TL-WNT22N v1 which uses AR9271 chipset, still unsupported in FreeBSD by ath(4), and with only a partial/buggy support in Linux through ath9k_htc. Practically speaking, this thing works well on Windows only (macOS doesn't support it either)

- TL-WNT22N v2, which uses the RTL8188EUS, well supported in FreeBSD, through urtwn(4)

Now, check the box which your dongle came inside to find out which of the 2 you have.

If it's the second, then:

- instructions about how to setup wireless are available on Handbook, man pages and many forums threads. Refer to the handbook 30.3 Wireless Networking, as well as to wpa_supplicant(8), wpa_supplican.conf(5) and ifconfig(8) man pages

- Like in all other Unix-like libre OSs with a modular kernel, drivers in FreeBSD are not downloaded somewhere (with the notable exception of Nvidia, hardly anybody, any company will ever be interested in investing money into developing drivers for FreeBSD), rather they come all bounded with the OS itself, having been developed/ported by the same people who maintain FreeBSD itself. The exception is the 3rd-party hardcoded/built-in firmware which those NICs come preinstalled with: it is distributed as closed-source binaries and needs to be loaded along with the driver. Sone firmware (e.g. Realtek) is already found in the FreeBSD base system, some other (e.g. Broadcom) can be installed from ports: net/bwn-firmware-kmod

Many common drivers are built in the default GENERIC kernel,meaning you don't have to load them: if a supported NIC is discovered, a device node (ex. run0) is created. If the module is not built in kernel (like urtwn(4)), then it can be loaded with kldload(8): kldload if_urtwn,or loaded automatically at boot by editing /boot/loader.conf and adding:
Code:
if_urtwn_load="YES"

The module itself if_urtwn.ko, physically resides under /boot/kernel folder.

If you use urtwn driver, you must agree with the Realtek License on order for firmware to be loaded (otherwise misbehaviour may occurr). Inside /boot/loader.conf place:

Code:
legal.realtek.license_ack=1
 
ShelLuser You right. My bad.
I must explain in detail which chipset I'm using. Gimme a few time and I can found even the grade of purity in the conductors of which is make, and perhaps the diagram of the connections and how they are disposed in the "core" (sorry, I'm studying electomechanic, not informatic-electronics, hence the term that I've used denotes my level of understanding about this area).
Of course that I know that he was kidding. Why not. If I'm trowing a model instead of the chipset, why somebody wouldn't take it like a joke?
 
I'm sorry if I have offended you. That was not my intent. I apologize.

For sure. I just was asking for help. Don't lie to me: your apologies aren't because you recognize what you have said. For YOUR information: I think that I told that to ShelLuser a time ago, that I was trying to run a program which is for simulate electro-pneumatics circuits. I have no studies in this WHOLE world of the informatics, hence everyone can see the cause of my non-knowing: you know about a PC, I know what the fuck it's a PLC and why the A.C. it's better outside, leaving apart the area of electronic, why the heck it's better because of its high U.

Second, I'm not really interested in solving your problem. Instead, I prefer to teach you how to solve your problem yourself. That's why there are the references to using "man" above, and ShelLuser's reference to Apropos. Why do I want to teach you? Because (a) it is less work for me to help you do the first steps, and then you do the rest yourself, (b) I'm hoping that in a few weeks or a year, you'll be able to help others, and (c) as a parent of a grown child, I can't help it but I have to educate people and make the world a better place.

You pretend to tech me something? I will try to make to you the same: tell me how the shitty fuck, you could be capable to understand how the hell fix something that you have no knowing of it, that you aren't studying right now, with a mediocre section of the "sacro-sanctum" handbook that throws a few words, yet you haven't be kidded by who have a BIG and SOLID idea of which you're speaking of?

So what was the intent? I think there are three parts to it.

First, I simply am not capable of helping, nor is anyone else. If you tell me that you have a WN722N, that doesn't tell us what chip is really in there. As explained above, there is no 1-to-1 translation from devices to chips. You need to find that out and post it. Some of the commands to find that out were posted above. And thanks to ShelLuser for making the list of commands even more complete. Once we have the exact ID of the chip, we might be able to find out which driver to use.
And this it's so simple that you only have to do a poor search in the all-mighty google. Here you have one, in case that you hadn't done yet: https://www.lelong.com.my/tp-link-t...r-bhlonlinesales-191944173-2018-05-Sale-P.htm
But as you want the components of such device, I'll give you 'em: https://wikidevi.com/wiki/File:TL-WN722N-front_b.jpg
Do you see that? I'm not some guy expert on electronics components, despite of it, I'm capable of distinguish in the image: a processor (the thing in the center, or perhaps it could be the holly chipset, as I said, I'm not a electronic), and a couple of resistences integrated.
In case that you want the source, here's: https://wikidevi.com/wiki/TP-LINK_TL-WN722N

Third, I'm not the FreeBSD support system. I have many hobbies and tasks in life (including being a parent, a spouse, an employee, an amateur musician, the section leader of percussion in a band, and so on), and performing support for an operating system I happen to like is pretty low on the list. I invest a few minutes here and there into it, but I can't be bothered to do it full-time. Yes, I work in the computer industry, and yes, I have helped paying customers and supported them. Those are customers that typically spend M$ on their systems, and dozens or hundreds of K$ per year on their support contract. If you insist on getting technical support from me, you have to be aware that the going rate is many hundreds of $ per hour, and billing would be through my employer. So consider yourself happy that I gave you a little bit of help for free.

Of course, we can use the classic: call to the routine. I have to study to get a title of electro-mechanic (which it's much more than the 50% of the time of my week) and tomorrow I must go to a course of auxiliar of pharmacy. Despite of it, Sensucht94 knows that I want to know not only about technology, but also about biology. Besides I'm doing my firsts steps on Arduino. Sorry, I'm not a musician: give me a beer (and I'm not kidding) and I'll sing. Also I want to play the guitar and piano by own count. Not enough, because I'm wanting to understand a system which is almost unknown by the standard user. Still, I want to study chemistry, but not for now. Now I'm learning about nanotechnology to be capable of doing a project which parts are made in 3D-impresors, its system based on Arduino, and using a micro servomotor. And here you have the half of the history: don't you dare to see how I have the splice of my cable that gives me the service, and the damage on my keyboard because of, both because of a change of house of go and back because a familiar trouble that I won't type here. Still you don't know all the whole history.

Now, I'll go and find some other thread on this forum, to see whether anyone else needs help. And if you post the USB manufacturer and model ID of your chip, I'll probably spend half an hour checking whether I can find out which driver you should use and how to get it installed/compiled/configured/whatever. But you need to make that first step. There is a German saying: "Hilft Dir selbst, so hilft Gott": If you help yourself, god will help too.

Thanks but you don't need to. A guy says me that he was capable to understand Arduino by himself when I asked him for help. Since that I trying to understanding it by my own. Conslussion: I don't need that you say that you gonna waste your precious time looking for a solution and kidding me because I wasn't so specific. I can do it by my own, thanks.
 
So, TP-LINK WNT22N strikes again? That beautiful dongle often betrays new FreeBSD users expectations (you're not the first one I see struggling with it). The problem is that there are 2 versions of this usb card:

- TL-WNT22N v1 which uses AR9271 chipset, still unsupported in FreeBSD by ath(4), and with only a partial/buggy support in Linux through ath9k_htc. Practically speaking, this thing works well on Windows only (macOS doesn't support it either)

- TL-WNT22N v2, which uses the RTL8188EUS, well supported in FreeBSD, through urtwn(4)

Now, check the box which your dongle came inside to find out which of the 2 you have.

If it's the second, then:

- instructions about how to setup wireless are available on Handbook, man pages and many forums threads. Refer to the handbook 30.3 Wireless Networking, as well as to wpa_supplicant(8), wpa_supplican.conf(5) and ifconfig(8) man pages

- Like in all other Unix-like libre OSs with a modular kernel, drivers in FreeBSD are not downloaded somewhere (with the notable exception of Nvidia, hardly anybody, any company will ever be interested in investing money into developing drivers for FreeBSD), rather they come all bounded with the OS itself, having been developed/ported by the same people who maintain FreeBSD itself. The exception is the 3rd-party hardcoded/built-in firmware which those NICs come preinstalled with: it is distributed as closed-source binaries and needs to be loaded along with the driver. Sone firmware (e.g. Realtek) is already found in the FreeBSD base system, some other (e.g. Broadcom) can be installed from ports: net/bwn-firmware-kmod

Many common drivers are built in the default GENERIC kernel,meaning you don't have to load them: if a supported NIC is discovered, a device node (ex. run0) is created. If the module is not built in kernel (like urtwn(4)), then it can be loaded with kldload(8): kldload if_urtwn,or loaded automatically at boot by editing /boot/loader.conf and adding:
Code:
if_urtwn_load="YES"

The module itself if_urtwn.ko, physically resides under /boot/kernel folder.

If you use urtwn driver, you must agree with the Realtek License on order for firmware to be loaded (otherwise misbehaviour may occurr). Inside /boot/loader.conf place:

Code:
legal.realtek.license_ack=1

Thanks for throw a rope instead of mount a circus only just because I wasn't so specific.
 
OK, I just looked at the high-resolution picture from the wiki page you pointed to. It describes the *OLDER* version of this device. To find out the chip model, I had to to zoom into the chip in the middle (click on the high-resolution version first): and it is an Atheros AR9271L. Not good: That chip is known to not be supported, as Sensucht already wrote above. Matter-of-fact, if you read about that in the FreeBSD developer wiki at
https://wiki.freebsd.org/dev/ath(4)
it is clear it won't be supported for a while, as there is no work in progress to support it.

So the question is: Does the PC board of your device really look like the picture of the wiki? Does the USB chip ID say that it is a Atheros 9271? If yes, return it to the vendor, and try to get your money back.

Or you MIGHT be lucky, and you have the newer model, which both Sensucht and the Wiki page talk about. In that case, it should just work, as Sensucht said in this instructions.

Unfortunately, the web page of the vendor (in Malaysia) you pointed to doesn't have any information about the exact identity of the device. It doesn't have a full EAN on the web page. The outside picture (white plastic USB dongle, not PC board) on the vendor page looks exactly like the picture in the Wiki you pointed to ... and unfortunately the two versions (older=bad and newer=good) look exactly the same.

Let us know what happens next; now I'm curious.
 
Oh, and while we are at it: usage of 4-letter words starting with 'f' *hint hint* is a way to increase the likelihood of ending up in the pre-moderate queue or winning a short holiday from the forum. I presume we are all grow up here, so lets act as we are and use some finesse when trying to mock or insult each other. Okay?
 
Thanks for throw a rope instead of mount a circus only just because I wasn't so specific.

Whatever other say BSDAppentic3 you can't afford to talk like that. Let's keep the debate civil. This is a serious and high-level tech/support forum not a tavern. We may still have fun talking about ScreenShots, Music and video games, but this doesn't keep this forum from being mainly a professional support platform for power users and people using FreeBSD at workplaces, on enterprise envs and public servers. Which means, people often are working here not having casual chat about their home-server or their FreeBSD desktop.
For such a reason,and not only, no personal attack is allowed; you can criticize statements regarding FreeBSD or IT world in general, but if you feel offended,than there are PMs (talk with the person directly explaining what you didn't like) and there is the report flag: mods will take care.

I've been mod in other forums in the past (one dedicated to Latin2Italian translation and one to Medicine-related Q&A:p), and I'll be honest: I wouldn't have hesitated giving you a temporary ban you for what you wrote

But this didn't happen and this forum confirms once again being the most friendly tech forum you can find online. Rather, you've been warned in the kindest of the ways.

Trust me (or better go find out yourself), you believe that this forum is not friendly and you're not being treated well? Go on Slackware/Alpine Linux mailing-lists, or even better, go on some Arch/Gentoo Linux forum, full of fanatics, know-it-all boys and proud distro users: your 'beginner-level' question would have never been answered, you would have been heavily criticized and pointed out some wiki page, but framed as noob either way. And if you had spoken the way you spoke above, a permaban is what you would have surely got in return.


So whether you like it or not, 'this is the best of all possible Worlds' (to quote Leibniz),maining the best you can get right now.

Wanna know the main reason which brought me to stay with FreeBSD? Community

I'll leave you with a nice page I strongly suggest you to read, when you find the time: Thread FreeBSD Forums Rules.38922

Yours faithfully
 
Sensucht94
Thanks, but you don't need to remind me that I was aggressive and offensive. You know how old I am, I know perfectly what I had done well either what I done bad.
Crivens Of course I can be much more offensive without using "bad words". And for your information, in that case, no one can ban me. I really don't know to offend, I don't need to write like a marine speaks in a tavern who have drink some beers. No.
 
I don't want that this thread changes its course to a discussion of bar. I think that all of you want the same.
So, we must return to the cordiality, to the "good words", to don't try to be offensive and don't write like we're discussing.
I don't want this because suddenly I get fear of be banned. I really don't care about it. -Snake- knows that I can get off easily, nobody will miss me. Except for a few users.
So, let's me explain: if I wrote asking for help, that wasn't to be kidded like if I was an idiot. That was because the handbook only says a few words about how to compile drivers: https://www.freebsd.org/doc/en/books/arch-handbook/driverbasics.html
That's why, when I read the response of ralphbsz I get sick.
I really don't need to invent apologizes. I was bad, I was tired, I was in troubles not only with this.
 
So, I appreciate if we could return like ralphbsz has done: back to the topic. Don't you gonna think that I will edit my angry and obfuscated messages: I won't retract. What I said, I said it: end of history.
 
Thanks ralphbsz !
Here's the output of
Code:
 root@hostfbsd:~ # usbconfig -u 4 -a 3 dump_device_desc
:
Code:
ugen4.3: <ATHEROS USB2.0 WLAN> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x00ff  <Vendor specific>
  bDeviceSubClass = 0x00ff 
  bDeviceProtocol = 0x00ff 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x0cf3 
  idProduct = 0x9271 
  bcdDevice = 0x0108 
  iManufacturer = 0x0010  <ATHEROS>
  iProduct = 0x0020  <USB2.0 WLAN>
  iSerialNumber = 0x0030  <12345>
  bNumConfigurations = 0x0001
 
It's an Atheros 9271 chip, the output above is super clear. Unfortunately that seems to imply that there is no driver for it in FreeBSD. Ok, you're done with this device, unless you are willing to switch OSes.

You could theoretically find the maintainer of the Atheros code on the kernel mailing list, and send him an e-mail, and beg and plead. I don't think that makes much sense; they probably get dozens of requests, and if they haven't done it yet, there must be good reasons.

Another option would be to create a small VM on your FreeBSD machine, run Windows or Linux or OpenBSD inside it, and use it only to run a network bridge from this device to a local network. This would be insanely much work.
 
There is no driver for this for FreeBSD: It's an Atheros 9271 chip, the output above is super clear. Unfortunately. Ok, you're done with this device. Hopefully you get your money back.

You could theoretically find the maintained of the Atheros code on the kernel mailing list, and send him an e-mail, and beg and plead. I don't think that makes much sense; they probably get dozens of requests, and if they haven't done it yet, there must be good reasons.
Why? There's no possibilities of use this device here?
 
Why? There's no possibilities of use this device here?
The 9271 is just not supported with the existing drivers on FreeBSD.

EDITed to add: Which is really strange. Because the 9270 (different last digit) is supported by the otus driver. And the maintainer of that stack has talked about the 9271 chip in his blog postings. That makes very little sense.
 
Back
Top