/* * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. * All rights reserved * www.brocade.com * * Linux driver for Brocade Fibre Channel Host Bus Adapter. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License (GPL) Version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */#ifndef __BFA_FC_H__#define __BFA_FC_H__#include"bfad_drv.h"typedef u64 wwn_t;#define WWN_NULL (0)#define FC_SYMNAME_MAX 256/* max name server symbolic name size */#pragma pack(1)#define MAC_ADDRLEN (6)struct mac_s { u8 mac[MAC_ADDRLEN]; };#define mac_t struct mac_s/* * generic SCSI cdb definition */#define SCSI_MAX_CDBLEN 16struct scsi_cdb_s {
u8 scsi_cdb[SCSI_MAX_CDBLEN];};/* ------------------------------------------------------------ * SCSI status byte values * ------------------------------------------------------------ */#define SCSI_STATUS_GOOD 0x00#define SCSI_STATUS_CHECK_CONDITION 0x02#define SCSI_STATUS_CONDITION_MET 0x04#define SCSI_STATUS_BUSY 0x08#define SCSI_STATUS_INTERMEDIATE 0x10#define SCSI_STATUS_ICM 0x14/* intermediate condition met */#define SCSI_STATUS_RESERVATION_CONFLICT 0x18#define SCSI_STATUS_COMMAND_TERMINATED 0x22#define SCSI_STATUS_QUEUE_FULL 0x28#define SCSI_STATUS_ACA_ACTIVE 0x30#define SCSI_MAX_ALLOC_LEN 0xFF/* maximum allocarion length *//* * Fibre Channel Header Structure (FCHS) definition */struct fchs_s {#ifdef __BIG_ENDIAN
u32 routing:4;/* routing bits */
u32 cat_info:4;/* category info */#else
u32 cat_info:4;/* category info */
u32 routing:4;/* routing bits */#endif
u32 d_id:24;/* destination identifier */
u32 cs_ctl:8;/* class specific control */
u32 s_id:24;/* source identifier */
u32 type:8;/* data struc