~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to include/target/target_core_base.h

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#include <net/sock.h>
10
10
#include <net/tcp.h>
11
11
 
12
 
#define TARGET_CORE_MOD_VERSION         "v4.0.0-rc7-ml"
13
 
#define SHUTDOWN_SIGS   (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT))
 
12
#define TARGET_CORE_MOD_VERSION         "v4.1.0-rc1-ml"
14
13
 
15
 
/* Used by transport_generic_allocate_iovecs() */
16
 
#define TRANSPORT_IOV_DATA_BUFFER               5
17
14
/* Maximum Number of LUNs per Target Portal Group */
 
15
/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
18
16
#define TRANSPORT_MAX_LUNS_PER_TPG              256
19
17
/*
20
18
 * By default we use 32-byte CDBs in TCM Core and subsystem plugin code.
74
72
};
75
73
 
76
74
/* Used for generate timer flags */
77
 
enum timer_flags_table {
78
 
        TF_RUNNING      = 0x01,
79
 
        TF_STOP         = 0x02,
 
75
enum se_task_flags {
 
76
        TF_ACTIVE               = (1 << 0),
 
77
        TF_SENT                 = (1 << 1),
 
78
        TF_REQUEST_STOP         = (1 << 2),
80
79
};
81
80
 
82
81
/* Special transport agnostic struct se_cmd->t_states */
83
82
enum transport_state_table {
84
83
        TRANSPORT_NO_STATE      = 0,
85
84
        TRANSPORT_NEW_CMD       = 1,
86
 
        TRANSPORT_DEFERRED_CMD  = 2,
87
85
        TRANSPORT_WRITE_PENDING = 3,
88
86
        TRANSPORT_PROCESS_WRITE = 4,
89
87
        TRANSPORT_PROCESSING    = 5,
90
 
        TRANSPORT_COMPLETE_OK   = 6,
91
 
        TRANSPORT_COMPLETE_FAILURE = 7,
92
 
        TRANSPORT_COMPLETE_TIMEOUT = 8,
 
88
        TRANSPORT_COMPLETE      = 6,
93
89
        TRANSPORT_PROCESS_TMR   = 9,
94
 
        TRANSPORT_TMR_COMPLETE  = 10,
95
90
        TRANSPORT_ISTATE_PROCESSING = 11,
96
 
        TRANSPORT_ISTATE_PROCESSED = 12,
97
 
        TRANSPORT_KILL          = 13,
98
 
        TRANSPORT_REMOVE        = 14,
99
 
        TRANSPORT_FREE          = 15,
100
91
        TRANSPORT_NEW_CMD_MAP   = 16,
101
 
        TRANSPORT_FREE_CMD_INTR = 17,
 
92
        TRANSPORT_COMPLETE_QF_WP = 18,
 
93
        TRANSPORT_COMPLETE_QF_OK = 19,
102
94
};
103
95
 
104
96
/* Used for struct se_cmd->se_cmd_flags */
108
100
        SCF_EMULATED_TASK_SENSE         = 0x00000004,
109
101
        SCF_SCSI_DATA_SG_IO_CDB         = 0x00000008,
110
102
        SCF_SCSI_CONTROL_SG_IO_CDB      = 0x00000010,
111
 
        SCF_SCSI_CONTROL_NONSG_IO_CDB   = 0x00000020,
112
103
        SCF_SCSI_NON_DATA_CDB           = 0x00000040,
113
104
        SCF_SCSI_CDB_EXCEPTION          = 0x00000080,
114
105
        SCF_SCSI_RESERVATION_CONFLICT   = 0x00000100,
115
 
        SCF_CMD_PASSTHROUGH_NOALLOC     = 0x00000200,
116
106
        SCF_SE_CMD_FAILED               = 0x00000400,
117
107
        SCF_SE_LUN_CMD                  = 0x00000800,
118
108
        SCF_SE_ALLOW_EOO                = 0x00001000,
119
 
        SCF_SE_DISABLE_ONLINE_CHECK     = 0x00002000,
120
109
        SCF_SENT_CHECK_CONDITION        = 0x00004000,
121
110
        SCF_OVERFLOW_BIT                = 0x00008000,
122
111
        SCF_UNDERFLOW_BIT               = 0x00010000,
123
112
        SCF_SENT_DELAYED_TAS            = 0x00020000,
124
113
        SCF_ALUA_NON_OPTIMIZED          = 0x00040000,
125
114
        SCF_DELAYED_CMD_FROM_SAM_ATTR   = 0x00080000,
126
 
        SCF_PASSTHROUGH_SG_TO_MEM       = 0x00100000,
127
 
        SCF_PASSTHROUGH_CONTIG_TO_SG    = 0x00200000,
 
115
        SCF_UNUSED                      = 0x00100000,
128
116
        SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
129
 
        SCF_EMULATE_SYNC_CACHE          = 0x00800000,
130
 
        SCF_EMULATE_CDB_ASYNC           = 0x01000000,
131
 
        SCF_EMULATE_SYNC_UNMAP          = 0x02000000
132
117
};
133
118
 
134
119
/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
205
190
        SCSI_INDEX_TYPE_MAX
206
191
} scsi_index_t;
207
192
 
208
 
struct scsi_index_table {
209
 
        spinlock_t      lock;
210
 
        u32             scsi_mib_index[SCSI_INDEX_TYPE_MAX];
211
 
} ____cacheline_aligned;
212
 
 
213
193
struct se_cmd;
214
194
 
215
195
struct t10_alua {
235
215
        atomic_t lu_gp_ref_cnt;
236
216
        spinlock_t lu_gp_lock;
237
217
        struct config_group lu_gp_group;
238
 
        struct list_head lu_gp_list;
 
218
        struct list_head lu_gp_node;
239
219
        struct list_head lu_gp_mem_list;
240
220
} ____cacheline_aligned;
241
221
 
291
271
} ____cacheline_aligned;
292
272
 
293
273
struct t10_wwn {
294
 
        unsigned char vendor[8];
295
 
        unsigned char model[16];
296
 
        unsigned char revision[4];
297
 
        unsigned char unit_serial[INQUIRY_VPD_SERIAL_LEN];
 
274
        char vendor[8];
 
275
        char model[16];
 
276
        char revision[4];
 
277
        char unit_serial[INQUIRY_VPD_SERIAL_LEN];
298
278
        spinlock_t t10_vpd_lock;
299
279
        struct se_subsystem_dev *t10_sub_dev;
300
280
        struct config_group t10_wwn_group;
366
346
        int (*t10_pr_clear)(struct se_cmd *);
367
347
};
368
348
 
369
 
struct t10_reservation_template {
 
349
struct t10_reservation {
370
350
        /* Reservation effects all target ports */
371
351
        int pr_all_tg_pt;
372
352
        /* Activate Persistence across Target Power Loss enabled
373
353
         * for SCSI device */
374
354
        int pr_aptpl_active;
375
 
        /* Used by struct t10_reservation_template->pr_aptpl_buf_len */
 
355
        /* Used by struct t10_reservation->pr_aptpl_buf_len */
376
356
#define PR_APTPL_BUF_LEN                        8192
377
357
        u32 pr_aptpl_buf_len;
378
358
        u32 pr_generation;
397
377
 
398
378
struct se_queue_req {
399
379
        int                     state;
400
 
        void                    *cmd;
 
380
        struct se_cmd           *cmd;
401
381
        struct list_head        qr_list;
402
382
} ____cacheline_aligned;
403
383
 
408
388
        wait_queue_head_t       thread_wq;
409
389
} ____cacheline_aligned;
410
390
 
411
 
/*
412
 
 * Used one per struct se_cmd to hold all extra struct se_task
413
 
 * metadata.  This structure is setup and allocated in
414
 
 * drivers/target/target_core_transport.c:__transport_alloc_se_cmd()
415
 
 */
416
 
struct se_transport_task {
417
 
        unsigned char           *t_task_cdb;
418
 
        unsigned char           __t_task_cdb[TCM_MAX_COMMAND_SIZE];
419
 
        unsigned long long      t_task_lba;
420
 
        int                     t_tasks_failed;
421
 
        int                     t_tasks_fua;
422
 
        bool                    t_tasks_bidi;
423
 
        u32                     t_task_cdbs;
424
 
        u32                     t_tasks_check;
425
 
        u32                     t_tasks_no;
426
 
        u32                     t_tasks_sectors;
427
 
        u32                     t_tasks_se_num;
428
 
        u32                     t_tasks_se_bidi_num;
429
 
        u32                     t_tasks_sg_chained_no;
430
 
        atomic_t                t_fe_count;
431
 
        atomic_t                t_se_count;
432
 
        atomic_t                t_task_cdbs_left;
433
 
        atomic_t                t_task_cdbs_ex_left;
434
 
        atomic_t                t_task_cdbs_timeout_left;
435
 
        atomic_t                t_task_cdbs_sent;
436
 
        atomic_t                t_transport_aborted;
437
 
        atomic_t                t_transport_active;
438
 
        atomic_t                t_transport_complete;
439
 
        atomic_t                t_transport_queue_active;
440
 
        atomic_t                t_transport_sent;
441
 
        atomic_t                t_transport_stop;
442
 
        atomic_t                t_transport_timeout;
443
 
        atomic_t                transport_dev_active;
444
 
        atomic_t                transport_lun_active;
445
 
        atomic_t                transport_lun_fe_stop;
446
 
        atomic_t                transport_lun_stop;
447
 
        spinlock_t              t_state_lock;
448
 
        struct completion       t_transport_stop_comp;
449
 
        struct completion       transport_lun_fe_stop_comp;
450
 
        struct completion       transport_lun_stop_comp;
451
 
        struct scatterlist      *t_tasks_sg_chained;
452
 
        struct scatterlist      t_tasks_sg_bounce;
453
 
        void                    *t_task_buf;
454
 
        /*
455
 
         * Used for pre-registered fabric SGL passthrough WRITE and READ
456
 
         * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
457
 
         * and other HW target mode fabric modules.
458
 
         */
459
 
        struct scatterlist      *t_task_pt_sgl;
460
 
        struct list_head        *t_mem_list;
461
 
        /* Used for BIDI READ */
462
 
        struct list_head        *t_mem_bidi_list;
463
 
        struct list_head        t_task_list;
464
 
} ____cacheline_aligned;
465
 
 
466
391
struct se_task {
467
 
        unsigned char   task_sense;
468
 
        struct scatterlist *task_sg;
469
 
        struct scatterlist *task_sg_bidi;
470
 
        u8              task_scsi_status;
471
 
        u8              task_flags;
472
 
        int             task_error_status;
473
 
        int             task_state_flags;
474
 
        bool            task_padded_sg;
475
392
        unsigned long long      task_lba;
476
 
        u32             task_no;
477
 
        u32             task_sectors;
478
 
        u32             task_size;
479
 
        u32             task_sg_num;
480
 
        u32             task_sg_offset;
 
393
        u32                     task_sectors;
 
394
        u32                     task_size;
 
395
        struct se_cmd           *task_se_cmd;
 
396
        struct scatterlist      *task_sg;
 
397
        u32                     task_sg_nents;
 
398
        u16                     task_flags;
 
399
        u8                      task_sense;
 
400
        u8                      task_scsi_status;
 
401
        int                     task_error_status;
481
402
        enum dma_data_direction task_data_direction;
482
 
        struct se_cmd *task_se_cmd;
483
 
        struct se_device        *se_dev;
 
403
        atomic_t                task_state_active;
 
404
        struct list_head        t_list;
 
405
        struct list_head        t_execute_list;
 
406
        struct list_head        t_state_list;
484
407
        struct completion       task_stop_comp;
485
 
        atomic_t        task_active;
486
 
        atomic_t        task_execute_queue;
487
 
        atomic_t        task_timeout;
488
 
        atomic_t        task_sent;
489
 
        atomic_t        task_stop;
490
 
        atomic_t        task_state_active;
491
 
        struct timer_list       task_timer;
492
 
        struct se_device *se_obj_ptr;
493
 
        struct list_head t_list;
494
 
        struct list_head t_execute_list;
495
 
        struct list_head t_state_list;
496
408
} ____cacheline_aligned;
497
409
 
498
 
#define TASK_CMD(task)  ((task)->task_se_cmd)
499
 
#define TASK_DEV(task)  ((task)->se_dev)
500
 
 
501
410
struct se_cmd {
502
411
        /* SAM response code being sent to initiator */
503
412
        u8                      scsi_status;
513
422
        int                     sam_task_attr;
514
423
        /* Transport protocol dependent state, see transport_state_table */
515
424
        enum transport_state_table t_state;
516
 
        /* Transport protocol dependent state for out of order CmdSNs */
517
 
        int                     deferred_t_state;
518
425
        /* Transport specific error status */
519
426
        int                     transport_error_status;
 
427
        /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */
 
428
        int                     check_release:1;
 
429
        int                     cmd_wait_set:1;
520
430
        /* See se_cmd_flags_table */
521
431
        u32                     se_cmd_flags;
522
432
        u32                     se_ordered_id;
528
438
        u32                     orig_fe_lun;
529
439
        /* Persistent Reservation key */
530
440
        u64                     pr_res_key;
531
 
        atomic_t                transport_sent;
532
441
        /* Used for sense data */
533
442
        void                    *sense_buffer;
534
 
        struct list_head        se_delayed_list;
535
 
        struct list_head        se_ordered_list;
536
 
        struct list_head        se_lun_list;
 
443
        struct list_head        se_delayed_node;
 
444
        struct list_head        se_ordered_node;
 
445
        struct list_head        se_lun_node;
 
446
        struct list_head        se_qf_node;
537
447
        struct se_device      *se_dev;
538
448
        struct se_dev_entry   *se_deve;
539
449
        struct se_device        *se_obj_ptr;
542
452
        /* Only used for internal passthrough and legacy TCM fabric modules */
543
453
        struct se_session       *se_sess;
544
454
        struct se_tmr_req       *se_tmr_req;
545
 
        /* t_task is setup to t_task_backstore in transport_init_se_cmd() */
546
 
        struct se_transport_task *t_task;
547
 
        struct se_transport_task t_task_backstore;
 
455
        struct list_head        se_queue_node;
 
456
        struct list_head        se_cmd_list;
 
457
        struct completion       cmd_wait_comp;
548
458
        struct target_core_fabric_ops *se_tfo;
549
 
        int (*transport_emulate_cdb)(struct se_cmd *);
550
 
        void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *);
551
 
        void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
 
459
        int (*execute_task)(struct se_task *);
552
460
        void (*transport_complete_callback)(struct se_cmd *);
 
461
 
 
462
        unsigned char           *t_task_cdb;
 
463
        unsigned char           __t_task_cdb[TCM_MAX_COMMAND_SIZE];
 
464
        unsigned long long      t_task_lba;
 
465
        int                     t_tasks_failed;
 
466
        int                     t_tasks_fua;
 
467
        bool                    t_tasks_bidi;
 
468
        u32                     t_tasks_sg_chained_no;
 
469
        atomic_t                t_fe_count;
 
470
        atomic_t                t_se_count;
 
471
        atomic_t                t_task_cdbs_left;
 
472
        atomic_t                t_task_cdbs_ex_left;
 
473
        atomic_t                t_task_cdbs_sent;
 
474
        atomic_t                t_transport_aborted;
 
475
        atomic_t                t_transport_active;
 
476
        atomic_t                t_transport_complete;
 
477
        atomic_t                t_transport_queue_active;
 
478
        atomic_t                t_transport_sent;
 
479
        atomic_t                t_transport_stop;
 
480
        atomic_t                transport_dev_active;
 
481
        atomic_t                transport_lun_active;
 
482
        atomic_t                transport_lun_fe_stop;
 
483
        atomic_t                transport_lun_stop;
 
484
        spinlock_t              t_state_lock;
 
485
        struct completion       t_transport_stop_comp;
 
486
        struct completion       transport_lun_fe_stop_comp;
 
487
        struct completion       transport_lun_stop_comp;
 
488
        struct scatterlist      *t_tasks_sg_chained;
 
489
 
 
490
        struct work_struct      work;
 
491
 
 
492
        /*
 
493
         * Used for pre-registered fabric SGL passthrough WRITE and READ
 
494
         * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
 
495
         * and other HW target mode fabric modules.
 
496
         */
 
497
        struct scatterlist      *t_task_pt_sgl;
 
498
        u32                     t_task_pt_sgl_num;
 
499
 
 
500
        struct scatterlist      *t_data_sg;
 
501
        unsigned int            t_data_nents;
 
502
        struct scatterlist      *t_bidi_data_sg;
 
503
        unsigned int            t_bidi_data_nents;
 
504
 
 
505
        /* Used for BIDI READ */
 
506
        struct list_head        t_task_list;
 
507
        u32                     t_task_list_num;
 
508
 
553
509
} ____cacheline_aligned;
554
510
 
555
 
#define T_TASK(cmd)     ((cmd)->t_task)
556
 
#define CMD_TFO(cmd)    ((cmd)->se_tfo)
557
 
 
558
511
struct se_tmr_req {
559
512
        /* Task Management function to be preformed */
560
513
        u8                      function;
609
562
} ____cacheline_aligned;
610
563
 
611
564
struct se_session {
 
565
        int                     sess_tearing_down:1;
612
566
        u64                     sess_bin_isid;
613
567
        struct se_node_acl      *se_node_acl;
614
568
        struct se_portal_group *se_tpg;
615
569
        void                    *fabric_sess_ptr;
616
570
        struct list_head        sess_list;
617
571
        struct list_head        sess_acl_list;
 
572
        struct list_head        sess_cmd_list;
 
573
        struct list_head        sess_wait_list;
 
574
        spinlock_t              sess_cmd_lock;
618
575
} ____cacheline_aligned;
619
576
 
620
 
#define SE_SESS(cmd)            ((cmd)->se_sess)
621
 
#define SE_NODE_ACL(sess)       ((sess)->se_node_acl)
622
 
 
623
577
struct se_device;
624
578
struct se_transform_info;
625
579
struct scatterlist;
640
594
        struct se_ml_stat_grps  ml_stat_grps;
641
595
}  ____cacheline_aligned;
642
596
 
643
 
#define ML_STAT_GRPS(lacl)      (&(lacl)->ml_stat_grps)
644
 
 
645
597
struct se_dev_entry {
646
598
        bool                    def_pr_registered;
647
599
        /* See transport_lunflags_table */
688
640
        int             emulate_reservations;
689
641
        int             emulate_alua;
690
642
        int             enforce_pr_isids;
 
643
        int             is_nonrot;
 
644
        int             emulate_rest_reord;
691
645
        u32             hw_block_size;
692
646
        u32             block_size;
693
647
        u32             hw_max_sectors;
695
649
        u32             optimal_sectors;
696
650
        u32             hw_queue_depth;
697
651
        u32             queue_depth;
698
 
        u32             task_timeout;
699
652
        u32             max_unmap_lba_count;
700
653
        u32             max_unmap_block_desc_count;
701
654
        u32             unmap_granularity;
727
680
        /* T10 Inquiry and VPD WWN Information */
728
681
        struct t10_wwn  t10_wwn;
729
682
        /* T10 SPC-2 + SPC-3 Reservations */
730
 
        struct t10_reservation_template t10_reservation;
 
683
        struct t10_reservation t10_pr;
731
684
        spinlock_t      se_dev_lock;
732
685
        void            *se_dev_su_ptr;
733
 
        struct list_head g_se_dev_list;
 
686
        struct list_head se_dev_node;
734
687
        struct config_group se_dev_group;
735
688
        /* For T10 Reservations */
736
689
        struct config_group se_dev_pr_group;
738
691
        struct se_dev_stat_grps dev_stat_grps;
739
692
} ____cacheline_aligned;
740
693
 
741
 
#define T10_ALUA(su_dev)        (&(su_dev)->t10_alua)
742
 
#define T10_RES(su_dev)         (&(su_dev)->t10_reservation)
743
 
#define T10_PR_OPS(su_dev)      (&(su_dev)->t10_reservation.pr_ops)
744
 
#define DEV_STAT_GRP(dev)       (&(dev)->dev_stat_grps)
745
 
 
746
694
struct se_device {
747
695
        /* Set to 1 if thread is NOT sleeping on thread_sem */
748
696
        u8                      thread_active;
780
728
        atomic_t                dev_status_thr_count;
781
729
        atomic_t                dev_hoq_count;
782
730
        atomic_t                dev_ordered_sync;
 
731
        atomic_t                dev_qf_count;
783
732
        struct se_obj           dev_obj;
784
733
        struct se_obj           dev_access_obj;
785
734
        struct se_obj           dev_export_obj;
786
 
        struct se_queue_obj     *dev_queue_obj;
787
 
        struct se_queue_obj     *dev_status_queue_obj;
 
735
        struct se_queue_obj     dev_queue_obj;
788
736
        spinlock_t              delayed_cmd_lock;
789
737
        spinlock_t              ordered_cmd_lock;
790
738
        spinlock_t              execute_task_lock;
796
744
        spinlock_t              dev_status_thr_lock;
797
745
        spinlock_t              se_port_lock;
798
746
        spinlock_t              se_tmr_lock;
 
747
        spinlock_t              qf_cmd_lock;
799
748
        /* Used for legacy SPC-2 reservationsa */
800
749
        struct se_node_acl      *dev_reserved_node_acl;
801
750
        /* Used for ALUA Logical Unit Group membership */
809
758
        struct task_struct      *process_thread;
810
759
        pid_t                   process_thread_pid;
811
760
        struct task_struct              *dev_mgmt_thread;
 
761
        struct work_struct      qf_work_queue;
812
762
        struct list_head        delayed_cmd_list;
813
763
        struct list_head        ordered_cmd_list;
814
764
        struct list_head        execute_task_list;
815
765
        struct list_head        state_task_list;
 
766
        struct list_head        qf_cmd_list;
816
767
        /* Pointer to associated SE HBA */
817
768
        struct se_hba           *se_hba;
818
769
        struct se_subsystem_dev *se_sub_dev;
824
775
        struct list_head        g_se_dev_list;
825
776
}  ____cacheline_aligned;
826
777
 
827
 
#define SE_DEV(cmd)             ((cmd)->se_lun->lun_se_dev)
828
 
#define SU_DEV(dev)             ((dev)->se_sub_dev)
829
 
#define DEV_ATTRIB(dev)         (&(dev)->se_sub_dev->se_dev_attrib)
830
 
#define DEV_T10_WWN(dev)        (&(dev)->se_sub_dev->t10_wwn)
831
 
 
832
778
struct se_hba {
833
779
        u16                     hba_tpgt;
834
780
        u32                     hba_id;
837
783
        /* Virtual iSCSI devices attached. */
838
784
        u32                     dev_count;
839
785
        u32                     hba_index;
840
 
        atomic_t                load_balance_queue;
841
 
        atomic_t                left_queue_depth;
842
 
        /* Maximum queue depth the HBA can handle. */
843
 
        atomic_t                max_queue_depth;
844
786
        /* Pointer to transport specific host structure. */
845
787
        void                    *hba_ptr;
846
788
        /* Linked list for struct se_device */
847
789
        struct list_head        hba_dev_list;
848
 
        struct list_head        hba_list;
 
790
        struct list_head        hba_node;
849
791
        spinlock_t              device_lock;
850
 
        spinlock_t              hba_queue_lock;
851
792
        struct config_group     hba_group;
852
793
        struct mutex            hba_access_mutex;
853
794
        struct se_subsystem_api *transport;
854
795
}  ____cacheline_aligned;
855
796
 
856
 
#define SE_HBA(dev)             ((dev)->se_hba)
857
 
 
858
797
struct se_port_stat_grps {
859
798
        struct config_group stat_group;
860
799
        struct config_group scsi_port_group;
881
820
        struct se_port_stat_grps port_stat_grps;
882
821
} ____cacheline_aligned;
883
822
 
884
 
#define SE_LUN(cmd)             ((cmd)->se_lun)
885
 
#define PORT_STAT_GRP(lun)      (&(lun)->port_stat_grps)
886
 
 
887
823
struct scsi_port_stats {
888
824
       u64     cmd_pdus;
889
825
       u64     tx_data_octets;
930
866
        spinlock_t              tpg_lun_lock;
931
867
        /* Pointer to $FABRIC_MOD portal group */
932
868
        void                    *se_tpg_fabric_ptr;
933
 
        struct list_head        se_tpg_list;
 
869
        struct list_head        se_tpg_node;
934
870
        /* linked list for initiator ACL list */
935
871
        struct list_head        acl_node_list;
936
872
        struct se_lun           *tpg_lun_list;
949
885
        struct config_group     tpg_param_group;
950
886
} ____cacheline_aligned;
951
887
 
952
 
#define TPG_TFO(se_tpg) ((se_tpg)->se_tpg_tfo)
953
 
 
954
888
struct se_wwn {
955
889
        struct target_fabric_configfs *wwn_tf;
956
890
        struct config_group     wwn_group;
958
892
        struct config_group     fabric_stat_group;
959
893
} ____cacheline_aligned;
960
894
 
961
 
struct se_global {
962
 
        u16                     alua_lu_gps_counter;
963
 
        int                     g_sub_api_initialized;
964
 
        u32                     in_shutdown;
965
 
        u32                     alua_lu_gps_count;
966
 
        u32                     g_hba_id_counter;
967
 
        struct config_group     target_core_hbagroup;
968
 
        struct config_group     alua_group;
969
 
        struct config_group     alua_lu_gps_group;
970
 
        struct list_head        g_lu_gps_list;
971
 
        struct list_head        g_se_tpg_list;
972
 
        struct list_head        g_hba_list;
973
 
        struct list_head        g_se_dev_list;
974
 
        struct se_hba           *g_lun0_hba;
975
 
        struct se_subsystem_dev *g_lun0_su_dev;
976
 
        struct se_device        *g_lun0_dev;
977
 
        struct t10_alua_lu_gp   *default_lu_gp;
978
 
        spinlock_t              g_device_lock;
979
 
        spinlock_t              hba_lock;
980
 
        spinlock_t              se_tpg_lock;
981
 
        spinlock_t              lu_gps_lock;
982
 
        spinlock_t              plugin_class_lock;
983
 
} ____cacheline_aligned;
984
 
 
985
895
#endif /* TARGET_CORE_BASE_H */