How to register a device in Linux

I need to register a new device in Linux, but I noticed that in the 2.6.34 kernel the function is device_registernot exported ... What could be the solution?

+3
source share
3 answers

I believe that you are better off using register_blkdevor register_chrdev, depending on the type of device.

+2
source

In linux-2.6.32.28 / drivers / base

core.c:EXPORT_SYMBOL_GPL(device_register);

ANd for 2.6.38 is also in the same file, which concludes in 2.6.34, should it be in the same file?

But if u talks about mdio, the following characters are found (via nm vmlinux):

ffffffff81b66fae t fixed_mdio_bus_exit
ffffffff81af4468 t fixed_mdio_bus_init
ffffffff813977f0 t fixed_mdio_read
ffffffff81397610 t fixed_mdio_write
ffffffff81a68760 d mdio_bus_class
ffffffff813971b0 T mdio_bus_exit
ffffffff81af4425 T mdio_bus_init
ffffffff81396fd0 t mdio_bus_match
ffffffff81a687e0 d mdio_bus_pm_ops
ffffffff81396ff0 t mdio_bus_restore
ffffffff81397050 t mdio_bus_resume
ffffffff81397100 t mdio_bus_suspend
ffffffff81a686e0 D mdio_bus_type
ffffffff813975d0 T mdiobus_alloc
ffffffff81397380 T mdiobus_free
ffffffff813972a0 T mdiobus_read
ffffffff81397430 T mdiobus_register
ffffffff813971e0 t mdiobus_release
ffffffff81397330 T mdiobus_scan
ffffffff813973c0 T mdiobus_unregister
ffffffff81397210 T mdiobus_write

and for mii:

ffffffff81507a20 T dsa_slave_mii_bus_init
ffffffff81395b60 T phy_mii_ioctl

And for the EXPORT_SYMBOL declaration:

./drivers/of/of_mdio.c:
EXPORT_SYMBOL(of_mdiobus_register);

./drivers/net/phy/mdio-bitbang.c:
EXPORT_SYMBOL(alloc_mdio_bitbang);
EXPORT_SYMBOL(free_mdio_bitbang);

./drivers/net/phy/mdio_bus.c:
EXPORT_SYMBOL(mdiobus_alloc);
EXPORT_SYMBOL(mdiobus_register);
EXPORT_SYMBOL(mdiobus_unregister);
EXPORT_SYMBOL(mdiobus_free);
EXPORT_SYMBOL(mdiobus_scan);
EXPORT_SYMBOL(mdiobus_read);
EXPORT_SYMBOL(mdiobus_write);
EXPORT_SYMBOL(mdio_bus_type);

./drivers/net/phy/mdio-octeon.c:
EXPORT_SYMBOL(octeon_mdiobus_force_mod_depencency);

./drivers/net/fec_mpc52xx_phy.c:
EXPORT_SYMBOL_GPL(mpc52xx_fec_mdio_driver);

./drivers/net/mdio.c:
EXPORT_SYMBOL(mdio45_probe);
EXPORT_SYMBOL(mdio_set_flag);
EXPORT_SYMBOL(mdio45_links_ok);
EXPORT_SYMBOL(mdio45_nway_restart);
EXPORT_SYMBOL(mdio45_ethtool_gset_npage);
EXPORT_SYMBOL(mdio45_ethtool_spauseparam_an);
EXPORT_SYMBOL(mdio_mii_ioctl);

./drivers/net/fsl_pq_mdio.c:
EXPORT_SYMBOL_GPL(fsl_pq_mdio_bus_name);

./drivers/s390/net/qeth_core_main.c:
EXPORT_SYMBOL_GPL(qeth_mdio_read);

Not sure if they will help you?

Your similar question is located at:

http://www.linuxforums.org/forum/kernel/178782-how-control-switch-marvel-88e6097-mdio-bus-mpc8306-processor.html

. MPC8306 ( , linux-kernel specific ..) :

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC830xKIT

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8306

:

http://patchwork.ozlabs.org/patch/21828/

MDIO .

:

http://www.mail-archive.com/eldk@lists.denx.de/msg00235.html

, ELDK MPC8306 .

:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8306&fpsp=1&tab=Documentation_Tab

+1

O'Reillys O'reilly. , . , , ...

0
source

All Articles