]> git.karo-electronics.de Git - karo-tx-linux.git/commit
qla2xxx: Add LLD target-mode infrastructure for >= 24xx series
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 8 Mar 2012 22:27:03 +0000 (14:27 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 15 Apr 2012 00:42:40 +0000 (17:42 -0700)
commit0970147719e31f1344f0c132bc431fb4bb942b3a
tree927675a9afa846d28ea1663249e679190543fa05
parentbfb79eac2026b411df9e253a9c350039b4b04bb7
qla2xxx: Add LLD target-mode infrastructure for >= 24xx series

This patch adds the internal qla_target.[c,h] support pieces for qla2xxx
LLD target mode for 24xx series HW.  This code was originally based on
external qla2x00t module based on 8.02.01-k4, and has been refactored to push
the bulk of code into mainline qla2xxx.ko LLD -> qla_target.c.

The implementation uses internal workqueues for I/O context submission
into tcm_qla2xxx code, and includes the following API for external
interaction to allow qla2xxx LDD to function without direct target-core
dependencies:

struct qla_tgt_func_tmpl {

        int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *,
                        unsigned char *, uint32_t, int, int, int);
        int (*handle_data)(struct qla_tgt_cmd *);
        int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t, uint32_t);
        void (*free_cmd)(struct qla_tgt_cmd *);
        void (*free_mcmd)(struct qla_tgt_mgmt_cmd *);
        void (*free_session)(struct qla_tgt_sess *);

        int (*check_initiator_node_acl)(struct scsi_qla_host *, unsigned char *,
                                        void *, uint8_t *, uint16_t);
        struct qla_tgt_sess *(*find_sess_by_loop_id)(struct scsi_qla_host *,
                                                const uint16_t);
        struct qla_tgt_sess *(*find_sess_by_s_id)(struct scsi_qla_host *,
                                                const uint8_t *);
        void (*clear_nacl_from_fcport_map)(struct qla_tgt_sess *);
        void (*put_sess)(struct qla_tgt_sess *);
};

(nab: Add qla_tgt_func_tmpl->free_mcmd() usage in qla_tgt_xmit_tm_rsp +
      Fix possible NULL dereference in qla_tgt_handle_srr_work (DanC) +
      Fix NULL pointer dereference in qla_tgt_abort_task (DanC) +
      Convert to qlini_mode='enabled' by default in qla_target.c)
(joern: Remove loop_id from qla_tgt_make_local_sess() arguments +
        Remove unused s_id + fix s_id endianness bug +
        simplify qla_tgt_abort_work)
(gerard: fix section __exit mismatch in qla_tgt_exit)

Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: James Bottomley <JBottomley@Parallels.com>
Cc: Roland Dreier <roland@purestorage.com>
Cc: Joern Engel <joern@logfs.org>
Cc: Madhuranath Iyengar <mni@risingtidesystems.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/Makefile
drivers/scsi/qla2xxx/qla_target.c [new file with mode: 0644]
drivers/scsi/qla2xxx/qla_target.h [new file with mode: 0644]