Source
...
Target
...@@ -18,3 +18,4 @@ ...@@ -18,3 +18,4 @@
#define USBDriver_InsertTransfer 0x054a42 #define USBDriver_InsertTransfer 0x054a42
#define USBDriver_TransferComplete 0x054a43 #define USBDriver_TransferComplete 0x054a43
#define USBDriver_ScheduleSoftInterrupt 0x054a44 #define USBDriver_ScheduleSoftInterrupt 0x054a44
#define USBDriver_Version 0x054a45
This diff is collapsed.
; Copyright 2011 Castle Technology Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; Assembler version of port.c, for use with HAL version of the USB drivers
; See also usbhal.c for some bits which were easier done in C.
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:ImageSize.<ImageSize>
GET Hdr.usbhal
sb RN 9
AREA |C$$code|, CODE, READONLY
; External interfaces to HAL code
IMPORT USBHAL_WorkspaceOffset
IMPORT HAL_CounterDelay
IMPORT snprintf
IMPORT printf
; Internal interfaces to rest of HAL USB code
EXPORT spltty
EXPORT splx
EXPORT splbio
EXPORT delay
EXPORT selrecord
EXPORT selwakeup
EXPORT config_deactivate
EXPORT uiomove
EXPORT psignal
EXPORT kthread_create
EXPORT kthread_create1
EXPORT kthread_exit
EXPORT device_probe_and_attach
EXPORT ratecheck
EXPORT malloc_contig
EXPORT free_contig
EXPORT min
EXPORT logprintf
EXPORT cold
EXPORT hz
EXPORT _snprintf
EXPORT malloc
EXPORT free
IMPORT HALHeap_GetArea
IMPORT HALHeap_GetAreaAligned
IMPORT HALHeap_FreeArea
cold
DCD 0
hz
DCD 1000
spltty
MRS a1, CPSR
AND a1, a1, #I32_bit
MOV pc, lr
splx
TST a1, #I32_bit
MRSEQ a2, CPSR
BICEQ a2, a2, #I32_bit
MSREQ CPSR_c, a2
MOV pc, lr
splbio
MRS a1, CPSR
ORR a2, a1, #I32_bit
AND a1, a1, #I32_bit
MSR CPSR_c, a2
MOV pc, lr
delay
B HAL_CounterDelay
logprintf
B printf
kthread_create1
config_deactivate
uiomove
kthread_create
ratecheck
MOV a1, #0
selrecord
selwakeup
psignal
kthread_exit
device_probe_and_attach
MOV pc, lr
min
CMP a1, a2
MOVGT a1, a2
MOV pc, lr
_snprintf
B snprintf
malloc
; Note that this is a vanilla implementation, i.e. no M_ZERO support
; (but the usbdriver sources already deal with that)
MOV r1, r0
LDR r2, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_Normal
LDR r0, [sb, r2]
B HALHeap_GetArea
free
MOV r1, r0
LDR r2, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_Normal
LDR r0, [sb, r2]
B HALHeap_FreeArea
malloc_contig
; R0 = length
; R1 = alignment
ADD r0, r0, #3 ; Make size multiple of 4 for easy memset
BIC r0, r0, #3
Push "r0,lr"
LDR r3, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_NCNB
MOV r2, r1
MOV r1, r0
LDR r0, [sb, r3]
BL HALHeap_GetAreaAligned
Pull "r1,lr"
CMP r0, #0
MOVEQ pc, lr
; Zero the memory
MOV ip, #0
10
SUBS r1, r1, #4
STR ip, [r0, r1]
BGT %BT10
MOV pc, lr
free_contig
; R0 = pointer to pointer
LDR r2, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_NCNB
LDR r1, [r0]
LDR r0, [sb, r2]
B HALHeap_FreeArea
END
...@@ -16,32 +16,43 @@ ...@@ -16,32 +16,43 @@
; trigger callbacks by calling OS_LeaveOS and OS_EnterOS ; trigger callbacks by calling OS_LeaveOS and OS_EnterOS
GET Hdr:ListOpts GET Hdr:ListOpts
OPT OptNoList OPT OptNoList
GET Hdr:PublicWS GET Hdr:PublicWS
GET Hdr:Macros
GET Hdr:System
GET Hdr:OSRSI6
AREA |C$$code|, CODE, READONLY AREA |C$$data|, DATA
ptr_IRQsema
DCD 0 ; Cached IRQsema ptr
EXPORT triggercbs AREA |C$$code|, CODE, READONLY
EXPORT triggercbs
triggercbs triggercbs
; MOV ip, lr ; seen cases of ip corrupted stmfd r13!, {lr}
stmfd r13!, {lr} LDR r3, =ptr_IRQsema
MOV lr, #0 LDR r1, [sl,#-536] ; Get relocation
; LDR lr, [lr,#&420] ; kernel's CDA semaphore ADD r3, r3, r1
; MOVS lr, lr LDR r2, [r3]
; BNE %ft2 CMP r2, #0
LDR lr, [lr,#IRQsema] ; kernel's IRQ semaphore BNE %FT10
MOVS lr, lr MOV r0, #6
; BNE %ft1 MOV r1, #0
LDMNEFD r13!,{pc} ; NZ is within IRQ.. so no CB allowed MOV r2, #OSRSI6_IRQsema
SWI &7c SWI XOS_ReadSysInfo
SWI &16 MOVVS r2, #0
ldmfd r13!,{pc} CMP r2, #0
; MOV pc, ip MOVEQ r2, #Legacy_IRQsema
;2 STR r2, [r3]
; DCD &ff000000 ;illegal instr to abort to indicate 10
; attempt to trigger cb whilst cda threaded LDR lr, [r2]
;1 MOVS lr, lr
; DCD &ff000000 ;illegal instr to abort to indicate LDMNEFD r13!,{pc} ; NZ is within IRQ.. so no CB allowed
; attempt to trigger CB in IRQ SWI OS_LeaveOS
SWI OS_EnterOS
ldmfd r13!,{pc}
LTORG
END END
This diff is collapsed.
/* $NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $ */ /* $NetBSD: hid.c,v 1.30 2010/05/14 17:32:57 plunky Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */ /* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
/* /*
...@@ -17,13 +17,6 @@ ...@@ -17,13 +17,6 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
...@@ -38,8 +31,13 @@ ...@@ -38,8 +31,13 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef __riscos
#include <dev/usb/usbhal.h>
#endif
#include <sys/cdefs.h> #include <sys/cdefs.h>
//__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $"); #ifndef __riscos
__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.30 2010/05/14 17:32:57 plunky Exp $");
#endif
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
...@@ -68,9 +66,9 @@ Static void hid_clear_local(struct hid_item *); ...@@ -68,9 +66,9 @@ Static void hid_clear_local(struct hid_item *);
#define MAXUSAGE 256 #define MAXUSAGE 256
struct hid_data { struct hid_data {
u_char *start; const u_char *start;
u_char *end; const u_char *end;
u_char *p; const u_char *p;
struct hid_item cur; struct hid_item cur;
int32_t usages[MAXUSAGE]; int32_t usages[MAXUSAGE];
int nu; int nu;
...@@ -98,7 +96,7 @@ hid_clear_local(struct hid_item *c) ...@@ -98,7 +96,7 @@ hid_clear_local(struct hid_item *c)
} }
struct hid_data * struct hid_data *
hid_start_parse(void *d, int len, enum hid_kind kind) hid_start_parse(const void *d, int len, enum hid_kind kind)
{ {
struct hid_data *s; struct hid_data *s;
...@@ -108,7 +106,7 @@ hid_start_parse(void *d, int len, enum hid_kind kind) ...@@ -108,7 +106,7 @@ hid_start_parse(void *d, int len, enum hid_kind kind)
memset(s, 0, sizeof *s); memset(s, 0, sizeof *s);
#endif #endif
s->start = s->p = d; s->start = s->p = d;
s->end = (void*) ((char *)d + len); s->end = ((const u_char *)d) + len;
s->kind = kind; s->kind = kind;
return (s); return (s);
} }
...@@ -131,9 +129,9 @@ hid_get_item(struct hid_data *s, struct hid_item *h) ...@@ -131,9 +129,9 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
struct hid_item *c = &s->cur; struct hid_item *c = &s->cur;
unsigned int bTag, bType, bSize; unsigned int bTag, bType, bSize;
u_int32_t oldpos; u_int32_t oldpos;
u_char *data; const u_char *data;
int32_t dval; int32_t dval;
u_char *p; const u_char *p;
struct hid_item *hi; struct hid_item *hi;
int i; int i;
enum hid_kind retkind; enum hid_kind retkind;
...@@ -200,7 +198,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) ...@@ -200,7 +198,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
dval |= *data++ << 24; dval |= *data++ << 24;
break; break;
default: default:
printf("BAD LENGTH %d\n", bSize); printf("BAD LENGTH %d\n", bSize);
continue; continue;
} }
...@@ -267,7 +265,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) ...@@ -267,7 +265,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
s->nu = 0; s->nu = 0;
return (1); return (1);
default: default:
printf("Main bTag=%d\n", bTag); printf("Main bTag=%d\n", bTag);
break; break;
} }
break; break;
...@@ -306,18 +304,18 @@ hid_get_item(struct hid_data *s, struct hid_item *h) ...@@ -306,18 +304,18 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
break; break;
case 10: /* Push */ case 10: /* Push */
hi = malloc(sizeof *hi, M_TEMP, M_WAITOK); hi = malloc(sizeof *hi, M_TEMP, M_WAITOK);
*hi = s->cur; *hi = *c;
c->next = hi; c->next = hi;
break; break;
case 11: /* Pop */ case 11: /* Pop */
hi = c->next; hi = c->next;
oldpos = c->loc.pos; oldpos = c->loc.pos;
s->cur = *hi; *c = *hi;
c->loc.pos = oldpos; c->loc.pos = oldpos;
free(hi, M_TEMP); free(hi, M_TEMP);
break; break;
default: default:
printf("Global bTag=%d\n", bTag); printf("Global bTag=%d\n", bTag);
break; break;
} }
break; break;
...@@ -370,19 +368,19 @@ hid_get_item(struct hid_data *s, struct hid_item *h) ...@@ -370,19 +368,19 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
c->set_delimiter = dval; c->set_delimiter = dval;
break; break;
default: default:
printf("Local bTag=%d\n", bTag); printf("Local bTag=%d\n", bTag);
break; break;
} }
break; break;
default: default:
printf("default bType=%d\n", bType); printf("default bType=%d\n", bType);
break; break;
} }
} }
} }
int int
hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id) hid_report_size(const void *buf, int len, enum hid_kind k, u_int8_t id)
{ {
struct hid_data *d; struct hid_data *d;
struct hid_item h; struct hid_item h;
...@@ -401,7 +399,7 @@ hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id) ...@@ -401,7 +399,7 @@ hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id)
lo = h.loc.pos; lo = h.loc.pos;
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (lo != 0) { if (lo != 0) {
printf("hid_report_size: lo != 0\n"); printf("hid_report_size: lo != 0\n");
} }
#endif #endif
} }
...@@ -414,7 +412,7 @@ hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id) ...@@ -414,7 +412,7 @@ hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id)
} }
int int
hid_locate(void *desc, int size, u_int32_t u, u_int8_t id, enum hid_kind k, hid_locate(const void *desc, int size, u_int32_t u, u_int8_t id, enum hid_kind k,
struct hid_location *loc, u_int32_t *flags) struct hid_location *loc, u_int32_t *flags)
{ {
struct hid_data *d; struct hid_data *d;
...@@ -440,41 +438,73 @@ hid_locate(void *desc, int size, u_int32_t u, u_int8_t id, enum hid_kind k, ...@@ -440,41 +438,73 @@ hid_locate(void *desc, int size, u_int32_t u, u_int8_t id, enum hid_kind k,
return (0); return (0);
} }
long
hid_get_data(const u_char *buf, const struct hid_location *loc)
{
u_int hsize = loc->size;
u_long data;
if (hsize == 0)
return (0);
data = hid_get_udata(buf, loc);
if (data < (1 << (hsize - 1)))
return (data);
return data - (1 << hsize);
}
u_long u_long
hid_get_data(u_char *buf, struct hid_location *loc) hid_get_udata(const u_char *buf, const struct hid_location *loc)
{ {
u_int hpos = loc->pos; u_int hpos = loc->pos;
u_int hsize = loc->size; u_int hsize = loc->size;
u_int32_t data; u_int i, num, off;
int i, s; u_long data;
DPRINTFN(10, ("hid_get_data: loc %d/%d\n", hpos, hsize));
if (hsize == 0) if (hsize == 0)
return (0); return (0);
data = 0; data = 0;
s = hpos / 8; off = hpos / 8;
for (i = hpos; i < hpos+hsize; i += 8) num = (hpos + hsize + 7) / 8 - off;
data |= buf[i / 8] << ((i / 8 - s) * 8);
for (i = 0; i < num; i++)
data |= buf[off + i] << (i * 8);
data >>= hpos % 8; data >>= hpos % 8;
data &= (1 << hsize) - 1; data &= (1 << hsize) - 1;
hsize = 32 - hsize;
/* Sign extend */ DPRINTFN(10,("hid_get_udata: loc %d/%d = %lu\n", hpos, hsize, data));
data = ((int32_t)data << hsize) >> hsize;
DPRINTFN(10,("hid_get_data: loc %d/%d = %lu\n",
loc->pos, loc->size, (long)data));
return (data); return (data);
} }
/*
* hid_is_collection(desc, size, id, usage)
*
* This function is broken in the following way.
*
* It is used to discover if the given 'id' is part of 'usage' collection
* in the descriptor in order to match report id against device type.
*
* The semantics of hid_start_parse() means though, that only a single
* kind of report is considered. The current HID code that uses this for
* matching is actually only looking for input reports, so this works
* for now.
*
* This function could try all report kinds (input, output and feature)
* consecutively if necessary, but it may be better to integrate the
* libusbhid code which can consider multiple report kinds simultaneously
*
* Needs some thought.
*/
int int
hid_is_collection(void *desc, int size, u_int8_t id, u_int32_t usage) hid_is_collection(const void *desc, int size, u_int8_t id, u_int32_t usage)
{ {
struct hid_data *hd; struct hid_data *hd;
struct hid_item hi; struct hid_item hi;
u_int32_t coll_usage = ~0; u_int32_t coll_usage = ~0;
hd = hid_start_parse(desc, size, hid_none); hd = hid_start_parse(desc, size, hid_input);
if (hd == NULL) if (hd == NULL)
return (0); return (0);
...@@ -483,10 +513,15 @@ hid_is_collection(void *desc, int size, u_int8_t id, u_int32_t usage) ...@@ -483,10 +513,15 @@ hid_is_collection(void *desc, int size, u_int8_t id, u_int32_t usage)
DPRINTFN(2,("hid_is_collection: kind=%d id=%d usage=0x%x" DPRINTFN(2,("hid_is_collection: kind=%d id=%d usage=0x%x"
"(0x%x)\n", "(0x%x)\n",
hi.kind, hi.report_ID, hi.usage, coll_usage)); hi.kind, hi.report_ID, hi.usage, coll_usage));
if (hi.kind == hid_collection && if (hi.kind == hid_collection &&
hi.collection == HCOLL_APPLICATION) hi.collection == HCOLL_APPLICATION)
coll_usage = hi.usage; coll_usage = hi.usage;
if (hi.kind == hid_endcollection &&
if (hi.kind == hid_endcollection)
coll_usage = ~0;
if (hi.kind == hid_input &&
coll_usage == usage && coll_usage == usage &&
hi.report_ID == id) { hi.report_ID == id) {
DPRINTFN(2,("hid_is_collection: found\n")); DPRINTFN(2,("hid_is_collection: found\n"));
......
This diff is collapsed.
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
* USB spec: http://www.usb.org/developers/docs/usbspec.zip * USB spec: http://www.usb.org/developers/docs/usbspec.zip
*/ */
#ifdef __riscos
#include <dev/usb/usbhal.h>
#endif
#include <sys/cdefs.h> #include <sys/cdefs.h>
//__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.74 2005/03/02 11:37:27 mycroft Exp $"); //__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.74 2005/03/02 11:37:27 mycroft Exp $");
...@@ -109,7 +112,7 @@ Static bus_child_detached_t uhub_child_detached; ...@@ -109,7 +112,7 @@ Static bus_child_detached_t uhub_child_detached;
USB_DECLARE_DRIVER(uhub); USB_DECLARE_DRIVER(uhub);
#if defined __riscos #if defined __riscos
/* Create the driver instance for the hub connected to hub case */ /* Create the driver instance for the hub connected to hub case */
struct cfattach uhub_uhub_ca = { halconst struct cfattach uhub_uhub_ca = {
sizeof(struct uhub_softc), uhub_match, uhub_attach, sizeof(struct uhub_softc), uhub_match, uhub_attach,
uhub_detach, uhub_activate uhub_detach, uhub_activate
}; };
...@@ -160,7 +163,9 @@ USB_ATTACH(uhub) ...@@ -160,7 +163,9 @@ USB_ATTACH(uhub)
{ {
USB_ATTACH_START(uhub, sc, uaa); USB_ATTACH_START(uhub, sc, uaa);
usbd_device_handle dev = uaa->device; usbd_device_handle dev = uaa->device;
#if !defined(__riscos) || defined(USB_DEBUG)
char devinfo[1024]; char devinfo[1024];
#endif
usbd_status err; usbd_status err;
struct usbd_hub *hub = NULL; struct usbd_hub *hub = NULL;
usb_device_request_t req; usb_device_request_t req;
...@@ -172,6 +177,7 @@ USB_ATTACH(uhub) ...@@ -172,6 +177,7 @@ USB_ATTACH(uhub)
DPRINTFN(1,("uhub_attach\n")); DPRINTFN(1,("uhub_attach\n"));
sc->sc_hub = dev; sc->sc_hub = dev;
#if !defined(__riscos) || defined(USB_DEBUG)
usbd_devinfo(dev, 1, devinfo, sizeof(devinfo)); usbd_devinfo(dev, 1, devinfo, sizeof(devinfo));
USB_ATTACH_SETUP; USB_ATTACH_SETUP;
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
...@@ -182,6 +188,7 @@ USB_ATTACH(uhub) ...@@ -182,6 +188,7 @@ USB_ATTACH(uhub)
UHUB_IS_SINGLE_TT(sc) ? "single" : "multiple", UHUB_IS_SINGLE_TT(sc) ? "single" : "multiple",
UHUB_IS_SINGLE_TT(sc) ? "" : "s"); UHUB_IS_SINGLE_TT(sc) ? "" : "s");
} }
#endif
err = usbd_set_config_index(dev, 0, 1); err = usbd_set_config_index(dev, 0, 1);
if (err) { if (err) {
DPRINTF(("%s: configuration failed, error=%s\n", DPRINTF(("%s: configuration failed, error=%s\n",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef __riscos
#include <dev/usb/usbhal.h>
#endif
#include <sys/cdefs.h> #include <sys/cdefs.h>
//__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.106 2004/10/24 12:52:40 augustss Exp $"); //__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.106 2004/10/24 12:52:40 augustss Exp $");
...@@ -91,6 +94,7 @@ Static void usbd_start_next(usbd_pipe_handle pipe); ...@@ -91,6 +94,7 @@ Static void usbd_start_next(usbd_pipe_handle pipe);
Static usbd_status usbd_open_pipe_ival Static usbd_status usbd_open_pipe_ival
(usbd_interface_handle, u_int8_t, u_int8_t, usbd_pipe_handle *, int); (usbd_interface_handle, u_int8_t, u_int8_t, usbd_pipe_handle *, int);
#ifndef __riscos
Static int usbd_nbuses = 0; Static int usbd_nbuses = 0;
void void
...@@ -104,6 +108,10 @@ usbd_finish(void) ...@@ -104,6 +108,10 @@ usbd_finish(void)
{ {
--usbd_nbuses; --usbd_nbuses;
} }
#else
void usbd_init(void) {}
void usbd_finish(void) {}
#endif
static __inline int static __inline int
usbd_xfer_isread(usbd_xfer_handle xfer) usbd_xfer_isread(usbd_xfer_handle xfer)
...@@ -338,7 +346,7 @@ usbd_transfer(usbd_xfer_handle xfer) ...@@ -338,7 +346,7 @@ usbd_transfer(usbd_xfer_handle xfer)
/* Copy data if going out. */ /* Copy data if going out. */
if (!(xfer->flags & USBD_NO_COPY) && size != 0 && if (!(xfer->flags & USBD_NO_COPY) && size != 0 &&
!usbd_xfer_isread(xfer)) !usbd_xfer_isread(xfer))
#ifdef __riscos #if defined(__riscos) && !defined(USBHAL)
{ {
/* the buffer pointer is actually a buffermanager private ID */ /* the buffer pointer is actually a buffermanager private ID */
if (xfer->rqflags & URQ_RISCOS_BUF) if (xfer->rqflags & URQ_RISCOS_BUF)
...@@ -346,7 +354,7 @@ usbd_transfer(usbd_xfer_handle xfer) ...@@ -346,7 +354,7 @@ usbd_transfer(usbd_xfer_handle xfer)
else else
#endif #endif
memcpy(KERNADDR(dmap, 0), xfer->buffer, size); memcpy(KERNADDR(dmap, 0), xfer->buffer, size);
#ifdef __riscos #if defined(__riscos) && !defined(USBHAL)
} }
#endif #endif
...@@ -612,7 +620,7 @@ usbd_clear_endpoint_stall(usbd_pipe_handle pipe) ...@@ -612,7 +620,7 @@ usbd_clear_endpoint_stall(usbd_pipe_handle pipe)
usbd_device_handle dev = pipe->device; usbd_device_handle dev = pipe->device;
#endif #endif
usb_device_request_t req; usb_device_request_t req;
usbd_status err; usbd_status err = USBD_NORMAL_COMPLETION;
DPRINTFN(8, ("usbd_clear_endpoint_stall\n")); DPRINTFN(8, ("usbd_clear_endpoint_stall\n"));
...@@ -910,7 +918,7 @@ usb_transfer_complete(usbd_xfer_handle xfer) ...@@ -910,7 +918,7 @@ usb_transfer_complete(usbd_xfer_handle xfer)
xfer->actlen = xfer->length; xfer->actlen = xfer->length;
} }
#endif #endif
#ifdef __riscos #if defined(__riscos) && !defined(USBHAL)
/* the buffer pointer is actually a buffermanager private ID, /* the buffer pointer is actually a buffermanager private ID,
but this is sorted out in the code */ but this is sorted out in the code */
if (xfer->rqflags & URQ_RISCOS_BUF) if (xfer->rqflags & URQ_RISCOS_BUF)
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef __riscos
#include <dev/usb/usbhal.h>
#endif
#include <sys/cdefs.h> #include <sys/cdefs.h>
//__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.43 2005/04/12 13:10:14 itohy Exp $"); //__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.43 2005/04/12 13:10:14 itohy Exp $");
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.