hat_getkpfnum() DDI 函数已过时。开发者应更新他们的设备驱动程序,以便不使用 hat_getkpfnum() DDI 接口。如果驱动程序使用 hat_getkpfnum(),会显示与下例相似的警告:
WARNING: Module mydrv is using the obsolete hat_getkpfnum(9F) interface in a way that will not be supported in a future release of Solaris. Please contact the vendor that supplied the module for assistance, or consult the Writing Device Drivers guide, available from http://www.sun.com for migration advice. --- Callstack of bad caller: hat_getkpfnum_badcall+93 hat_getkpfnum+6e mydrv_setup_tx_ring+2d mydrv_do_attach+84 mydrv_attach+242 devi_attach+6f attach_node+62 i_ndi_config_node+82 i_ddi_attachchild+4a devi_attach_node+4b devi_attach_children+57 config_immediate_children+6e devi_config_common+77 mt_config_thread+8b |
要确定驱动程序是否在使用 hat_getkpfnum(),请参阅驱动程序源代码,或者使用 nm() 检查驱动程序的符号。使用驱动程序 mydrv 为例,键入以下语法:
% nm /usr/kernel/drv/mydrv | grep hat_getkpfnum |
有关从 hat_getkpfnum() 迁移出驱动程序的指南,请参阅《编写设备驱动程序》中的附录 B “Solaris DDI/DKI 服务汇总”。