* Completed SubmitTransfer

* Added SubmitAsyncTransfer and SubmitPeriodicTransfer (not implemented)
* Removed unecessary spinlock 
* Wrapped some lines to follow coding guidelines



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22932 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Salvatore Benedetto
2007-11-15 21:25:16 +00:00
parent 76748b3cb1
commit 3f652d19a6
2 changed files with 35 additions and 9 deletions
+28 -4
View File
@@ -66,7 +66,6 @@ OHCI::OHCI(pci_info *info, Stack *stack)
fPCIInfo(info), fPCIInfo(info),
fStack(stack), fStack(stack),
fRegisterArea(-1), fRegisterArea(-1),
fSpinLock(0),
fHccaArea(-1), fHccaArea(-1),
fDummyControl(NULL), fDummyControl(NULL),
fDummyBulk(NULL), fDummyBulk(NULL),
@@ -264,10 +263,9 @@ OHCI::OHCI(pci_info *info, Stack *stack)
} }
// The controller is now in SUSPEND state, we have 2ms to go OPERATIONAL. // The controller is now in SUSPEND state, we have 2ms to go OPERATIONAL.
// In order to do so we need a spinlock // In order to do so we need to disable interrupts.
cpu_status former = disable_interrupts(); cpu_status former = disable_interrupts();
acquire_spinlock(&fSpinLock);
// Set up host controller register // Set up host controller register
_WriteReg(OHCI_HCCA, (uint32)hccaPhysicalAddress); _WriteReg(OHCI_HCCA, (uint32)hccaPhysicalAddress);
@@ -286,7 +284,6 @@ OHCI::OHCI(pci_info *info, Stack *stack)
// And finally start the controller // And finally start the controller
_WriteReg(OHCI_CONTROL, control); _WriteReg(OHCI_CONTROL, control);
release_spinlock(&fSpinLock);
restore_interrupts(former); restore_interrupts(former);
// The controller is now OPERATIONAL. // The controller is now OPERATIONAL.
@@ -429,6 +426,33 @@ OHCI::SubmitTransfer(Transfer *transfer)
if (transfer->TransferPipe()->DeviceAddress() == fRootHubAddress) if (transfer->TransferPipe()->DeviceAddress() == fRootHubAddress)
return fRootHub->ProcessTransfer(this, transfer); return fRootHub->ProcessTransfer(this, transfer);
uint32 type = transfer->TransferPipe()->Type();
if ((type & USB_OBJECT_CONTROL_PIPE) || (type & USB_OBJECT_BULK_PIPE)) {
TRACE(("usb_ohci: submitting async transfer\n"));
return _SubmitAsyncTransfer(transfer);
}
if ((type & USB_OBJECT_INTERRUPT_PIPE) || (type & USB_OBJECT_ISO_PIPE)) {
TRACE(("usb_ohci: submitting periodic transfer\n"));
return _SubmitPeriodicTransfer(transfer);
}
TRACE_ERROR(("usb_ohci: tried to submit transfer for unknow pipe"
" type %lu\n", type));
return B_ERROR;
}
status_t
OHCI::_SubmitAsyncTransfer(Transfer *transfer)
{
return B_ERROR;
}
status_t
OHCI::_SubmitPeriodicTransfer(Transfer *transfer)
{
return B_ERROR; return B_ERROR;
} }
+7 -5
View File
@@ -59,7 +59,6 @@ public:
virtual status_t SubmitTransfer(Transfer *transfer); virtual status_t SubmitTransfer(Transfer *transfer);
virtual status_t CancelQueuedTransfers(Pipe *pipe, virtual status_t CancelQueuedTransfers(Pipe *pipe,
bool force); bool force);
status_t SubmitRequest(Transfer *transfer);
virtual status_t NotifyPipeChange(Pipe *pipe, virtual status_t NotifyPipeChange(Pipe *pipe,
usb_change change); usb_change change);
@@ -68,7 +67,8 @@ static status_t AddTo(Stack *stack);
// Port operations // Port operations
uint8 PortCount() { return fPortCount; }; uint8 PortCount() { return fPortCount; };
status_t GetPortStatus(uint8 index, usb_port_status *status); status_t GetPortStatus(uint8 index,
usb_port_status *status);
status_t SetPortFeature(uint8 index, uint16 feature); status_t SetPortFeature(uint8 index, uint16 feature);
status_t ClearPortFeature(uint8 index, uint16 feature); status_t ClearPortFeature(uint8 index, uint16 feature);
@@ -82,9 +82,13 @@ static int32 _InterruptHandler(void *data);
static int32 _FinishThread(void *data); static int32 _FinishThread(void *data);
void _FinishTransfer(); void _FinishTransfer();
status_t _SubmitAsyncTransfer(Transfer *transfer);
status_t _SubmitPeriodicTransfer(Transfer *transfer);
// Endpoint related methods // Endpoint related methods
status_t _CreateEndpoint(Pipe *pipe, bool isIsochronous); status_t _CreateEndpoint(Pipe *pipe,
bool isIsochronous);
ohci_endpoint_descriptor *_AllocateEndpoint(); ohci_endpoint_descriptor *_AllocateEndpoint();
void _FreeEndpoint( void _FreeEndpoint(
ohci_endpoint_descriptor *endpoint); ohci_endpoint_descriptor *endpoint);
@@ -109,8 +113,6 @@ static pci_module_info *sPCIModule;
uint32 *fOperationalRegisters; uint32 *fOperationalRegisters;
area_id fRegisterArea; area_id fRegisterArea;
spinlock fSpinLock;
// Host Controller Communication Area related stuff // Host Controller Communication Area related stuff
area_id fHccaArea; area_id fHccaArea;
ohci_hcca *fHcca; ohci_hcca *fHcca;