From owner-freebsd-scsi Thu Jun 27 06:08:33 1996 Return-Path: owner-freebsd-scsi Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA23176 for freebsd-scsi-outgoing; Thu, 27 Jun 1996 06:08:33 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id GAA23169 for ; Thu, 27 Jun 1996 06:08:26 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id XAA11215; Thu, 27 Jun 1996 23:02:36 +1000 Date: Thu, 27 Jun 1996 23:02:36 +1000 From: Bruce Evans Message-Id: <199606271302.XAA11215@godzilla.zeta.org.au> To: cau@cc.gatech.edu, freebsd-scsi@FreeBSD.org Subject: Re: help writing a new SCSI device driver Sender: owner-freebsd-scsi@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >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