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

Lines Matching defs:st_bp

5429 static int append_to_buffer(const char __user *ubp, struct osst_buffer *st_bp, int do_count)
5433 for (i=0, offset=st_bp->buffer_bytes;
5434 i < st_bp->sg_segs && offset >= st_bp->sg[i].length; i++)
5435 offset -= st_bp->sg[i].length;
5436 if (i == st_bp->sg_segs) { /* Should never happen */
5440 for ( ; i < st_bp->sg_segs && do_count > 0; i++) {
5441 cnt = st_bp->sg[i].length - offset < do_count ?
5442 st_bp->sg[i].length - offset : do_count;
5443 res = copy_from_user(page_address(sg_page(&st_bp->sg[i])) + offset, ubp, cnt);
5447 st_bp->buffer_bytes += cnt;
5462 static int from_buffer(struct osst_buffer *st_bp, char __user *ubp, int do_count)
5466 for (i=0, offset=st_bp->read_pointer;
5467 i < st_bp->sg_segs && offset >= st_bp->sg[i].length; i++)
5468 offset -= st_bp->sg[i].length;
5469 if (i == st_bp->sg_segs) { /* Should never happen */
5473 for ( ; i < st_bp->sg_segs && do_count > 0; i++) {
5474 cnt = st_bp->sg[i].length - offset < do_count ?
5475 st_bp->sg[i].length - offset : do_count;
5476 res = copy_to_user(ubp, page_address(sg_page(&st_bp->sg[i])) + offset, cnt);
5480 st_bp->buffer_bytes -= cnt;
5481 st_bp->read_pointer += cnt;
5494 static int osst_zero_buffer_tail(struct osst_buffer *st_bp)
5498 for (i = 0, offset = st_bp->buffer_bytes;
5499 i < st_bp->sg_segs && offset >= st_bp->sg[i].length; i++)
5500 offset -= st_bp->sg[i].length;
5501 if (i == st_bp->sg_segs) { /* Should never happen */
5505 for (do_count = OS_DATA_SIZE - st_bp->buffer_bytes;
5506 i < st_bp->sg_segs && do_count > 0; i++) {
5507 cnt = st_bp->sg[i].length - offset < do_count ?
5508 st_bp->sg[i].length - offset : do_count ;
5509 memset(page_address(sg_page(&st_bp->sg[i])) + offset, 0, cnt);
5522 static int osst_copy_to_buffer(struct osst_buffer *st_bp, unsigned char *ptr)
5526 for (i = 0; i < st_bp->sg_segs && do_count > 0; i++) {
5527 cnt = st_bp->sg[i].length < do_count ?
5528 st_bp->sg[i].length : do_count ;
5529 memcpy(page_address(sg_page(&st_bp->sg[i])), ptr, cnt);
5533 if (do_count || i != st_bp->sg_segs-1) { /* Should never happen */
5543 static int osst_copy_from_buffer(struct osst_buffer *st_bp, unsigned char *ptr)
5547 for (i = 0; i < st_bp->sg_segs && do_count > 0; i++) {
5548 cnt = st_bp->sg[i].length < do_count ?
5549 st_bp->sg[i].length : do_count ;
5550 memcpy(ptr, page_address(sg_page(&st_bp->sg[i])), cnt);
5554 if (do_count || i != st_bp->sg_segs-1) { /* Should never happen */