/*
* QLOGIC LINUX SOFTWARE
*
* QLogic ISP2x00 device driver for Linux 2.6.x
* Copyright (C) 2003-2005 QLogic Corporation
* (www.qlogic.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* 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.
*
*/
#include "qla_def.h"
/**
* IO descriptor handle definitions.
*
* Signature form:
*
* |31------28|27-------------------12|11-------0|
* | Type | Rolling Signature | Index |
* |----------|-----------------------|----------|
*
**/
#define HDL_TYPE_SCSI 0
#define HDL_TYPE_ASYNC_IOCB 0x0A
#define HDL_INDEX_BITS 12
#define HDL_ITER_BITS 16
#define HDL_TYPE_BITS 4
#define HDL_INDEX_MASK ((1UL << HDL_INDEX_BITS) - 1)
#define HDL_ITER_MASK ((1UL << HDL_ITER_BITS) - 1)
#define HDL_TYPE_MASK ((1UL << HDL_TYPE_BITS) - 1)
#define HDL_INDEX_SHIFT 0
#define HDL_ITER_SHIFT (HDL_INDEX_SHIFT + HDL_INDEX_BITS)
#define HDL_TYPE_SHIFT (HDL_ITER_SHIFT + HDL_ITER_BITS)
/* Local Prototypes. */
static inline uint32_t qla2x00_to_handle(uint16_t, uint16_t, uint16_t);
static inline uint16_t qla2x00_handle_to_idx(uint32_t);
static inline uint32_t qla2x00_iodesc_to_handle(struct io_descriptor *);
static inline struct io_descriptor *qla2x00_handle_to_iodesc(scsi_qla_host_t *,
uint32_t);
static inline struct io_descriptor *qla2x00_alloc_iodesc(scsi_qla_host_t *);
static inline void qla2x00_free_iodesc(struct io_descriptor *);
static inline void qla2x00_init_io_descriptors(scsi_qla_host_t *);
static void qla2x00_iodesc_timeout(unsigned long);
static inline void qla2x00_add_iodesc_timer(struct io_descriptor *);
static inline void qla2x00_remove_iodesc_timer(struct io_descriptor *);
static inline void qla2x00_update_login_fcport(scsi_qla_host_t *,
struct mbx_entry