Lines Matching refs:off
172 int cnt, off = 0; in spc_gen_naa_6h_vendor_specific() local
178 buf[off] = 0x6 << 4; in spc_gen_naa_6h_vendor_specific()
181 buf[off++] |= (company_id >> 20) & 0xf; in spc_gen_naa_6h_vendor_specific()
182 buf[off++] = (company_id >> 12) & 0xff; in spc_gen_naa_6h_vendor_specific()
183 buf[off++] = (company_id >> 4) & 0xff; in spc_gen_naa_6h_vendor_specific()
184 buf[off] = (company_id & 0xf) << 4; in spc_gen_naa_6h_vendor_specific()
194 for (cnt = off + 13; *p && off < cnt; p++) { in spc_gen_naa_6h_vendor_specific()
202 buf[off++] |= val; in spc_gen_naa_6h_vendor_specific()
205 buf[off] = val << 4; in spc_gen_naa_6h_vendor_specific()
224 u32 unit_serial_len, off = 0; in spc_emulate_evpd_83() local
227 off = 4; in spc_emulate_evpd_83()
241 buf[off++] = 0x1; in spc_emulate_evpd_83()
244 buf[off] = 0x00; in spc_emulate_evpd_83()
247 buf[off++] |= 0x3; in spc_emulate_evpd_83()
248 off++; in spc_emulate_evpd_83()
251 buf[off++] = 0x10; in spc_emulate_evpd_83()
254 spc_gen_naa_6h_vendor_specific(dev, &buf[off]); in spc_emulate_evpd_83()
257 off = (len + 4); in spc_emulate_evpd_83()
273 id_len += sprintf(&buf[off+12], "%s:%s", prod, in spc_emulate_evpd_83()
276 buf[off] = 0x2; /* ASCII */ in spc_emulate_evpd_83()
277 buf[off+1] = 0x1; /* T10 Vendor ID */ in spc_emulate_evpd_83()
278 buf[off+2] = 0x0; in spc_emulate_evpd_83()
280 memset(&buf[off+4], 0x20, INQUIRY_VENDOR_LEN); in spc_emulate_evpd_83()
281 memcpy(&buf[off+4], dev->t10_wwn.vendor, in spc_emulate_evpd_83()
286 buf[off+3] = id_len; in spc_emulate_evpd_83()
289 off += (id_len + 4); in spc_emulate_evpd_83()
306 buf[off] = tpg->proto_id << 4; in spc_emulate_evpd_83()
307 buf[off++] |= 0x1; /* CODE SET == Binary */ in spc_emulate_evpd_83()
308 buf[off] = 0x80; /* Set PIV=1 */ in spc_emulate_evpd_83()
310 buf[off] |= 0x10; in spc_emulate_evpd_83()
312 buf[off++] |= 0x4; in spc_emulate_evpd_83()
313 off++; /* Skip over Reserved */ in spc_emulate_evpd_83()
314 buf[off++] = 4; /* DESIGNATOR LENGTH */ in spc_emulate_evpd_83()
317 off += 2; in spc_emulate_evpd_83()
318 put_unaligned_be16(lun->lun_rtpi, &buf[off]); in spc_emulate_evpd_83()
319 off += 2; in spc_emulate_evpd_83()
337 buf[off] = tpg->proto_id << 4; in spc_emulate_evpd_83()
338 buf[off++] |= 0x1; /* CODE SET == Binary */ in spc_emulate_evpd_83()
339 buf[off] = 0x80; /* Set PIV=1 */ in spc_emulate_evpd_83()
341 buf[off] |= 0x10; in spc_emulate_evpd_83()
343 buf[off++] |= 0x5; in spc_emulate_evpd_83()
344 off++; /* Skip over Reserved */ in spc_emulate_evpd_83()
345 buf[off++] = 4; /* DESIGNATOR LENGTH */ in spc_emulate_evpd_83()
346 off += 2; /* Skip over Reserved Field */ in spc_emulate_evpd_83()
347 put_unaligned_be16(tg_pt_gp_id, &buf[off]); in spc_emulate_evpd_83()
348 off += 2; in spc_emulate_evpd_83()
368 buf[off++] |= 0x1; /* CODE SET == Binary */ in spc_emulate_evpd_83()
370 buf[off++] |= 0x6; in spc_emulate_evpd_83()
371 off++; /* Skip over Reserved */ in spc_emulate_evpd_83()
372 buf[off++] = 4; /* DESIGNATOR LENGTH */ in spc_emulate_evpd_83()
373 off += 2; /* Skip over Reserved Field */ in spc_emulate_evpd_83()
374 put_unaligned_be16(lu_gp_id, &buf[off]); in spc_emulate_evpd_83()
375 off += 2; in spc_emulate_evpd_83()
385 buf[off] = tpg->proto_id << 4; in spc_emulate_evpd_83()
386 buf[off++] |= 0x3; /* CODE SET == UTF-8 */ in spc_emulate_evpd_83()
387 buf[off] = 0x80; /* Set PIV=1 */ in spc_emulate_evpd_83()
389 buf[off] |= 0x10; in spc_emulate_evpd_83()
391 buf[off++] |= 0x8; in spc_emulate_evpd_83()
392 off += 2; /* Skip over Reserved and length */ in spc_emulate_evpd_83()
400 scsi_name_len = sprintf(&buf[off], "%s,t,0x%04x", in spc_emulate_evpd_83()
417 buf[off-1] = scsi_name_len; in spc_emulate_evpd_83()
418 off += scsi_name_len; in spc_emulate_evpd_83()
425 buf[off] = tpg->proto_id << 4; in spc_emulate_evpd_83()
426 buf[off++] |= 0x3; /* CODE SET == UTF-8 */ in spc_emulate_evpd_83()
427 buf[off] = 0x80; /* Set PIV=1 */ in spc_emulate_evpd_83()
429 buf[off] |= 0x20; in spc_emulate_evpd_83()
431 buf[off++] |= 0x8; in spc_emulate_evpd_83()
432 off += 2; /* Skip over Reserved and length */ in spc_emulate_evpd_83()
439 scsi_target_len = sprintf(&buf[off], "%s", in spc_emulate_evpd_83()
456 buf[off-1] = scsi_target_len; in spc_emulate_evpd_83()
457 off += scsi_target_len; in spc_emulate_evpd_83()
1146 int off = ten ? 8 : 4; in spc_emulate_modeselect() local
1160 if (cmd->data_length < off + 2) in spc_emulate_modeselect()
1172 page = buf[off] & 0x3f; in spc_emulate_modeselect()
1173 subpage = buf[off] & 0x40 ? buf[off + 1] : 0; in spc_emulate_modeselect()
1187 if (cmd->data_length < off + length) { in spc_emulate_modeselect()
1192 if (memcmp(buf + off, tbuf, length)) in spc_emulate_modeselect()