Lines Matching refs:rbuf

1798 		unsigned int (*actor)(struct ata_scsi_args *args, u8 *rbuf))
1821 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1829 static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
1881 memcpy(rbuf, hdr, sizeof(hdr));
1882 memcpy(&rbuf[8], "ATA ", 8);
1883 ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16);
1886 ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV + 2, 4);
1887 if (strncmp(&rbuf[32], " ", 4) == 0)
1888 ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV, 4);
1890 if (rbuf[32] == 0 || rbuf[32] == ' ')
1891 memcpy(&rbuf[32], "n/a ", 4);
1894 memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc));
1896 memcpy(rbuf + 58, versions, sizeof(versions));
1904 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1911 static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
1930 rbuf[num_pages + 4] = pages[i];
1933 rbuf[3] = num_pages; /* number of supported VPD pages */
1940 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1947 static unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf)
1956 memcpy(rbuf, hdr, sizeof(hdr));
1957 ata_id_string(args->id, (unsigned char *) &rbuf[4],
1965 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1975 static unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf)
1980 rbuf[1] = 0x83; /* this page code */
1984 rbuf[num + 0] = 2;
1985 rbuf[num + 3] = ATA_ID_SERNO_LEN;
1987 ata_id_string(args->id, (unsigned char *) rbuf + num,
1993 rbuf[num + 0] = 2;
1994 rbuf[num + 1] = 1;
1995 rbuf[num + 3] = sat_model_serial_desc_len;
1997 memcpy(rbuf + num, "ATA ", 8);
1999 ata_id_string(args->id, (unsigned char *) rbuf + num, ATA_ID_PROD,
2002 ata_id_string(args->id, (unsigned char *) rbuf + num, ATA_ID_SERNO,
2009 rbuf[num + 0] = 1;
2010 rbuf[num + 1] = 3;
2011 rbuf[num + 3] = ATA_ID_WWN_LEN;
2013 ata_id_string(args->id, (unsigned char *) rbuf + num,
2017 rbuf[3] = num - 4; /* page len (assume less than 256 bytes) */
2024 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2031 static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf)
2033 rbuf[1] = 0x89; /* our page code */
2034 rbuf[2] = (0x238 >> 8); /* page size fixed at 238h */
2035 rbuf[3] = (0x238 & 0xff);
2037 memcpy(&rbuf[8], "linux ", 8);
2038 memcpy(&rbuf[16], "libata ", 16);
2039 memcpy(&rbuf[32], DRV_VERSION, 4);
2041 rbuf[36] = 0x34; /* force D2H Reg FIS (34h) */
2042 rbuf[37] = (1 << 7); /* bit 7 indicates Command FIS */
2046 rbuf[38] = ATA_DRDY; /* really, this is Status reg */
2047 rbuf[40] = 0x1;
2048 rbuf[48] = 0x1;
2050 rbuf[56] = ATA_CMD_ID_ATA;
2052 memcpy(&rbuf[60], &args->id[0], 512);
2056 static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf)
2061 rbuf[1] = 0xb0;
2062 rbuf[3] = 0x3c; /* required VPD size with unmap support */
2072 put_unaligned_be16(min_io_sectors, &rbuf[6]);
2089 put_unaligned_be64(max_blocks, &rbuf[36]);
2090 put_unaligned_be32(1, &rbuf[28]);
2096 static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf)
2102 rbuf[1] = 0xb1;
2103 rbuf[3] = 0x3c;
2104 rbuf[4] = media_rotation_rate >> 8;
2105 rbuf[5] = media_rotation_rate;
2106 rbuf[7] = form_factor;
2108 rbuf[8] = (zoned << 4);
2113 static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf)
2116 rbuf[1] = 0xb2;
2117 rbuf[3] = 0x4;
2118 rbuf[5] = 1 << 6; /* TPWS */
2123 static unsigned int ata_scsiop_inq_b6(struct ata_scsi_args *args, u8 *rbuf)
2128 rbuf[1] = 0xb6;
2129 rbuf[3] = 0x3C;
2135 rbuf[4] |= 1;
2136 put_unaligned_be32(args->dev->zac_zones_optimal_open, &rbuf[8]);
2137 put_unaligned_be32(args->dev->zac_zones_optimal_nonseq, &rbuf[12]);
2138 put_unaligned_be32(args->dev->zac_zones_max_open, &rbuf[16]);
2143 static unsigned int ata_scsiop_inq_b9(struct ata_scsi_args *args, u8 *rbuf)
2146 u8 *desc = &rbuf[64];
2150 rbuf[1] = 0xb9;
2151 put_unaligned_be16(64 + (int)cpr_log->nr_cpr * 32 - 4, &rbuf[2]);
2379 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2388 static unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf)
2391 u8 *scsicmd = args->cmd->cmnd, *p = rbuf;
2478 rbuf[0] = p - rbuf - 1;
2479 rbuf[2] |= dpofua;
2481 rbuf[3] = sizeof(sat_blk_desc);
2482 memcpy(rbuf + 4, sat_blk_desc, sizeof(sat_blk_desc));
2485 put_unaligned_be16(p - rbuf - 2, &rbuf[0]);
2486 rbuf[3] |= dpofua;
2488 rbuf[7] = sizeof(sat_blk_desc);
2489 memcpy(rbuf + 8, sat_blk_desc, sizeof(sat_blk_desc));
2507 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2514 static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
2531 rbuf[0] = last_lba >> (8 * 3);
2532 rbuf[1] = last_lba >> (8 * 2);
2533 rbuf[2] = last_lba >> (8 * 1);
2534 rbuf[3] = last_lba;
2537 rbuf[4] = sector_size >> (8 * 3);
2538 rbuf[5] = sector_size >> (8 * 2);
2539 rbuf[6] = sector_size >> (8 * 1);
2540 rbuf[7] = sector_size;
2543 rbuf[0] = last_lba >> (8 * 7);
2544 rbuf[1] = last_lba >> (8 * 6);
2545 rbuf[2] = last_lba >> (8 * 5);
2546 rbuf[3] = last_lba >> (8 * 4);
2547 rbuf[4] = last_lba >> (8 * 3);
2548 rbuf[5] = last_lba >> (8 * 2);
2549 rbuf[6] = last_lba >> (8 * 1);
2550 rbuf[7] = last_lba;
2553 rbuf[ 8] = sector_size >> (8 * 3);
2554 rbuf[ 9] = sector_size >> (8 * 2);
2555 rbuf[10] = sector_size >> (8 * 1);
2556 rbuf[11] = sector_size;
2558 rbuf[12] = 0;
2559 rbuf[13] = log2_per_phys;
2560 rbuf[14] = (lowest_aligned >> 8) & 0x3f;
2561 rbuf[15] = lowest_aligned;
2565 rbuf[14] |= 0x80; /* LBPME */
2570 rbuf[14] |= 0x40; /* LBPRZ */
2575 rbuf[12] = (1 << 4); /* RC_BASIS */
2583 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2590 static unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf)
2592 rbuf[3] = 8; /* just one lun, LUN 0, size 8 bytes */
3310 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
3317 static unsigned int ata_scsiop_maint_in(struct ata_scsi_args *args, u8 *rbuf)
3397 rbuf[0] = rwcdlp;
3398 rbuf[1] = cdlp | supported;