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/