• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/usb/gadget/

Lines Matching defs:fsg

228  * (fsg->next_buffhd_to_fill) that points to the next buffer head to use.
345 struct fsg_dev *fsg, *new_fsg;
451 if (common->fsg)
453 ERROR(common, "common->fsg is NULL in %s at %u\n", func, line);
489 static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep)
493 if (ep == fsg->bulk_in)
495 else if (ep == fsg->bulk_out)
499 DBG(fsg, "%s set halt\n", name);
508 /* Caller must hold fsg->lock */
608 struct fsg_dev *fsg = fsg_from_func(f);
609 struct usb_request *req = fsg->common->ep0req;
614 if (!fsg_is_set(fsg->common))
623 if (w_index != fsg->interface_number || w_value != 0)
628 DBG(fsg, "bulk reset request\n");
629 raise_exception(fsg->common, FSG_STATE_RESET);
636 if (w_index != fsg->interface_number || w_value != 0)
638 VDBG(fsg, "get max LUN\n");
639 *(u8 *) req->buf = fsg->common->nluns - 1;
643 return ep0_queue(fsg->common);
646 VDBG(fsg,
661 static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep,
667 if (ep == fsg->bulk_in)
668 dump_msg(fsg, "bulk-in", req->buf, req->length);
670 spin_lock_irq(&fsg->common->lock);
673 spin_unlock_irq(&fsg->common->lock);
685 WARNING(fsg, "error in submission: %s --> %d\n",
692 start_transfer((common)->fsg, (common)->fsg->ep_name, \
843 * common->fsg is NULL */
962 * common->fsg is NULL */
1515 static int halt_bulk_in_endpoint(struct fsg_dev *fsg)
1519 rc = fsg_set_halt(fsg, fsg->bulk_in);
1521 VDBG(fsg, "delayed bulk-in endpoint halt\n");
1524 WARNING(fsg, "usb_ep_set_halt -> %d\n", rc);
1532 rc = usb_ep_set_halt(fsg->bulk_in);
1537 static int wedge_bulk_in_endpoint(struct fsg_dev *fsg)
1541 DBG(fsg, "bulk-in set wedge\n");
1542 rc = usb_ep_set_wedge(fsg->bulk_in);
1544 VDBG(fsg, "delayed bulk-in endpoint wedge\n");
1547 WARNING(fsg, "usb_ep_set_wedge -> %d\n", rc);
1555 rc = usb_ep_set_wedge(fsg->bulk_in);
1560 static int pad_with_zeros(struct fsg_dev *fsg)
1562 struct fsg_buffhd *bh = fsg->common->next_buffhd_to_fill;
1568 fsg->common->usb_amount_left = nkeep + fsg->common->residue;
1569 while (fsg->common->usb_amount_left > 0) {
1573 rc = sleep_thread(fsg->common);
1578 nsend = min(fsg->common->usb_amount_left, FSG_BUFLEN);
1582 start_transfer(fsg, fsg->bulk_in, bh->inreq,
1584 bh = fsg->common->next_buffhd_to_fill = bh->next;
1585 fsg->common->usb_amount_left -= nsend;
1631 * common->fsg is NULL */
1664 fsg_set_halt(common->fsg, common->fsg->bulk_out);
1665 rc = halt_bulk_in_endpoint(common->fsg);
1667 /* Don't know what to do if common->fsg is NULL */
1693 * common->fsg is NULL */
1696 if (common->fsg)
1697 rc = halt_bulk_in_endpoint(common->fsg);
1699 rc = pad_with_zeros(common->fsg);
1701 /* Don't know what to do if common->fsg is NULL */
1784 /* Don't know what to do if common->fsg is NULL */
2179 static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
2183 struct fsg_common *common = fsg->common;
2186 if (req->status || test_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags))
2193 DBG(fsg, "invalid CBW: len %u sig 0x%x\n",
2206 wedge_bulk_in_endpoint(fsg);
2207 set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
2214 DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, "
2221 fsg_set_halt(fsg, fsg->bulk_out);
2222 halt_bulk_in_endpoint(fsg);
2261 /* Don't know what to do if common->fsg is NULL */
2275 rc = fsg_is_set(common) ? received_cbw(common->fsg, bh) : -EIO;
2310 struct fsg_dev *fsg;
2318 if (common->fsg) {
2319 fsg = common->fsg;
2325 usb_ep_free_request(fsg->bulk_in, bh->inreq);
2329 usb_ep_free_request(fsg->bulk_out, bh->outreq);
2335 if (fsg->bulk_in_enabled) {
2336 usb_ep_disable(fsg->bulk_in);
2337 fsg->bulk_in_enabled = 0;
2339 if (fsg->bulk_out_enabled) {
2340 usb_ep_disable(fsg->bulk_out);
2341 fsg->bulk_out_enabled = 0;
2344 common->fsg = NULL;
2352 common->fsg = new_fsg;
2353 fsg = common->fsg;
2358 rc = enable_endpoint(common, fsg->bulk_in, d);
2361 fsg->bulk_in_enabled = 1;
2365 rc = enable_endpoint(common, fsg->bulk_out, d);
2368 fsg->bulk_out_enabled = 1;
2370 clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
2376 rc = alloc_request(common, fsg->bulk_in, &bh->inreq);
2379 rc = alloc_request(common, fsg->bulk_out, &bh->outreq);
2400 struct fsg_dev *fsg = fsg_from_func(f);
2401 fsg->common->new_fsg = fsg;
2402 raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
2408 struct fsg_dev *fsg = fsg_from_func(f);
2409 fsg->common->new_fsg = NULL;
2410 raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
2440 if (likely(common->fsg)) {
2444 usb_ep_dequeue(common->fsg->bulk_in, bh->inreq);
2446 usb_ep_dequeue(common->fsg->bulk_out,
2464 if (common->fsg->bulk_in_enabled)
2465 usb_ep_fifo_flush(common->fsg->bulk_in);
2466 if (common->fsg->bulk_out_enabled)
2467 usb_ep_fifo_flush(common->fsg->bulk_out);
2515 &common->fsg->atomic_bitflags))
2516 usb_ep_clear_halt(common->fsg->bulk_in);
2914 struct fsg_dev *fsg = fsg_from_func(f);
2915 struct fsg_common *common = fsg->common;
2917 DBG(fsg, "unbind\n");
2918 if (fsg->common->fsg == fsg) {
2919 fsg->common->new_fsg = NULL;
2920 raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
2921 wait_event(common->fsg_wait, common->fsg != fsg);
2925 usb_free_descriptors(fsg->function.descriptors);
2926 usb_free_descriptors(fsg->function.hs_descriptors);
2927 kfree(fsg);
2933 struct fsg_dev *fsg = fsg_from_func(f);
2938 fsg->gadget = gadget;
2945 fsg->interface_number = i;
2951 ep->driver_data = fsg->common; /* claim the endpoint */
2952 fsg->bulk_in = ep;
2957 ep->driver_data = fsg->common; /* claim the endpoint */
2958 fsg->bulk_out = ep;
2981 ERROR(fsg, "unable to autoconfigure all endpoints\n");
2997 struct fsg_dev *fsg;
3000 fsg = kzalloc(sizeof *fsg, GFP_KERNEL);
3001 if (unlikely(!fsg))
3004 fsg->function.name = FSG_DRIVER_DESC;
3005 fsg->function.strings = fsg_strings_array;
3006 fsg->function.bind = fsg_bind;
3007 fsg->function.unbind = fsg_unbind;
3008 fsg->function.setup = fsg_setup;
3009 fsg->function.set_alt = fsg_set_alt;
3010 fsg->function.disable = fsg_disable;
3012 fsg->common = common;
3019 rc = usb_add_function(c, &fsg->function);
3021 kfree(fsg);
3023 fsg_common_get(fsg->common);