X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Finclude%2Fusb.h;h=67a3830f69c3b3618616269d82a1c9e85988027a;hb=f239f43b91dfa5fbec1a8d19b41db0b792d4c751;hp=cea1d4da90e00ef5eec51edb6f1dad42cc59e670;hpb=1765258283f5fc36987ae44cdd516163290629e0;p=carl9170fw.git diff --git a/carlfw/include/usb.h b/carlfw/include/usb.h index cea1d4d..67a3830 100644 --- a/carlfw/include/usb.h +++ b/carlfw/include/usb.h @@ -19,8 +19,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; If not, see . */ #ifndef __CARL9170FW_USB_H @@ -141,6 +140,12 @@ static inline __inline void usb_clear_input_ep_toggle(unsigned int ep) ~AR9170_USB_EP_IN_TOGGLE); } +static inline __inline void usb_clear_input_ep_stall(unsigned int ep) +{ + andl(AR9170_USB_REG_EP_IN_MAX_SIZE_HIGH + (ep << 1), + ~AR9170_USB_EP_IN_STALL); +} + static inline __inline void usb_set_input_ep_toggle(unsigned int ep) { orl(AR9170_USB_REG_EP_IN_MAX_SIZE_HIGH + (ep << 1), @@ -159,6 +164,12 @@ static inline __inline void usb_set_output_ep_toggle(unsigned int ep) AR9170_USB_EP_OUT_TOGGLE); } +static inline __inline void usb_clear_output_ep_stall(unsigned int ep) +{ + andl(AR9170_USB_REG_EP_OUT_MAX_SIZE_HIGH + (ep << 1), + ~AR9170_USB_EP_OUT_STALL); +} + static inline void usb_structure_check(void) { BUILD_BUG_ON(sizeof(struct usb_config_descriptor) != USB_DT_CONFIG_SIZE); @@ -172,6 +183,7 @@ void __noreturn jump_to_bootcode(void); void send_cmd_to_host(const uint8_t len, const uint8_t type, const uint8_t ext, const uint8_t *body); +void usb_reset_eps(void); void usb_init(void); void usb_ep0rx(void); void usb_ep0tx(void);