question on cdevsw_add mask/match

看板DFBSD_kernel作者時間21年前 (2005/03/19 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/6 (看更多)
I'm a little confused as how to correctly specify mask and match for cdevsw_add() and cdevsw_remove(). There are a number of drivers that specify mask and match similar to the following cdevsw_add(&isp_cdevsw, -1, device_get_unit(isp->isp_dev)); (not to single out the QLogic driver ;^) ). The problem with this specification is on a kldunload, the kernel will spit out the following svd(202)[ffffffff/00000000]: Warning: cdevsw_remove() called while 1 device refs still exist! because destroy_all_dev() uses the mask (0xffffffff) on dev->si_udev and compares it to the match value (0) which won't match because si_udev is a combination of the major and minor numbers (0xca00 in the above case) and not the unit number. The question is what is the correct way to specify mask/match? In my case, 0/0 "works" but I wasn't sure if that specification is correct. -- Chuck Tuffli Agilent Technologies
文章代碼(AID): #12EsJv00 (DFBSD_kernel)
文章代碼(AID): #12EsJv00 (DFBSD_kernel)