Lines Matching defs:device
47 . - sane_open() : open a particular scanner device, adding a handle
48 to the opened device
59 . - sane_close() : close opened scanner device, freeing scanner handle
134 * opened device. Sessions are inserted here on sane_open() and
140 /* pointer to the first device attached to the backend
141 * the same device may be opened several time
346 * running on). If it is false, the device list includes all remote
350 * sane_open() call is performed. A device name may be specified
358 struct Rts8891_Device *device;
385 for (device = first_device; dev_num < num_devices; device = device->next)
390 sane_device->name = device->file_name;
391 sane_device->vendor = device->model->vendor;
392 sane_device->model = device->model->product;
393 sane_device->type = device->model->type;
412 * device. The name of the device to be opened is passed in argument
413 * name. If the call completes successfully, a handle for the device
415 * string as the device requests opening the first available device
416 * (if there is such a device).
423 struct Rts8891_Device *device = NULL;
429 DBG (DBG_info, "sane_open: no device requested, using default\n");
432 device = first_device;
433 DBG (DBG_info, "sane_open: device %s used as default device\n",
434 device->file_name);
439 DBG (DBG_info, "sane_open: device %s requested\n", name);
440 /* walk the device list until we find a matching name */
441 device = first_device;
442 while (device && strcmp (device->file_name, name) != 0)
444 DBG (DBG_info, "sane_open: device %s doesn't match\n",
445 device->file_name);
446 device = device->next;
450 /* check whether we have found a match or reach the end of the device list */
451 if (!device)
453 DBG (DBG_info, "sane_open: no device found\n");
457 /* now we have a device, duplicate it and return it in handle */
458 DBG (DBG_info, "sane_open: device %s found\n", name);
460 if (device->model->flags & RTS8891_FLAG_UNTESTED)
476 status = sanei_usb_open (device->file_name, &device->devnum);
479 DBG (DBG_warn, "sane_open: couldn't open device `%s': %s\n",
480 device->file_name, sane_strstatus (status));
484 /* device initialization */
485 if (device->initialized == SANE_FALSE)
488 status = detect_device (device);
495 status = initialize_device (device);
503 status = init_device (device);
510 device->initialized = SANE_TRUE;
518 session->dev = device;
529 /* release the interface to allow device sharing */
532 sanei_usb_release_interface (device->devnum, 0);
586 * returns the option descriptor for option number n of the device
589 * options that are available for device handle h (the count includes
592 * (and at the returned address) until the device is closed.
913 * number n of the device represented by handle h. The manner in which
1062 * @return SANE_STATUS_GOOD on success, SANE_STATUS_BUSY if the device is
1063 * in use by another session or SANE_STATUS_WARMING_UP if the device is
1084 DBG (DBG_warn, "sane_start: device is already scanning\n");
1088 /* claim the interface reserve device */
1672 * device for which the parameters should be obtained and a pointer
1697 * This function is used to read image data from the device
2083 * cancel the currently pending operation of the device represented by
2109 /* store last scan time for the device */
2145 /* release the interface to allow device sharing */
2159 * This function terminates the association between the device handle
2160 * passed in argument h and the device it represents. If the device is
2253 * function will first close all device handles that still might be
2254 * open (it is recommended to close device handles explicitly through
2388 * to attach the backend to a device specified by the configuration file.
2392 * @param devname name of the device to try to attach to, it is
2420 * The attach tries to open the given usb device and match it
2426 * @param devicename name of the device to try to attach to, it is
2432 * device structure
2433 * SANE_STATUS_UNSUPPORTED if the device if unknown by the backend
2439 struct Rts8891_Device *device;
2446 for (device = first_device; device; device = device->next)
2448 if (strcmp (device->file_name, devicename) == 0)
2451 "attach_rts8891: device already attached (is ok)!\n");
2457 /* open usb device */
2461 DBG (DBG_error, "attach_rts8891: couldn't open device `%s': %s\n",
2467 DBG (DBG_info, "attach_rts8891: device `%s' successfully opened\n",
2476 "attach_rts8891: couldn't get vendor and product ids of device `%s': %s\n",
2484 /* get the index of the device in the device description table */
2494 /* if we reach the list termination entry, the device is unknown */
2498 "attach_rts8891: unknown device `%s': 0x%04x:0x%04x\n",
2510 /* allocate device struct */
2511 device = malloc (sizeof (*device));
2512 if (device == NULL)
2516 memset (device, 0, sizeof (*device));
2518 /* struct describing low lvel device */
2519 device->model = rts8891_usb_device_list[dn].model;
2521 /* name of the device */
2522 device->file_name = strdup (devicename);
2525 device->model->vendor,
2526 device->model->product, device->model->type, device->file_name);
2528 /* we insert new device at start of the chained list */
2532 device->next = first_device;
2533 first_device = device;
2535 device->reg_count = 244;
2537 device->initialized = SANE_FALSE;
2538 device->needs_warming = SANE_TRUE;
2539 device->parking = SANE_FALSE;
2541 device->last_scan.tv_sec = 0;
2542 device->start_time.tv_sec = 0;
2546 device->sensor = rtscfg.sensornumber;
2548 /* copy configuration settings to device */
2549 device->conf.modelnumber = dn;
2550 device->conf.allowsharing = rtscfg.allowsharing;
3508 * This function initializes the device:
3556 dev->sensor = device->model->sensor;
4019 * This function initializes the device:
4846 /* store detected values in device struct */
5205 /* store detected values in device struct */
5435 /* store detected values in device struct */
7725 /* claim the interface to reserve device */
7770 /* claim the interface reserve device */