FreeBSD/sys/dev/isci/isci.c
/**
 * @brief In this method the user must read from PCI memory via access.
 *        This method is used for access to memory space and IO space.
 *
 * @param[in]  controller The controller for which to read a DWORD.
 * @param[in]  address This parameter depicts the address from
 *             which to read.
 *
 * @return The value being returned from the PCI memory location.
 *
 * @todo This PCI memory access calls likely need to be optimized into macro?
 */
@brief In this method the user must read from PCI memory via access.
This method is used for access to memory space and IO space.

@param[in]  controller The controller for which to read a DWORD.
@param[in]  address This parameter depicts the address from
which to read.

@return The value being returned from the PCI memory location.


@brief In this method the user must read from PCI memory via access . This method is used for access to memory space and IO space . @param [ in ] controller The controller for which to read a DWORD . @param [ in ] address This parameter depicts the address from which to read . @return The value being returned from the PCI memory location .
uint32_t
scic_cb_pci_read_dword(SCI_CONTROLLER_HANDLE_T scic_controller, void *address)
{
	SCI_CONTROLLER_HANDLE_T scif_controller =
		(SCI_CONTROLLER_HANDLE_T)sci_object_get_association(scic_controller);
	struct ISCI_CONTROLLER *isci_controller =
		(struct ISCI_CONTROLLER *)sci_object_get_association(scif_controller);
	struct isci_softc *isci = isci_controller->isci;
	uint32_t bar = (uint32_t)(((POINTER_UINT)address & 0xF0000000) >> 28);
	bus_size_t offset = (bus_size_t)((POINTER_UINT)address & 0x0FFFFFFF);
	return (bus_space_read_4(isci->pci_bar[bar].bus_tag,
	    isci->pci_bar[bar].bus_handle, offset));
}
uint32_t scic_cb_pci_read_dword ( SCI_CONTROLLER_HANDLE_T scic_controller , void * address ) { SCI_CONTROLLER_HANDLE_T scif_controller = ( SCI_CONTROLLER_HANDLE_T ) sci_object_get_association ( scic_controller ) ; struct ISCI_CONTROLLER * isci_controller = ( struct ISCI_CONTROLLER * ) sci_object_get_association ( scif_controller ) ; struct isci_softc * isci = isci_controller -> isci ; uint32_t bar = ( uint32_t ) ( ( ( POINTER_UINT ) address & 0xF0000000 ) >> 28 ) ; bus_size_t offset = ( bus_size_t ) ( ( POINTER_UINT ) address & 0x0FFFFFFF ) ; return ( bus_space_read_4 ( isci -> pci_bar [ bar ] . bus_tag , isci -> pci_bar [ bar ] . bus_handle , offset ) ) ; }
@brief In this method the user must read from PCI memory via access.
@brief In this method the user must read from PCI memory via access .