Fri Oct 16 17:00:16 2015 UTC ()
Whitespace.


(skrll)
diff -r1.234.2.54 -r1.234.2.55 src/sys/dev/usb/ehci.c

cvs diff -r1.234.2.54 -r1.234.2.55 src/sys/dev/usb/ehci.c (expand / switch to unified diff)

--- src/sys/dev/usb/ehci.c 2015/10/11 09:17:51 1.234.2.54
+++ src/sys/dev/usb/ehci.c 2015/10/16 17:00:15 1.234.2.55
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ehci.c,v 1.234.2.54 2015/10/11 09:17:51 skrll Exp $ */ 1/* $NetBSD: ehci.c,v 1.234.2.55 2015/10/16 17:00:15 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2004-2012 The NetBSD Foundation, Inc. 4 * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net), Charles M. Hannum, 8 * by Lennart Augustsson (lennart@augustsson.net), Charles M. Hannum,
9 * Jeremy Morse (jeremy.morse@gmail.com), Jared D. McNeill 9 * Jeremy Morse (jeremy.morse@gmail.com), Jared D. McNeill
10 * (jmcneill@invisible.ca) and Matthew R. Green (mrg@eterna.com.au). 10 * (jmcneill@invisible.ca) and Matthew R. Green (mrg@eterna.com.au).
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -43,27 +43,27 @@ @@ -43,27 +43,27 @@
43 43
44/* 44/*
45 * TODO: 45 * TODO:
46 * 1) hold off explorations by companion controllers until ehci has started. 46 * 1) hold off explorations by companion controllers until ehci has started.
47 * 47 *
48 * 2) The hub driver needs to handle and schedule the transaction translator, 48 * 2) The hub driver needs to handle and schedule the transaction translator,
49 * to assign place in frame where different devices get to go. See chapter 49 * to assign place in frame where different devices get to go. See chapter
50 * on hubs in USB 2.0 for details. 50 * on hubs in USB 2.0 for details.
51 * 51 *
52 * 3) Command failures are not recovered correctly. 52 * 3) Command failures are not recovered correctly.
53 */ 53 */
54 54
55#include <sys/cdefs.h> 55#include <sys/cdefs.h>
56__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.54 2015/10/11 09:17:51 skrll Exp $"); 56__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.55 2015/10/16 17:00:15 skrll Exp $");
57 57
58#include "ohci.h" 58#include "ohci.h"
59#include "uhci.h" 59#include "uhci.h"
60 60
61#ifdef _KERNEL_OPT 61#ifdef _KERNEL_OPT
62#include "opt_usb.h" 62#include "opt_usb.h"
63#endif 63#endif
64 64
65#include <sys/param.h> 65#include <sys/param.h>
66 66
67#include <sys/bus.h> 67#include <sys/bus.h>
68#include <sys/cpu.h> 68#include <sys/cpu.h>
69#include <sys/device.h> 69#include <sys/device.h>
@@ -159,27 +159,27 @@ Static void ehci_check_itd_intr(ehci_so @@ -159,27 +159,27 @@ Static void ehci_check_itd_intr(ehci_so
159Static void ehci_check_sitd_intr(ehci_softc_t *, struct ehci_xfer *); 159Static void ehci_check_sitd_intr(ehci_softc_t *, struct ehci_xfer *);
160Static void ehci_idone(struct ehci_xfer *); 160Static void ehci_idone(struct ehci_xfer *);
161Static void ehci_timeout(void *); 161Static void ehci_timeout(void *);
162Static void ehci_timeout_task(void *); 162Static void ehci_timeout_task(void *);
163Static void ehci_intrlist_timeout(void *); 163Static void ehci_intrlist_timeout(void *);
164Static void ehci_doorbell(void *); 164Static void ehci_doorbell(void *);
165Static void ehci_pcd(void *); 165Static void ehci_pcd(void *);
166 166
167Static struct usbd_xfer * 167Static struct usbd_xfer *
168 ehci_allocx(struct usbd_bus *, unsigned int); 168 ehci_allocx(struct usbd_bus *, unsigned int);
169Static void ehci_freex(struct usbd_bus *, struct usbd_xfer *); 169Static void ehci_freex(struct usbd_bus *, struct usbd_xfer *);
170Static void ehci_get_lock(struct usbd_bus *, kmutex_t **); 170Static void ehci_get_lock(struct usbd_bus *, kmutex_t **);
171Static int ehci_roothub_ctrl(struct usbd_bus *, 171Static int ehci_roothub_ctrl(struct usbd_bus *,
172 usb_device_request_t *, void *, int); 172 usb_device_request_t *, void *, int);
173 173
174Static usbd_status ehci_root_intr_transfer(struct usbd_xfer *); 174Static usbd_status ehci_root_intr_transfer(struct usbd_xfer *);
175Static usbd_status ehci_root_intr_start(struct usbd_xfer *); 175Static usbd_status ehci_root_intr_start(struct usbd_xfer *);
176Static void ehci_root_intr_abort(struct usbd_xfer *); 176Static void ehci_root_intr_abort(struct usbd_xfer *);
177Static void ehci_root_intr_close(struct usbd_pipe *); 177Static void ehci_root_intr_close(struct usbd_pipe *);
178Static void ehci_root_intr_done(struct usbd_xfer *); 178Static void ehci_root_intr_done(struct usbd_xfer *);
179 179
180Static usbd_status ehci_device_ctrl_transfer(struct usbd_xfer *); 180Static usbd_status ehci_device_ctrl_transfer(struct usbd_xfer *);
181Static usbd_status ehci_device_ctrl_start(struct usbd_xfer *); 181Static usbd_status ehci_device_ctrl_start(struct usbd_xfer *);
182Static void ehci_device_ctrl_abort(struct usbd_xfer *); 182Static void ehci_device_ctrl_abort(struct usbd_xfer *);
183Static void ehci_device_ctrl_close(struct usbd_pipe *); 183Static void ehci_device_ctrl_close(struct usbd_pipe *);
184Static void ehci_device_ctrl_done(struct usbd_xfer *); 184Static void ehci_device_ctrl_done(struct usbd_xfer *);
185 185
@@ -202,39 +202,40 @@ Static void ehci_device_isoc_close(stru @@ -202,39 +202,40 @@ Static void ehci_device_isoc_close(stru
202Static void ehci_device_isoc_done(struct usbd_xfer *); 202Static void ehci_device_isoc_done(struct usbd_xfer *);
203 203
204Static usbd_status ehci_device_fs_isoc_transfer(struct usbd_xfer *); 204Static usbd_status ehci_device_fs_isoc_transfer(struct usbd_xfer *);
205Static usbd_status ehci_device_fs_isoc_start(struct usbd_xfer *); 205Static usbd_status ehci_device_fs_isoc_start(struct usbd_xfer *);
206Static void ehci_device_fs_isoc_abort(struct usbd_xfer *); 206Static void ehci_device_fs_isoc_abort(struct usbd_xfer *);
207Static void ehci_device_fs_isoc_close(struct usbd_pipe *); 207Static void ehci_device_fs_isoc_close(struct usbd_pipe *);
208Static void ehci_device_fs_isoc_done(struct usbd_xfer *); 208Static void ehci_device_fs_isoc_done(struct usbd_xfer *);
209 209
210Static void ehci_device_clear_toggle(struct usbd_pipe *); 210Static void ehci_device_clear_toggle(struct usbd_pipe *);
211Static void ehci_noop(struct usbd_pipe *); 211Static void ehci_noop(struct usbd_pipe *);
212 212
213Static void ehci_disown(ehci_softc_t *, int, int); 213Static void ehci_disown(ehci_softc_t *, int, int);
214 214
215Static ehci_soft_qh_t *ehci_alloc_sqh(ehci_softc_t *); 215Static ehci_soft_qh_t * ehci_alloc_sqh(ehci_softc_t *);
216Static void ehci_free_sqh(ehci_softc_t *, ehci_soft_qh_t *); 216Static void ehci_free_sqh(ehci_softc_t *, ehci_soft_qh_t *);
217 217
218Static ehci_soft_qtd_t *ehci_alloc_sqtd(ehci_softc_t *); 218Static ehci_soft_qtd_t *ehci_alloc_sqtd(ehci_softc_t *);
219Static void ehci_free_sqtd(ehci_softc_t *, ehci_soft_qtd_t *); 219Static void ehci_free_sqtd(ehci_softc_t *, ehci_soft_qtd_t *);
220Static usbd_status ehci_alloc_sqtd_chain(struct ehci_pipe *, 220Static usbd_status ehci_alloc_sqtd_chain(struct ehci_pipe *,
221 ehci_softc_t *, int, int, struct usbd_xfer *, 221 ehci_softc_t *, int, int, struct usbd_xfer *,
222 ehci_soft_qtd_t **, ehci_soft_qtd_t **); 222 ehci_soft_qtd_t **, ehci_soft_qtd_t **);
223Static void ehci_free_sqtd_chain(ehci_softc_t *, ehci_soft_qtd_t *, 223Static void ehci_free_sqtd_chain(ehci_softc_t *, ehci_soft_qtd_t *,
224 ehci_soft_qtd_t *); 224 ehci_soft_qtd_t *);
225 225
226Static ehci_soft_itd_t *ehci_alloc_itd(ehci_softc_t *); 226Static ehci_soft_itd_t *ehci_alloc_itd(ehci_softc_t *);
227Static ehci_soft_sitd_t *ehci_alloc_sitd(ehci_softc_t *); 227Static ehci_soft_sitd_t *
 228 ehci_alloc_sitd(ehci_softc_t *);
228Static void ehci_free_itd(ehci_softc_t *, ehci_soft_itd_t *); 229Static void ehci_free_itd(ehci_softc_t *, ehci_soft_itd_t *);
229Static void ehci_free_sitd(ehci_softc_t *, ehci_soft_sitd_t *); 230Static void ehci_free_sitd(ehci_softc_t *, ehci_soft_sitd_t *);
230Static void ehci_rem_free_itd_chain(ehci_softc_t *, 231Static void ehci_rem_free_itd_chain(ehci_softc_t *,
231 struct ehci_xfer *); 232 struct ehci_xfer *);
232Static void ehci_rem_free_sitd_chain(ehci_softc_t *, 233Static void ehci_rem_free_sitd_chain(ehci_softc_t *,
233 struct ehci_xfer *); 234 struct ehci_xfer *);
234Static void ehci_abort_isoc_xfer(struct usbd_xfer *, 235Static void ehci_abort_isoc_xfer(struct usbd_xfer *,
235 usbd_status); 236 usbd_status);
236 237
237Static usbd_status ehci_device_request(struct usbd_xfer *); 238Static usbd_status ehci_device_request(struct usbd_xfer *);
238 239
239Static usbd_status ehci_device_setintr(ehci_softc_t *, ehci_soft_qh_t *, 240Static usbd_status ehci_device_setintr(ehci_softc_t *, ehci_soft_qh_t *,
240 int); 241 int);