how CAN-bus Linux driver MCP251x.c works

cheng chen freakrobot at acm.org
Fri Jan 14 09:23:13 EST 2011


I am studying CAN-bus chip Linux driver, MCP251x.c in the kernel source.
However, I find a little confused about how this driver works, it registers
itself as a SPI slave device using the structure
struct spi_driver  mcp2510_can_driver = {
    .driver = {...}
    .probe=
    ...
}
In probe function, it registers itself as a "net_device" with
"mcp251x_netdev_ops". So I am not sure how this system works.

I know that the userspace must see it as a network driver. But can userspace
really see this driver? Or what it can see is the module "can.ko" -- the
protocol stack ?
Does the network stack talks to SPI and SPI talks to mcp2510 chip and
transmit messages can-bus? Or something else?

Thanks

-- 
Cheng(誠)

My Page: http://freakrobot.blogbus.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110114/4ae80cd0/attachment.html 


More information about the Kernelnewbies mailing list