/*1* Copyright(c) 2007 Intel Corporation. All rights reserved.2*3* This program is free software; you can redistribute it and/or modify it4* under the terms and conditions of the GNU General Public License,5* version 2, as published by the Free Software Foundation.6*7* This program is distributed in the hope it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for10* more details.11*12* You should have received a copy of the GNU General Public License along with13* this program; if not, write to the Free Software Foundation, Inc.,14* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.15*16* Maintained at www.Open-FCoE.org17*/1819#ifndef _FC_NS_H_20#define _FC_NS_H_2122#include <linux/types.h>2324/*25* Fibre Channel Services - Name Service (dNS)26* From T11.org FC-GS-2 Rev 5.3 November 1998.27*/2829/*30* Common-transport sub-type for Name Server.31*/32#define FC_NS_SUBTYPE 2 /* fs_ct_hdr.ct_fs_subtype */3334/*35* Name server Requests.36* Note: this is an incomplete list, some unused requests are omitted.37*/38enum fc_ns_req {39FC_NS_GA_NXT = 0x0100, /* get all next */40FC_NS_GI_A = 0x0101, /* get identifiers - scope */41FC_NS_GPN_ID = 0x0112, /* get port name by ID */42FC_NS_GNN_ID = 0x0113, /* get node name by ID */43FC_NS_GSPN_ID = 0x0118, /* get symbolic port name */44FC_NS_GID_PN = 0x0121, /* get ID for port name */45FC_NS_GID_NN = 0x0131, /* get IDs for node name */46FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */47FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */48FC_NS_GID_PT = 0x01a1, /* get IDs by port type */49FC_NS_RPN_ID = 0x0212, /* reg port name for ID */50FC_NS_RNN_ID = 0x0213, /* reg node name for ID */51FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */52FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */53FC_NS_RFF_ID = 0x021f, /* reg FC4 Features for ID */54FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */55};5657/*58* Port type values.59*/60enum fc_ns_pt {61FC_NS_UNID_PORT = 0x00, /* unidentified */62FC_NS_N_PORT = 0x01, /* N port */63FC_NS_NL_PORT = 0x02, /* NL port */64FC_NS_FNL_PORT = 0x03, /* F/NL port */65FC_NS_NX_PORT = 0x7f, /* Nx port */66FC_NS_F_PORT = 0x81, /* F port */67FC_NS_FL_PORT = 0x82, /* FL port */68FC_NS_E_PORT = 0x84, /* E port */69FC_NS_B_PORT = 0x85, /* B port */70};7172/*73* Port type object.74*/75struct fc_ns_pt_obj {76__u8 pt_type;77};7879/*80* Port ID object81*/82struct fc_ns_fid {83__u8 fp_flags; /* flags for responses only */84__u8 fp_fid[3];85};8687/*88* fp_flags in port ID object, for responses only.89*/90#define FC_NS_FID_LAST 0x80 /* last object */9192/*93* FC4-types object.94*/95#define FC_NS_TYPES 256 /* number of possible FC-4 types */96#define FC_NS_BPW 32 /* bits per word in bitmap */9798struct fc_ns_fts {99__be32 ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */100};101102/*103* FC4-features object.104*/105struct fc_ns_ff {106__be32 fd_feat[FC_NS_TYPES * 4 / FC_NS_BPW]; /* 4-bits per FC-type */107};108109/*110* GID_PT request.111*/112struct fc_ns_gid_pt {113__u8 fn_pt_type;114__u8 fn_domain_id_scope;115__u8 fn_area_id_scope;116__u8 fn_resvd;117};118119/*120* GID_FT or GPN_FT request.121*/122struct fc_ns_gid_ft {123__u8 fn_resvd;124__u8 fn_domain_id_scope;125__u8 fn_area_id_scope;126__u8 fn_fc4_type;127};128129/*130* GPN_FT response.131*/132struct fc_gpn_ft_resp {133__u8 fp_flags; /* see fp_flags definitions above */134__u8 fp_fid[3]; /* port ID */135__be32 fp_resvd;136__be64 fp_wwpn; /* port name */137};138139/*140* GID_PN request141*/142struct fc_ns_gid_pn {143__be64 fn_wwpn; /* port name */144};145146/*147* GID_PN response or GSPN_ID request148*/149struct fc_gid_pn_resp {150__u8 fp_resvd;151__u8 fp_fid[3]; /* port ID */152};153154/*155* GSPN_ID response156*/157struct fc_gspn_resp {158__u8 fp_name_len;159char fp_name[];160};161162/*163* RFT_ID request - register FC-4 types for ID.164*/165struct fc_ns_rft_id {166struct fc_ns_fid fr_fid; /* port ID object */167struct fc_ns_fts fr_fts; /* FC-4 types object */168};169170/*171* RPN_ID request - register port name for ID.172* RNN_ID request - register node name for ID.173*/174struct fc_ns_rn_id {175struct fc_ns_fid fr_fid; /* port ID object */176__be64 fr_wwn; /* node name or port name */177} __attribute__((__packed__));178179/*180* RSNN_NN request - register symbolic node name181*/182struct fc_ns_rsnn {183__be64 fr_wwn; /* node name */184__u8 fr_name_len;185char fr_name[];186} __attribute__((__packed__));187188/*189* RSPN_ID request - register symbolic port name190*/191struct fc_ns_rspn {192struct fc_ns_fid fr_fid; /* port ID object */193__u8 fr_name_len;194char fr_name[];195} __attribute__((__packed__));196197/*198* RFF_ID request - register FC-4 Features for ID.199*/200struct fc_ns_rff_id {201struct fc_ns_fid fr_fid; /* port ID object */202__u8 fr_resvd[2];203__u8 fr_feat; /* FC-4 Feature bits */204__u8 fr_type; /* FC-4 type */205} __attribute__((__packed__));206207#endif /* _FC_NS_H_ */208209210