Add a yet unused physical memory version of queue_bulk_v(). For full/lowspeed
devices it's uninteresting, but for EHCI it may be implemented some day. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36246 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -187,7 +187,7 @@ BulkPipe::QueueBulk(void *data, size_t dataLength, usb_callback_func callback,
|
||||
|
||||
status_t
|
||||
BulkPipe::QueueBulkV(iovec *vector, size_t vectorCount,
|
||||
usb_callback_func callback, void *callbackCookie)
|
||||
usb_callback_func callback, void *callbackCookie, bool physical)
|
||||
{
|
||||
if (vectorCount > 0 && vector == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -196,6 +196,7 @@ BulkPipe::QueueBulkV(iovec *vector, size_t vectorCount,
|
||||
if (!transfer)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
transfer->SetPhysical(physical);
|
||||
transfer->SetVector(vector, vectorCount);
|
||||
transfer->SetCallback(callback, callbackCookie);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ Transfer::Transfer(Pipe *pipe)
|
||||
fVector(&fData),
|
||||
fVectorCount(0),
|
||||
fBaseAddress(NULL),
|
||||
fPhysical(false),
|
||||
fFragmented(false),
|
||||
fActualLength(0),
|
||||
fUserArea(-1),
|
||||
@@ -76,6 +77,13 @@ Transfer::SetData(uint8 *data, size_t dataLength)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Transfer::SetPhysical(bool physical)
|
||||
{
|
||||
fPhysical = physical;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Transfer::SetVector(iovec *vector, size_t vectorCount)
|
||||
{
|
||||
|
||||
@@ -323,14 +323,29 @@ status_t
|
||||
queue_bulk_v(usb_pipe pipe, iovec *vector, size_t vectorCount,
|
||||
usb_callback_func callback, void *callbackCookie)
|
||||
{
|
||||
TRACE_MODULE("queue_bulk(%ld, %p, %ld, %p, %p)\n",
|
||||
TRACE_MODULE("queue_bulk_v(%ld, %p, %ld, %p, %p)\n",
|
||||
pipe, vector, vectorCount, callback, callbackCookie);
|
||||
Object *object = gUSBStack->GetObject(pipe);
|
||||
if (!object || (object->Type() & USB_OBJECT_BULK_PIPE) == 0)
|
||||
return B_DEV_INVALID_PIPE;
|
||||
|
||||
return ((BulkPipe *)object)->QueueBulkV(vector, vectorCount, callback,
|
||||
callbackCookie);
|
||||
callbackCookie, false);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
queue_bulk_v_physical(usb_pipe pipe, iovec *vector, size_t vectorCount,
|
||||
usb_callback_func callback, void *callbackCookie)
|
||||
{
|
||||
TRACE_MODULE("queue_bulk_v_physical(%ld, %p, %ld, %p, %p)\n",
|
||||
pipe, vector, vectorCount, callback, callbackCookie);
|
||||
Object *object = gUSBStack->GetObject(pipe);
|
||||
if (!object || (object->Type() & USB_OBJECT_BULK_PIPE) == 0)
|
||||
return B_DEV_INVALID_PIPE;
|
||||
|
||||
return ((BulkPipe *)object)->QueueBulkV(vector, vectorCount, callback,
|
||||
callbackCookie, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -537,6 +552,7 @@ struct usb_module_info gModuleInfoV3 = {
|
||||
get_device_parent, // get_device_parent
|
||||
reset_port, // reset_port
|
||||
disable_port // disable_port
|
||||
//queue_bulk_v_physical // queue_bulk_v_physical
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -397,7 +397,8 @@ virtual const char * TypeName() { return "bulk pipe"; };
|
||||
status_t QueueBulkV(iovec *vector,
|
||||
size_t vectorCount,
|
||||
usb_callback_func callback,
|
||||
void *callbackCookie);
|
||||
void *callbackCookie,
|
||||
bool physical);
|
||||
};
|
||||
|
||||
|
||||
@@ -603,6 +604,9 @@ public:
|
||||
uint8 * Data() { return (uint8 *)fData.iov_base; };
|
||||
size_t DataLength() { return fData.iov_len; };
|
||||
|
||||
void SetPhysical(bool physical);
|
||||
bool IsPhysical() { return fPhysical; };
|
||||
|
||||
void SetVector(iovec *vector, size_t vectorCount);
|
||||
iovec * Vector() { return fVector; };
|
||||
size_t VectorCount() { return fVectorCount; };
|
||||
@@ -633,6 +637,7 @@ private:
|
||||
iovec * fVector;
|
||||
size_t fVectorCount;
|
||||
void * fBaseAddress;
|
||||
bool fPhysical;
|
||||
bool fFragmented;
|
||||
size_t fActualLength;
|
||||
area_id fUserArea;
|
||||
|
||||
Reference in New Issue
Block a user