X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=atusb%2Finclude%2Fatusb%2Fep0.h;fp=atusb%2Finclude%2Fatusb%2Fep0.h;h=77773450d66086cf04faaee1cb94389e4c7451e0;hb=dd4bc9ff49b9a7075e579fdd62fd930d27a9a7df;hp=0000000000000000000000000000000000000000;hpb=c164bf7f87f9081fee7e1a186dd7a87a9a020b9e;p=linux-libre-firmware.git diff --git a/atusb/include/atusb/ep0.h b/atusb/include/atusb/ep0.h new file mode 100644 index 0000000..7777345 --- /dev/null +++ b/atusb/include/atusb/ep0.h @@ -0,0 +1,64 @@ +/* + * include/atusb/ep0.h - EP0 extension protocol + * + * Written 2008-2011, 2013 by Werner Almesberger + * Copyright 2008-2011, 2013 Werner Almesberger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + + +#ifndef EP0_H +#define EP0_H + +#include + + +/* + * EP0 protocol: + * + * 0.0 initial release + * 0.1 addition of ATUSB_TEST + * 0.2 First public release + * 0.3 ATUSB_EUI64_READ/WRITE for permanent EUI64 handling + * Support to run the firmware on Atmel Raven USB dongles + * Remove FCS frame check from firmware and leave it to the driver + * Use extended operation mode for TX for automatic ACK handling + */ + +#define EP0ATUSB_MAJOR 0 /* EP0 protocol, major revision */ +#define EP0ATUSB_MINOR 3 /* EP0 protocol, minor revision */ + + +/* + * bmRequestType: + * + * D7 D6..5 D4...0 + * | | | + * direction (0 = host->dev) + * type (2 = vendor) + * recipient (0 = device) + */ + +#ifndef USB_TYPE_VENDOR +#define USB_TYPE_VENDOR 0x40 +#endif + +#ifndef USB_DIR_IN +#define USB_DIR_IN 0x80 +#endif + +#ifndef USB_DIR_OUT +#define USB_DIR_OUT 0x00 +#endif + +#define ATUSB_FROM_DEV(req) (ATUSB_REQ_FROM_DEV | (req) << 8) +#define ATUSB_TO_DEV(req) (ATUSB_REQ_TO_DEV | (req) << 8) + + +void ep0_init(void); + +#endif /* !EP0_H */