atmegadci.c (192446) | atmegadci.c (192499) |
---|---|
1#include <sys/cdefs.h> | 1#include <sys/cdefs.h> |
2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/atmegadci.c 192446 2009-05-20 17:00:55Z thompsa $"); | 2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/atmegadci.c 192499 2009-05-21 00:04:17Z thompsa $"); |
3 4/*- 5 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 1060 unchanged lines hidden (view full) --- 1071 struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); 1072 uint8_t ep_no; 1073 1074 USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); 1075 1076 DPRINTFN(9, "xfer=%p, pipe=%p, error=%d\n", 1077 xfer, xfer->pipe, error); 1078 | 3 4/*- 5 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 1060 unchanged lines hidden (view full) --- 1071 struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); 1072 uint8_t ep_no; 1073 1074 USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); 1075 1076 DPRINTFN(9, "xfer=%p, pipe=%p, error=%d\n", 1077 xfer, xfer->pipe, error); 1078 |
1079 if (xfer->flags_int.usb2_mode == USB_MODE_DEVICE) { | 1079 if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { |
1080 ep_no = (xfer->endpoint & UE_ADDR); 1081 1082 /* select endpoint number */ 1083 ATMEGA_WRITE_1(sc, ATMEGA_UENUM, ep_no); 1084 1085 /* disable endpoint interrupt */ 1086 ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, 0); 1087 --- 94 unchanged lines hidden (view full) --- 1182 struct atmegadci_softc *sc; 1183 struct usb2_endpoint_descriptor *ed; 1184 1185 DPRINTFN(5, "pipe=%p\n", pipe); 1186 1187 USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); 1188 1189 /* check mode */ | 1080 ep_no = (xfer->endpoint & UE_ADDR); 1081 1082 /* select endpoint number */ 1083 ATMEGA_WRITE_1(sc, ATMEGA_UENUM, ep_no); 1084 1085 /* disable endpoint interrupt */ 1086 ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, 0); 1087 --- 94 unchanged lines hidden (view full) --- 1182 struct atmegadci_softc *sc; 1183 struct usb2_endpoint_descriptor *ed; 1184 1185 DPRINTFN(5, "pipe=%p\n", pipe); 1186 1187 USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); 1188 1189 /* check mode */ |
1190 if (udev->flags.usb2_mode != USB_MODE_DEVICE) { | 1190 if (udev->flags.usb_mode != USB_MODE_DEVICE) { |
1191 /* not supported */ 1192 return; 1193 } 1194 /* get softc */ 1195 sc = ATMEGA_BUS2SC(udev->bus); 1196 1197 /* get endpoint descriptor */ 1198 ed = pipe->edesc; --- 890 unchanged lines hidden (view full) --- 2089static void 2090atmegadci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc, 2091 struct usb2_pipe *pipe) 2092{ 2093 struct atmegadci_softc *sc = ATMEGA_BUS2SC(udev->bus); 2094 2095 DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d,%d)\n", 2096 pipe, udev->address, | 1191 /* not supported */ 1192 return; 1193 } 1194 /* get softc */ 1195 sc = ATMEGA_BUS2SC(udev->bus); 1196 1197 /* get endpoint descriptor */ 1198 ed = pipe->edesc; --- 890 unchanged lines hidden (view full) --- 2089static void 2090atmegadci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc, 2091 struct usb2_pipe *pipe) 2092{ 2093 struct atmegadci_softc *sc = ATMEGA_BUS2SC(udev->bus); 2094 2095 DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d,%d)\n", 2096 pipe, udev->address, |
2097 edesc->bEndpointAddress, udev->flags.usb2_mode, | 2097 edesc->bEndpointAddress, udev->flags.usb_mode, |
2098 sc->sc_rt_addr, udev->device_index); 2099 2100 if (udev->device_index != sc->sc_rt_addr) { 2101 | 2098 sc->sc_rt_addr, udev->device_index); 2099 2100 if (udev->device_index != sc->sc_rt_addr) { 2101 |
2102 if (udev->flags.usb2_mode != USB_MODE_DEVICE) { | 2102 if (udev->flags.usb_mode != USB_MODE_DEVICE) { |
2103 /* not supported */ 2104 return; 2105 } 2106 if (udev->speed != USB_SPEED_FULL) { 2107 /* not supported */ 2108 return; 2109 } 2110 if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) --- 16 unchanged lines hidden --- | 2103 /* not supported */ 2104 return; 2105 } 2106 if (udev->speed != USB_SPEED_FULL) { 2107 /* not supported */ 2108 return; 2109 } 2110 if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) --- 16 unchanged lines hidden --- |