scsi_hba_pkt_alloc man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

scsi_hba_pkt_alloc(9F)	 Kernel Functions for Drivers	scsi_hba_pkt_alloc(9F)

NAME
       scsi_hba_pkt_alloc,  scsi_hba_pkt_free  -  allocate and free a scsi_pkt
       structure

SYNOPSIS
       #include <sys/scsi/scsi.h>

       struct	 scsi_pkt    *scsi_hba_pkt_alloc(dev_info_t    *dip,	struct
       scsi_address  *ap,  int	cmdlen, int statuslen, int tgtlen, int hbalen,
       int (*callback, caddr_t arg, caddr_t arg);

       void scsi_hba_pkt_free(struct scsi_address *ap, struct scsi_pkt *pkt);

INTERFACE LEVEL
       Solaris architecture specific (Solaris DDI).

PARAMETERS
       dip	       Pointer to a dev_info_t	structure,  defining  the  HBA
		       driver instance.

       ap	       Pointer	to  a scsi_address(9S) structure, defining the
		       target instance.

       cmdlen	       Length in bytes to be allocated for  the	 SCSI  command
		       descriptor block (CDB).

       statuslen       Length  in  bytes  to  be allocated for the SCSI status
		       completion block (SCB).

       tgtlen	       Length in bytes to be allocated for a private data area
		       for the target driver's exclusive use.

       hbalen	       Length in bytes to be allocated for a private data area
		       for the HBA driver's exclusive use.

       callback	       Indicates  what	scsi_hba_pkt_alloc()  should  do  when
		       resources are not available:

		       NULL_FUNC

			   Do not wait for resources.  Return a NULL pointer.

		       SLEEP_FUNC

			   Wait indefinitely for resources.

       arg	       Must be NULL.

       pkt	       A pointer to a scsi_pkt(9S) structure.

DESCRIPTION
       For scsi_hba_pkt_alloc():

       The scsi_hba_pkt_alloc() function allocates space for a scsi_pkt struc‐
       ture. HBA drivers must use this interface when  allocating  a  scsi_pkt
       from their tran_init_pkt(9E) entry point.

       If callback is NULL_FUNC, scsi_hba_pkt_alloc() may not sleep when allo‐
       cating resources, and callers should be prepared to deal	 with  alloca‐
       tion failures.

       The scsi_hba_pkt_alloc() function copies the scsi_address(9S) structure
       pointed to by ap to the pkt_address field in the scsi_pkt(9S).

       The scsi_hba_pkt_alloc()	 function  also	 allocates  memory  for	 these
       scsi_pkt(9S)  data  areas,  and sets these fields to point to the allo‐
       cated memory:

       pkt_ha_private	       HBA private data area.

       pkt_private	       Target driver private data area.

       pkt_scbp		       SCSI status completion block.

       pkt_cdbp		       SCSI command descriptor block.

       For scsi_hba_pkt_free():

       The scsi_hba_pkt_free() function frees  the  space  allocated  for  the
       scsi_pkt(9S) structure.

RETURN VALUES
       The  scsi_hba_pkt_alloc()  function  returns  a pointer to the scsi_pkt
       structure, or NULL if no space is available.

CONTEXT
       The scsi_hba_pkt_alloc() function can be called from  user,  interrupt,
       or kernel context. Drivers must not allow scsi_hba_pkt_alloc() to sleep
       if called from an interrupt routine.

       The scsi_hba_pkt_free() function can be called from user, interrupt, or
       kernel context.

SEE ALSO
       tran_init_pkt(9E), scsi_address(9S), scsi_pkt(9S)

       Writing Device Drivers

SunOS 5.10			  16 Jan 2006		scsi_hba_pkt_alloc(9F)
[top]

List of man pages available for SunOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net