diff options
Diffstat (limited to 'include/scsi/libfcoe.h')
-rw-r--r-- | include/scsi/libfcoe.h | 93 |
1 files changed, 51 insertions, 42 deletions
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index b2410605b740..c603f4a7e7fc 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -53,33 +53,36 @@ enum fip_state { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * struct fcoe_ctlr - FCoE Controller and FIP state. | 56 | * struct fcoe_ctlr - FCoE Controller and FIP state |
57 | * @state: internal FIP state for network link and FIP or non-FIP mode. | 57 | * @state: internal FIP state for network link and FIP or non-FIP mode. |
58 | * @lp: &fc_lport: libfc local port. | 58 | * @mode: LLD-selected mode. |
59 | * @sel_fcf: currently selected FCF, or NULL. | 59 | * @lp: &fc_lport: libfc local port. |
60 | * @fcfs: list of discovered FCFs. | 60 | * @sel_fcf: currently selected FCF, or NULL. |
61 | * @fcf_count: number of discovered FCF entries. | 61 | * @fcfs: list of discovered FCFs. |
62 | * @sol_time: time when a multicast solicitation was last sent. | 62 | * @fcf_count: number of discovered FCF entries. |
63 | * @sel_time: time after which to select an FCF. | 63 | * @sol_time: time when a multicast solicitation was last sent. |
64 | * @port_ka_time: time of next port keep-alive. | 64 | * @sel_time: time after which to select an FCF. |
65 | * @ctlr_ka_time: time of next controller keep-alive. | 65 | * @port_ka_time: time of next port keep-alive. |
66 | * @timer: timer struct used for all delayed events. | 66 | * @ctlr_ka_time: time of next controller keep-alive. |
67 | * @link_work: &work_struct for doing FCF selection. | 67 | * @timer: timer struct used for all delayed events. |
68 | * @recv_work: &work_struct for receiving FIP frames. | 68 | * @link_work: &work_struct for doing FCF selection. |
69 | * @recv_work: &work_struct for receiving FIP frames. | ||
69 | * @fip_recv_list: list of received FIP frames. | 70 | * @fip_recv_list: list of received FIP frames. |
70 | * @user_mfs: configured maximum FC frame size, including FC header. | 71 | * @user_mfs: configured maximum FC frame size, including FC header. |
71 | * @flogi_oxid: exchange ID of most recent fabric login. | 72 | * @flogi_oxid: exchange ID of most recent fabric login. |
72 | * @flogi_count: number of FLOGI attempts in AUTO mode. | 73 | * @flogi_count: number of FLOGI attempts in AUTO mode. |
73 | * @link: current link status for libfc. | 74 | * @link: current link status for libfc. |
74 | * @last_link: last link state reported to libfc. | 75 | * @last_link: last link state reported to libfc. |
75 | * @map_dest: use the FC_MAP mode for destination MAC addresses. | 76 | * @map_dest: use the FC_MAP mode for destination MAC addresses. |
76 | * @spma: supports SPMA server-provided MACs mode | 77 | * @spma: supports SPMA server-provided MACs mode |
77 | * @dest_addr: MAC address of the selected FC forwarder. | 78 | * @send_ctlr_ka: need to send controller keep alive |
78 | * @ctl_src_addr: the native MAC address of our local port. | 79 | * @send_port_ka: need to send port keep alives |
79 | * @data_src_addr: the assigned MAC address for the local port after FLOGI. | 80 | * @dest_addr: MAC address of the selected FC forwarder. |
80 | * @send: LLD-supplied function to handle sending of FIP Ethernet frames. | 81 | * @ctl_src_addr: the native MAC address of our local port. |
81 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. | 82 | * @send: LLD-supplied function to handle sending FIP Ethernet frames |
82 | * @lock: lock protecting this structure. | 83 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. |
84 | * @get_src_addr: LLD-supplied function to supply a source MAC address. | ||
85 | * @lock: lock protecting this structure. | ||
83 | * | 86 | * |
84 | * This structure is used by all FCoE drivers. It contains information | 87 | * This structure is used by all FCoE drivers. It contains information |
85 | * needed by all FCoE low-level drivers (LLDs) as well as internal state | 88 | * needed by all FCoE low-level drivers (LLDs) as well as internal state |
@@ -87,6 +90,7 @@ enum fip_state { | |||
87 | */ | 90 | */ |
88 | struct fcoe_ctlr { | 91 | struct fcoe_ctlr { |
89 | enum fip_state state; | 92 | enum fip_state state; |
93 | enum fip_state mode; | ||
90 | struct fc_lport *lp; | 94 | struct fc_lport *lp; |
91 | struct fcoe_fcf *sel_fcf; | 95 | struct fcoe_fcf *sel_fcf; |
92 | struct list_head fcfs; | 96 | struct list_head fcfs; |
@@ -104,29 +108,32 @@ struct fcoe_ctlr { | |||
104 | u8 flogi_count; | 108 | u8 flogi_count; |
105 | u8 link; | 109 | u8 link; |
106 | u8 last_link; | 110 | u8 last_link; |
111 | u8 reset_req; | ||
107 | u8 map_dest; | 112 | u8 map_dest; |
108 | u8 spma; | 113 | u8 spma; |
114 | u8 send_ctlr_ka; | ||
115 | u8 send_port_ka; | ||
109 | u8 dest_addr[ETH_ALEN]; | 116 | u8 dest_addr[ETH_ALEN]; |
110 | u8 ctl_src_addr[ETH_ALEN]; | 117 | u8 ctl_src_addr[ETH_ALEN]; |
111 | u8 data_src_addr[ETH_ALEN]; | ||
112 | 118 | ||
113 | void (*send)(struct fcoe_ctlr *, struct sk_buff *); | 119 | void (*send)(struct fcoe_ctlr *, struct sk_buff *); |
114 | void (*update_mac)(struct fcoe_ctlr *, u8 *old, u8 *new); | 120 | void (*update_mac)(struct fc_lport *, u8 *addr); |
121 | u8 * (*get_src_addr)(struct fc_lport *); | ||
115 | spinlock_t lock; | 122 | spinlock_t lock; |
116 | }; | 123 | }; |
117 | 124 | ||
118 | /* | 125 | /** |
119 | * struct fcoe_fcf - Fibre-Channel Forwarder. | 126 | * struct fcoe_fcf - Fibre-Channel Forwarder |
120 | * @list: list linkage. | 127 | * @list: list linkage |
121 | * @time: system time (jiffies) when an advertisement was last received. | 128 | * @time: system time (jiffies) when an advertisement was last received |
122 | * @switch_name: WWN of switch from advertisement. | 129 | * @switch_name: WWN of switch from advertisement |
123 | * @fabric_name: WWN of fabric from advertisement. | 130 | * @fabric_name: WWN of fabric from advertisement |
124 | * @fc_map: FC_MAP value from advertisement. | 131 | * @fc_map: FC_MAP value from advertisement |
125 | * @fcf_mac: Ethernet address of the FCF. | 132 | * @fcf_mac: Ethernet address of the FCF |
126 | * @vfid: virtual fabric ID. | 133 | * @vfid: virtual fabric ID |
127 | * @pri: seletion priority, smaller values are better. | 134 | * @pri: selection priority, smaller values are better |
128 | * @flags: flags received from advertisement. | 135 | * @flags: flags received from advertisement |
129 | * @fka_period: keep-alive period, in jiffies. | 136 | * @fka_period: keep-alive period, in jiffies |
130 | * | 137 | * |
131 | * A Fibre-Channel Forwarder (FCF) is the entity on the Ethernet that | 138 | * A Fibre-Channel Forwarder (FCF) is the entity on the Ethernet that |
132 | * passes FCoE frames on to an FC fabric. This structure represents | 139 | * passes FCoE frames on to an FC fabric. This structure represents |
@@ -148,6 +155,7 @@ struct fcoe_fcf { | |||
148 | u8 pri; | 155 | u8 pri; |
149 | u16 flags; | 156 | u16 flags; |
150 | u32 fka_period; | 157 | u32 fka_period; |
158 | u8 fd_flags:1; | ||
151 | }; | 159 | }; |
152 | 160 | ||
153 | /* FIP API functions */ | 161 | /* FIP API functions */ |
@@ -155,9 +163,10 @@ void fcoe_ctlr_init(struct fcoe_ctlr *); | |||
155 | void fcoe_ctlr_destroy(struct fcoe_ctlr *); | 163 | void fcoe_ctlr_destroy(struct fcoe_ctlr *); |
156 | void fcoe_ctlr_link_up(struct fcoe_ctlr *); | 164 | void fcoe_ctlr_link_up(struct fcoe_ctlr *); |
157 | int fcoe_ctlr_link_down(struct fcoe_ctlr *); | 165 | int fcoe_ctlr_link_down(struct fcoe_ctlr *); |
158 | int fcoe_ctlr_els_send(struct fcoe_ctlr *, struct sk_buff *); | 166 | int fcoe_ctlr_els_send(struct fcoe_ctlr *, struct fc_lport *, struct sk_buff *); |
159 | void fcoe_ctlr_recv(struct fcoe_ctlr *, struct sk_buff *); | 167 | void fcoe_ctlr_recv(struct fcoe_ctlr *, struct sk_buff *); |
160 | int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_frame *fp, u8 *sa); | 168 | int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_lport *, |
169 | struct fc_frame *); | ||
161 | 170 | ||
162 | /* libfcoe funcs */ | 171 | /* libfcoe funcs */ |
163 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); | 172 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); |