Date: Thu, 27 Jun 1996 23:02:36 +1000 From: Bruce Evans <bde@zeta.org.au> To: cau@cc.gatech.edu, freebsd-scsi@FreeBSD.org Subject: Re: help writing a new SCSI device driver Message-ID: <199606271302.XAA11215@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>Could someone give me a description of the following? I'd like >to know what they are supposed to do (description, what to return, >whatever). >-xx_init() - is this required? I see it in the drivers, but not > as one of the elements of the scsi_* structures... Internal to drivers. Many of the SCSI drivers have a common ancestry so their function names are often similar. Many (not necessarily SCSI) drivers follow the convention that local functions are named xx_foo and global functions are named xxfoo. >-xx_scsi_cmd() This is the main entry point to the driver. It can be named anything, but there must be a corresponding entry in the scsi adapter struct. >-xx_minphys() This is to stop physio() from requesting a larger block size than the driver can handle (e.g., 256 scattered blocks of 4K when the driver can only handle 16 scattered blocks. physio() actually never asks for more than 64K). >-xx_adapter_info() Another entry in the scsi adapter struct. >-xxintr() Interrupt handler for driver xx. >-KVTOPHYS, PHYSTOKV Kernel Virtual address TO PHYSical address and the reverse. >-splbio(), splx(), other spl() calls See a daemon book. SCSI drivers should need only splbio() and splx() (to protect critical code from being interrupted). Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606271302.XAA11215>