~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/scsi/fcoe_sysfs.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (c) 2011-2012 Intel Corporation.  All rights reserved.
  4  *
  5  * Maintained at www.Open-FCoE.org
  6  */
  7 
  8 #ifndef FCOE_SYSFS
  9 #define FCOE_SYSFS
 10 
 11 #include <linux/if_ether.h>
 12 #include <linux/device.h>
 13 #include <scsi/fc/fc_fcoe.h>
 14 
 15 struct fcoe_ctlr_device;
 16 struct fcoe_fcf_device;
 17 
 18 struct fcoe_sysfs_function_template {
 19         void (*get_fcoe_ctlr_link_fail)(struct fcoe_ctlr_device *);
 20         void (*get_fcoe_ctlr_vlink_fail)(struct fcoe_ctlr_device *);
 21         void (*get_fcoe_ctlr_miss_fka)(struct fcoe_ctlr_device *);
 22         void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *);
 23         void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *);
 24         void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *);
 25         void (*set_fcoe_ctlr_mode)(struct fcoe_ctlr_device *);
 26         int  (*set_fcoe_ctlr_enabled)(struct fcoe_ctlr_device *);
 27         void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *);
 28         void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *);
 29 };
 30 
 31 #define dev_to_ctlr(d)                                  \
 32         container_of((d), struct fcoe_ctlr_device, dev)
 33 
 34 enum fip_conn_type {
 35         FIP_CONN_TYPE_UNKNOWN,
 36         FIP_CONN_TYPE_FABRIC,
 37         FIP_CONN_TYPE_VN2VN,
 38 };
 39 
 40 enum ctlr_enabled_state {
 41         FCOE_CTLR_ENABLED,
 42         FCOE_CTLR_DISABLED,
 43         FCOE_CTLR_UNUSED,
 44 };
 45 
 46 struct fcoe_ctlr_device {
 47         u32                             id;
 48 
 49         struct device                   dev;
 50         struct fcoe_sysfs_function_template *f;
 51 
 52         struct list_head                fcfs;
 53         char                            work_q_name[20];
 54         struct workqueue_struct         *work_q;
 55         char                            devloss_work_q_name[20];
 56         struct workqueue_struct         *devloss_work_q;
 57         struct mutex                    lock;
 58 
 59         int                             fcf_dev_loss_tmo;
 60         enum fip_conn_type              mode;
 61 
 62         enum ctlr_enabled_state         enabled;
 63 
 64         /* expected in host order for displaying */
 65         struct fcoe_fc_els_lesb         lesb;
 66 };
 67 
 68 static inline void *fcoe_ctlr_device_priv(const struct fcoe_ctlr_device *ctlr)
 69 {
 70         return (void *)(ctlr + 1);
 71 }
 72 
 73 /* fcf states */
 74 enum fcf_state {
 75         FCOE_FCF_STATE_UNKNOWN,
 76         FCOE_FCF_STATE_DISCONNECTED,
 77         FCOE_FCF_STATE_CONNECTED,
 78         FCOE_FCF_STATE_DELETED,
 79 };
 80 
 81 struct fcoe_fcf_device {
 82         u32                 id;
 83         struct device       dev;
 84         struct list_head    peers;
 85         struct work_struct  delete_work;
 86         struct delayed_work dev_loss_work;
 87         u32                 dev_loss_tmo;
 88         void                *priv;
 89         enum fcf_state      state;
 90 
 91         u64                 fabric_name;
 92         u64                 switch_name;
 93         u32                 fc_map;
 94         u16                 vfid;
 95         u8                  mac[ETH_ALEN];
 96         u8                  priority;
 97         u32                 fka_period;
 98         u8                  selected;
 99         u16                 vlan_id;
100 };
101 
102 #define dev_to_fcf(d)                                   \
103         container_of((d), struct fcoe_fcf_device, dev)
104 /* parentage should never be missing */
105 #define fcoe_fcf_dev_to_ctlr_dev(x)             \
106         dev_to_ctlr((x)->dev.parent)
107 #define fcoe_fcf_device_priv(x)                 \
108         ((x)->priv)
109 
110 struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
111                             struct fcoe_sysfs_function_template *f,
112                             int priv_size);
113 void fcoe_ctlr_device_delete(struct fcoe_ctlr_device *);
114 struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *,
115                                             struct fcoe_fcf_device *);
116 void fcoe_fcf_device_delete(struct fcoe_fcf_device *);
117 
118 int __init fcoe_sysfs_setup(void);
119 void __exit fcoe_sysfs_teardown(void);
120 
121 #endif /* FCOE_SYSFS */
122 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php