Lines Matching refs:rbuf
1802 * Returns rbuf buffer. The result is copied to @cmd's buffer if
1833 unsigned int (*actor)(struct ata_scsi_args *args, u8 *rbuf))
1835 u8 *rbuf;
1840 rbuf = ata_scsi_rbuf_get(cmd, false, &flags);
1841 rc = actor(args, rbuf);
1851 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1859 static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
1910 memcpy(rbuf, hdr, sizeof(hdr));
1911 memcpy(&rbuf[8], "ATA ", 8);
1912 ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16);
1915 ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV + 2, 4);
1916 if (strncmp(&rbuf[32], " ", 4) == 0)
1917 ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV, 4);
1919 if (rbuf[32] == 0 || rbuf[32] == ' ')
1920 memcpy(&rbuf[32], "n/a ", 4);
1923 memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc));
1925 memcpy(rbuf + 58, versions, sizeof(versions));
1933 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1940 static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
1957 rbuf[3] = num_pages; /* number of supported VPD pages */
1958 memcpy(rbuf + 4, pages, num_pages);
1965 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1972 static unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf)
1981 memcpy(rbuf, hdr, sizeof(hdr));
1982 ata_id_string(args->id, (unsigned char *) &rbuf[4],
1990 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2000 static unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf)
2005 rbuf[1] = 0x83; /* this page code */
2009 rbuf[num + 0] = 2;
2010 rbuf[num + 3] = ATA_ID_SERNO_LEN;
2012 ata_id_string(args->id, (unsigned char *) rbuf + num,
2018 rbuf[num + 0] = 2;
2019 rbuf[num + 1] = 1;
2020 rbuf[num + 3] = sat_model_serial_desc_len;
2022 memcpy(rbuf + num, "ATA ", 8);
2024 ata_id_string(args->id, (unsigned char *) rbuf + num, ATA_ID_PROD,
2027 ata_id_string(args->id, (unsigned char *) rbuf + num, ATA_ID_SERNO,
2034 rbuf[num + 0] = 1;
2035 rbuf[num + 1] = 3;
2036 rbuf[num + 3] = ATA_ID_WWN_LEN;
2038 ata_id_string(args->id, (unsigned char *) rbuf + num,
2042 rbuf[3] = num - 4; /* page len (assume less than 256 bytes) */
2049 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2056 static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf)
2058 rbuf[1] = 0x89; /* our page code */
2059 rbuf[2] = (0x238 >> 8); /* page size fixed at 238h */
2060 rbuf[3] = (0x238 & 0xff);
2062 memcpy(&rbuf[8], "linux ", 8);
2063 memcpy(&rbuf[16], "libata ", 16);
2064 memcpy(&rbuf[32], DRV_VERSION, 4);
2066 rbuf[36] = 0x34; /* force D2H Reg FIS (34h) */
2067 rbuf[37] = (1 << 7); /* bit 7 indicates Command FIS */
2071 rbuf[38] = ATA_DRDY; /* really, this is Status reg */
2072 rbuf[40] = 0x1;
2073 rbuf[48] = 0x1;
2075 rbuf[56] = ATA_CMD_ID_ATA;
2077 memcpy(&rbuf[60], &args->id[0], 512);
2081 static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf)
2086 rbuf[1] = 0xb0;
2087 rbuf[3] = 0x3c; /* required VPD size with unmap support */
2097 put_unaligned_be16(min_io_sectors, &rbuf[6]);
2114 put_unaligned_be64(max_blocks, &rbuf[36]);
2115 put_unaligned_be32(1, &rbuf[28]);
2121 static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf)
2127 rbuf[1] = 0xb1;
2128 rbuf[3] = 0x3c;
2129 rbuf[4] = media_rotation_rate >> 8;
2130 rbuf[5] = media_rotation_rate;
2131 rbuf[7] = form_factor;
2133 rbuf[8] = (zoned << 4);
2138 static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf)
2141 rbuf[1] = 0xb2;
2142 rbuf[3] = 0x4;
2143 rbuf[5] = 1 << 6; /* TPWS */
2148 static unsigned int ata_scsiop_inq_b6(struct ata_scsi_args *args, u8 *rbuf)
2153 rbuf[1] = 0xb6;
2154 rbuf[3] = 0x3C;
2160 rbuf[4] |= 1;
2161 put_unaligned_be32(args->dev->zac_zones_optimal_open, &rbuf[8]);
2162 put_unaligned_be32(args->dev->zac_zones_optimal_nonseq, &rbuf[12]);
2163 put_unaligned_be32(args->dev->zac_zones_max_open, &rbuf[16]);
2285 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2294 static unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf)
2297 u8 *scsicmd = args->cmd->cmnd, *p = rbuf;
2376 rbuf[0] = p - rbuf - 1;
2377 rbuf[2] |= dpofua;
2379 rbuf[3] = sizeof(sat_blk_desc);
2380 memcpy(rbuf + 4, sat_blk_desc, sizeof(sat_blk_desc));
2383 unsigned int output_len = p - rbuf - 2;
2385 rbuf[0] = output_len >> 8;
2386 rbuf[1] = output_len;
2387 rbuf[3] |= dpofua;
2389 rbuf[7] = sizeof(sat_blk_desc);
2390 memcpy(rbuf + 8, sat_blk_desc, sizeof(sat_blk_desc));
2408 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2415 static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
2434 rbuf[0] = last_lba >> (8 * 3);
2435 rbuf[1] = last_lba >> (8 * 2);
2436 rbuf[2] = last_lba >> (8 * 1);
2437 rbuf[3] = last_lba;
2440 rbuf[4] = sector_size >> (8 * 3);
2441 rbuf[5] = sector_size >> (8 * 2);
2442 rbuf[6] = sector_size >> (8 * 1);
2443 rbuf[7] = sector_size;
2446 rbuf[0] = last_lba >> (8 * 7);
2447 rbuf[1] = last_lba >> (8 * 6);
2448 rbuf[2] = last_lba >> (8 * 5);
2449 rbuf[3] = last_lba >> (8 * 4);
2450 rbuf[4] = last_lba >> (8 * 3);
2451 rbuf[5] = last_lba >> (8 * 2);
2452 rbuf[6] = last_lba >> (8 * 1);
2453 rbuf[7] = last_lba;
2456 rbuf[ 8] = sector_size >> (8 * 3);
2457 rbuf[ 9] = sector_size >> (8 * 2);
2458 rbuf[10] = sector_size >> (8 * 1);
2459 rbuf[11] = sector_size;
2461 rbuf[12] = 0;
2462 rbuf[13] = log2_per_phys;
2463 rbuf[14] = (lowest_aligned >> 8) & 0x3f;
2464 rbuf[15] = lowest_aligned;
2468 rbuf[14] |= 0x80; /* LBPME */
2473 rbuf[14] |= 0x40; /* LBPRZ */
2478 rbuf[12] = (1 << 4); /* RC_BASIS */
2486 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2493 static unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf)
2496 rbuf[3] = 8; /* just one lun, LUN 0, size 8 bytes */
3296 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
3303 static unsigned int ata_scsiop_maint_in(struct ata_scsi_args *args, u8 *rbuf)
3361 rbuf[1] = supported; /* supported */