Lines Matching refs:this

16    along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 additional uses of the libraries contained in this release of SANE.
22 to produce an executable, this does not by itself cause the
33 those changes may be distributed with this exception intact.
36 whether to permit this exception to apply to your modifications.
37 If you do not wish that, delete this exception notice.
236 if (!asHpOpenFd[iCount].devname) /* Is this entry free ? */
296 hp_nonscsi_write (HpScsi this, hp_byte_t *data, size_t len, HpConnect connect)
307 n = write (this->fd, data, len);
311 n = sanei_pio_write (this->fd, data, len);
316 status = sanei_usb_write_bulk ((SANE_Int)this->fd, data, &loc_len);
336 hp_nonscsi_read (HpScsi this, hp_byte_t *data, size_t *len, HpConnect connect,
362 n = read (this->fd, data, *len);
366 n = sanei_pio_read (this->fd, data, *len);
370 status = sanei_usb_read_bulk((SANE_Int)this->fd, (SANE_Byte *)data, len);
537 hp_scsi_close (HpScsi this, int completely)
540 DBG(3, "scsi_close: closing fd %ld\n", (long)this->fd);
542 connect = sanei_hp_scsi_get_connect (this);
546 if ( hp_IsOpenFd (this->fd, connect) == SANE_STATUS_GOOD )
553 assert(this->fd >= 0);
556 hp_nonscsi_close (this->fd, connect);
558 sanei_scsi_close (this->fd);
563 hp_RemoveOpenFd (this->fd, connect);
670 sanei_hp_scsi_destroy (HpScsi this,int completely)
673 * assert(this->fd >= 0);
674 * DBG(3, "scsi_close: closing fd %d\n", this->fd);
677 hp_scsi_close (this, completely);
678 if ( this->devname ) sanei_hp_free (this->devname);
679 sanei_hp_free(this);
683 sanei_hp_scsi_inq (HpScsi this)
685 return this->inq_data;
689 sanei_hp_scsi_vendor (HpScsi this)
692 memcpy(buf, sanei_hp_scsi_inq(this) + 8, 8);
698 sanei_hp_scsi_model (HpScsi this)
702 memcpy(buf, sanei_hp_scsi_inq(this) + 16, 16);
708 sanei_hp_scsi_devicename (HpScsi this)
710 return this->devname;
813 sanei_hp_scsi_get_connect (HpScsi this)
816 return sanei_hp_get_connect (sanei_hp_scsi_devicename (this));
821 hp_scsi_flush (HpScsi this)
823 hp_byte_t * data = this->buf + HP_SCSI_CMD_LEN;
824 size_t len = this->bufp - data;
831 this->bufp = this->buf;
836 *this->bufp++ = 0x0A;
837 *this->bufp++ = 0;
838 *this->bufp++ = len >> 16;
839 *this->bufp++ = len >> 8;
840 *this->bufp++ = len;
841 *this->bufp++ = 0;
843 connect = sanei_hp_scsi_get_connect (this);
845 return sanei_scsi_cmd (this->fd, this->buf, HP_SCSI_CMD_LEN + len, 0, 0);
847 return hp_nonscsi_write (this, this->buf+HP_SCSI_CMD_LEN, len, connect);
851 hp_scsi_room (HpScsi this)
853 return this->buf + HP_SCSI_BUFSIZ - this->bufp;
857 hp_scsi_need (HpScsi this, size_t need)
861 if (need > hp_scsi_room(this))
862 RETURN_IF_FAIL( hp_scsi_flush(this) );
868 hp_scsi_write (HpScsi this, const void *data, size_t len)
872 RETURN_IF_FAIL( hp_scsi_need(this, len) );
873 memcpy(this->bufp, data, len);
874 this->bufp += len;
883 RETURN_IF_FAIL( hp_scsi_write(this, c_data, maxwrite) );
892 hp_scsi_scl(HpScsi this, HpScl scl, int val)
901 RETURN_IF_FAIL( hp_scsi_need(this, 10) );
906 count = sprintf((char *)this->bufp, "\033*%c%d%c", group, val, param);
907 this->bufp += count;
909 assert(count > 0 && this->bufp < this->buf + HP_SCSI_BUFSIZ);
911 return hp_scsi_flush(this);
916 hp_scsi_read_slow (HpScsi this, void * dest, size_t *len)
932 status = sanei_scsi_cmd (this->fd, read_cmd, sizeof(read_cmd),
962 * a well-formed response. Naturally, this parameter would be zero
965 hp_scsi_read (HpScsi this, void * dest, size_t *len, int isResponse)
969 RETURN_IF_FAIL( hp_scsi_flush(this) );
971 connect = sanei_hp_scsi_get_connect (this);
978 info = sanei_hp_device_info_get (sanei_hp_scsi_devicename (this));
989 RETURN_IF_FAIL( sanei_scsi_cmd (this->fd, read_cmd,
994 RETURN_IF_FAIL (hp_scsi_read_slow (this, dest, len));
999 RETURN_IF_FAIL( hp_nonscsi_read (this, dest, len, connect, isResponse) );
1469 sanei_hp_scsi_pipeout (HpScsi this, int outfd, HpProcessData *procdata)
1472 * anything not in this list, we will ignore. */
1520 const char *devname = sanei_hp_scsi_devicename (this);
1528 RETURN_IF_FAIL( hp_scsi_flush(this) );
1575 sanei_hp_scl_inquire (this, SCL_FRONT_BUTTON, &val, 0, 0);
1579 status = sanei_hp_scl_startScan (this, procdata->startscan);
1619 status = sanei_scsi_req_enter(this->fd, req->cmd, 6,
1678 status = hp_scsi_read (this, read_buf, &nread, 0);