diff options
author | Sergey Samoylenko <s.samoylenko@yadro.com> | 2021-04-20 21:59:20 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-05-15 14:14:28 -0400 |
commit | 2469f1e0412cb053e37b7499ce5e48b6be4d7653 (patch) | |
tree | 9105017d155c655f2137b7fb7ad12170f1b67887 /drivers/target/target_core_spc.c | |
parent | 17f947b8b06f57615d31e4159dec1d5d7dda775f (diff) |
scsi: target: core: Add configurable IEEE Company ID attribute
Implement an attribute which provides a way to set a company specific WWN
in configfs via:
target/core/$backstore/$name/wwn/company_id
The Open Fabrics Alliance ID 001405h remains the default.
Link: https://lore.kernel.org/r/20210420185920.42431-3-s.samoylenko@yadro.com
Signed-off-by: Sergey Samoylenko <s.samoylenko@yadro.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_spc.c')
-rw-r--r-- | drivers/target/target_core_spc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index b2d19493a994..fe5d5ce4099c 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -136,20 +136,20 @@ void spc_gen_naa_6h_vendor_specific(struct se_device *dev, unsigned char *buf) { unsigned char *p = &dev->t10_wwn.unit_serial[0]; + u32 company_id = dev->t10_wwn.company_id; int cnt, off = 0; bool next = true; /* * Start NAA IEEE Registered Extended Identifier/Designator */ - buf[off++] = 0x6 << 4; + buf[off] = 0x6 << 4; - /* - * Use OpenFabrics IEEE Company ID: 00 14 05 - */ - buf[off++] = 0x01; - buf[off++] = 0x40; - buf[off] = (0x5 << 4); + /* IEEE COMPANY_ID */ + buf[off++] |= (company_id >> 20) & 0xf; + buf[off++] = (company_id >> 12) & 0xff; + buf[off++] = (company_id >> 4) & 0xff; + buf[off] = (company_id & 0xf) << 4; /* * Generate up to 36 bits of VENDOR SPECIFIC IDENTIFIER starting on |