how CAN-bus Linux driver MCP251x.c works

cheng chen freakrobot at
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 = {...}
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?



My Page:
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list