LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2017, 01:29 PM   #1
Josh2017
LQ Newbie
 
Registered: Jan 2017
Posts: 3

Rep: Reputation: Disabled
How does the same Linux OS or kernel know to talk to different wifi cards?


I have a newbie question.

I know at very low level communication is done buy register r/w via certain bus.

I assume register maps are different for different brand peripherals of the same type, e.g., PCIe wifi cards from different manufacturer.

I assume OS or kernel talk to the peripherals at an abstract level.

And what the level is?
And what paves between this level and the lower level?

An example is Linux on two computers with same CPU but very different WiFi cards.
 
Old 04-11-2017, 01:33 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,482

Rep: Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530Reputation: 5530
that is called device driver. The kernel sends a unified message to the driver, and the driver will translate it and forward it to the device.
 
Old 04-11-2017, 03:58 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora 33
Posts: 3,566

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Devices on the PCI bus each have unique vendor/model codes that determine which driver gets called. You can read the PCI config registers with lspci.
 
Old 04-12-2017, 09:15 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,139
Blog Entries: 4

Rep: Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227Reputation: 3227
Quote:
Originally Posted by pan64 View Post
that is called device driver. The kernel sends a unified message to the driver, and the driver will translate it and forward it to the device.
To put it another way, the device driver presents Linux with a generic abstraction of the device. "It's a network card." Linux calls the driver's various subroutines, also handing it the device-table entry. It's the responsibility of the (vendor and device-specific) driver to implement each call – to actually "push the buttons and flip the switches in the hardware" to make a particular device do its thing.

Devices uniquely self-identify themselves, so that drivers can be sure they're talking to a compatible device and so that Linux knows what driver to associate with each device. (Which beats the hell out of fiddling with DIP-switches like we had to do in the bad old days!)

Last edited by sundialsvcs; 04-12-2017 at 09:17 AM.
 
Old 04-12-2017, 03:24 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,836

Rep: Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370Reputation: 3370
"two computers with same CPU but very different WiFi cards"

Think of it as a two cars that are identical except for the tires. Once you install the tires to the rims and to the car they act the same.

If you ignore the networking part of the question it comes down to the ability to access a device on a bus.
 
Old 04-13-2017, 08:13 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,185

Rep: Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377Reputation: 1377
And of course a LOT of devices are identical internally no matter what the manufacturer stamps on the case, which is why you'll find drivers that are based around "chip-sets" rather than specific manufacturer/model.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Random Linux Commands to Make Google Talk, Fix Wifi, Find Duplicate Files, and More LXer Syndicated Linux News 0 11-10-2012 06:21 PM
Linux compatible wifi cards aquaboot Debian 3 12-01-2010 11:00 PM
Fully working Wifi pci cards in for Linux snama Linux - Hardware 1 12-31-2008 05:24 AM
best wifi cards for linux monkeyman2000 Linux - Wireless Networking 3 09-07-2005 02:23 PM
WiFi cards for Linux Gecki Linux - Wireless Networking 1 08-13-2005 09:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration