The sequence is something like this, assuming a Hostmot2 step generator for the example.
At module load time the "loadrt hostmot2" set up the high-level driver, and then "loadrt hm2_eth" locates the 7i82 on the ethernet port and then the main hostmot2 driver queries the board so see what it has. If it finds a stepgen:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/hostmot2.c#L933
Then it calls the stepgen driver, which creates a HAL pin "hm2_7i92.0.stepgen.00,position-cmd"
github.com/LinuxCNC/linuxcnc/blob/master...tmot2/stepgen.c#L754
G-code G1 X1 F100
Every 1mS the motion component updates the HAL pin joint.0.motor-pos-cmd.
Every servo thread cycle the hm2_read and write functions are called, for each device. So in this example the stepgen driver is called, and the step rate required to reach the new position in the next servo period is converted to an integer value to be sent to a register on the FPGA:
github.com/LinuxCNC/linuxcnc/blob/master...tmot2/stepgen.c#L282
Where the step_rate_reg points to an address on the FPGA calculated as an offset from the stepgen base address based on the FPGA "
regmap
" file.
All the register value updates are collected from all the modules in the main driver:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/hostmot2.c#L127
github.com/LinuxCNC/linuxcnc/blob/master...tmot2/hm2_eth.c#L738
And then the hm2_eth driver combines the register addresses and values into UDP packets:
(or the PCI driver does it for PCI cards etc etc)
You might have noticed that as well as encoder, stepgen etc functions there is one called "smart serial".
This is what is used to communicate with smart-serial remotes.
So HAL pin values are read by the sserial.c file, converted into FPGA register / value data that is transmitted via UDP (or PCI, or EPP, or SPI) to the FPGA which then comverts the data to the smart-serial protocial that are sent to the smart-serial slave. And then data from the slaves travels back the other direction.
Parts of the sserial.c file look like parts of the hostmot2.c file:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L1849
Except that the sserial data is simpler so the various data types are handled in one file, rather than being farmed out to sub-drivers as is the case with Hostmot2 modules.
There is an interesting special case, the 7i90 can act either as a Hostmot2 device controlled by EPP parallel port or SPI, or it can be configured as a smart-serial remote.
So it would be possible to have a 7i90 Hostmot2 master on the parallel port connected by CAT5 serial cables to multiple other 7i90 boards configured as smart-serial IO.