epfile 861 drivers/usb/gadget/function/f_fs.c static void __ffs_epfile_read_buffer_free(struct ffs_epfile *epfile) epfile 867 drivers/usb/gadget/function/f_fs.c struct ffs_buffer *buf = xchg(&epfile->read_buffer, READ_BUFFER_DROP); epfile 873 drivers/usb/gadget/function/f_fs.c static ssize_t __ffs_epfile_read_buffered(struct ffs_epfile *epfile, epfile 881 drivers/usb/gadget/function/f_fs.c struct ffs_buffer *buf = xchg(&epfile->read_buffer, NULL); epfile 899 drivers/usb/gadget/function/f_fs.c if (cmpxchg(&epfile->read_buffer, NULL, buf)) epfile 906 drivers/usb/gadget/function/f_fs.c static ssize_t __ffs_epfile_read_data(struct ffs_epfile *epfile, epfile 937 drivers/usb/gadget/function/f_fs.c if (unlikely(cmpxchg(&epfile->read_buffer, NULL, buf))) epfile 945 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = file->private_data; epfile 953 drivers/usb/gadget/function/f_fs.c if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) epfile 957 drivers/usb/gadget/function/f_fs.c ep = epfile->ep; epfile 963 drivers/usb/gadget/function/f_fs.c epfile->ffs->wait, (ep = epfile->ep)); epfile 969 drivers/usb/gadget/function/f_fs.c halt = (!io_data->read == !epfile->in); epfile 970 drivers/usb/gadget/function/f_fs.c if (halt && epfile->isoc) epfile 974 drivers/usb/gadget/function/f_fs.c ret = ffs_mutex_lock(&epfile->mutex, file->f_flags & O_NONBLOCK); epfile 990 drivers/usb/gadget/function/f_fs.c ret = __ffs_epfile_read_buffered(epfile, &io_data->data); epfile 1000 drivers/usb/gadget/function/f_fs.c gadget = epfile->ffs->gadget; epfile 1002 drivers/usb/gadget/function/f_fs.c spin_lock_irq(&epfile->ffs->eps_lock); epfile 1004 drivers/usb/gadget/function/f_fs.c if (epfile->ep != ep) { epfile 1017 drivers/usb/gadget/function/f_fs.c spin_unlock_irq(&epfile->ffs->eps_lock); epfile 1031 drivers/usb/gadget/function/f_fs.c spin_lock_irq(&epfile->ffs->eps_lock); epfile 1033 drivers/usb/gadget/function/f_fs.c if (epfile->ep != ep) { epfile 1078 drivers/usb/gadget/function/f_fs.c spin_unlock_irq(&epfile->ffs->eps_lock); epfile 1095 drivers/usb/gadget/function/f_fs.c ret = __ffs_epfile_read_data(epfile, data, ep->status, epfile 1116 drivers/usb/gadget/function/f_fs.c io_data->ffs = epfile->ffs; epfile 1137 drivers/usb/gadget/function/f_fs.c spin_unlock_irq(&epfile->ffs->eps_lock); epfile 1139 drivers/usb/gadget/function/f_fs.c mutex_unlock(&epfile->mutex); epfile 1149 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = inode->i_private; epfile 1153 drivers/usb/gadget/function/f_fs.c if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) epfile 1156 drivers/usb/gadget/function/f_fs.c file->private_data = epfile; epfile 1157 drivers/usb/gadget/function/f_fs.c ffs_data_opened(epfile->ffs); epfile 1165 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = kiocb->ki_filp->private_data; epfile 1171 drivers/usb/gadget/function/f_fs.c spin_lock_irqsave(&epfile->ffs->eps_lock, flags); epfile 1178 drivers/usb/gadget/function/f_fs.c spin_unlock_irqrestore(&epfile->ffs->eps_lock, flags); epfile 1272 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = inode->i_private; epfile 1276 drivers/usb/gadget/function/f_fs.c __ffs_epfile_read_buffer_free(epfile); epfile 1277 drivers/usb/gadget/function/f_fs.c ffs_data_closed(epfile->ffs); epfile 1285 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = file->private_data; epfile 1291 drivers/usb/gadget/function/f_fs.c if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) epfile 1295 drivers/usb/gadget/function/f_fs.c ep = epfile->ep; epfile 1301 drivers/usb/gadget/function/f_fs.c epfile->ffs->wait, (ep = epfile->ep)); epfile 1306 drivers/usb/gadget/function/f_fs.c spin_lock_irq(&epfile->ffs->eps_lock); epfile 1309 drivers/usb/gadget/function/f_fs.c if (epfile->ep != ep) { epfile 1310 drivers/usb/gadget/function/f_fs.c spin_unlock_irq(&epfile->ffs->eps_lock); epfile 1316 drivers/usb/gadget/function/f_fs.c ret = usb_ep_fifo_status(epfile->ep->ep); epfile 1319 drivers/usb/gadget/function/f_fs.c usb_ep_fifo_flush(epfile->ep->ep); epfile 1323 drivers/usb/gadget/function/f_fs.c ret = usb_ep_clear_halt(epfile->ep->ep); epfile 1326 drivers/usb/gadget/function/f_fs.c ret = epfile->ep->num; epfile 1333 drivers/usb/gadget/function/f_fs.c switch (epfile->ffs->gadget->speed) { epfile 1343 drivers/usb/gadget/function/f_fs.c desc = epfile->ep->descs[desc_idx]; epfile 1345 drivers/usb/gadget/function/f_fs.c spin_unlock_irq(&epfile->ffs->eps_lock); epfile 1354 drivers/usb/gadget/function/f_fs.c spin_unlock_irq(&epfile->ffs->eps_lock); epfile 1889 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile, *epfiles; epfile 1899 drivers/usb/gadget/function/f_fs.c epfile = epfiles; epfile 1900 drivers/usb/gadget/function/f_fs.c for (i = 1; i <= count; ++i, ++epfile) { epfile 1901 drivers/usb/gadget/function/f_fs.c epfile->ffs = ffs; epfile 1902 drivers/usb/gadget/function/f_fs.c mutex_init(&epfile->mutex); epfile 1904 drivers/usb/gadget/function/f_fs.c sprintf(epfile->name, "ep%02x", ffs->eps_addrmap[i]); epfile 1906 drivers/usb/gadget/function/f_fs.c sprintf(epfile->name, "ep%u", i); epfile 1907 drivers/usb/gadget/function/f_fs.c epfile->dentry = ffs_sb_create_file(ffs->sb, epfile->name, epfile 1908 drivers/usb/gadget/function/f_fs.c epfile, epfile 1910 drivers/usb/gadget/function/f_fs.c if (unlikely(!epfile->dentry)) { epfile 1922 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = epfiles; epfile 1926 drivers/usb/gadget/function/f_fs.c for (; count; --count, ++epfile) { epfile 1927 drivers/usb/gadget/function/f_fs.c BUG_ON(mutex_is_locked(&epfile->mutex)); epfile 1928 drivers/usb/gadget/function/f_fs.c if (epfile->dentry) { epfile 1929 drivers/usb/gadget/function/f_fs.c d_delete(epfile->dentry); epfile 1930 drivers/usb/gadget/function/f_fs.c dput(epfile->dentry); epfile 1931 drivers/usb/gadget/function/f_fs.c epfile->dentry = NULL; epfile 1941 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = func->ffs->epfiles; epfile 1952 drivers/usb/gadget/function/f_fs.c if (epfile) { epfile 1953 drivers/usb/gadget/function/f_fs.c epfile->ep = NULL; epfile 1954 drivers/usb/gadget/function/f_fs.c __ffs_epfile_read_buffer_free(epfile); epfile 1955 drivers/usb/gadget/function/f_fs.c ++epfile; epfile 1965 drivers/usb/gadget/function/f_fs.c struct ffs_epfile *epfile = ffs->epfiles; epfile 1983 drivers/usb/gadget/function/f_fs.c epfile->ep = ep; epfile 1984 drivers/usb/gadget/function/f_fs.c epfile->in = usb_endpoint_dir_in(ep->ep->desc); epfile 1985 drivers/usb/gadget/function/f_fs.c epfile->isoc = usb_endpoint_xfer_isoc(ep->ep->desc); epfile 1991 drivers/usb/gadget/function/f_fs.c ++epfile;