xref: /haiku/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.h (revision 4f6fa362cfa47f22a0c789a42d35556d7ac25a31)
121255d1fSMarcus Overhagen /*
221255d1fSMarcus Overhagen  * Copyright 2007, Marcus Overhagen. All rights reserved.
321255d1fSMarcus Overhagen  * Distributed under the terms of the MIT License.
421255d1fSMarcus Overhagen  */
521255d1fSMarcus Overhagen #ifndef _AHCI_CONTROLLER_H
621255d1fSMarcus Overhagen #define _AHCI_CONTROLLER_H
721255d1fSMarcus Overhagen 
821255d1fSMarcus Overhagen 
921255d1fSMarcus Overhagen #include "ahci_defs.h"
1021255d1fSMarcus Overhagen 
1121255d1fSMarcus Overhagen 
12*4f6fa362SAxel Dörfler class AHCIController {
13*4f6fa362SAxel Dörfler public:
14*4f6fa362SAxel Dörfler 				AHCIController(device_node_handle node,
15*4f6fa362SAxel Dörfler 					pci_device_info *pciDevice);
16*4f6fa362SAxel Dörfler 				~AHCIController();
1721255d1fSMarcus Overhagen 
1821255d1fSMarcus Overhagen 	void		ExecuteRequest(scsi_ccb *request);
1921255d1fSMarcus Overhagen 	uchar		AbortRequest(scsi_ccb *request);
2021255d1fSMarcus Overhagen 	uchar		TerminateRequest(scsi_ccb *request);
2121255d1fSMarcus Overhagen 	uchar		ResetDevice(uchar targetID, uchar targetLUN);
2221255d1fSMarcus Overhagen 
23*4f6fa362SAxel Dörfler 	device_node_handle DeviceNode() { return fNode; }
2421255d1fSMarcus Overhagen 
2521255d1fSMarcus Overhagen private:
2621255d1fSMarcus Overhagen 	bool		IsDevicePresent(uint device);
2721255d1fSMarcus Overhagen 
2821255d1fSMarcus Overhagen private:
2921255d1fSMarcus Overhagen 	device_node_handle 			fNode;
30*4f6fa362SAxel Dörfler 	pci_device_info*			fPCIDevice;
3121255d1fSMarcus Overhagen 	uint32						fDevicePresentMask;
3221255d1fSMarcus Overhagen };
3321255d1fSMarcus Overhagen 
3421255d1fSMarcus Overhagen 
3521255d1fSMarcus Overhagen inline bool
3621255d1fSMarcus Overhagen AHCIController::IsDevicePresent(uint device)
3721255d1fSMarcus Overhagen {
3821255d1fSMarcus Overhagen 	return fDevicePresentMask & (1 << device);
3921255d1fSMarcus Overhagen }
4021255d1fSMarcus Overhagen 
4121255d1fSMarcus Overhagen 
42*4f6fa362SAxel Dörfler #endif	// _AHCI_CONTROLLER_H
43