fsg 264 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg; fsg 339 drivers/usb/gadget/function/f_mass_storage.c if (common->fsg) fsg 376 drivers/usb/gadget/function/f_mass_storage.c static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep) fsg 380 drivers/usb/gadget/function/f_mass_storage.c if (ep == fsg->bulk_in) fsg 382 drivers/usb/gadget/function/f_mass_storage.c else if (ep == fsg->bulk_out) fsg 386 drivers/usb/gadget/function/f_mass_storage.c DBG(fsg, "%s set halt\n", name); fsg 489 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg = fsg_from_func(f); fsg 490 drivers/usb/gadget/function/f_mass_storage.c struct usb_request *req = fsg->common->ep0req; fsg 495 drivers/usb/gadget/function/f_mass_storage.c if (!fsg_is_set(fsg->common)) fsg 498 drivers/usb/gadget/function/f_mass_storage.c ++fsg->common->ep0_req_tag; /* Record arrival of a new request */ fsg 501 drivers/usb/gadget/function/f_mass_storage.c dump_msg(fsg, "ep0-setup", (u8 *) ctrl, sizeof(*ctrl)); fsg 509 drivers/usb/gadget/function/f_mass_storage.c if (w_index != fsg->interface_number || w_value != 0 || fsg 517 drivers/usb/gadget/function/f_mass_storage.c DBG(fsg, "bulk reset request\n"); fsg 518 drivers/usb/gadget/function/f_mass_storage.c raise_exception(fsg->common, FSG_STATE_PROTOCOL_RESET); fsg 525 drivers/usb/gadget/function/f_mass_storage.c if (w_index != fsg->interface_number || w_value != 0 || fsg 528 drivers/usb/gadget/function/f_mass_storage.c VDBG(fsg, "get max LUN\n"); fsg 529 drivers/usb/gadget/function/f_mass_storage.c *(u8 *)req->buf = _fsg_common_get_max_lun(fsg->common); fsg 533 drivers/usb/gadget/function/f_mass_storage.c return ep0_queue(fsg->common); fsg 536 drivers/usb/gadget/function/f_mass_storage.c VDBG(fsg, fsg 549 drivers/usb/gadget/function/f_mass_storage.c static int start_transfer(struct fsg_dev *fsg, struct usb_ep *ep, fsg 554 drivers/usb/gadget/function/f_mass_storage.c if (ep == fsg->bulk_in) fsg 555 drivers/usb/gadget/function/f_mass_storage.c dump_msg(fsg, "bulk-in", req->buf, req->length); fsg 569 drivers/usb/gadget/function/f_mass_storage.c WARNING(fsg, "error in submission: %s --> %d\n", fsg 580 drivers/usb/gadget/function/f_mass_storage.c if (start_transfer(common->fsg, common->fsg->bulk_in, bh->inreq)) fsg 590 drivers/usb/gadget/function/f_mass_storage.c if (start_transfer(common->fsg, common->fsg->bulk_out, bh->outreq)) fsg 1401 drivers/usb/gadget/function/f_mass_storage.c static int halt_bulk_in_endpoint(struct fsg_dev *fsg) fsg 1405 drivers/usb/gadget/function/f_mass_storage.c rc = fsg_set_halt(fsg, fsg->bulk_in); fsg 1407 drivers/usb/gadget/function/f_mass_storage.c VDBG(fsg, "delayed bulk-in endpoint halt\n"); fsg 1410 drivers/usb/gadget/function/f_mass_storage.c WARNING(fsg, "usb_ep_set_halt -> %d\n", rc); fsg 1418 drivers/usb/gadget/function/f_mass_storage.c rc = usb_ep_set_halt(fsg->bulk_in); fsg 1423 drivers/usb/gadget/function/f_mass_storage.c static int wedge_bulk_in_endpoint(struct fsg_dev *fsg) fsg 1427 drivers/usb/gadget/function/f_mass_storage.c DBG(fsg, "bulk-in set wedge\n"); fsg 1428 drivers/usb/gadget/function/f_mass_storage.c rc = usb_ep_set_wedge(fsg->bulk_in); fsg 1430 drivers/usb/gadget/function/f_mass_storage.c VDBG(fsg, "delayed bulk-in endpoint wedge\n"); fsg 1433 drivers/usb/gadget/function/f_mass_storage.c WARNING(fsg, "usb_ep_set_wedge -> %d\n", rc); fsg 1441 drivers/usb/gadget/function/f_mass_storage.c rc = usb_ep_set_wedge(fsg->bulk_in); fsg 1514 drivers/usb/gadget/function/f_mass_storage.c fsg_set_halt(common->fsg, common->fsg->bulk_out); fsg 1515 drivers/usb/gadget/function/f_mass_storage.c rc = halt_bulk_in_endpoint(common->fsg); fsg 1551 drivers/usb/gadget/function/f_mass_storage.c rc = halt_bulk_in_endpoint(common->fsg); fsg 1579 drivers/usb/gadget/function/f_mass_storage.c fsg_set_halt(common->fsg, fsg 1580 drivers/usb/gadget/function/f_mass_storage.c common->fsg->bulk_out); fsg 2076 drivers/usb/gadget/function/f_mass_storage.c static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) fsg 2080 drivers/usb/gadget/function/f_mass_storage.c struct fsg_common *common = fsg->common; fsg 2083 drivers/usb/gadget/function/f_mass_storage.c if (req->status || test_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags)) fsg 2090 drivers/usb/gadget/function/f_mass_storage.c DBG(fsg, "invalid CBW: len %u sig 0x%x\n", fsg 2105 drivers/usb/gadget/function/f_mass_storage.c wedge_bulk_in_endpoint(fsg); fsg 2106 drivers/usb/gadget/function/f_mass_storage.c set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); fsg 2114 drivers/usb/gadget/function/f_mass_storage.c DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, " fsg 2123 drivers/usb/gadget/function/f_mass_storage.c fsg_set_halt(fsg, fsg->bulk_out); fsg 2124 drivers/usb/gadget/function/f_mass_storage.c halt_bulk_in_endpoint(fsg); fsg 2176 drivers/usb/gadget/function/f_mass_storage.c rc = fsg_is_set(common) ? received_cbw(common->fsg, bh) : -EIO; fsg 2198 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg; fsg 2206 drivers/usb/gadget/function/f_mass_storage.c if (common->fsg) { fsg 2207 drivers/usb/gadget/function/f_mass_storage.c fsg = common->fsg; fsg 2213 drivers/usb/gadget/function/f_mass_storage.c usb_ep_free_request(fsg->bulk_in, bh->inreq); fsg 2217 drivers/usb/gadget/function/f_mass_storage.c usb_ep_free_request(fsg->bulk_out, bh->outreq); fsg 2223 drivers/usb/gadget/function/f_mass_storage.c if (fsg->bulk_in_enabled) { fsg 2224 drivers/usb/gadget/function/f_mass_storage.c usb_ep_disable(fsg->bulk_in); fsg 2225 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_in_enabled = 0; fsg 2227 drivers/usb/gadget/function/f_mass_storage.c if (fsg->bulk_out_enabled) { fsg 2228 drivers/usb/gadget/function/f_mass_storage.c usb_ep_disable(fsg->bulk_out); fsg 2229 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_out_enabled = 0; fsg 2232 drivers/usb/gadget/function/f_mass_storage.c common->fsg = NULL; fsg 2240 drivers/usb/gadget/function/f_mass_storage.c common->fsg = new_fsg; fsg 2241 drivers/usb/gadget/function/f_mass_storage.c fsg = common->fsg; fsg 2244 drivers/usb/gadget/function/f_mass_storage.c rc = config_ep_by_speed(common->gadget, &(fsg->function), fsg->bulk_in); fsg 2247 drivers/usb/gadget/function/f_mass_storage.c rc = usb_ep_enable(fsg->bulk_in); fsg 2250 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_in->driver_data = common; fsg 2251 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_in_enabled = 1; fsg 2253 drivers/usb/gadget/function/f_mass_storage.c rc = config_ep_by_speed(common->gadget, &(fsg->function), fsg 2254 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_out); fsg 2257 drivers/usb/gadget/function/f_mass_storage.c rc = usb_ep_enable(fsg->bulk_out); fsg 2260 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_out->driver_data = common; fsg 2261 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_out_enabled = 1; fsg 2262 drivers/usb/gadget/function/f_mass_storage.c common->bulk_out_maxpacket = usb_endpoint_maxp(fsg->bulk_out->desc); fsg 2263 drivers/usb/gadget/function/f_mass_storage.c clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); fsg 2269 drivers/usb/gadget/function/f_mass_storage.c rc = alloc_request(common, fsg->bulk_in, &bh->inreq); fsg 2272 drivers/usb/gadget/function/f_mass_storage.c rc = alloc_request(common, fsg->bulk_out, &bh->outreq); fsg 2294 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg = fsg_from_func(f); fsg 2296 drivers/usb/gadget/function/f_mass_storage.c __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, fsg); fsg 2302 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg = fsg_from_func(f); fsg 2304 drivers/usb/gadget/function/f_mass_storage.c __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL); fsg 2337 drivers/usb/gadget/function/f_mass_storage.c if (likely(common->fsg)) { fsg 2341 drivers/usb/gadget/function/f_mass_storage.c usb_ep_dequeue(common->fsg->bulk_in, bh->inreq); fsg 2343 drivers/usb/gadget/function/f_mass_storage.c usb_ep_dequeue(common->fsg->bulk_out, fsg 2352 drivers/usb/gadget/function/f_mass_storage.c if (common->fsg->bulk_in_enabled) fsg 2353 drivers/usb/gadget/function/f_mass_storage.c usb_ep_fifo_flush(common->fsg->bulk_in); fsg 2354 drivers/usb/gadget/function/f_mass_storage.c if (common->fsg->bulk_out_enabled) fsg 2355 drivers/usb/gadget/function/f_mass_storage.c usb_ep_fifo_flush(common->fsg->bulk_out); fsg 2407 drivers/usb/gadget/function/f_mass_storage.c &common->fsg->atomic_bitflags)) fsg 2408 drivers/usb/gadget/function/f_mass_storage.c usb_ep_clear_halt(common->fsg->bulk_in); fsg 2896 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg = fsg_from_func(f); fsg 2897 drivers/usb/gadget/function/f_mass_storage.c struct fsg_common *common = fsg->common; fsg 2914 drivers/usb/gadget/function/f_mass_storage.c ret = fsg_common_set_cdev(fsg->common, c->cdev, fsg 2915 drivers/usb/gadget/function/f_mass_storage.c fsg->common->can_stall); fsg 2918 drivers/usb/gadget/function/f_mass_storage.c fsg_common_set_inquiry_string(fsg->common, NULL, NULL); fsg 2936 drivers/usb/gadget/function/f_mass_storage.c fsg->gadget = gadget; fsg 2943 drivers/usb/gadget/function/f_mass_storage.c fsg->interface_number = i; fsg 2949 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_in = ep; fsg 2954 drivers/usb/gadget/function/f_mass_storage.c fsg->bulk_out = ep; fsg 2981 drivers/usb/gadget/function/f_mass_storage.c ERROR(fsg, "unable to autoconfigure all endpoints\n"); fsg 2985 drivers/usb/gadget/function/f_mass_storage.c if (fsg->common->state != FSG_STATE_TERMINATED) { fsg 2986 drivers/usb/gadget/function/f_mass_storage.c raise_exception(fsg->common, FSG_STATE_EXIT); fsg 2987 drivers/usb/gadget/function/f_mass_storage.c wait_for_completion(&fsg->common->thread_notifier); fsg 2996 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg = fsg_from_func(f); fsg 2997 drivers/usb/gadget/function/f_mass_storage.c struct fsg_common *common = fsg->common; fsg 2999 drivers/usb/gadget/function/f_mass_storage.c DBG(fsg, "unbind\n"); fsg 3000 drivers/usb/gadget/function/f_mass_storage.c if (fsg->common->fsg == fsg) { fsg 3001 drivers/usb/gadget/function/f_mass_storage.c __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL); fsg 3003 drivers/usb/gadget/function/f_mass_storage.c wait_event(common->fsg_wait, common->fsg != fsg); fsg 3006 drivers/usb/gadget/function/f_mass_storage.c usb_free_all_descriptors(&fsg->function); fsg 3397 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg; fsg 3400 drivers/usb/gadget/function/f_mass_storage.c fsg = container_of(f, struct fsg_dev, function); fsg 3407 drivers/usb/gadget/function/f_mass_storage.c kfree(fsg); fsg 3414 drivers/usb/gadget/function/f_mass_storage.c struct fsg_dev *fsg; fsg 3416 drivers/usb/gadget/function/f_mass_storage.c fsg = kzalloc(sizeof(*fsg), GFP_KERNEL); fsg 3417 drivers/usb/gadget/function/f_mass_storage.c if (unlikely(!fsg)) fsg 3424 drivers/usb/gadget/function/f_mass_storage.c fsg->function.name = FSG_DRIVER_DESC; fsg 3425 drivers/usb/gadget/function/f_mass_storage.c fsg->function.bind = fsg_bind; fsg 3426 drivers/usb/gadget/function/f_mass_storage.c fsg->function.unbind = fsg_unbind; fsg 3427 drivers/usb/gadget/function/f_mass_storage.c fsg->function.setup = fsg_setup; fsg 3428 drivers/usb/gadget/function/f_mass_storage.c fsg->function.set_alt = fsg_set_alt; fsg 3429 drivers/usb/gadget/function/f_mass_storage.c fsg->function.disable = fsg_disable; fsg 3430 drivers/usb/gadget/function/f_mass_storage.c fsg->function.free_func = fsg_free; fsg 3432 drivers/usb/gadget/function/f_mass_storage.c fsg->common = common; fsg 3434 drivers/usb/gadget/function/f_mass_storage.c return &fsg->function; fsg 38 drivers/usb/gadget/function/storage_common.h # define dump_msg(fsg, /* const char * */ label, \ fsg 42 drivers/usb/gadget/function/storage_common.h DBG(fsg, "%s, length %u:\n", label, length); \ fsg 48 drivers/usb/gadget/function/storage_common.h # define dump_cdb(fsg) do { } while (0) fsg 52 drivers/usb/gadget/function/storage_common.h # define dump_msg(fsg, /* const char * */ label, \ fsg 57 drivers/usb/gadget/function/storage_common.h # define dump_cdb(fsg) \ fsg 59 drivers/usb/gadget/function/storage_common.h 16, 1, (fsg)->cmnd, (fsg)->cmnd_size, 0) \ fsg 63 drivers/usb/gadget/function/storage_common.h # define dump_cdb(fsg) do { } while (0)