Skip Navigation Links | |
Exit Print View | |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 11.1 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_get_device_type_string(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- allocate an I/O buffer for SCSI DMA
#include <sys/scsi/scsi.h> struct buf *scsi_alloc_consistent_buf(structscsi_address*ap, struct buf *bp, size_t datalen, uint_t bflags, int (*callback)(caddr_t), caddr_t arg);
Solaris DDI specific (Solaris DDI).
Pointer to the scsi_address(9S) structure.
Pointer to the buf(9S) structure.
Number of bytes for the data buffer.
Flags setting for the allocated buffer header. This should either be B_READ or B_WRITE.
A pointer to a callback function, NULL_FUNC or SLEEP_FUNC.
The callback function argument.
The scsi_alloc_consistent_buf() function returns allocates a buffer header and the associated data buffer for direct memory access (DMA) transfer. This buffer is allocated from the iobp space, which is considered consistent memory. For more details, see ddi_dma_mem_alloc(9F) and ddi_dma_sync(9F).
For buffers allocated via scsi_alloc_consistent_buf(), and marked with the PKT_CONSISTENT flag via scsi_init_pkt(9F), the HBA driver must ensure that the data transfer for the command is correctly synchronized before the target driver's command completion callback is performed.
If bp is NULL, a new buffer header will be allocated using getrbuf(9F). In addition, if datalen is non-zero, a new buffer will be allocated using ddi_dma_mem_alloc(9F).
callback indicates what the allocator routines should do when direct memory access (DMA) resources are not available; the valid values are:
Do not wait for resources. Return a NULL pointer.
Wait indefinitely for resources.
callback points to a function that is called when resources may become available. callback must return either 0 (indicating that it attempted to allocate resources but failed to do so), in which case it is put back on a list to be called again later, or 1 indicating either success in allocating resources or indicating that it no longer cares for a retry. The last argument arg is supplied to the callback function when it is invoked.
The scsi_alloc_consistent_buf() function returns a pointer to a buf(9S) structure on success. It returns NULL if resources are not available even if waitfunc was not SLEEP_FUNC.
If callback is SLEEP_FUNC, then this routine may be called only from user-level code. Otherwise, it may be called fromuser, interrupt, or kernel context. The callback function may not block or call routines that block.
Example 1 Allocate a request sense packet with consistent DMA resources attached.
bp = scsi_alloc_consistent_buf(&devp->sd_address, NULL, SENSE_LENGTH, B_READ, SLEEP_FUNC, NULL); rqpkt = scsi_init_pkt(&devp->sd_address, NULL, bp, CDB_GROUP0, 1, 0, PKT_CONSISTENT, SLEEP_FUNC, NULL);
Example 2 Allocate an inquiry packet with consistent DMA resources attached.
bp = scsi_alloc_consistent_buf(&devp->sd_address, NULL, SUN_INQSIZE, B_READ, canwait, NULL); if (bp) { pkt = scsi_init_pkt(&devp->sd_address, NULL, bp, CDB_GROUP0, 1, PP_LEN, PKT_CONSISTENT, canwait, NULL); }
ddi_dma_mem_alloc(9F), ddi_dma_sync(9F), getrbuf(9F), scsi_destroy_pkt(9F), scsi_init_pkt(9F), scsi_free_consistent_buf(9F), buf(9S), scsi_address(9S)