130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* 230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * FC Transport Netlink Interface 330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Copyright (C) 2006 James Smart, Emulex Corporation 530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * This program is free software; you can redistribute it and/or modify 730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * it under the terms of the GNU General Public License as published by 830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * the Free Software Foundation; either version 2 of the License, or 930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * (at your option) any later version. 1030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 1130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * This program is distributed in the hope that it will be useful, 1230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * but WITHOUT ANY WARRANTY; without even the implied warranty of 1330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * GNU General Public License for more details. 1530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 1630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * You should have received a copy of the GNU General Public License 1730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * along with this program; if not, write to the Free Software 1830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 2030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */ 2130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#ifndef SCSI_NETLINK_FC_H 2230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define SCSI_NETLINK_FC_H 2330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 2430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#include <scsi/scsi_netlink.h> 2530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 2630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* 2730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * This file intended to be included by both kernel and user space 2830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */ 2930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 3030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* 3130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * FC Transport Message Types 3230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */ 3330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng /* kernel -> user */ 3430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FC_NL_ASYNC_EVENT 0x0100 3530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng /* user -> kernel */ 3630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* none */ 3730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 3830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 3930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* 4030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Message Structures : 4130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */ 4230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 4330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* macro to round up message lengths to 8byte boundary */ 4430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FC_NL_MSGALIGN(len) (((len) + 7) & ~7) 4530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 4630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 4730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* 4830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * FC Transport Broadcast Event Message : 4930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * FC_NL_ASYNC_EVENT 5030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 5130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Note: if Vendor Unique message, &event_data will be start of 5230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * vendor unique payload, and the length of the payload is 5330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * per event_datalen 5430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * 5530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Note: When specifying vendor_id, be sure to read the Vendor Type and ID 5630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * formatting requirements specified in scsi_netlink.h 5730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */ 5830692c65c4174412c90e79489e98ab85c1a7412fBen Chengstruct fc_nl_event { 5930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng struct scsi_nl_hdr snlh; /* must be 1st element ! */ 6030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint64_t seconds; 6130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint64_t vendor_id; 6230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint16_t host_no; 6330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint16_t event_datalen; 6430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint32_t event_num; 6530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint32_t event_code; 6630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng uint32_t event_data; 6730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng} __attribute__((aligned(sizeof(uint64_t)))); 6830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 6930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 7030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#endif /* SCSI_NETLINK_FC_H */ 7130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng 72