Sponsored Content
Full Discussion: The simplest network driver
Top Forums Programming The simplest network driver Post 302576009 by Corona688 on Wednesday 23rd of November 2011 11:28:56 AM
Old 11-23-2011
I haven't tried it, but my suspicion is that "probe" would be run for everything. Probing is how you detect non-plug-and-play things which don't advertise their presence, so PCI ID's wouldn't seem to apply.

But PCI drivers, usually not needing to probe, mostly don't probe at all. I think the PCI NE2000 network driver can, but has to be forced to do so by module options at load-time because blindly poking around at I/O addresses can be dangerous. Something unexpected might be occupying the bus resources it expects which could lock the PC or worse. On some IBM laptops, BIOS resources were found at addresses lm_sensors was expecting temperature sensors at, causing probes to brick the system!

One PCI ID for two drivers is a rare situation. Plug-and-play is supposed to be one model to one PCI ID, no ambiguity. If there's two drivers for the same ID, whichever gets loaded first wins. If they're built-in, whichever gets checked first on boot wins. Since the order of built-ins is arbitrary, if you want to control the order, you must make the drivers modules.

A rare situation but it still happens. There's two incompatible revisions of the old realtek 8139 network chip and two different linux kernel drivers -- 8139cp and 8139too. If you load the wrong one, it complains, and tells you to load the other in dmesg. Easy when they're modules, impossible when they're not.

Last edited by Corona688; 11-23-2011 at 12:38 PM..
 

8 More Discussions You Might Find Interesting

1. Programming

Network device driver

HI, I am writing a network device driver for RTL8139c card on 2.6.18 kernel ... I am facing few queries listed below 1. Can i able to at all write a driver for RTL8139C or Realtek had designed new chip for 2.6 series kernel? 2. If no then which driver file 2.6.18 uses .. Is it 8139too.c or... (1 Reply)
Discussion started by: niketan
1 Replies

2. Solaris

network driver cpu usage

Hello all, Needed a suggestion from you all, if you know anything about this stuff. We have a high network traffic application. Close to around 700Meg /sec on one NIC. When the traffic is around 200Meg on the NIC, the VCPU(not the CPU, cause we have 24 VCPU) utilization by the NIC driver... (5 Replies)
Discussion started by: Naanu
5 Replies

3. Solaris

Installing Network on Computer, might be driver

Hi All, Just completing my second Solaris installation, in the previous one which was on a Dell X64 machine, I went through the Network configuration setting, on the current computer which I am installing Solaris on, its a custom built machine and for some reason, I didnt see the screen where I... (1 Reply)
Discussion started by: platforminc
1 Replies

4. Solaris

network driver not detecting in solaris 10 X86 on HPDL380G5 Server

I have installed solaris10 x86 on HP DL380 G5 Server, but network card is not getting detected. i have installed the network driver, downloaded from the following link HP ProLiant DL380 G5 Server series- Download drivers and software - HP Business Support Center Can any one suggest me how to... (1 Reply)
Discussion started by: raj.chinnu
1 Replies

5. Red Hat

How to know whether the network driver alredy installed in my system

I am using NVIDIA nforce: Networking controllers And Redhat enterprice linux ws version 4 32 bit: OS I want to connect my system to Broadband internet using linux. From where can I download the driver for nertwork. How to know whether the network driver alredy installed in my system. ... (0 Replies)
Discussion started by: rijas
0 Replies

6. Solaris

Can I Install the Gani Network Driver Using the Application that Came on the CD?

When I boot up the Solaris 10 5/09 install CD and select 'Solaris' from the GRUB menu that comes up, a menu loads. Option 5 is 'Apply Driver Updates'. Can I install the Gani driver using that? I tried using the tar file (the way it came) that I wrote to a floppy but when I asked it to look at the... (8 Replies)
Discussion started by: Bradj47
8 Replies

7. UNIX for Dummies Questions & Answers

Simulated driver for Network Interface Adapter

Hi all, I got sort of a task to do. I have to write in C "simulated network driver". What does it mean? - It has to run on all network adapters - It has to be as simple as it can be - It has to run on all linux distributions (or at least most of them) - It does not have to run a network... (4 Replies)
Discussion started by: Chrisdot
4 Replies

8. Programming

Compiling virtual network adapter driver problem (net_device struct)

Hi, I found on linuxgazette.net/93/bhaskaran.html page very useful sample of virtual driver (not connected to real hardware). I try to compile it with no effect. So: I got fresh Ubuntu 9.10 (kernel 2.6.31-14) My source is saved in networkAdapter.c file in /usr/src/myModules directory. I... (21 Replies)
Discussion started by: Chrisdot
21 Replies
DEVICE_PROBE(9) 					   BSD Kernel Developer's Manual					   DEVICE_PROBE(9)

NAME
DEVICE_PROBE -- probe for device existence SYNOPSIS
#include <sys/param.h> #include <sys/bus.h> int DEVICE_PROBE(device_t dev); DESCRIPTION
The DEVICE_PROBE() method should probe to see if the device is present. It should return 0 if the device exists, ENXIO if it cannot be found. If some other error happens during the probe (such as a memory allocation failure), an appropriate error code should be returned. For cases where more than one driver matches a device, a priority value can be returned. In this case, success codes are values less than or equal to zero with the highest value representing the best match. Failure codes are represented by positive values and the regular UNIX error codes should be used for the purpose. If a driver returns a success code which is less than zero, it must not assume that it will be the same driver which is attached to the device. In particular, it must not assume that any values stored in the softc structure will be available for its attach method and any resources allocated during probe must be released and re-allocated if the attach method is called. In addition it is an absolute requirement that the probe routine have no side effects whatsoever. The probe routine may be called more than once before the attach routine is called. If a success code of zero is returned, the driver can assume that it will be the one attached, but must not hold any resources when the probe routine returns. A driver may assume that the softc is preserved when it returns a success code of zero. RETURN VALUES
A value equal to or less than zero indicates success, greater than zero indicates an error (errno). For values equal to or less than zero: zero indicates highest priority, no further probing is done; for a value less than zero, the lower the value the lower the priority, e.g. -100 indicates a lower priority than -50. The following values are used by convention to indicate different strengths of matching in a probe routine. Except as noted, these are just suggested values, and there's nothing magical about them. BUS_PROBE_SPECIFIC The device that cannot be reprobed, and that no possible other driver may exist (typically legacy drivers who don't follow all the rules, or special needs drivers). BUS_PROBE_VENDOR The device is supported by a vendor driver. This is for source or binary drivers that are not yet integrated into the FreeBSD tree. Its use in the base OS is prohibited. BUS_PROBE_DEFAULT The device is a normal device matching some plug and play ID. This is the normal return value for drivers to use. It is intended that nearly all of the drivers in the tree should return this value. BUS_PROBE_LOW_PRIORITY The driver is a legacy driver, or an otherwise less desirable driver for a given plug and play ID. The driver has spe- cial requirements like when there are two drivers that support overlapping series of hardware devices. In this case the one that supports the older part of the line would return this value, while the one that supports the newer ones would return BUS_PROBE_DEFAULT. BUS_PROBE_GENERIC The driver matches the type of device generally. This allows drivers to match all serial ports generally, with spe- cialized drivers matching particular types of serial ports that need special treatment for some reason. BUS_PROBE_HOOVER The driver matches all unclaimed devices on a bus. The ugen(4) device is one example. BUS_PROBE_NOWILDCARD The driver expects its parent to tell it which children to manage and no probing is really done. The device only matches if its parent bus specifically said to use this driver. SEE ALSO
device(9), DEVICE_ATTACH(9), DEVICE_DETACH(9), DEVICE_IDENTIFY(9), DEVICE_SHUTDOWN(9) AUTHORS
This manual page was written by Doug Rabson. BSD
February 8, 2012 BSD
All times are GMT -4. The time now is 06:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy