What is probing in linux

Difference Between Probe and resume functions in Linux

I am a newbie to Linux. Can some one Please explain me about the differences between this functions. and the sequence of execution. I had a look @ this query. Probe method device drivers and got some idea about probe. I have understanding the resume function is called after suspend. Please guide me in understanding the functionality.

2 Answers 2

Both are different in perspect:

Probe: Will get called when you are registering your device to for the first time.(Gets called (a). during device boot or (b). calling insmod/modprob).

Resume: It is a handler function routine part of the driver, you may supply function for the handler or leav(depends on your driver implementation).

So in simple words — Probe gets called only once (During registration of driver) — Resume gets called depending on

(a) whether you have supplied function routine for handler

(b) If so then on suspend it gets called. (so n times it will get called for n times it gets suspended)

I guess there is enough information in a thread that you’re mentioned. But I’ll try to explain in other words.

Probe function is a part of initialization sequence of linux device driver. Usually, an Init function contains some sort of driver registration calls, and one of linux layers would call probe() later. But only driver’s author can decide what part of code should be executed in init() or probe() : it depends on your device hardware specifications and corresponding linux layer (PCI, SPI, etc) features. By the way, in your driver you’re not obliged to use any existing layer, so it is not mandatory to have probe().

Читайте также:  Linux manjaro установка node js

Conserning suspend-resume: this pair of functions should take a place only when you’re want to implement any energy-saving features of your device. Suspend() tells that you can switch off something (if have any) to preserve energy. Resume() tells that you should switch in on again. Have no such options? Do not implement suspend-resume.

Источник

Оцените статью
Adblock
detector