I notice in "Linux_driver_TJA110" the file "nxp.c" has the following code below, suggesting the operating system gets a handle to a "work queue" for sending data, and interrupts are set to alert the operating system to received data. Is that right?
Given the above, the structures "phy_device" and "phy_queue" seem quite important to understanding how the code works, but they are never defined in the C or H files.
Could anyone provide a S32DS project (or anything) that shows how to fully build this code? Such that everything is defined, and we can trace through it?
Can anyone help provide header files and libraries we would need to build code in S32DS that would drive the TJA1100 chip?
It is difficult to get started without more guidance.
= = = = = = = = =
static int nxp_config_init(struct phy_device *phydev)
{
. . .
/* enable all interrupts */
phydev->interrupts = PHY_INTERRUPT_ENABLED;
phydev->drv->config_intr(phydev);
/* Setup and queue a polling function:
*
* The phy_queue is normally used to schedule the interrupt handler
* from interrupt context after an irq has been received.
* Here it is repurposed as scheduling mechanism for the poll function
*/
if (((struct nxp_specific_data *)phydev->priv)->poll_setup == 0) {
cancel_work_sync(&phydev->phy_queue);
INIT_WORK(&phydev->phy_queue, poll);
queue_work(system_power_efficient_wq, &phydev->phy_queue);
((struct nxp_specific_data *)phydev->priv)->poll_setup = 1;
}
. . .
}