PERFORCE change 122157 for review
Rui Paulo
rpaulo at FreeBSD.org
Fri Jun 22 16:05:23 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=122157
Change 122157 by rpaulo at rpaulo_epsilon on 2007/06/22 16:05:19
Adapt to bsdimp@ changes to the USB stack.
This driver does not depend on usb_port.h.
Add some comments.
Affected files ...
.. //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#2 edit
Differences ...
==== //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#1 $
+ * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#2 $
*/
#include <sys/cdefs.h>
@@ -51,8 +51,8 @@
#include "usbdevs.h"
#ifdef USB_DEBUG
-#define DPRINTF(x) if (atpdebug) logprintf x
-#define DPRINTFN(n,x) if (atpdebug>(n)) logprintf x
+#define DPRINTF(x) if (atpdebug) printf x
+#define DPRINTFN(n,x) if (atpdebug>(n)) printf x
int atpdebug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp");
SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW,
@@ -64,12 +64,16 @@
+/*
+ * Device interface.
+ */
+static int atp_match(device_t);
+static int atp_attach(device_t);
+static int atp_detach(device_t);
-struct atp_softc {
- device_t sc_dev;
-
-};
-
+/*
+ * char device interface.
+ */
static d_open_t atp_open;
static d_close_t atp_close;
static d_read_t atp_read;
@@ -87,6 +91,33 @@
.d_name = "atp",
};
+struct atp_softc {
+ device_t sc_dev;
+
+};
+
+static device_method_t atp_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, atp_match),
+ DEVMETHOD(device_attach, atp_attach),
+ DEVMETHOD(device_detach, atp_detach),
+
+ { 0, 0 }
+};
+
+static driver_t atp_driver = {
+ "atp",
+ atp_methods,
+ sizeof(struct atp_softc)
+};
+
+static devclass_t atp_devclass;
+
+DRIVER_MODULE(atp, uhub, atp_driver, atp_devclass, usbd_driver_load, 0);
+
+/*
+ * Products supported by this driver.
+ */
static struct atp_product {
uint16_t vendor;
uint16_t product;
@@ -97,13 +128,10 @@
};
-USB_DECLARE_DRIVER(atp);
-
-
static int
atp_match(device_t self)
{
- USB_MATCH_START(atp, uaa);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
usb_interface_descriptor_t *id;
int size, i;
usbd_status err;
@@ -189,4 +217,4 @@
return -1;
}
-DRIVER_MODULE(atp, uhub, atp_driver, atp_devclass, usbd_driver_load, 0);
+
More information about the p4-projects
mailing list